/* ==================== 现代化软件下载站样式 ==================== */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS 变量定义 - 支持主题切换 */
:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* 深色主题 */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

/* 页面基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 20%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 头部样式 ==================== */
.site-header {
    padding: 50px 30px;
    margin-bottom: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 添加动态背景效果 */
.site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gradientMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gradientMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.site-title {
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
}

.site-tagline {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    margin: 0;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* 主题切换按钮 */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* ==================== 搜索框 ==================== */
.search-container {
    max-width: 600px;
    margin: -20px auto 40px;
    position: relative;
    z-index: 10;
}

.search-box {
    width: 100%;
    padding: 18px 25px;
    padding-left: 55px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.search-container::before {
    content: '🔍';
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* ==================== 分类导航 ==================== */
.category-tabs {
    display: flex;
    margin-bottom: 40px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tabs .tab {
    padding: 14px 28px;
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--card-bg);
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-tabs .tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.category-tabs .tab span {
    position: relative;
    z-index: 1;
}

.category-tabs .tab:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-color);
}

.category-tabs .tab.active {
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

.category-tabs .tab.active::before {
    opacity: 1;
}

/* 分类图标 */
.tab-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

/* ==================== 文件列表区域 ==================== */
.file-container {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-title {
    background: var(--primary-gradient);
    color: #fff;
    padding: 25px 30px;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title::before {
    content: '📁';
    font-size: 1.3em;
}

/* 空数据提示 */
.empty-tip {
    padding: 80px 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.empty-tip::before {
    content: '📂';
    display: block;
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* ==================== 表格样式 ==================== */
.file-list {
    padding: 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* 表头样式 */
thead {
    background-color: var(--bg-color);
}

thead th {
    padding: 20px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

/* 表格行样式 */
tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.03);
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

tbody td {
    padding: 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

/* 文件名列样式 */
td:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

/* 文件图标 */
.file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecff 100%);
    flex-shrink: 0;
}

/* 文件大小样式 */
.file-size {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-size::before {
    content: '💾';
    font-size: 0.9em;
}

/* 下载次数样式 */
.download-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.download-count::before {
    content: '⬇️';
    font-size: 0.9em;
}

/* ==================== 下载按钮 ==================== */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.download-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.4);
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn::after {
    content: '↓';
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.download-btn:hover::after {
    transform: translateY(2px);
}

/* ==================== 页脚 ==================== */
.site-footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ==================== 统计卡片 ==================== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    text-align: center;
    min-width: 150px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ==================== 加载动画 ==================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    /* 头部适配 */
    .site-header {
        padding: 30px 15px;
        margin-bottom: 20px;
        border-radius: 16px;
    }
    
    .site-title {
        font-size: 1.8rem;
        letter-spacing: 0;
    }
    
    .site-tagline {
        font-size: 0.95rem;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 1rem;
    }
    
    /* 统计卡片适配 */
    .stats-bar {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 12px 15px;
        min-width: 100px;
        flex: 1;
        max-width: calc(33% - 8px);
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* 搜索框适配 */
    .search-container {
        margin: -15px 10px 20px;
    }
    
    .search-box {
        padding: 14px 18px;
        padding-left: 45px;
        font-size: 0.95rem;
        border-radius: 25px;
    }
    
    .search-container::before {
        left: 18px;
        font-size: 1rem;
    }
    
    /* 分类导航适配 - 横向滚动 */
    .category-tabs {
        gap: 6px;
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .category-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .category-tabs .tab {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
        border-radius: 20px;
    }
    
    /* 文件列表容器 */
    .file-container {
        border-radius: 12px;
    }
    
    .category-title {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    /* 表格适配 - 卡片式布局 */
    .file-list {
        overflow-x: hidden;
    }
    
    table {
        display: block;
    }
    
    thead {
        display: none;
    }
    
    tbody {
        display: block;
    }
    
    tbody tr {
        display: block;
        padding: 15px;
        margin: 0;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }
    
    tbody tr:hover {
        transform: none;
        box-shadow: none;
        background-color: rgba(102, 126, 234, 0.02);
    }
    
    tbody td {
        display: block;
        padding: 5px 0;
        border: none;
        text-align: left;
    }
    
    /* 文件名行 */
    tbody td:first-child {
        display: flex;
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 8px;
        padding: 0;
    }
    
    .file-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    /* 文件大小和下载次数 */
    tbody td:nth-child(2),
    tbody td:nth-child(3) {
        display: inline-flex;
        align-items: center;
        padding: 0;
        margin-right: 15px;
        font-size: 0.85rem;
    }
    
    .file-size,
    .download-count {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    /* 下载按钮行 */
    tbody td:last-child {
        display: block;
        margin-top: 12px;
        padding: 0;
        text-align: right;
    }
    
    .download-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    
    /* 页脚适配 */
    .site-footer {
        margin-top: 30px;
        padding: 20px 15px;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    
    /* 空提示适配 */
    .empty-tip {
        padding: 50px 20px;
        font-size: 1rem;
    }
    
    .empty-tip::before {
        font-size: 3rem;
    }
}

/* 超小屏幕适配 */
@media (max-width: 400px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-tagline {
        font-size: 0.85rem;
    }
    
    .stat-card {
        min-width: 80px;
        padding: 10px 12px;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .category-tabs .tab {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    tbody td:first-child {
        font-size: 0.95rem;
    }
    
    .file-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .download-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* 隐藏某些列在移动端 */
@media (max-width: 640px) {
    table th:nth-child(3),
    table td:nth-child(3) {
        display: none;
    }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Logo 样式 */
.site-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 5px;
}
.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.site-header .site-title {
    margin: 0;
}
