/* ===== 全局重置 & 变量 ===== */
:root {
    --bg-primary: #f4f6fb;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-header: rgba(15, 23, 42, 0.9);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-dark);
}

img {
    max-width: 100%;
    display: block;
}

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

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== 徽章 ===== */
.badge {
    display: inline-block;
    background: var(--gradient-1);
    color: #fff;
    padding: 4px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}
.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.logo-icon {
    font-size: 1.8rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}
.main-nav a {
    padding: 8px 18px;
    border-radius: 50px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
    background: var(--accent);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
    padding: 140px 0 80px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-text h1 {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 480px;
}
.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.hero-stats {
    display: flex;
    gap: 40px;
}
.stat-item {
    display: flex;
    flex-direction: column;
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 迷你日历预览 */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.calendar-preview {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    width: 100%;
    max-width: 340px;
    border: 1px solid var(--border-color);
}
.calendar-header {
    text-align: center;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 0.8rem;
}
.calendar-grid .day-name {
    font-weight: 600;
    color: var(--text-light);
    padding: 6px 0;
}
.calendar-grid .day {
    padding: 8px 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    cursor: default;
}
.calendar-grid .day.today {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.calendar-grid .day.exam-day {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    font-weight: 600;
    position: relative;
}
.calendar-grid .day.exam-day::after {
    content: '•';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent);
    font-size: 1.2rem;
}

/* ===== Section Header ===== */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}
.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== Filter Bar ===== */
.filter-section {
    padding: 80px 0;
}
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-tag {
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.filter-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.filter-tag.active {
    background: var(--gradient-1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 4px 16px;
    gap: 10px;
    transition: var(--transition);
    min-width: 240px;
}
.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.search-box i {
    color: var(--text-light);
}
.search-box input {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}
.search-box input::placeholder {
    color: var(--text-light);
}

/* ===== Exam Grid ===== */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.exam-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: var(--transition);
}
.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.exam-card:hover::before {
    opacity: 1;
}
.exam-card .card-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.exam-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}
.exam-card .exam-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.exam-card .exam-info i {
    width: 16px;
    color: var(--accent);
}
.exam-card .exam-status {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.open {
    background: #dcfce7;
    color: #166534;
}
.status-badge.closed {
    background: #fee2e2;
    color: #991b1b;
}
.status-badge.upcoming {
    background: #fef9c3;
    color: #854d0e;
}
[data-theme="dark"] .status-badge.open {
    background: #166534;
    color: #dcfce7;
}
[data-theme="dark"] .status-badge.closed {
    background: #991b1b;
    color: #fee2e2;
}
[data-theme="dark"] .status-badge.upcoming {
    background: #854d0e;
    color: #fef9c3;
}

/* ===== Countdown Section ===== */
.countdown-section {
    padding: 80px 0;
    background: var(--bg-primary);
}
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.countdown-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.countdown-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.countdown-card .countdown-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}
.countdown-card h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.countdown-timer .time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-width: 64px;
}
.countdown-timer .time-unit span:first-child {
    font-size: 1.8rem;
}
.countdown-timer .time-unit span:last-child {
    font-size: 0.65rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
}

/* ===== Tips Section ===== */
.tips-section {
    padding: 80px 0;
}
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.tip-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.tip-card .tip-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}
.tip-card h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.tip-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 0;
    margin-top: 40px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col .logo {
    margin-bottom: 16px;
}
.footer-col p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}
.footer-col h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer-col ul a:hover {
    color: var(--accent);
}
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero-text h1 {
        font-size: 2.4rem;
    }
    .hero-visual {
        order: -1;
    }
    .calendar-preview {
        max-width: 280px;
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-header);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        padding: 16px 24px;
        box-shadow: var(--shadow-md);
    }
    .main-nav.open {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 4px;
    }
    .main-nav a {
        display: block;
        padding: 12px 16px;
    }
    .hamburger {
        display: flex;
    }
    .hero-text h1 {
        font-size: 2rem;
    }
    .hero-stats {
        gap: 24px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        min-width: 100%;
    }
    .exam-grid {
        grid-template-columns: 1fr;
    }
    .countdown-grid {
        grid-template-columns: 1fr 1fr;
    }
    .tips-grid {
        grid-template-columns: 1fr;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.6rem;
    }
    .hero-actions {
        flex-direction: column;
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .hero-stats {
        flex-wrap: wrap;
        gap: 16px;
    }
    .countdown-grid {
        grid-template-columns: 1fr;
    }
    .countdown-timer {
        font-size: 1.2rem;
    }
    .countdown-timer .time-unit {
        min-width: 50px;
        padding: 6px 8px;
    }
    .countdown-timer .time-unit span:first-child {
        font-size: 1.4rem;
    }
}