:root {
    --bg: #F2E6C8;
    --deep: #E0D2AE;
    --paper: #FBF4E2;
    --soft: #EBE0C4;
    --ink: #161208;
    --text: #2A2210;
    --muted: #5A4A28;
    --faint: #7A6840;
    --dark-gold: #5C4814;
    --sea-gold: #B8943A;
    --line: rgba(22,18,8,0.12);
    --line-strong: rgba(92,72,20,0.50);
    --shadow: 0 12px 28px rgba(22,18,8,0.10);
    --head-h: 114px;
    --max: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { display: block; max-width: 100%; }
body.ui-locked { overflow: hidden; }

.site-head { position: fixed; inset: 0 0 auto 0; z-index: 1000; }
.microbar { height: 20px; background: var(--ink); color: var(--sea-gold); font-size: 12px; }
.microbar-inner, .brandbar-inner, .wave-nav-inner {
    width: min(var(--max), calc(100% - 32px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.text-trigger, .menu-trigger, .close-trigger {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    min-height: 44px;
    padding: 0 10px;
}
.microbar .text-trigger { min-height: 20px; padding: 0 2px; color: var(--sea-gold); font-size: 12px; }
.brandbar { height: 54px; background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.brand-home { min-width: 72px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); font-weight: 800; font-size: 16px; }
.brand-home img, .drawer-brand img, .footer-brand img { height: 24px; width: auto; object-fit: contain; }
.brand-actions { display: flex; align-items: center; gap: 8px; }
.app-link, .menu-trigger {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--dark-gold);
    color: var(--text);
    background: var(--paper);
    border-radius: 4px;
    font-size: 14px;
}
.app-link { background: linear-gradient(135deg, #161208 0%, #B8943A 100%); color: var(--paper); border-color: transparent; }

.wave-nav { height: 40px; background: var(--paper); border-bottom: 1px solid var(--line); }
.wave-nav-inner { justify-content: center; gap: 30px; }
.wave-item { width: 220px; max-width: 26vw; height: 40px; display: grid; grid-template-rows: 18px 12px; align-content: center; justify-items: center; font-size: 13px; color: var(--muted); }
.wave-mark { display: block; width: 100%; height: 6px; border: 1px solid var(--dark-gold); border-radius: 60% 40% 55% 45% / 60% 45% 55% 40%; transform: skewX(-12deg); }
.wave-item.is-current { color: var(--ink); font-weight: 700; }
.wave-item.is-current .wave-mark { background: var(--sea-gold); border-color: var(--sea-gold); }

.site-main { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; padding: calc(var(--head-h) + 34px) 0 72px; }
.page-intro { margin: 0 0 28px; }
.eyebrow { display: inline-block; color: var(--dark-gold); font-size: 12px; letter-spacing: .08em; font-weight: 700; }
h1, h2, h3 { color: var(--ink); margin-top: 0; }
h1 { font-size: 24px; line-height: 1.3; margin-bottom: 14px; }
h2 { font-size: 20px; line-height: 1.4; margin-bottom: 10px; }
h3 { font-size: 16px; line-height: 1.45; margin-bottom: 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 16px; color: var(--ink); font-weight: 700; }
.muted { color: var(--muted); }

.primary-btn, .secondary-btn {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-btn { background: linear-gradient(135deg, #161208 0%, #B8943A 100%); color: var(--paper); box-shadow: var(--shadow); }
.secondary-btn { background: var(--paper); color: var(--text); border: 1px solid var(--dark-gold); }
.primary-btn:hover, .secondary-btn:hover { transform: translateY(-1px); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--sea-gold); outline-offset: 3px; }

.media-slot { width: 100%; min-height: 120px; background: var(--paper); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.media-slot.is-empty { background: linear-gradient(135deg, rgba(251,244,226,.85), rgba(224,210,174,.5)); }

.home-index { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 16px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: rgba(251,244,226,.45); font-size: 13px; }
.home-index a { color: var(--dark-gold); min-height: 32px; display: inline-flex; align-items: center; }
.hero-copy { max-width: 760px; padding: 20px 0 26px; }
.hero-copy .actions { margin-top: 18px; }

.home-section { margin: 34px 0; }
.slash-feature { position: relative; min-height: 300px; background: var(--deep); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.slash-copy { width: 58%; padding: 28px; position: relative; z-index: 2; }
.slash-media { position: absolute; width: 48%; height: 180px; right: -12px; top: 18px; clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%); background: var(--paper); }
.slash-feature::after { content: ""; position: absolute; inset: auto 0 0 42%; height: 1px; background: var(--line-strong); transform: rotate(-8deg); transform-origin: left center; }

.wide-story { background: var(--paper); border: 1px solid var(--line-strong); padding: 28px; box-shadow: var(--shadow); }
.wide-story .media-slot { height: 220px; margin: 18px 0; }

.spine-pair { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; }
.spine-card { border-left: 7px solid var(--dark-gold); background: var(--soft); padding: 22px; min-height: 240px; box-shadow: var(--shadow); }
.spine-card:first-child { background: var(--paper); }
.spine-card .media-slot { height: 150px; margin-bottom: 16px; }

.shelf-pair { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: stretch; }
.shelf-card { background: var(--paper); border: 1px solid var(--line); padding: 24px; }
.shelf-card .media-slot { height: 170px; margin-bottom: 14px; }
.shelf-card:first-child { border-top: 4px solid var(--sea-gold); }

.periods { display: grid; grid-template-columns: .8fr 1.15fr .9fr; gap: 12px; align-items: stretch; }
.period-card { padding: 20px; border: 1px solid var(--line); background: var(--paper); }
.period-card:nth-child(2) { transform: translateY(12px); background: var(--deep); }
.period-card:nth-child(3) { margin-top: 24px; }
.period-media { height: 170px; margin-bottom: 16px; }

.status-list { display: grid; gap: 10px; }
.status-item { display: grid; grid-template-columns: 120px 1fr; border: 1px solid var(--line); background: var(--paper); }
.status-item strong { padding: 14px; background: var(--ink); color: var(--sea-gold); }
.status-item span { padding: 14px; }
.status-media { height: 190px; margin-bottom: 16px; }

.app-stack { background: var(--paper); border-top: 4px solid var(--dark-gold); padding: 28px; }
.app-stack .app-images { margin-top: 22px; display: grid; grid-template-columns: 1fr 92px; gap: 14px; align-items: end; }
.app-stack .app-main-media { max-height: 320px; min-height: 220px; }
.app-stack .app-main-media img { max-height: 320px; }
.app-stack .app-icon-media { width: 92px; min-height: 92px; height: 92px; }
.app-stack .app-icon-media img { width: 48px; height: 48px; object-fit: contain; }

.method-list, .topic-list, .legal-list, .help-list { display: grid; gap: 14px; }
.method-item, .topic-item, .legal-item, .help-item { background: var(--paper); border: 1px solid var(--line); padding: 22px; }
.method-item:nth-child(even), .topic-item:nth-child(even) { margin-left: 48px; background: var(--soft); }

.faq-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.faq-mini details { background: var(--paper); border: 1px solid var(--line); padding: 16px 18px; }
.faq-mini summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.faq-mini p { margin: 12px 0 0; color: var(--muted); }

.brand-note { background: var(--ink); color: var(--paper); padding: 30px; border-top: 3px solid var(--sea-gold); }
.brand-note h2, .brand-note h3 { color: var(--sea-gold); }
.brand-note p { color: var(--paper); }

/* inner page layouts */
.layout-wide-card .feature-card { background: var(--paper); border: 1px solid var(--line-strong); padding: 28px; box-shadow: var(--shadow); }
.layout-wide-card .feature-card + .feature-card { margin-top: 18px; }
.layout-wide-card .feature-card:nth-child(even) { background: var(--soft); margin-left: 54px; }
.layout-wide-card .feature-card .media-slot { height: 220px; margin: 16px 0; }

.layout-slash .slash-block { position: relative; min-height: 280px; border: 1px solid var(--line); background: var(--paper); margin-bottom: 18px; overflow: hidden; }
.layout-slash .slash-block:nth-child(even) { background: var(--deep); }
.layout-slash .slash-block .copy { width: 62%; padding: 24px; }
.layout-slash .slash-block .media-slot { position: absolute; right: 0; top: 0; width: 40%; height: 100%; clip-path: polygon(22% 0,100% 0,100% 100%,0 100%); }

.layout-spine .spine-line { display: grid; grid-template-columns: 150px 1fr; margin-bottom: 12px; background: var(--paper); border: 1px solid var(--line); }
.layout-spine .spine-title { background: var(--ink); color: var(--sea-gold); padding: 20px; display: flex; align-items: center; font-weight: 800; }
.layout-spine .spine-body { padding: 20px 24px; }
.layout-spine .spine-body .media-slot { height: 180px; margin-bottom: 14px; }

.layout-single .single-section { max-width: 720px; margin: 0 auto 24px; padding: 22px 0; border-bottom: 1px solid var(--line-strong); }
.layout-single .single-section .media-slot { height: 220px; margin: 18px 0; }

.layout-status .status-board { display: grid; gap: 12px; }
.layout-status .status-row { display: grid; grid-template-columns: 120px 160px 1fr; border: 1px solid var(--line); background: var(--paper); }
.layout-status .status-row > * { padding: 16px; }
.layout-status .status-label { background: var(--ink); color: var(--sea-gold); font-weight: 700; }
.layout-status .status-state { color: var(--dark-gold); font-weight: 700; border-right: 1px solid var(--line); }
.layout-status .media-slot { height: 210px; margin-bottom: 18px; }

.layout-checklist .check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.layout-checklist .check-item { position: relative; background: var(--paper); border: 1px solid var(--line); padding: 22px 22px 22px 50px; }
.layout-checklist .check-item::before { content: "✓"; position: absolute; left: 18px; top: 20px; color: var(--dark-gold); font-weight: 900; }
.layout-checklist .check-item:first-child { grid-column: 1 / -1; }
.layout-checklist .check-item .media-slot { height: 190px; margin-bottom: 14px; }

.layout-method .method-step { display: grid; grid-template-columns: 84px 1fr; gap: 18px; border-bottom: 1px solid var(--line-strong); padding: 22px 0; }
.layout-method .step-no { width: 64px; height: 64px; display: grid; place-items: center; background: var(--ink); color: var(--sea-gold); font-weight: 800; border-radius: 50%; }

.layout-topics .topic-row { display: grid; grid-template-columns: 210px 1fr; gap: 18px; padding: 22px; margin-bottom: 12px; background: var(--paper); border: 1px solid var(--line); }
.layout-topics .topic-row:nth-child(even) { grid-template-columns: 1fr 210px; background: var(--soft); }
.layout-topics .topic-row:nth-child(even) h2 { grid-column: 2; grid-row: 1; }
.layout-topics .topic-row:nth-child(even) .topic-copy { grid-column: 1; grid-row: 1; }

.layout-center .center-card { width: min(760px, 100%); margin: 0 auto 18px; padding: 26px; background: var(--paper); border: 1px solid var(--line-strong); text-align: center; }
.layout-center .center-card:nth-child(even) { width: min(680px, 100%); background: var(--soft); }
.layout-center .center-card .media-slot { height: 220px; margin-bottom: 16px; }
.layout-center .center-card p { text-align: left; }

.layout-terms .term-section { padding: 22px 0; border-bottom: 1px solid var(--line-strong); }
.layout-terms .term-section h2 { display: inline-block; padding: 4px 10px; background: var(--ink); color: var(--sea-gold); }

.layout-about .about-banner { height: 200px; margin-bottom: 24px; }
.layout-about .about-manifesto { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; }
.layout-about .about-manifesto > section { padding: 24px; background: var(--paper); border: 1px solid var(--line); }
.layout-about .about-manifesto > section:nth-child(2) { background: var(--ink); color: var(--paper); }
.layout-about .about-manifesto > section:nth-child(2) h2 { color: var(--sea-gold); }

.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 20px; background: var(--paper); border-left: 4px solid var(--dark-gold); box-shadow: 0 6px 16px rgba(22,18,8,.06); }

.contact-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-card { padding: 24px; background: var(--paper); border: 1px solid var(--line); }
.contact-card:nth-child(2n) { background: var(--soft); }

.site-footer { background: var(--ink); color: var(--bg); border-top: 1px solid var(--sea-gold); font-size: 13px; }
.footer-inner { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; padding: 34px 0 72px; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--sea-gold); margin-bottom: 22px; }
.footer-brand strong { color: var(--paper); font-size: 16px; }
.footer-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.footer-groups section { display: flex; flex-direction: column; gap: 6px; }
.footer-groups h2 { color: var(--sea-gold); font-size: 13px; margin-bottom: 4px; }
.footer-groups a { color: var(--bg); min-height: 30px; display: inline-flex; align-items: center; }
.footer-notice { margin-top: 26px; color: var(--bg); max-width: 760px; }
.footer-copy { color: var(--faint); margin-bottom: 0; }

.ui-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(22,18,8,.46); transition: opacity .18s ease; }
.ui-overlay[aria-hidden="true"] { opacity: 0; visibility: hidden; pointer-events: none; }
.ui-overlay[aria-hidden="false"] { opacity: 1; visibility: visible; pointer-events: auto; }
.site-drawer { position: fixed; z-index: 1600; top: 10vh; right: 24px; width: min(32vw, 420px); max-height: 80vh; background: var(--paper); border: 1px solid var(--line-strong); box-shadow: 0 22px 60px rgba(22,18,8,.25); transition: transform .2s ease, opacity .2s ease; }
.site-drawer[aria-hidden="true"] { transform: translateX(120%); opacity: 0; visibility: hidden; pointer-events: none; }
.site-drawer[aria-hidden="false"] { transform: translateX(0); opacity: 1; visibility: visible; pointer-events: auto; }
.drawer-head { height: 58px; padding: 0 12px 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-scroll { overflow-y: auto; max-height: calc(80vh - 58px); padding: 16px 18px 20px; }
.drawer-group { margin-bottom: 18px; }
.drawer-group h2 { font-size: 13px; color: var(--dark-gold); margin-bottom: 6px; }
.drawer-group a { display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.drawer-group strong { color: var(--ink); }
.drawer-group span { color: var(--muted); font-size: 13px; }
.close-trigger { color: var(--dark-gold); }

.site-search { position: fixed; z-index: 1600; top: 74px; left: 50%; width: min(760px, calc(100% - 32px)); transform: translateX(-50%); background: var(--paper); border: 1px solid var(--line-strong); box-shadow: var(--shadow); padding: 24px; transition: opacity .18s ease, transform .18s ease; }
.site-search[aria-hidden="true"] { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -16px); }
.site-search[aria-hidden="false"] { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.search-head { display: flex; justify-content: space-between; gap: 20px; }
.search-head h2 { margin: 4px 0 0; }
.search-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.search-presets a { min-height: 44px; display: grid; place-items: center; border: 1px solid var(--dark-gold); background: var(--soft); color: var(--ink); }

.mobile-bottom { display: none; }

@media (max-width: 760px) {
    :root { --head-h: 74px; }
    .wave-nav { display: none; }
    .microbar-inner, .brandbar-inner, .site-main, .footer-inner { width: calc(100% - 32px); }
    .brand-actions { gap: 6px; }
    .app-link, .menu-trigger { padding: 0 10px; }
    .site-main { padding-top: calc(var(--head-h) + 24px); padding-bottom: 84px; }
    .slash-feature { min-height: 410px; }
    .slash-copy { width: 100%; padding: 22px; padding-top: 220px; }
    .slash-media { width: calc(100% - 28px); right: 14px; top: 14px; height: 180px; clip-path: polygon(10% 0,100% 0,92% 100%,0 100%); }
    .spine-pair, .shelf-pair, .periods, .faq-mini, .footer-groups, .contact-paths, .layout-checklist .check-grid, .layout-about .about-manifesto { grid-template-columns: 1fr; }
    .period-card:nth-child(2) { transform: none; }
    .period-card:nth-child(3) { margin-top: 0; }
    .status-item { grid-template-columns: 96px 1fr; }
    .app-stack { padding: 22px; }
    .app-stack .app-images { grid-template-columns: 1fr 72px; }
    .app-stack .app-icon-media { width: 72px; height: 72px; min-height: 72px; }
    .layout-wide-card .feature-card:nth-child(even), .method-item:nth-child(even), .topic-item:nth-child(even) { margin-left: 0; }
    .layout-slash .slash-block { padding-top: 190px; }
    .layout-slash .slash-block .copy { width: 100%; }
    .layout-slash .slash-block .media-slot { width: 100%; height: 190px; clip-path: polygon(8% 0,100% 0,94% 100%,0 100%); }
    .layout-spine .spine-line { grid-template-columns: 66px 1fr; }
    .layout-spine .spine-title { writing-mode: vertical-rl; justify-content: center; padding: 14px; }
    .layout-status .status-row { grid-template-columns: 88px 100px 1fr; font-size: 13px; }
    .layout-status .status-row > * { padding: 12px; }
    .layout-method .method-step { grid-template-columns: 58px 1fr; gap: 12px; }
    .layout-method .step-no { width: 48px; height: 48px; }
    .layout-topics .topic-row, .layout-topics .topic-row:nth-child(even) { grid-template-columns: 1fr; }
    .layout-topics .topic-row:nth-child(even) h2, .layout-topics .topic-row:nth-child(even) .topic-copy { grid-column: auto; grid-row: auto; }
    .site-drawer { top: 8vh; right: 6vw; width: 88vw; max-height: 80vh; }
    .site-search { inset: 0; width: 100%; transform: none; background: var(--ink); color: var(--sea-gold); border: 0; padding: calc(24px + env(safe-area-inset-top)) 20px 24px; }
    .site-search[aria-hidden="true"] { transform: translateY(-16px); }
    .site-search[aria-hidden="false"] { transform: translateY(0); }
    .site-search h2 { color: var(--sea-gold); }
    .site-search p { color: var(--bg); }
    .site-search .close-trigger { color: var(--sea-gold); }
    .search-presets { grid-template-columns: 1fr 1fr; }
    .search-presets a { background: var(--paper); color: var(--ink); }
    .mobile-bottom { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); z-index: 1200; left: 0; right: 0; bottom: 0; min-height: calc(48px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom); }
    .mobile-bottom a { min-height: 48px; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
    .mobile-bottom a.is-current { background: var(--sea-gold); color: var(--ink); font-weight: 700; }
    .footer-inner { padding-bottom: 92px; }
}

@media (max-width: 430px) {
    .brand-home img { max-width: 112px; }
    .app-link, .menu-trigger { font-size: 13px; padding: 0 8px; }
    .home-index { gap: 6px; }
    .wide-story, .spine-card, .shelf-card, .app-stack, .center-card { padding: 20px; }
    .layout-status .status-row { grid-template-columns: 1fr; }
    .layout-status .status-state { border-right: 0; border-bottom: 1px solid var(--line); }
}
