/* 全局样式重置 */
* {
    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;
    position: relative; /* 为了让弹窗可以绝对定位 */
}

/* 容器样式 */
.container {
    max-width: 1200px;
    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;
}

/* 搜索框样式 - 新增搜索框和清除按钮的样式 */
.search-container {
    margin: 20px 0 30px;
    max-width: 600px;
    width: 100%;
}

/* 搜索输入框和清除按钮的容器 */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* 搜索框样式调整 */
#searchInput {
    width: 100%;
    padding-right: 45px; /* 为清除按钮留出空间 */
}

/* 清除按钮样式 */
.clear-search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    display: none; /* 默认隐藏 */
}

/* 当搜索框有内容时显示清除按钮 */
.clear-search-btn.show {
    display: flex;
}

.clear-search-btn:hover {
    background-color: #f0f0f0;
    color: #ff4757;
}

/* 按钮样式 */
.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;
}

/* 提示框样式：用于突出重要信息 */
.tip-box {
    background: #f0e6ff; /* 淡紫色背景 */
    border-left: 4px solid #7b36ff; /* 主色调左侧边框 */
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}
        
.tip-box p {
    margin-bottom: 0;
    color: #3a00b0; /* 深紫色文字 */
    font-weight: 500;
}

/* 内容区域样式（默认隐藏） */
.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;
    width: 100%;
}

/* 内容头部样式 */
.content-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-header h2 {
    color: #7b36ff;
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.content-header p {
    color: #666;
    line-height: 1.6;
    max-width: 800px;
}

/* 工作表选项卡样式 */
.sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
    justify-content: center;
}

.sheet-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.sheet-tab.active {
    background: #7b36ff;
    color: white;
    border-color: #7b36ff;
}

.sheet-tab:hover:not(.active) {
    background: #e9ecef;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.resource-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.resource-table th {
    background: #7b36ff;
    color: white;
    padding: 15px;
    text-align: left;
    position: sticky;
    top: 0;
}

.resource-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.resource-table tr:nth-child(even) {
    background: #f8f9fa;
}

.resource-table tr:hover {
    background: #e9ecef;
}

/* 下载链接样式 */
.download-link {
    color: #7b36ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
}

.download-link:hover {
    color: #5a1fd9;
    text-decoration: underline;
}

.download-link i {
    margin-right: 5px;
}

/* 文本内容样式 */
.text-content {
    color: #666;
    font-style: italic;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #7b36ff;
}

/* 加载指示器样式 */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-indicator i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* 旋转动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 返回链接样式 */
.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;
}

/* 提示弹窗样式 */
.info-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

/* 弹窗显示状态 */
.info-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

/* 弹窗头部 */
.popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    color: #7b36ff;
    margin: 0;
}

/* 弹窗关闭按钮 */
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff4757;
}

/* 弹窗内容 */
.popup-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.popup-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

/* 弹窗底部 */
.popup-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.popup-footer button {
    background: #7b36ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.popup-footer button:hover {
    background: #5a1fd9;
}

/* 悬浮按钮样式 */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #7b36ff;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    display: none;
}

.floating-btn.show {
    display: flex;
}

.floating-btn:hover {
    background: #5a1fd9;
    transform: scale(1.05);
}

/* 隐藏元素的类 */
.hidden {
    display: none !important;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .password-protection, .content-area {
        padding: 25px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .sheet-tabs {
        flex-direction: column;
    }
    
    .resource-table {
        font-size: 0.9rem;
    }
    
    .resource-table th, 
    .resource-table td {
        padding: 8px 10px;
    }
    
    /* 移动端弹窗调整 */
    .info-popup {
        width: 95%;
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}
