:root {
    --bg: #0C0B08;
    --bg-deep: #080706;
    --surface: #161410;
    --surface-2: #1E1A14;
    --title: #F3E6C0;
    --text: #E4D6B0;
    --muted: #B89A58;
    --soft: #8A7040;
    --gold: #C9A227;
    --gold-bright: #E0C056;
    --gold-deep: #8A6E18;
    --copper: #8A5A2A;
    --cream: #F7EFD4;
    --border: rgba(201, 162, 39, 0.22);
    --border-strong: rgba(201, 162, 39, 0.50);
    --shadow: 0 12px 28px rgba(0,0,0,0.45);
    --content: 980px;
    --side: 148px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
}
body.overlay-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a, button, input { font: inherit; }
button { color: inherit; }
img { max-width: 100%; display: block; }

.notice-bar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 80;
    height: 20px;
    background: var(--bg-deep);
    color: var(--muted);
    border-bottom: 1px solid rgba(201,162,39,.12);
}
.notice-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 20px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    line-height: 20px;
}
.text-button, .menu-trigger, .close-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.text-button { min-width: 44px; min-height: 20px; color: var(--muted); text-align: right; }

.site-header {
    position: fixed;
    inset: 20px 0 auto 0;
    z-index: 79;
    height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--gold-deep);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 0 max(16px, calc((100vw - 1200px) / 2 + 16px));
}
.brand-link { min-height: 44px; display: inline-flex; align-items: center; justify-self: start; }
.brand-logo, .footer-logo, .menu-logo { height: 24px; width: auto; object-fit: contain; }
.logo-fallback { color: var(--title); font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-english { color: var(--muted); font-size: 13px; letter-spacing: .08em; white-space: nowrap; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.header-app, .menu-trigger {
    min-height: 44px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--title);
    font-size: 14px;
    white-space: nowrap;
}
.header-app:hover, .menu-trigger:hover, .text-button:hover { color: var(--gold-bright); }

.double-nav {
    margin-top: 72px;
    height: 64px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.nav-row {
    max-width: var(--content);
    width: 100%;
    margin: 0 auto;
    min-height: 31px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 26px;
    overflow: hidden;
}
.nav-row a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}
.nav-row a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1px;
    height: 1px;
    background: transparent;
}
.nav-row a:hover { color: var(--gold-bright); }
.nav-row a.is-current { color: var(--gold-bright); }
.nav-row a.is-current::after { background: var(--gold-bright); }

.site-shell {
    position: relative;
    max-width: calc(var(--content) + var(--side) + 40px);
    margin: 0 auto;
    min-height: 60vh;
}
.side-nav {
    position: fixed;
    top: 154px;
    width: var(--side);
    padding: 12px 14px 24px 0;
    border-right: 1px solid var(--border);
    max-height: calc(100vh - 172px);
    overflow-y: auto;
}
.side-group { margin-bottom: 18px; }
.side-group-title { color: var(--soft); font-size: 12px; margin-bottom: 4px; }
.side-group a {
    display: block;
    min-height: 34px;
    padding: 5px 8px;
    color: var(--text);
    font-size: 13px;
    border-left: 1px solid transparent;
}
.side-group a:hover { color: var(--gold-bright); }
.side-group a.is-current { color: var(--gold-bright); border-left-color: var(--gold-bright); }

.main-content {
    width: min(var(--content), calc(100% - var(--side) - 24px));
    margin-left: calc(var(--side) + 24px);
    padding: 38px 16px 76px;
}

h1, h2, h3 { color: var(--title); margin-top: 0; }
h1 { font-size: 24px; line-height: 1.3; margin-bottom: 14px; }
h2 { font-size: 20px; line-height: 1.4; margin-bottom: 12px; }
h3 { font-size: 16px; line-height: 1.5; margin-bottom: 8px; }
p { margin: 0 0 14px; }
.lead { color: var(--cream); font-size: 17px; line-height: 1.8; max-width: 760px; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .12em; margin-bottom: 8px; }
.page-intro { margin-bottom: 28px; }
.page-intro p { max-width: 820px; color: var(--text); }
.section-block { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--border); }
.section-block:first-of-type { margin-top: 24px; }
.section-note { color: var(--muted); }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn-primary, .btn-secondary {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg,#E0C056 0%,#C9A227 55%,#8A6E18 100%);
    color: #1A1408;
    font-weight: 700;
    box-shadow: var(--shadow);
}
.btn-secondary { background: #0C0B08; color: var(--title); border: 1px solid var(--border-strong); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.media-slot {
    width: 100%;
    min-height: 120px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.media-176 { height: 176px; }
.media-160 { height: 160px; }
.media-200 { height: 200px; }
.media-app { height: min(320px, 46vw); min-height: 220px; }
.media-brand { height: 180px; }

.home-opening {
    padding: 8px 0 30px;
    border-bottom: 1px solid var(--border);
}
.home-opening .lead { font-size: 20px; margin-bottom: 8px; }
.numbered-scenes { display: grid; gap: 14px; }
.scene-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}
.scene-index { color: var(--gold-bright); font-size: 13px; font-weight: 700; }
.scene-row h3 { margin-bottom: 6px; }
.scene-row p { margin: 0; }
.scene-visual { margin: 18px 0 4px 128px; }

.note-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}
.note-card .media-slot { margin-bottom: 14px; }
.note-card p:last-child { margin-bottom: 0; }

.flow-nodes { display: flex; flex-wrap: wrap; gap: 12px; }
.flow-node {
    flex: 1 1 190px;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.flow-node strong { display: block; color: var(--gold-bright); margin-bottom: 6px; }

.works-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.work-item { padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.work-item h3 { margin-bottom: 6px; }
.work-item p { margin-bottom: 0; }
.shelf-head { margin-bottom: 16px; }

.week-blocks { display: grid; gap: 14px; }
.week-block { padding: 18px; border-left: 2px solid var(--gold-deep); background: var(--surface); }
.week-block strong { color: var(--gold-bright); display: block; margin-bottom: 6px; }

.status-list { display: grid; gap: 10px; }
.status-row {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.status-name { color: var(--gold-bright); font-weight: 700; }

.app-band {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(210px, .7fr);
    gap: 24px;
    align-items: center;
    padding: 24px;
    background: var(--bg-deep);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    border-radius: 10px;
}
.app-icon-inline { width: 48px; height: 48px; margin-bottom: 12px; }
.app-icon-inline img { width: 48px; height: 48px; object-fit: contain; }

.faq-mini { display: grid; gap: 10px; }
.faq-mini details, .faq-list details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 16px;
}
.faq-mini summary, .faq-list summary {
    cursor: pointer;
    min-height: 46px;
    display: flex;
    align-items: center;
    color: var(--title);
    font-weight: 700;
}
.faq-mini details p, .faq-list details p { padding: 0 0 16px; margin: 0; }

.single-notes { display: grid; gap: 14px; }
.single-note { padding: 18px; border-top: 1px solid var(--border); background: linear-gradient(90deg, rgba(201,162,39,.07), transparent 60%); }
.single-note:first-child { border-top-color: var(--border-strong); }

.memo-list { counter-reset: memo; display: grid; gap: 10px; }
.memo-item {
    position: relative;
    padding: 16px 16px 16px 52px;
    border-bottom: 1px solid var(--border);
}
.memo-item::before {
    counter-increment: memo;
    content: counter(memo, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 14px;
    color: var(--gold-bright);
    font-weight: 700;
}

.method-steps { display: grid; gap: 14px; }
.method-step { padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.method-step h2 { display: flex; gap: 10px; align-items: center; }
.method-step .step-mark { color: var(--gold-bright); font-size: 13px; }

.topic-list { display: grid; gap: 12px; }
.topic-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.topic-item h2 { margin-bottom: 5px; }
.topic-tags { color: var(--muted); font-size: 13px; }

.terms { display: grid; gap: 18px; }
.term-block { padding: 18px; background: var(--surface); border-left: 2px solid var(--gold-deep); }
.term-block p:last-child { margin-bottom: 0; }

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-card { padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.help-card p:last-child { margin-bottom: 0; }

.contact-paths { display: grid; gap: 12px; }
.contact-path { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

.about-banner { margin-bottom: 22px; }
.brand-statement { padding: 20px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; }
.brand-principles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-principle { padding: 16px; border-bottom: 1px solid var(--border); }

.site-footer {
    position: relative;
    z-index: 2;
    background: var(--bg-deep);
    border-top: 1px solid var(--gold-deep);
    padding: 28px max(16px, calc((100vw - 980px) / 2)) calc(74px + env(safe-area-inset-bottom));
    color: var(--text);
    font-size: 13px;
}
.footer-top { display: grid; grid-template-columns: 220px 1fr; gap: 26px; }
.footer-brand { display: flex; gap: 10px; align-items: flex-start; }
.footer-brand strong { display: block; color: var(--title); font-size: 15px; }
.footer-brand span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.footer-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.footer-groups strong { color: var(--muted); display: block; margin-bottom: 7px; }
.footer-groups a { display: block; min-height: 28px; color: var(--text); }
.footer-groups a:hover { color: var(--gold-bright); }
.footer-note { margin: 24px 0 8px; color: var(--muted); max-width: 880px; }
.copyright { margin: 0; color: var(--soft); }

.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,.68);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.overlay.is-active { visibility: visible; opacity: 1; pointer-events: auto; }
.full-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    max-height: 72vh;
    background: var(--surface);
    border-top: 1px solid var(--border-strong);
    transform: translateY(102%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .24s ease, visibility .24s ease;
    box-shadow: 0 -18px 40px rgba(0,0,0,.55);
}
.full-menu.is-open { transform: translateY(0); visibility: visible; pointer-events: auto; }
.full-menu-head {
    min-height: 58px;
    padding: 8px max(16px, calc((100vw - 980px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.menu-brand { display: flex; align-items: center; gap: 10px; color: var(--title); }
.close-button { min-width: 44px; min-height: 44px; color: var(--gold-bright); }
.full-menu-body {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 16px 28px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    overflow-y: auto;
    max-height: calc(72vh - 58px);
}
.menu-group h2 { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.menu-group a { display: block; padding: 8px 0; border-bottom: 1px solid rgba(201,162,39,.12); }
.menu-group a strong { color: var(--title); display: block; font-size: 14px; }
.menu-group a span { color: var(--soft); display: block; font-size: 12px; line-height: 1.5; margin-top: 2px; }
.menu-group a:hover strong { color: var(--gold-bright); }

.search-layer {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 115;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
}
.search-layer.is-open { visibility: visible; pointer-events: auto; opacity: 1; }
.search-card {
    max-width: 740px;
    margin: 12px auto 0;
    padding: 20px;
    background: var(--bg-deep);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    border-radius: 8px;
}
.search-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.search-head strong { color: var(--title); font-size: 18px; }
.search-head p { margin: 2px 0 0; color: var(--muted); }
.search-label { display: block; color: var(--muted); font-size: 12px; margin-top: 12px; }
#site-search-input {
    width: 100%;
    min-height: 44px;
    margin: 5px 0 12px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--cream);
}
.search-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.search-presets a { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; }
.search-presets a:hover { border-color: var(--gold-bright); }
.search-presets a span { display: block; color: var(--soft); font-size: 12px; }
.search-empty { color: var(--muted); margin: 8px 0 0; }

.mobile-bottom { display: none; }

@media (max-width: 880px) {
    .site-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 0 10px 0 16px;
    }
    .brand-english { display: none; }
    .header-actions { gap: 0; }
    .header-app, .menu-trigger { padding: 0 8px; }
    .double-nav, .side-nav { display: none; }
    .site-shell { max-width: none; }
    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 104px 16px 84px;
    }
    .scene-row { grid-template-columns: 1fr; gap: 6px; }
    .scene-visual { margin-left: 0; }
    .note-columns, .works-grid, .help-grid, .brand-principles { grid-template-columns: 1fr; }
    .app-band { grid-template-columns: 1fr; }
    .media-app { height: 280px; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-groups { grid-template-columns: 1fr 1fr; }
    .site-footer { padding: 26px 16px calc(72px + env(safe-area-inset-bottom)); }
    .full-menu-body { grid-template-columns: 1fr 1fr; }
    .search-layer { inset: 0; top: 0; background: var(--bg-deep); overflow-y: auto; }
    .search-card { margin: 0; max-width: none; min-height: 100vh; border: 0; border-radius: 0; padding: 24px 16px 90px; }
    .search-presets { grid-template-columns: 1fr; }
    .mobile-bottom {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        height: calc(48px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-deep);
        border-top: 1px solid var(--border-strong);
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    .mobile-bottom a {
        min-width: 0;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        color: var(--text);
    }
    .mobile-bottom a.is-current { background: var(--gold); color: #1A1408; font-weight: 700; }
    .full-menu { bottom: calc(48px + env(safe-area-inset-bottom)); max-height: calc(72vh - 20px); }
    .full-menu-body { max-height: calc(72vh - 78px); }
}

@media (max-width: 520px) {
    .main-content { padding-top: 96px; }
    .lead { font-size: 16px; }
    .home-opening .lead { font-size: 18px; }
    .status-row { grid-template-columns: 1fr; gap: 4px; }
    .footer-groups { grid-template-columns: 1fr 1fr; gap: 14px; }
    .full-menu-body { grid-template-columns: 1fr; }
    .media-app { height: 260px; }
}
