/* ============================================
   试卷下载站 - 统一样式表
   适用页面：index.html（首页）/ list.html（列表页）/ detail.html（详情页）
   ============================================ */

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e5e7eb;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========== Topbar ========== */
.topbar {
    background-color: #1e293b;
    color: #cbd5e1;
    height: 32px;
    line-height: 32px;
    font-size: 13px;
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar a {
    color: #cbd5e1;
    margin-left: 16px;
}

.topbar a:hover {
    color: #fff;
}

/* ========== Header & Navigation ========== */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
    height: 70px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.logo span {
    color: #10b981;
}

.nav-menu {
    display: flex;
    gap: 28px;
    flex: 1;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    background-color: var(--bg-light);
}

.search-box input {
    border: none;
    outline: none;
    padding: 8px 16px;
    width: 180px;
    font-size: 14px;
    background-color: transparent;
}

.search-box button {
    border: none;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}

.search-box button:hover {
    background-color: var(--primary-dark);
}

.btn-upload {
    background-color: var(--primary-color);
    color: white;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-upload:hover {
    background-color: var(--primary-dark);
    color: white;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========== Mobile Drawer ========== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-white);
    z-index: 201;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

.drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-header h3 {
    font-size: 18px;
    color: var(--primary-color);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.drawer-nav {
    padding: 16px 0;
}

.drawer-nav a {
    display: block;
    padding: 14px 20px;
    color: var(--text-color);
    border-bottom: 1px solid var(--bg-light);
}

.drawer-nav a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.drawer-search {
    padding: 16px 20px;
}

.drawer-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    font-size: 14px;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
    background-color: var(--bg-white);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--text-light);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    color: var(--text-color);
    font-size: 14px;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #ccc;
}

/* ========== Main Layout ========== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 30px 0;
}

.article {
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 30px;
}

/* ========== 详情页专用 ========== */
.file-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.file-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    background-color: #dbeafe;
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.info-table tr {
    border-bottom: 1px solid var(--border-color);
}

.info-table th,
.info-table td {
    padding: 14px 0;
    text-align: left;
    font-size: 14px;
}

.info-table th {
    width: 120px;
    color: var(--text-light);
    font-weight: 500;
}

.info-table td {
    color: var(--text-color);
}

.description {
    margin-bottom: 30px;
}

.description h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.description p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 10px;
}

.download-section {/*
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 24px;*/
    margin-top: 30px;
}

.download-section h3 {
    font-size: 18px;
/*    color: var(--primary-color);*/
    margin-bottom: 16px;
}

.download-links {
    list-style: none;
}

.download-links li {
    margin-bottom: 12px;
}

.download-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 15px;
    padding: 8px 16px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.download-links a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.download-notice {
    margin-top: 24px;/*
    padding: 20px;
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;*/
}

.download-notice h4 {
    font-size: 15px;
/*    color: #92400e;*/
    margin-bottom: 10px;
}

.download-notice ul {
    list-style: none;
    font-size: 13px;
    color: #78716c;
    line-height: 1.8;
}

.download-notice li:before {
    content: "• ";
    color: #f59e0b;
}

/* ========== 列表页专用 ========== */
.list-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 18px;
    margin-bottom: 24px;
}

.list-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.list-header p {
    font-size: 14px;
    color: var(--text-light);
}

.list-header p strong {
    color: var(--primary-color);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.filter-group select,
.filter-group input {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    background-color: white;
    color: var(--text-color);
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary-color);
}

.filter-group input {
    width: 160px;
}

.btn-filter {
    margin-left: auto;
    padding: 8px 18px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.btn-filter:hover {
    background-color: var(--primary-dark);
}

.file-list {
    width: 100%;
    border-collapse: collapse;
}

.file-list thead th {
    background-color: #f1f5f9;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.file-list tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.file-list tbody tr:hover {
    background-color: #f8fafc;
}

.file-list tbody td {
    padding: 14px;
    font-size: 14px;
    vertical-align: middle;
}

.file-name {
    font-weight: 500;
}

.file-name a {
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}

.file-name a:hover {
    color: var(--primary-color);
}

.file-icon {
    font-size: 18px;
}

.file-desc {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
    font-weight: 400;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    background-color: #dbeafe;
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.tag-green {
    background-color: #d1fae5;
    color: #059669;
}

.tag-orange {
    background-color: #fed7aa;
    color: #c2410c;
}

.cell-muted {
    color: var(--text-light);
    white-space: nowrap;
}

.action-links {
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

.action-links a {
    font-size: 13px;
}

.action-download {
    font-weight: 600;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    color: var(--text-color);
    background-color: white;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* ========== 首页专用 - 两栏列表 ========== */
.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.home-section {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.home-section h3 {
    font-size: 15px;
    padding: 12px 16px;
    background-color: #f1f5f9;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-section h3 .more {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
}

.home-section h3 .more:hover {
    color: var(--primary-color);
}

.home-list {
    list-style: none;
}

.home-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px dashed var(--border-color);
}

.home-list li:last-child {
    border-bottom: none;
}

.home-list li::before {
    content: "·";
    color: var(--primary-color);
    font-weight: 700;
    flex-shrink: 0;
}

.home-list a {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-list a:hover {
    color: var(--primary-color);
}

.home-list time {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

/* ========== 侧边栏 ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background-color: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.sidebar-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--text-color);
}

.ad-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.ad-box h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.ad-box p {
    font-size: 13px;
    opacity: 0.9;
}

.related-list {
    list-style: none;
}

.related-list li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.related-list li:last-child {
    border-bottom: none;
}

.related-list a {
    font-size: 14px;
    color: var(--text-color);
    display: block;
    line-height: 1.5;
}

.related-list a:hover {
    color: var(--primary-color);
}

.related-list span {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-list a {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-color);
}

.category-list a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========== Footer ========== */
.footer {
    background-color: #1e293b;
    color: #cbd5e1;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-section p,
.footer-section a {
    font-size: 14px;
    color: #cbd5e1;
    line-height: 2;
    display: block;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #334155;
    font-size: 13px;
    color: #94a3b8;
}

/* ========== 响应式 ========== */
@media screen and (max-width: 992px) {
    .file-list thead th:nth-child(3),
    .file-list tbody td:nth-child(3) {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .topbar {
        display: none;
    }

    .nav-wrapper {
        height: 60px;
    }

    .nav-menu,
    .search-box,
    .btn-upload {
        display: none;
    }

    .hamburger {
        display: flex;
        margin-left: auto;
    }

    .logo {
        font-size: 20px;
    }

    .main-content {
        grid-template-columns: 1fr;
        padding: 20px 0;
    }

    .article {
        padding: 20px;
    }

    /* 首页两栏变单栏 */
    .home-grid {
        grid-template-columns: 1fr;
    }

    /* 列表页标题与筛选 */
    .list-header h1 {
        font-size: 20px;
    }

    .filter-bar {
        gap: 10px;
    }

    .btn-filter {
        margin-left: 0;
        width: 100%;
    }

    /* 详情页标题与元信息 */
    .file-title {
        font-size: 22px;
    }

    .file-meta {
        flex-direction: column;
        gap: 10px;
    }

    .info-table th {
        width: 90px;
    }

    /* 列表页表格转卡片 */
    .file-list thead {
        display: none;
    }

    .file-list,
    .file-list tbody,
    .file-list tbody tr,
    .file-list tbody td {
        display: block;
        width: 100%;
    }

    .file-list tbody tr {
        border: 1px solid var(--border-color);
        border-radius: 6px;
        padding: 12px;
        margin-bottom: 12px;
    }

    .file-list tbody td {
        padding: 6px 0;
        border: none;
    }

    .file-list tbody td:nth-child(3) {
        display: block;
    }

    .file-list tbody td::before {
        content: attr(data-label);
        display: inline-block;
        min-width: 72px;
        font-size: 12px;
        color: var(--text-light);
    }

    .file-list tbody td:first-child::before {
        display: none;
    }

    .action-links {
        margin-top: 4px;
    }

    /* 页脚单栏 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .article {
        padding: 16px;
    }

    .file-title {
        font-size: 20px;
    }

    .download-section {
        padding: 16px;
    }

    .download-links a {
        font-size: 14px;
        padding: 10px 14px;
    }

    .filter-group input {
        width: 130px;
    }

    .file-list tbody td::before {
        min-width: 64px;
    }

    .file-name a {
        font-size: 14px;
    }

    .home-list li {
        padding: 10px 12px;
    }

    .home-list a {
        font-size: 13px;
    }
}
