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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #222;
    background: #f9f9fc;
    transition: background 0.3s, color 0.3s;
}

a {
    color: #1e3c72;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    padding-left: 1.5em;
}

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

/* 暗黑模式 */
body.dark {
    background: #121212;
    color: #e0e0e0;
}

body.dark a {
    color: #80b5ff;
}

body.dark header, body.dark footer, body.dark .section {
    background: #1e1e1e;
}

body.dark .card, body.dark .faq-item, body.dark .article-card {
    background: #2a2a2a;
    border-color: #333;
}

/* 导航吸顶 */
nav.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background 0.3s;
}

body.dark nav.sticky {
    background: rgba(30,30,30,0.85);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    body.dark .nav-links {
        background: rgba(30,30,30,0.95);
    }

    .nav-links.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* 返回顶部 */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #1e3c72;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s, background 0.3s;
}

.back-top.visible {
    display: flex;
}

.back-top:hover {
    transform: scale(1.1);
    background: #2a5298;
}

/* Banner轮播 */
.banner {
    position: relative;
    overflow: hidden;
    height: 400px;
    background: #eef2f7;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s;
}

.banner-slide.active {
    opacity: 1;
}

.banner-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
    transition: background 0.3s, transform 0.3s;
}

.banner-dot.active {
    background: #1e3c72;
}

.banner-dot:hover {
    transform: scale(1.3);
}

/* 通用section */
.section {
    padding: 60px 0;
    background: #fff;
    margin-bottom: 4px;
}

body.dark .section {
    background: #1e1e1e;
}

.section h2 {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section h3 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.section h4 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: rgba(248,249,250,0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid rgba(233,236,239,0.5);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    background: rgba(248,249,250,0.95);
}

body.dark .card {
    background: rgba(42,42,42,0.8);
    border-color: rgba(51,51,51,0.5);
}

body.dark .card:hover {
    background: rgba(42,42,42,0.95);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.faq-item {
    border-bottom: 1px solid #ddd;
    padding: 16px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.faq-item:hover {
    background: rgba(0,0,0,0.02);
}

body.dark .faq-item:hover {
    background: rgba(255,255,255,0.02);
}

.faq-question {
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
    margin-top: 0;
    color: #555;
    padding: 0 0;
}

body.dark .faq-answer {
    color: #bbb;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    margin-top: 8px;
    padding: 8px 0;
}

.article-card {
    background: rgba(248,249,250,0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(233,236,239,0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

body.dark .article-card {
    background: rgba(42,42,42,0.8);
    border-color: rgba(51,51,51,0.5);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

body.dark .article-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.article-card time {
    color: #777;
    font-size: 14px;
}

.article-card h4 {
    margin: 8px 0;
}

.btn-read {
    display: inline-block;
    margin-top: 10px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 14px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-read:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30,60,114,0.3);
    text-decoration: none;
}

.howto-step {
    background: rgba(241,243,245,0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

body.dark .howto-step {
    background: rgba(42,42,42,0.8);
}

.howto-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 40px 0;
    text-align: center;
}

.footer a {
    color: #99badd;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* 动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s, transform 0.6s;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.count-up {
    font-size: 36px;
    font-weight: 700;
    color: #1e3c72;
}

body.dark .count-up {
    color: #80b5ff;
}

.search-box {
    display: flex;
    max-width: 400px;
    margin: 20px auto;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-right: none;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #1e3c72;
}

.search-box button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
}

.dark-toggle {
    background: none;
    border: 1px solid #999;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
    transition: background 0.3s, color 0.3s;
}

.dark-toggle:hover {
    background: rgba(0,0,0,0.05);
}

body.dark .dark-toggle:hover {
    background: rgba(255,255,255,0.05);
}

/* 响应式微调 */
@media (max-width: 576px) {
    .banner {
        height: 280px;
    }

    .banner-slide h1 {
        font-size: 28px !important;
    }

    .banner-slide h2 {
        font-size: 24px !important;
    }

    .banner-slide p {
        font-size: 16px !important;
    }

    .section h2 {
        font-size: 24px;
    }

    .section h3 {
        font-size: 20px;
    }
}