/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 页面主体样式 */
body {
    background: linear-gradient(135deg, #d282ff 0%, #009d77 70%, #7b36ff 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* 容器样式 */
.container {
    max-width: 1000px;
    width: 100%;
}

/* 网站标题区域样式 */
.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.logo p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* 密码保护区域样式 */
.password-protection {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin-bottom: 40px;
}

.password-protection h2 {
    color: #7b36ff;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.password-protection p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 密码表单样式 */
.password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.input-group label {
    color: #7b36ff;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-group input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: #7b36ff;
    outline: none;
}

/* 提交按钮样式 */
.submit-btn {
    background: #7b36ff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #5a1fd9;
}

/* 错误提示信息样式 */
.error-message {
    color: #ff4757;
    margin-top: 15px;
    display: none;
}

/* 尝试次数提示样式 */
.attempts-warning {
    color: #ff4757;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* 内容区域样式（默认隐藏） */
.content-area {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

/* 内容头部样式 */
.content-header {
    text-align: center;
    margin-bottom: 30px;
}

.content-header h2 {
    color: #7b36ff;
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.content-header p {
    color: #666;
    line-height: 1.6;
}

/* 资源网格布局 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 资源项样式 */
.resource-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 5px solid #7b36ff;
    position: relative;
    overflow: hidden;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 资源项图标样式 */
.resource-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 36px;
    color: rgba(123, 54, 255, 0.1);
    z-index: 0;
}

.resource-content {
    position: relative;
    z-index: 1;
}

.resource-item h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.resource-item p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
    min-height: 80px;
}

/* 资源操作按钮样式 */
.resource-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.preview-btn, .download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    flex: 1;
}

.preview-btn {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.preview-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.download-btn {
    background: #7b36ff;
    color: white;
    border: 2px solid #7b36ff;
}

.download-btn:hover {
    background: #5a1fd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(123, 54, 255, 0.3);
}

.btn-icon {
    margin-right: 8px;
    font-size: 0.9em;
}

/* 返回链接样式 */
.back-link {
    display: inline-block;
    margin-top: 30px;
    color: #7b36ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-link:hover {
    color: #5a1fd9;
    text-decoration: underline;
}

/* 页脚样式 */
footer {
    text-align: center;
    color: white;
    margin-top: 50px;
    opacity: 0.9;
}

/* 预览弹窗样式 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000; /* 确保弹窗在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
}

/* 弹窗内容样式 */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 700px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

/* 弹窗淡入动画 */
@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-30px);}
    to {opacity: 1; transform: translateY(0);}
}

/* 关闭按钮样式 */
.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

/* 弹窗图片容器样式 */
.modal-image-container {
    margin: 20px 0;
    text-align: center;
}

/* 弹窗图片样式 */
.modal-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 弹窗文本样式 */
.modal-text {
    color: #666;
    line-height: 1.8;
    margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .password-protection, .content-area {
        padding: 25px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-actions {
        flex-direction: column;
    }
    
    /* 响应式弹窗样式 */
    .modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 20px;
    }
}
