/* Hexagon 数据展示系统样式 */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #818cf8;
    --secondary-color: #f093fb;
    --accent-color: #4facfe;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 0;
    margin: -20px -20px 40px -20px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
    opacity: 0.3;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(45deg, #fff, rgba(255,255,255,0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* 搜索区域 */
.search-section {
    margin-bottom: 30px;
}

.search-container {
    background: var(--surface);
    padding: 32px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-container:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-btn {
    padding: 14px 36px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.search-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;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:active {
    transform: translateY(0);
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select,
.filter-date {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.filter-select:focus,
.filter-date:focus {
    outline: none;
    border-color: var(--primary-color);
}

.clear-btn {
    padding: 10px 20px;
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: var(--border-color);
}

/* 统计卡片 */
.stats-section {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--surface);
    padding: 32px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-value {
    font-size: 48px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* 控制区域 */
.controls-section {
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 文章列表 */
.articles-section {
    margin-bottom: 30px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 20px;
    box-shadow: var(--shadow);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.articles-container {
    display: grid;
    gap: 20px;
}

.article-card {
    background: var(--surface);
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.article-card:hover::before {
    transform: scaleY(1);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    gap: 15px;
}

.article-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.3s;
}

.article-card:hover .article-title {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-type {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

.article-summary {
    color: var(--text-secondary);
    margin: 15px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.open-new-window-btn {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
}

.open-new-window-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.article-files {
    font-size: 14px;
    color: var(--text-secondary);
}

.read-more-btn {
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.read-more-btn:active {
    transform: translateY(0);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}

/* 分页 */
.pagination-section {
    margin-bottom: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 44px;
    padding: 12px 16px;
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--background);
    border-radius: 12px;
    max-width: 1600px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: 20px auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 10;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin-right: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--surface);
}

.modal-body {
    padding: 25px;
}

.modal-body-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.modal-main-content {
    flex: 1;
    min-width: 0;
}

.modal-sidebar {
    width: 350px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(95vh - 100px);
    overflow-y: auto;
}

.modal-body .article-meta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-body .article-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.modal-body .article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.modal-body .related-articles {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.modal-body .related-articles h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.related-articles-sidebar {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.related-articles-sidebar h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.files-list-sidebar {
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.files-list-sidebar h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.file-item-sidebar {
    padding: 12px;
    background: var(--background);
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.file-item-sidebar .file-item-info {
    margin-bottom: 8px;
}

.file-item-sidebar .file-item-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.file-item-sidebar .file-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-item-sidebar .file-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.file-item-sidebar .file-item-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-item-sidebar .read-more-btn {
    padding: 6px 12px;
    font-size: 12px;
}

.modal-body .related-list {
    list-style: none;
}

.modal-body .related-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.modal-body .related-list a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
    flex: 1;
}

.modal-body .related-list a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.view-count-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.modal-body .files-list {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.modal-body .files-list h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-body .file-item {
    padding: 15px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body .file-item-info {
    flex: 1;
}

.modal-body .file-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.modal-body .file-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-body .file-item-size {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        margin: -10px -10px 20px -10px;
        padding: 20px 0;
    }

    .logo {
        font-size: 18px;
        line-height: 1.2;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .search-container {
        padding: 20px;
        border-radius: 16px;
    }

    .search-box {
        flex-direction: column;
        gap: 12px;
    }

    .search-input {
        padding: 12px 16px;
        font-size: 16px;
    }

    .search-btn {
        padding: 12px 24px;
        width: 100%;
    }

    .filters {
        flex-direction: column;
        gap: 12px;
    }

    .filter-select,
    .filter-date,
    .clear-btn {
        width: 100%;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }

    .sort-select {
        flex: 1;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 36px;
    }

    .article-card {
        padding: 20px;
    }

    .article-header {
        flex-direction: column;
    }

    .article-title {
        font-size: 18px;
    }

    .article-meta {
        font-size: 13px;
        gap: 10px;
    }

    .article-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .article-actions {
        width: 100%;
        justify-content: space-between;
    }

    .read-more-btn {
        flex: 1;
    }

    /* 模态框移动端优化 */
    .modal {
        padding: 0;
    }

    .modal-content {
        margin: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
    }

    .modal-header h2 {
        font-size: 18px;
        line-height: 1.3;
    }

    .modal-close {
        font-size: 28px;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-body-layout {
        flex-direction: column;
        gap: 20px;
    }

    .modal-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        order: 2;
    }

    .modal-main-content {
        order: 1;
    }

    .modal-body .article-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .modal-body .article-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .modal-body .article-content img {
        border-radius: 8px;
        margin: 10px 0;
    }

    .modal-body .article-content table {
        font-size: 13px;
        overflow-x: auto;
        display: block;
    }

    .related-articles-sidebar,
    .files-list-sidebar {
        padding: 16px;
    }

    .related-articles-sidebar h3,
    .files-list-sidebar h3 {
        font-size: 16px;
    }

    .file-item-sidebar {
        padding: 12px;
    }

    .pagination {
        gap: 6px;
    }

    .pagination-btn {
        min-width: 36px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* detail.html 详情页移动端优化 */
@media (max-width: 768px) {
    .detail-page-container {
        padding: 10px !important;
    }

    .detail-header {
        padding-bottom: 15px !important;
        margin-bottom: 20px !important;
    }

    #detail-title {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }

    #detail-meta {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: flex-start !important;
    }

    #main-content {
        padding: 16px !important;
        font-size: 15px !important;
    }

    #main-content img {
        max-width: 100% !important;
        height: auto !important;
    }

    #main-content table {
        font-size: 13px !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    #sidebar {
        padding: 16px !important;
    }

    #sidebar h3 {
        font-size: 16px !important;
    }
}

/* 超小屏幕（手机竖屏）*/
@media (max-width: 480px) {
    .logo {
        font-size: 16px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 11px;
    }

    .article-title {
        font-size: 16px;
    }

    .article-type {
        font-size: 11px;
        padding: 4px 12px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .pagination-btn {
        min-width: 32px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

