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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #fefcf7;
    color: #2c2c2c;
    line-height: 1.6;
    scroll-behavior: smooth;
    transition: background 0.4s, color 0.4s;
}

a {
    color: #b8860b;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #8b6914;
}

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

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

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid rgba(240, 230, 140, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: background 0.4s, border-color 0.4s;
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #b8860b;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-menu a {
    padding: 8px 0;
    font-weight: 500;
    color: #555;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    border-bottom-color: #b8860b;
    color: #b8860b;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #b8860b;
}

.dark-mode-toggle {
    background: none;
    border: 2px solid #b8860b;
    color: #b8860b;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
}

.dark-mode-toggle:hover {
    background: #b8860b;
    color: #fff;
}

/* ===== 面包屑 ===== */
.breadcrumb {
    background: rgba(250, 248, 240, 0.7);
    backdrop-filter: blur(8px);
    padding: 12px 0;
    font-size: 0.9rem;
    color: #777;
    border-bottom: 1px solid #f0e68c;
}

.breadcrumb span {
    color: #b8860b;
}

/* ===== Hero 区域 (渐变Banner) ===== */
.hero {
    background: linear-gradient(135deg, #fff8dc 0%, #f5deb3 50%, #fce4a8 100%);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255, 215, 0, 0.15), transparent 60%);
    pointer-events: none;
}

.hero h1 {
    font-size: 2.8rem;
    color: #8b6914;
    margin-bottom: 16px;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(184, 134, 11, 0.1);
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto 24px;
}

.hero .btn {
    display: inline-block;
    background: linear-gradient(135deg, #b8860b, #d4a017);
    color: #fff;
    padding: 14px 36px;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.hero .btn:hover {
    background: linear-gradient(135deg, #9a7209, #b8860b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

/* ===== 通用区块 ===== */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    color: #8b6914;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #f0e68c, #b8860b);
    border-radius: 2px;
}

/* ===== 网格系统 ===== */
.grid {
    display: grid;
    gap: 30px;
}

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

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

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

/* ===== 卡片 (圆角+毛玻璃效果) ===== */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(240, 230, 140, 0.6);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: #b8860b;
}

.card h3 {
    color: #b8860b;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.card p {
    color: #666;
    font-size: 0.95rem;
}

.card .date {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
}

/* ===== FAQ 折叠 ===== */
.faq-item {
    border-bottom: 1px solid rgba(240, 230, 140, 0.6);
    padding: 16px 0;
    transition: border-color 0.3s;
}

.faq-question {
    font-weight: 600;
    color: #8b6914;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
}

.faq-question::after {
    content: '+';
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
    content: '−';
    transform: rotate(180deg);
}

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

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-top: 8px;
}

/* ===== How-to 步骤 ===== */
.howto-step {
    background: rgba(250, 248, 240, 0.7);
    backdrop-filter: blur(8px);
    border-left: 4px solid #b8860b;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 0 12px 12px 0;
    transition: all 0.3s;
}

.howto-step:hover {
    background: rgba(250, 248, 240, 0.9);
    border-left-width: 6px;
}

.howto-step strong {
    color: #8b6914;
}

/* ===== 文章卡片 ===== */
.article-card {
    border-bottom: 1px solid rgba(240, 230, 140, 0.5);
    padding: 20px 0;
    transition: all 0.3s;
}

.article-card:last-child {
    border-bottom: none;
}

.article-card h3 {
    margin-bottom: 4px;
    transition: color 0.3s;
}

.article-card:hover h3 {
    color: #b8860b;
}

.article-card .meta {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.article-card p {
    color: #555;
    margin-bottom: 8px;
}

.article-card .read-more {
    color: #b8860b;
    font-weight: 500;
}

/* ===== 页脚 ===== */
.footer {
    background: linear-gradient(135deg, #2c2c2c, #1a1a2e);
    color: #ddd;
    padding: 40px 0;
    font-size: 0.9rem;
}

.footer a {
    color: #f0e68c;
    transition: color 0.3s;
}

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

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

.footer h4 {
    color: #f0e68c;
    margin-bottom: 12px;
    font-size: 1rem;
}

.footer p,
.footer li {
    color: #bbb;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 6px;
}

.footer-bottom {
    border-top: 1px solid #444;
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #b8860b, #d4a017);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.4s;
    border: none;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #9a7209, #b8860b);
    transform: translateY(-2px) scale(1.05);
}

/* ===== 暗色模式 ===== */
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(16px);
    border-bottom-color: #333;
}

body.dark-mode .navbar a {
    color: #ccc;
}

body.dark-mode .navbar a:hover,
body.dark-mode .navbar a.active {
    color: #f0e68c;
    border-bottom-color: #f0e68c;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #1a1a2e, #2c2c2c, #1a1a2e);
}

body.dark-mode .hero h1 {
    color: #f0e68c;
}

body.dark-mode .hero p {
    color: #bbb;
}

body.dark-mode .card {
    background: rgba(40, 40, 50, 0.7);
    backdrop-filter: blur(12px);
    border-color: #333;
}

body.dark-mode .card h3 {
    color: #f0e68c;
}

body.dark-mode .card p {
    color: #bbb;
}

body.dark-mode .section-title h2 {
    color: #f0e68c;
}

body.dark-mode .faq-question {
    color: #f0e68c;
}

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

body.dark-mode .howto-step {
    background: rgba(40, 40, 50, 0.7);
    border-left-color: #f0e68c;
}

body.dark-mode .howto-step strong {
    color: #f0e68c;
}

body.dark-mode .article-card {
    border-bottom-color: #333;
}

body.dark-mode .article-card p {
    color: #bbb;
}

body.dark-mode .breadcrumb {
    background: rgba(30, 30, 30, 0.7);
    color: #aaa;
}

body.dark-mode .footer {
    background: #0a0a0a;
}

body.dark-mode .dark-mode-toggle {
    border-color: #f0e68c;
    color: #f0e68c;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #f0e68c;
    color: #121212;
}

/* ===== 滚动动画 (IntersectionObserver 配合) ===== */
.card,
.article-card,
.howto-step {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card.visible,
.article-card.visible,
.howto-step.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 响应式布局 ===== */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 20px;
        border-bottom: 2px solid #f0e68c;
        gap: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }

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

    .menu-toggle {
        display: block;
    }

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

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

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

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

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0;
    }

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

    .section {
        padding: 40px 0;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 12px;
    }
}

/* ===== 暗色模式下的移动菜单 ===== */
body.dark-mode .nav-menu {
    background: rgba(30, 30, 30, 0.95);
    border-bottom-color: #333;
}

/* ===== 额外 hover 动画 ===== */
.card:hover h3 {
    color: #d4a017;
}

.article-card:hover {
    padding-left: 8px;
    border-left: 2px solid #b8860b;
}

.faq-item:hover {
    border-bottom-color: #b8860b;
}

/* ===== 选择与焦点 ===== */
::selection {
    background: #b8860b;
    color: #fff;
}

:focus-visible {
    outline: 2px solid #b8860b;
    outline-offset: 2px;
}