:root {
    --yale-blue: #00356b;
    --yale-dark-blue: #00274d;
    --yale-light-blue: #286dc0;
    --accent-gold: #ffd700;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #333333;
    --text-color: #222222;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--yale-blue);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--yale-dark-blue);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent-gold);
    color: var(--text-color);
}

.btn-accent:hover { background-color: #e6c200; }

.section { padding: 80px 0; }

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background-color: var(--accent-gold);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--dark-gray);
    margin-bottom: 40px;
    max-width: 600px;
}

/* 无障碍工具栏 */
.accessibility-toolbar {
    background-color: var(--yale-blue);
    color: var(--white);
    padding: 10px 0;
    font-size: 0.9rem;
}

.accessibility-toolbar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.accessibility-controls {
    display: flex;
    gap: 15px;
}

.accessibility-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.accessibility-btn:hover { color: var(--accent-gold); }

/* 导航栏 */
header {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--yale-blue);
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-item { position: relative; }

.nav-link {
    font-weight: 600;
    padding: 10px 0;
    position: relative;
}

.nav-link.active { color: var(--yale-blue); }
.nav-link.active:after { width: 100%; }

.nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-gold);
    transition: var(--transition);
}

.nav-link:hover:after { width: 100%; }

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.dropdown-item:last-child { border-bottom: none; }

.dropdown-item:hover { background-color: var(--light-gray); }

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--yale-blue);
}

/* Resources 英雄区域 */
.resources-hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 53, 107, 0.7), rgba(0, 53, 107, 0.5)),
        url('https://images.unsplash.com/photo-1589998059171-988d887df646?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1600&q=80')
        center/cover no-repeat;
    color: var(--white);
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-weight: 300;
}

/* 资源类别网格 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.category-icon {
    background-color: #f0f7ff;
    color: var(--yale-blue);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.75rem;
}

.category-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--yale-blue);
}

/* 特色资源 */
.featured-resources {
    background-color: var(--light-gray);
    padding: 60px 0;
}

.featured-resource {
    display: flex;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.featured-resource-icon {
    width: 40%;
    background-color: var(--yale-blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.featured-resource-content {
    width: 60%;
    padding: 40px;
}

.resource-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.featured-resource-meta {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.featured-resource-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-resource-meta .meta-item i {
    color: var(--yale-blue);
}

.featured-resource-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 资源网格 */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.resource-item {
    background-color: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.resource-item:hover { transform: translateY(-5px); }

.resource-item-icon {
    color: var(--yale-blue);
    font-size: 2rem;
    margin-bottom: 15px;
}

.resource-item-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.resource-more {
    color: var(--yale-blue);
    font-weight: 600;
    display: inline-block;
    margin-top: 15px;
}

/* 学术背景区 */
.academic-bg { background-color: var(--light-gray); }

/* 快速链接 */
.quick-links-section { padding: 60px 0; }

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.quick-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--yale-blue);
}

.quick-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-gold);
}

.link-content { flex: 1; }

.link-content i {
    color: var(--yale-blue);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.link-content h4 {
    color: var(--yale-blue);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.link-arrow {
    color: var(--yale-blue);
    font-size: 1.25rem;
    margin-left: 1rem;
}

/* 支持联系 */
.support-section {
    background-color: var(--yale-blue);
    color: var(--white);
    padding: 60px 0;
    border-radius: 8px;
    margin: 40px 0;
}

.support-title {
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.support-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.125rem;
    opacity: 0.9;
}

.support-contacts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.contact-method i {
    background-color: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.contact-method h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.contact-method p {
    margin: 0;
    font-weight: 600;
}

.support-action { text-align: center; }

/* 页脚 */
footer {
    background-color: var(--yale-blue);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-gold);
}

.footer-links li { margin-bottom: 10px; }

.footer-links a:hover {
    color: var(--accent-gold);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent-gold);
    color: var(--text-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom-link { color: rgba(255,255,255,0.7); }
.footer-bottom-link:hover { color: var(--accent-gold); }

/* 响应式 */
@media (max-width: 992px) {
    .nav-menu {
        display: none;           /* 初始隐藏，靠 JS 切换 */
        flex-direction: column;  /* JS 切成 flex 时会变成竖排 */
        gap: 0;
        position: absolute;
        top: 78px;
        right: 20px;
        width: min(320px, calc(100vw - 40px));
        background: var(--white);
        box-shadow: var(--shadow);
        border-radius: 8px;
        padding: 10px 0;
        z-index: 1200;
    }

    .nav-menu .nav-item { width: 100%; }

    .nav-menu .nav-link {
        display: block;
        padding: 12px 20px;
    }

    .nav-menu .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        display: none; /* 移动端不自动展开下拉，避免撑爆 */
        background: var(--light-gray);
    }

    .nav-menu .nav-item:hover .dropdown { display: block; }

    .hamburger { display: block; }

    .hero-title { font-size: 2.8rem; }
    .hero-subtitle { font-size: 1.3rem; }

    .featured-resource { flex-direction: column; }
    .featured-resource-icon,
    .featured-resource-content { width: 100%; }
    .featured-resource-icon { height: 200px; }
}

@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .section-title { font-size: 2rem; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .categories-grid { grid-template-columns: 1fr; }

    .support-contacts {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .contact-method {
        flex-direction: column;
        text-align: center;
    }
}

/* 高对比度模式 */
.high-contrast {
    --yale-blue: #000000;
    --yale-dark-blue: #000000;
    --light-gray: #f0f0f0;
    --accent-gold: #ffff00;
    --text-color: #000000;
    --dark-gray: #333333;
    --white: #ffffff;
    --medium-gray: #000000;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 大字体模式 */
.large-text { font-size: 120%; }
.large-text .section-title { font-size: 3rem; }
.large-text .hero-title { font-size: 4.2rem; }
