/* ===== 全局变量与重置 ===== */
:root {
    --orange: #E8743B;
    --orange-dark: #C85A28;
    --cream: #F5E6C8;
    --cream-light: #FAF0DC;
    --brown: #3D2B1F;
    --brown-dark: #2A1810;
    --brown-light: #5C4030;
    --red-brown: #8B3A2A;
    --green: #6B8E4E;
    --yellow: #E8B84B;
    --pixel-font: 'Press Start 2P', 'Doto', monospace;
    --body-font: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--body-font);
    background: var(--cream);
    color: var(--brown);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 像素扫描线纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(61,43,31,0.015) 2px,
        rgba(61,43,31,0.015) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ===== 像素边框工具类 ===== */
.pixel-border {
    border: 3px solid var(--brown);
    box-shadow: 4px 4px 0 var(--brown);
}

.pixel-border-sm {
    border: 2px solid var(--brown);
    box-shadow: 3px 3px 0 var(--brown);
}

/* ===== 顶部导航 ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--brown-dark);
    border-bottom: 4px solid var(--orange);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-logo span {
    font-family: var(--pixel-font);
    font-size: 12px;
    color: var(--cream);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    color: var(--cream);
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--orange);
    color: var(--brown-dark);
}

.nav-cta {
    background: var(--orange);
    color: var(--brown-dark) !important;
    font-weight: 700 !important;
    padding: 8px 20px !important;
    border: 2px solid var(--cream);
}

.nav-cta:hover {
    background: var(--yellow) !important;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--cream);
    transition: all 0.3s;
}

/* ===== 页面容器 ===== */
.page {
    display: block;
    min-height: 100vh;
    padding-top: 64px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 通用区块 ===== */
.section {
    padding: 80px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--pixel-font);
    font-size: clamp(18px, 3vw, 28px);
    color: var(--brown);
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.5;
}

.section-subtitle {
    text-align: center;
    color: var(--brown-light);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 48px;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: var(--orange);
    margin: 0 auto 48px;
}

/* ===== 页脚 ===== */
.footer {
    background: var(--brown-dark);
    border-top: 4px solid var(--orange);
    padding: 48px 24px 24px;
    color: var(--cream);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand img {
    height: 48px;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 13px;
    color: var(--cream-light);
    opacity: 0.7;
    line-height: 1.7;
    max-width: 280px;
}

.footer-col h4 {
    font-family: var(--pixel-font);
    font-size: 11px;
    color: var(--orange);
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    font-size: 13px;
    color: var(--cream-light);
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: pointer;
}

.footer-col a:hover {
    opacity: 1;
    color: var(--yellow);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(245,230,200,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--cream-light);
    opacity: 0.5;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--brown);
    color: var(--cream);
    padding: 12px 24px;
    border: 2px solid var(--orange);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}


/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        background: var(--brown-dark);
        padding: 16px;
        gap: 8px;
        border-bottom: 4px solid var(--orange);
    }

    .community-grid { grid-template-columns: 1fr; }
    .community-visual { margin-top: 32px; }
    .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .hero-stats { gap: 24px; }
    .hero-stat-num { font-size: 18px; }
    .section { padding: 48px 16px; }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .hero-buttons { flex-direction: column; }
    .btn-primary, .btn-secondary { justify-content: center; }
}
