/* ===== 设计变量 ===== */
:root {
    --paper: #f7f4ee;
    --surface: #fffdf8;
    --surface-2: #fbf8f1;
    --ink: #1f2328;
    --ink-soft: #3c4046;
    --muted: #6f675b;
    --line: #e6dfd2;
    --line-strong: #d8cfbf;
    --accent: #c8452d;
    --accent-hover: #a93622;
    --accent-soft: #f4ded7;
    --jade: #3f7f6f;
    --jade-soft: #dfece7;
    --shadow-sm: 0 1px 2px rgba(31, 35, 40, .05);
    --shadow-md: 0 10px 30px rgba(31, 35, 40, .08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --container: 1120px;
    --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
    --header-height: 68px;
}

[data-theme="dark"] {
    --paper: #141619;
    --surface: #1d2024;
    --surface-2: #22262b;
    --ink: #ece8e1;
    --ink-soft: #d2ccc2;
    --muted: #a39a8c;
    --line: #31353b;
    --line-strong: #434851;
    --accent: #e06a50;
    --accent-hover: #ef7d63;
    --accent-soft: #3a2622;
    --jade: #6fb3a0;
    --jade-soft: #22342f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, .35);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

a:hover { color: var(--accent); }

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.3;
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: .01em;
}

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em; padding-left: 1.4em; }

::selection { background: var(--accent-soft); color: var(--ink); }

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    background: var(--ink);
    color: var(--paper);
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    transition: top .2s;
}
.skip-link:focus { top: 12px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.narrow-container { max-width: 820px; }

.icon-sun, .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: inline; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: var(--paper);
    border-radius: 9px;
    font-family: var(--font-serif);
    font-size: 19px;
    line-height: 1;
}

.brand-name {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .04em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
}

.nav-link {
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 15px;
    color: var(--ink-soft);
    white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.is-active { color: var(--accent); font-weight: 600; }
.nav-ico { display: none; }
.nav-ico svg { width: 19px; height: 19px; display: block; }
.nav-drawer-head { display: none; }
.nav-group { display: contents; }
.nav-group-title { display: none; }
@keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    min-width: 300px;
    flex: 0 1 380px;
}

.header-search .search-input {
    border: 0;
    background: transparent;
    outline: none;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 14px;
    padding: 6px 0;
}

.header-search .search-select {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    outline: none;
    padding: 4px 2px;
    max-width: 76px;
}

.search-button,
.hero-button {
    border: 0;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.search-button:hover, .hero-button:hover { background: var(--accent-hover); }

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 16px;
    transition: border-color .15s, color .15s;
}
.icon-button:hover { border-color: var(--line-strong); color: var(--accent); }

.menu-toggle { display: none; }
.menu-bar {
    width: 16px;
    height: 1.8px;
    background: currentColor;
    display: block;
    margin: 2.6px 0;
    border-radius: 2px;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 54px 0 40px;
    background:
        radial-gradient(720px 320px at 18% -10%, var(--accent-soft), transparent 65%),
        radial-gradient(620px 280px at 88% 0%, var(--jade-soft), transparent 60%),
        var(--paper);
    border-bottom: 1px solid var(--line);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .22;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent 30%, #000 100%);
}

.hero-inner { position: relative; z-index: 1; text-align: center; }

.hero h1 {
    font-size: clamp(1.7rem, 4.2vw, 2.9rem);
    letter-spacing: .06em;
}

.hero-sub {
    margin: 12px auto 26px;
    max-width: 640px;
    color: var(--muted);
    font-size: 15px;
}

.hero-search {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    padding: 12px;
    position: relative;
    text-align: left;
}

.hero-tabs {
    display: flex;
    gap: 4px;
    padding: 0 4px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.hero-tabs::-webkit-scrollbar { display: none; }

.hero-tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.hero-tab:hover { color: var(--ink); background: var(--surface-2); }
.hero-tab.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.hero-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px 6px 6px 16px;
    background: var(--paper);
}
.hero-search-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.hero-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 17px;
    padding: 10px 0;
}

.hero-button { padding: 11px 26px; border-radius: 11px; font-size: 15px; }

.hero-stats {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 13.5px;
}
.hero-stats strong { color: var(--ink); font-weight: 600; font-family: var(--font-serif); font-size: 1.08em; font-variant-numeric: tabular-nums; }
.hero-stats .hs-item { white-space: nowrap; }
.hero-stats .hs-dot { margin: 0 7px; color: var(--line-strong); }
.hero-stats .hs-short { display: none; }
@media (max-width: 640px) {
    .hero-stats { white-space: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; font-size: 11.5px; line-height: 1.7; margin-top: 12px; }
    .hero-stats::-webkit-scrollbar { display: none; }
    .hero-stats .hs-pre, .hero-stats .hs-m, .hero-stats .hs-long { display: none; }
    .hero-stats .hs-short { display: inline; }
    .hero-stats .hs-dot { margin: 0 5px; }
    .hero-stats-lit { margin-top: 5px; }
}

/* ===== Layout ===== */
.site-main { min-height: 60vh; }

.home-layout,
.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    padding-top: 34px;
    padding-bottom: 56px;
    align-items: start;
}

.home-main, .page-main, .entry-main { min-width: 0; }
.home-side, .page-side, .entry-side {
    position: sticky;
    top: calc(var(--header-height) + 18px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.page-layout { grid-template-columns: minmax(0, 1fr) 300px; }

/* ===== Footer ===== */
.site-footer {
    position: relative;
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(900px 340px at 92% -20%, rgba(200, 69, 45, .16), transparent 66%),
        linear-gradient(180deg, #20242a 0%, #171a1e 100%);
    color: #f3efe6;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(200, 69, 45, .75), rgba(63, 127, 111, .55), transparent);
}

.footer-shell {
    padding-top: 30px;
    padding-bottom: 16px;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
    gap: 40px;
    padding-bottom: 20px;
}

.site-footer .brand {
    color: #f3efe6;
}
.site-footer .brand-mark {
    background: #f3efe6;
    color: #20242a;
}
.site-footer .brand-name { color: #f3efe6; }

.footer-tagline {
    margin: 10px 0 0;
    color: #b8b0a2;
    font-family: var(--font-sans);
    font-size: 13px;
    letter-spacing: .04em;
}

.footer-desc {
    max-width: 390px;
    margin: 9px 0 0;
    color: #a8a094;
    font-size: 13.5px;
    line-height: 1.8;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}
.footer-badges span {
    padding: 3px 9px;
    border: 1px solid rgba(243, 239, 230, .16);
    border-radius: 999px;
    color: #c6beb2;
    font-size: 11.5px;
    line-height: 1.6;
}

.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.footer-col h2 {
    margin: 0 0 9px;
    color: #8e877c;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
}

.footer-col a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: #cfc7ba;
    font-size: 12.5px;
    line-height: 1.6;
    transition: color .15s, transform .15s;
}
.footer-col a::before {
    content: "";
    width: 4px;
    height: 4px;
    flex: 0 0 4px;
    border-radius: 50%;
    background: rgba(243, 239, 230, .28);
    transition: background .15s;
}
.footer-col a:hover {
    color: #fff;
    transform: translateX(2px);
}
.footer-col a:hover::before { background: var(--accent); }

.footer-links {
    padding: 14px 0 12px;
    border-top: 1px solid rgba(243, 239, 230, .10);
}
.footer-links-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 13px;
}
.footer-links-head h2 {
    margin: 0;
    color: #d8d1c5;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
}
.footer-links-head span { color: #817a6f; font-size: 11.5px; }

.footer-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid rgba(243, 239, 230, .13);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    color: #c9c1b4;
    font-size: 12.5px;
    line-height: 1.55;
    transition: border-color .15s, background .15s, color .15s;
}
.footer-link span {
    color: #857d71;
    font-size: 10px;
    line-height: 1;
}
.footer-link:hover {
    border-color: rgba(200, 69, 45, .7);
    background: rgba(200, 69, 45, .1);
    color: #fff;
}
.footer-link:hover span { color: #e6a08f; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 13px;
    border-top: 1px solid rgba(243, 239, 230, .10);
    color: #8a8276;
    font-size: 11.5px;
}
.footer-legal p { margin: 0 0 4px; line-height: 1.7; }
.footer-legal p:last-child { margin-bottom: 0; }
.footer-legal a { color: #b9b1a4; }
.footer-legal a:hover { color: #fff; }

.footer-copy { color: #cfc7ba; font-size: 12px; letter-spacing: .03em; }
.footer-by { font-family: var(--font-serif); font-style: italic; color: #e08a63; letter-spacing: .06em; margin-left: 7px; }
.footer-note { color: #8a8276; }
.footer-util { display: flex; align-items: center; flex-wrap: wrap; }
.footer-util a { color: #b9b1a4; font-size: 11.5px; letter-spacing: .04em; padding: 0 14px; border-left: 1px solid rgba(243, 239, 230, .14); }
.footer-util a:first-child { border-left: 0; padding-left: 0; }
.footer-util a:hover { color: #fff; }
.footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}
.footer-meta a { color: #b9b1a4; }
.footer-meta a:hover { color: #fff; }
.footer-meta span { color: #6f685e; }

[data-theme="dark"] .site-footer {
    background:
        radial-gradient(900px 340px at 92% -20%, rgba(224, 106, 80, .12), transparent 66%),
        linear-gradient(180deg, #171a1e 0%, #0f1113 100%);
}

/* ===== Responsive ===== */
@media (max-width: 1000px) {
    .header-search { flex-basis: 280px; min-width: 220px; }
    .main-nav { gap: 0; }
    .nav-link { padding: 8px 9px; font-size: 14px; }
}

@media (max-width: 900px) {
    .home-layout, .page-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .home-side, .page-side, .entry-side { position: static; }
    .footer-top { grid-template-columns: 1fr; gap: 20px; padding-bottom: 16px; }
    .footer-shell { padding-top: 26px; }
    .footer-nav { gap: 14px; }

    .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
    .main-nav {
        order: 4;
        flex-basis: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0 4px;
        border-top: 1px solid var(--line);
    }
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--paper);
    }
    body.nav-open .site-header { z-index: 90; }
    body.nav-open { overflow: hidden; }
    body.nav-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(20, 15, 10, .42);
        z-index: 80;
        animation: nav-fade .22s ease;
    }
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        width: min(320px, 86vw);
        order: initial;
        flex-basis: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 0 18px;
        border-top: 0;
        background: var(--surface);
        border-left: 1px solid var(--line);
        box-shadow: -20px 0 48px rgba(20, 15, 10, .18);
        overflow-y: auto;
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .26s cubic-bezier(.32, .72, .28, 1), visibility .26s;
    }
    .nav-open .main-nav { transform: translateX(0); visibility: visible; }
    .nav-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 16px 12px;
        border-bottom: 1px solid var(--line);
        margin-bottom: 4px;
        position: sticky;
        top: 0;
        background: var(--surface);
    }
    .nav-drawer-title { font-family: var(--font-serif); font-size: 16px; font-weight: 600; letter-spacing: .05em; }
    .nav-close {
        width: 30px;
        height: 30px;
        display: grid;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 50%;
        background: transparent;
        color: var(--muted);
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        transition: color .15s, border-color .15s;
    }
    .nav-close:hover { color: var(--accent); border-color: var(--accent); }
    .nav-group { display: block; padding: 0 10px; }
    .nav-group-title {
        display: block;
        font-size: 11px;
        color: var(--muted);
        letter-spacing: .14em;
        margin: 13px 12px 4px;
    }
    .main-nav .nav-link {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 11px 12px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        font-size: 14.5px;
        white-space: nowrap;
        text-align: left;
    }
    .main-nav .nav-link::after { content: "\203A"; margin-left: auto; color: var(--muted); opacity: .55; font-size: 17px; line-height: 1; }
    .main-nav .nav-link:hover { background: var(--surface-2); }
    .main-nav .nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
    .main-nav .nav-link.is-active::after { color: var(--accent); opacity: .8; }
    .main-nav .nav-ico {
        display: grid;
        place-items: center;
        width: 21px;
        height: 21px;
        border-radius: 0;
        background: none;
        color: var(--muted);
    }
    .main-nav .nav-link.is-active .nav-ico { background: none; color: var(--accent); }
    .main-nav .nav-ico svg { width: 19px; height: 19px; }
    .nav-link { padding: 11px 8px; border-radius: var(--radius-xs); }
    .header-search { order: 5; flex-basis: 100%; min-width: 0; }
    .menu-toggle { display: inline-grid; }
    .brand { flex: 1 1 auto; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .hero { padding: 34px 0 28px; }
    .footer-shell { padding-top: 20px; padding-bottom: 12px; }
    .site-footer { margin-top: 12px; }
    .footer-top { gap: 14px; padding-bottom: 12px; }
    .site-footer .brand-mark { width: 30px; height: 30px; font-size: 15px; }
    .site-footer .brand-name { font-size: 15px; }
    .footer-tagline { margin-top: 5px; font-size: 12px; }
    .footer-nav { display: flex; flex-wrap: wrap; gap: 2px 15px; }
    .footer-col { display: contents; }
    .footer-col h2 { display: none; }
    .footer-col a { padding: 2px 0; font-size: 12.5px; }
    .footer-col a::before { display: none; }
    .footer-links { padding: 12px 0 10px; }
    .footer-links-head { align-items: flex-start; flex-direction: column; gap: 3px; }
    .footer-links-head span { font-size: 11px; }
    .footer-bottom { flex-direction: column; gap: 6px; padding-top: 11px; font-size: 11px; }
    .hero-sub { font-size: 14px; }
    .hero-search { border-radius: 18px; padding: 10px; }
    .hero-input { font-size: 16px; }
    .hero-button { padding: 10px 18px; }
    .hero-stats { font-size: 12.5px; line-height: 1.9; }
    .site-footer { padding-top: 32px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
    .footer-brand { grid-column: 1 / -1; }
}


/* ===== 体验兜底：返回顶部 / 命中区 / 防溢出 / 断点 ===== */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-size: 18px;
    z-index: 60;
}
.back-to-top:hover { background: var(--surface-2); }

/* 可点元素最小触摸命中区 */
.search-button, .hero-button, .page-link, .entry-card, .footer-link, .chip {
    min-height: 44px;
}
.hero-button, .search-button { min-height: 48px; }

/* 图片 / 媒体不超出容器，保持比例 */
img, svg, video { max-width: 100%; height: auto; }

/* 锚点跳转避开固定头部 */
section[id], .sheet-section[id] { scroll-margin-top: calc(var(--header-height) + 16px); }

/* 超小屏兜底 */
@media (max-width: 360px) {
    .container { padding-left: 12px; padding-right: 12px; }
}

/* 大屏内容居中上限 */
@media (min-width: 1440px) {
    .container { max-width: 1280px; }
}
