:root {
    --bg: #0F0E0A;
    --deep: #080706;
    --panel: #1A1810;
    --panel-2: #242010;
    --title: #F5E6A8;
    --text: #E8DCB0;
    --muted: #B8A46A;
    --quiet: #8A7A48;
    --yellow: #E8B923;
    --yellow-bright: #F3D056;
    --yellow-deep: #A88212;
    --cream: #FFF6D8;
    --border: rgba(232,185,35,0.18);
    --border-strong: rgba(232,185,35,0.46);
    --shadow: 0 12px 28px rgba(0,0,0,0.40);
    --radius: 12px;
    --shell: 1120px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { max-width: 100%; }
.shell { width: min(calc(100% - 32px), var(--shell)); margin: 0 auto; }
.skip-link {
    position: fixed; left: 16px; top: -60px; z-index: 300;
    padding: 8px 12px; background: var(--yellow-bright); color: var(--bg); border-radius: 8px;
}
.skip-link:focus { top: 8px; }

.site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; }
.top-line { height: 22px; background: var(--deep); color: var(--muted); border-bottom: 1px solid var(--border); font-size: 12px; }
.top-line-inner { height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-button {
    min-width: 52px; min-height: 22px; padding: 0 8px; border: 0; background: transparent; color: var(--title); cursor: pointer;
}
.race-bar { height: 60px; background: #0C0B08; border-bottom: 1px solid var(--border-strong); }
.race-bar-inner { height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand-link { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; max-width: 260px; }
.brand-logo { display: block; height: 28px; width: auto; object-fit: contain; object-position: center; }
.brand-fallback { font-size: 16px; font-weight: 800; color: var(--title); letter-spacing: .04em; }
.drawer-button, .app-link, .close-button {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.drawer-button {
    min-width: 92px; padding: 0 20px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--title);
}
.app-link {
    justify-self: end; min-width: 98px; padding: 0 18px; color: var(--bg); font-weight: 800;
    background: linear-gradient(135deg,#F3D056 0%,#E8B923 55%,#A88212 100%);
}
.day-sign { height: 40px; background: #0B0A07; border-bottom: 1px solid var(--border); font-size: 13px; }
.day-sign-inner { height: 40px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.day-sign a { min-width: 92px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); }
.day-sign a.is-current { background: var(--yellow); color: var(--bg); font-weight: 800; }

.site-main { padding-top: 122px; min-height: 70vh; }
.page { padding: 28px 0 52px; }
.page-head { margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; color: var(--yellow); text-transform: uppercase; }
h1, h2, h3 { color: var(--title); margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 24px; line-height: 1.3; }
h2 { font-size: 20px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.5; }
p { margin: 0 0 14px; }
.lead { max-width: 820px; color: var(--cream); }
.muted { color: var(--muted); }
.small { color: var(--quiet); font-size: 13px; }

.card, .article-section, .timeline-item, .shelf-item, .faq-item, .note-box {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.article-section { padding: 22px; margin: 0 0 18px; }
.article-section p:last-child, .card p:last-child { margin-bottom: 0; }
.section-kicker { color: var(--yellow); font-size: 12px; letter-spacing: .12em; margin-bottom: 6px; }

.media-slot {
    width: 100%; background: var(--deep); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.banner-slot { height: 260px; margin-bottom: 18px; }
.thumb-slot { height: 180px; margin-bottom: 14px; }
.feature-slot { height: 200px; margin-bottom: 16px; }
.app-slot { height: 340px; margin-bottom: 16px; }
.icon-slot { width: 64px; height: 64px; flex: 0 0 64px; }
.icon-slot img { width: 48px; height: 48px; object-fit: contain; }

.hero-copy { max-width: 840px; margin: 0 auto; text-align: center; }
.hero-copy .lead { margin-left: auto; margin-right: auto; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; 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; white-space: nowrap; border: 1px solid var(--border-strong);
}
.btn-primary { color: var(--bg); font-weight: 800; background: linear-gradient(135deg,#F3D056 0%,#E8B923 55%,#A88212 100%); }
.btn-secondary { background: var(--deep); color: var(--title); }
.btn:hover, .btn:focus-visible, .drawer-button:hover, .drawer-button:focus-visible, .app-link:hover, .app-link:focus-visible,
.day-sign a:hover, .day-sign a:focus-visible, .footer-grid a:hover, .footer-grid a:focus-visible, .mobile-bar a:focus-visible {
    outline: none; border-color: var(--yellow-bright); filter: brightness(1.06);
}

.home-section { padding: 26px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head p { margin: 0; color: var(--muted); }
.number-list { display: grid; gap: 10px; }
.number-item { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.number-item:last-child { border-bottom: 0; }
.number-item .num { color: var(--yellow-bright); font-weight: 900; font-size: 18px; }
.number-item strong { color: var(--title); display: block; margin-bottom: 3px; }

.shelf { display: grid; gap: 12px; }
.shelf-item { padding: 16px; display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: start; }
.shelf-tag { color: var(--bg); background: var(--yellow); border-radius: 999px; padding: 4px 8px; text-align: center; font-size: 12px; font-weight: 800; }
.shelf-item strong { color: var(--title); }
.shelf-item a { color: var(--yellow-bright); min-height: 44px; display: inline-flex; align-items: center; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.timeline-item { position: relative; padding: 18px 18px 18px 22px; margin-bottom: 14px; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 24px; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px var(--bg); }
.status { display: inline-flex; min-height: 28px; align-items: center; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--yellow-bright); font-size: 12px; }

.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.note-box { padding: 18px; }
.note-box h3 { margin-bottom: 8px; }

.app-panel { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px; align-items: center; }
.app-title-row { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.app-title-row h2 { margin: 0; }

.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 18px; }
.faq-item h2, .faq-item h3 { margin-bottom: 8px; }

.link-list { display: grid; gap: 10px; }
.link-list a { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--deep); color: var(--title); }
.link-list a::after { content: "→"; color: var(--yellow); }

.site-footer { background: var(--deep); border-top: 1px solid var(--border-strong); color: var(--text); font-size: 13px; padding: 30px 0 calc(28px + env(safe-area-inset-bottom)); }
.footer-top { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.footer-brand-link { min-height: 44px; display: flex; align-items: center; }
.footer-brand strong { color: var(--title); font-size: 16px; }
.footer-brand span { color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }
.footer-grid section { display: flex; flex-direction: column; gap: 7px; }
.footer-grid h2 { font-size: 13px; margin: 0 0 6px; color: var(--yellow-bright); }
.footer-grid a { color: var(--text); min-height: 28px; }
.footer-note { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 18px; color: var(--muted); }
.footer-note p { margin-bottom: 8px; }

.overlay {
    position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.62); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.overlay:not([hidden]) { opacity: 1; pointer-events: auto; }
.race-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(400px, 86vw); background: #0C0B08; border-left: 1px solid var(--border-strong); box-shadow: var(--shadow); transform: translateX(102%); visibility: hidden; pointer-events: none; transition: transform .22s ease, visibility .22s ease; overflow-y: auto;
}
.race-drawer.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; }
.drawer-head { position: sticky; top: 0; z-index: 2; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #0C0B08; border-bottom: 1px solid var(--border); }
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-brand strong { color: var(--title); }
.close-button { border: 1px solid var(--border-strong); background: var(--deep); color: var(--title); padding: 0 14px; }
.drawer-groups { padding: 14px 16px 28px; }
.drawer-groups section { margin-bottom: 22px; }
.drawer-groups h2 { font-size: 13px; color: var(--yellow); margin-bottom: 8px; }
.drawer-groups a { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
.drawer-groups strong { display: block; color: var(--title); margin-bottom: 2px; }
.drawer-groups span { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; }

.search-layer { position: fixed; z-index: 155; left: 0; right: 0; top: 82px; visibility: hidden; pointer-events: none; transform: translateY(-14px); opacity: 0; transition: .2s ease; }
.search-layer.is-open { visibility: visible; pointer-events: auto; transform: translateY(0); opacity: 1; }
.search-card { width: min(calc(100% - 32px), 720px); margin: 0 auto; background: #0C0B08; border: 1px solid var(--border-strong); border-radius: 0 0 14px 14px; box-shadow: var(--shadow); padding: 18px; }
.search-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.search-head strong { color: var(--title); font-size: 18px; }
.search-head p { color: var(--muted); margin: 4px 0 0; }
.preset-links { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.preset-links 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(--title); }

.mobile-bar { display: none; }

@media (max-width: 820px) {
    .card-grid, .card-grid.two, .note-grid { grid-template-columns: 1fr; }
    .app-panel { grid-template-columns: 1fr; }
    .app-panel .app-slot { max-width: 360px; width: 100%; margin-left: auto; margin-right: auto; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
    .shell { width: calc(100% - 32px); }
    .day-sign { display: none; }
    .site-main { padding-top: 82px; padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
    .top-line-inner { gap: 8px; }
    .top-brand { max-width: calc(100vw - 96px); }
    .race-bar-inner { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
    .brand-link { min-width: 0; max-width: none; }
    .brand-logo { max-width: 138px; height: 28px; }
    .brand-fallback { max-width: 138px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
    .drawer-button { min-width: 66px; padding: 0 12px; }
    .app-link { min-width: 72px; padding: 0 10px; }
    .page { padding-top: 22px; }
    .banner-slot { height: 260px; }
    .section-head { align-items: start; flex-direction: column; gap: 6px; }
    .shelf-item { grid-template-columns: 62px 1fr; }
    .shelf-item a { grid-column: 2; }
    .footer-grid { gap: 16px; }
    .search-layer { inset: 0; top: 0; background: var(--deep); overflow-y: auto; }
    .search-card { width: 100%; min-height: 100%; margin: 0; border: 0; border-radius: 0; padding: calc(18px + env(safe-area-inset-top)) 16px 18px; box-shadow: none; }
    .preset-links { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .mobile-bar {
        position: fixed; z-index: 120; left: 0; right: 0; bottom: 0; height: calc(48px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); background: #0B0A07; border-top: 1px solid var(--border-strong);
    }
    .mobile-bar a { min-height: 48px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
    .mobile-bar a.is-current { background: var(--yellow); color: var(--bg); font-weight: 800; }
    .site-footer { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

.spacer-18 { height: 18px; }
.button-row.is-left { justify-content: flex-start; }
.app-title-card { margin-bottom: 18px; }
