:root {
    --bg: #0F0E0A;
    --bg-deep: #090807;
    --panel: #17150F;
    --panel-2: #1F1B12;
    --title: #F6E7B8;
    --text: #E4D4A2;
    --muted: #B39A5E;
    --soft: #8C7744;
    --gold: #E0B12A;
    --gold-bright: #F0C84A;
    --gold-deep: #A37A14;
    --sand: #F3E6C4;
    --border: rgba(224, 177, 42, 0.18);
    --border-strong: rgba(224, 177, 42, 0.46);
    --shadow: 0 12px 28px rgba(0,0,0,0.35);
    --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
}
body.ui-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
}
.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 120;
    background: var(--gold-bright);
    color: #1A1406;
    padding: 8px 12px;
    border-radius: 8px;
}
.skip-link:focus { top: 8px; }

.site-header { position: fixed; inset: 0 0 auto; z-index: 80; }
.gold-line {
    height: 22px;
    background: var(--bg-deep);
    color: var(--gold-bright);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.top-inner, .roll-inner, .tag-inner {
    width: min(100%, var(--max));
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
}
.top-inner { justify-content: space-between; }
.gold-line__brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plain-button {
    min-height: 22px;
    border: 0;
    background: transparent;
    color: var(--gold-bright);
    cursor: pointer;
    padding: 0 8px;
    font-size: 12px;
}
.roll-bar {
    height: 60px;
    background: rgba(9,8,7,0.98);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: 0 8px 22px rgba(0,0,0,0.2);
}
.roll-inner { justify-content: space-between; gap: 16px; }
.brand-link, .app-link, .drawer-toggle {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.brand-link { min-width: 120px; justify-content: flex-start; }
.brand-logo, .footer-logo, .drawer-logo { height: 28px; width: auto; object-fit: contain; object-position: center; }
.brand-text { color: var(--title); font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.drawer-toggle {
    min-width: 92px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--panel);
    color: var(--sand);
    cursor: pointer;
    padding: 0 20px;
    font-weight: 700;
}
.app-link {
    min-width: 120px;
    justify-content: flex-end;
    color: var(--gold-bright);
    font-weight: 700;
}
.tag-bar {
    height: 40px;
    background: var(--gold-deep);
    border-bottom: 1px solid var(--gold-bright);
    font-size: 13px;
}
.tag-inner { justify-content: center; gap: 10px; }
.tag-link {
    min-height: 32px;
    padding: 4px 20px;
    border-radius: 999px;
    color: var(--sand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tag-link:hover, .tag-link.is-active { background: var(--gold); color: #1A1406; }

.site-main { padding-top: 122px; min-height: 70vh; }
.page-shell { width: min(100%, var(--max)); margin: 0 auto; padding: 28px 16px 72px; }
.page-hero, .hero-card, .content-card, .section-block {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.page-hero { padding: 28px; margin-bottom: 22px; }
.page-hero--compact { display: grid; grid-template-columns: 1fr; gap: 18px; }
.eyebrow {
    display: inline-block;
    color: var(--gold-bright);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { color: var(--title); font-size: 24px; line-height: 1.3; margin-bottom: 14px; }
h2 { color: var(--title); font-size: 20px; line-height: 1.4; margin-bottom: 12px; }
h3 { color: var(--title); font-size: 16px; line-height: 1.45; margin-bottom: 8px; }
p { margin-bottom: 14px; }
.lead { font-size: 16px; color: var(--sand); max-width: 850px; }
.muted { color: var(--muted); }
.section-block { padding: 24px; margin-top: 18px; }
.section-block > p:last-child, .content-card > p:last-child { margin-bottom: 0; }

.media-slot {
    width: 100%;
    min-height: 120px;
    border-radius: 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.media-slot--banner { height: 260px; }
.media-slot--card { height: 180px; }
.media-slot--wide { height: 200px; }
.media-slot--app { height: min(360px, 60vw); }
.media-slot--page { height: 220px; }
.app-brand-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); }
.app-icon { width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain; object-position: center; border-radius: 10px; }

.hero-card { padding: 0; overflow: hidden; }
.hero-copy { padding: 24px 24px 28px; }
.hero-copy p { max-width: 900px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
    min-height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg,#F0C84A 0%,#E0B12A 55%,#A37A14 100%); color: #1A1406; }
.btn-secondary { background: var(--bg-deep); color: var(--sand); border: 1px solid var(--border-strong); }
.btn:hover { transform: translateY(-1px); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.content-card { overflow: hidden; }
.content-card__body { padding: 18px; }
.number-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.number-card, .index-card, .note-card, .policy-card {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}
.number-card .num, .focus-list .num {
    display: block;
    color: var(--gold-bright);
    font-size: 26px;
    line-height: 1;
    font-weight: 900;
    margin-bottom: 10px;
}
.rack-list, .focus-list, .method-list, .policy-list, .faq-list { display: grid; gap: 12px; }
.rack-item, .focus-item, .method-item, .policy-item, .faq-item {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}
.rack-item { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: start; }
.rack-code { color: var(--gold-bright); font-weight: 900; letter-spacing: .08em; }
.focus-item { display: grid; grid-template-columns: 56px 1fr; gap: 16px; }
.focus-item .num { margin: 2px 0 0; }
.timeline { position: relative; padding-left: 30px; display: grid; gap: 14px; }
.timeline:before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.timeline-item { position: relative; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.timeline-item:before { content: ""; position: absolute; left: -25px; top: 24px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 4px var(--bg); }
.status { display: inline-flex; min-height: 28px; align-items: center; padding: 0 10px; border-radius: 999px; background: var(--gold); color: #1A1406; font-size: 12px; font-weight: 900; }
.note-grid, .index-grid, .policy-grid, .two-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.topic-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.topic-chip { display: inline-flex; min-height: 38px; align-items: center; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-deep); color: var(--sand); }
.topic-chip:hover { border-color: var(--gold-bright); color: var(--gold-bright); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.small-print { color: var(--muted); font-size: 13px; }

.site-footer { background: var(--bg-deep); border-top: 1px solid var(--border-strong); color: var(--text); }
.footer-inner { width: min(100%, var(--max)); margin: 0 auto; padding: 28px 16px 86px; font-size: 13px; }
.footer-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.footer-brand__link { min-height: 44px; display: inline-flex; align-items: center; }
.footer-brand__text { font-size: 16px; color: var(--title); font-weight: 900; }
.footer-brand span { color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.footer-grid h2 { font-size: 14px; margin-bottom: 10px; }
.footer-grid a { display: block; min-height: 32px; color: var(--text); padding: 4px 0; }
.footer-grid a:hover { color: var(--gold-bright); }
.footer-note { color: var(--muted); margin: 20px 0 10px; }
.footer-copy { margin-bottom: 0; color: var(--soft); }

.page-overlay {
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(0,0,0,.64);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.page-overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.drawer-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 96;
    width: min(400px, 86vw);
    background: var(--bg-deep);
    border-right: 1px solid var(--border-strong);
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility .22s ease;
    display: flex;
    flex-direction: column;
}
.drawer-panel.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; }
.drawer-head { min-height: 74px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-close, .search-close {
    min-height: 44px;
    min-width: 64px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--panel);
    color: var(--sand);
    cursor: pointer;
}
.drawer-scroll { overflow-y: auto; padding: 14px 16px 28px; }
.drawer-group { padding: 10px 0 14px; border-bottom: 1px solid var(--border); }
.drawer-group:last-child { border-bottom: 0; }
.drawer-group h2 { font-size: 14px; color: var(--gold-bright); margin-bottom: 10px; }
.drawer-group a { display: block; padding: 10px 0; }
.drawer-group a strong { display: block; color: var(--title); font-size: 14px; }
.drawer-group a span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.55; }

.search-layer {
    position: fixed;
    left: 0;
    right: 0;
    top: 82px;
    z-index: 94;
    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 {
    width: min(calc(100% - 32px), 760px);
    margin: 12px auto 0;
    background: var(--bg-deep);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 20px;
}
.search-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.search-card h2 { margin-bottom: 6px; }
.search-card p { color: var(--muted); }
.search-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.search-presets a { min-height: 44px; display: flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; color: var(--sand); }
.search-presets a:hover { border-color: var(--gold-bright); color: var(--gold-bright); }

.mobile-bottom { display: none; }

@media (max-width: 860px) {
    .card-grid { grid-template-columns: 1fr; }
    .number-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .media-slot--page { height: 200px; }
}

@media (max-width: 640px) {
    .tag-bar { display: none; }
    .site-main { padding-top: 82px; }
    .top-inner, .roll-inner { padding-left: 16px; padding-right: 16px; }
    .roll-inner { gap: 8px; }
    .brand-link, .app-link { min-width: 0; flex: 1 1 0; }
    .brand-link { justify-content: flex-start; }
    .drawer-toggle { flex: 0 0 auto; min-width: 78px; padding: 0 14px; }
    .app-link { justify-content: flex-end; font-size: 13px; }
    .brand-logo { max-width: 106px; }
    .page-shell { padding: 20px 16px 76px; }
    .page-hero, .section-block { padding: 20px; }
    .hero-copy { padding: 20px; }
    .media-slot--banner { height: 220px; }
    .media-slot--wide { height: 180px; }
    .media-slot--page { height: 170px; }
    .number-grid, .note-grid, .index-grid, .policy-grid, .two-grid { grid-template-columns: 1fr; }
    .rack-item { grid-template-columns: 72px 1fr; gap: 12px; }
    .focus-item { grid-template-columns: 48px 1fr; gap: 12px; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .footer-inner { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .search-layer { inset: 0; top: 0; background: var(--bg-deep); overflow-y: auto; }
    .search-card { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; padding: 28px 16px calc(84px + env(safe-area-inset-bottom)); }
    .search-presets { grid-template-columns: 1fr 1fr; }
    .mobile-bottom {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 84;
        height: calc(48px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(9,8,7,.98);
        border-top: 1px solid var(--border-strong);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }
    .mobile-bottom a { min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--sand); }
    .mobile-bottom a.is-active { background: var(--gold); color: #1A1406; font-weight: 900; }
    .drawer-panel { z-index: 98; }
    .page-overlay { z-index: 90; }
}

@media (max-width: 400px) {
    .footer-grid { grid-template-columns: 1fr; }
    .search-presets { grid-template-columns: 1fr; }
}
