﻿/* ===== 全局重置 ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Microsoft YaHei", sans-serif;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ===== 顶部标题栏 ===== */
.site-header {
    background: #fff;
    color: #333;
    padding: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e8eaf6;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: #1a237e;
}

.site-logo-img {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    transition: all 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.site-logo-img:hover {
    border-radius: 50%;
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 8px 24px rgba(26, 35, 126, 0.35);
}

.site-logo span {
    color: #1565c0;
}

/* 表头右侧链接 */
.header-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-left: auto;
    margin-right: 16px;
    min-width: 100px;
}

.header-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a237e;
    padding: 4px 14px;
    border-radius: 6px;
    background: #e3f2fd;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.link-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.header-link:hover {
    color: #fff;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid #1a237e;
    border-radius: 4px;
    cursor: pointer;
    gap: 5px;
    padding: 6px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #1a237e;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===== 导航栏 ===== */
.navbar {
    background: #fff;
    border-bottom: 2px solid #e8eaf6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    transition:
        color 0.2s,
        background-color 0.2s;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #1a237e;
    background-color: #e8eaf6;
}

/* 下拉箭头 */
.arrow-down {
    margin-left: 4px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.dropdown:hover .arrow-down {
    transform: rotate(180deg);
}

/* ===== 二级下拉菜单（自动隐藏） ===== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 999;
    padding: 6px 0;
}

/* 鼠标悬停时显示，移开时自动隐藏 */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: #444;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.dropdown-menu li a:hover {
    background-color: #e8eaf6;
    color: #1a237e;
}

/* ===== 主内容区域 ===== */
main {
    flex: 1;
}

/* Hero 区域 */
.hero {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #5c6bc0 100%);
    color: #fff;
    padding: 100px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.hero p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 36px;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== 科目页面通用样式 ===== */
.subject-page {
    padding: 60px 0;
}

.subject-page .page-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 12px;
}

.subject-page .page-subtitle {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 50px;
}

/* 科目卡片 - 左图右文 */
.subject-card {
    display: flex;
    align-items: center;
    gap: 40px;
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef0f5;
    transition: all 0.4s ease;
    cursor: default;
}

.subject-card:last-child {
    margin-bottom: 0;
}

.subject-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(26, 35, 126, 0.15);
    border-color: #c5cae9;
}

/* 图片占位 */
.subject-img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e8eaf6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #9fa8da;
    overflow: hidden;
}

.subject-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.subject-info {
    flex: 1;
    min-width: 0;
}

.subject-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 3px solid #e8eaf6;
}

.subject-info p {
    font-size: 1rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 16px;
}

.subject-info .btn-subject {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.subject-info .btn-subject:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 35, 126, 0.35);
}

@media (max-width: 768px) {
    .subject-card {
        flex-direction: column;
        text-align: center;
        padding: 28px 20px;
        gap: 20px;
    }

    .subject-img {
        width: 160px;
        height: 160px;
    }

    .subject-info h3 {
        font-size: 1.3rem;
    }
}

.btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: #fff;
    color: #1a237e;
}

.btn-primary:hover {
    background: #e8eaf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: translateY(-2px);
}

/* 功能模块卡片区 */
.features {
    padding: 80px 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #1a237e;
    margin-bottom: 50px;
    position: relative;
}

.features h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: #1a237e;
    border-radius: 2px;
    margin: 12px auto 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #eef0f5;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: #c5cae9;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8eaf6;
}

.feature-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== 页脚 ===== */
.site-footer {
    background: #1a237e;
    color: #cfd8dc;
    padding: 50px 0 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #b0bec5;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #64b5f6;
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
    color: #90a4ae;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        display: none;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-link {
        padding: 12px 20px;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 3px solid #1a237e;
        margin-left: 20px;
        border-radius: 0;
        display: none;
    }

    .dropdown:hover .dropdown-menu {
        display: block;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero {
        padding: 60px 0 50px;
    }

    .features {
        padding: 50px 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
}
