:root {
    --bg: #0C100E;
    --bg-deep: #080A09;
    --panel: #141A16;
    --panel-2: #1A2420;
    --title: #E8F6EE;
    --text: #CDE3D6;
    --muted: #8FB3A0;
    --subtle: #6E8F7E;
    --brand: #2A9D5C;
    --brand-bright: #3CB371;
    --brand-deep: #146B3A;
    --sand: #EFE6D2;
    --border: rgba(42,157,92,0.18);
    --border-strong: rgba(42,157,92,0.45);
    --shadow: 0 12px 28px rgba(8,10,9,0.35);
    --shell: 1120px;
    --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
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", sans-serif;
    font-size: 15px;
    line-height: 1.7;
}
body.nav-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 1000;
    padding: 9px 12px;
    background: var(--sand);
    color: #08110C;
    border-radius: 8px;
}
.skip-link:focus { top: 8px; }

.shell { width: min(var(--shell), calc(100% - 32px)); margin-inline: auto; }
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 70; }
.top-line { height: 22px; background: #050706; color: var(--brand-bright); font-size: 12px; border-bottom: 1px solid var(--border); }
.top-line-inner { height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.text-button, .drawer-toggle, .icon-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.text-button { min-height: 22px; color: var(--brand-bright); }

.brand-bar { height: 60px; background: var(--bg-deep); border-bottom: 1px solid var(--border-strong); }
.brand-bar-inner { height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand-link { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; font-weight: 700; color: var(--title); }
.brand-logo-slot, .drawer-logo-slot, .footer-logo-slot { min-width: 28px; height: 28px; display: inline-grid; place-items: center; }
.brand-logo, .drawer-logo, .footer-logo { height: 28px; width: auto; max-width: 120px; object-fit: contain; object-position: center; }
.brand-logo-slot:empty { display: none; }
.brand-logo-slot:not(:empty) + .brand-fallback { display: none; }
.drawer-toggle { min-width: 72px; min-height: 44px; padding: 0 20px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); background: #0B110E; }
.app-link { justify-self: end; min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; background: linear-gradient(135deg,#3CB371 0%,#2A9D5C 55%,#146B3A 100%); color: #08110C; font-weight: 700; font-size: 14px; }

.tab-bar { height: 40px; background: #0D2518; border-bottom: 1px solid var(--border-strong); }
.tab-bar-inner { height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tab-link { min-height: 32px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 8px; font-size: 13px; color: var(--text); }
.tab-link.is-active { background: var(--brand); color: #08110C; font-weight: 700; }

.site-main { padding-top: 138px; min-height: 70vh; }
.page-shell { width: min(var(--shell), calc(100% - 32px)); margin: 0 auto; padding: 36px 0 72px; }
.page-head { margin-bottom: 28px; max-width: 820px; }
.kicker { margin: 0 0 8px; color: var(--brand-bright); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { color: var(--title); margin-top: 0; }
h1 { margin-bottom: 12px; font-size: 24px; line-height: 1.3; }
h2 { margin-bottom: 12px; font-size: 20px; line-height: 1.4; }
h3 { margin-bottom: 8px; font-size: 16px; line-height: 1.45; }
p { margin: 0 0 1em; }
.lead { color: var(--muted); font-size: 16px; }
.meta-note { color: var(--subtle); font-size: 13px; }

.hero-media, .media-slot { width: 100%; background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; }
.hero-media { height: 260px; margin-bottom: 20px; }
.media-slot { height: 180px; }
.media-slot.medium { height: 200px; }
.media-slot.tall { height: min(360px, 56vw); }
.hero-media img, .media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }

.hero-copy { padding: 20px 0 8px; }
.hero-copy h1 { font-size: clamp(24px, 4vw, 38px); }
.hero-copy .brand-lockup { color: var(--sand); font-weight: 700; letter-spacing: .04em; }
.actions { 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: 700; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg,#3CB371 0%,#2A9D5C 55%,#146B3A 100%); color: #08110C; }
.btn-secondary { background: #0B100E; color: var(--text); border: 1px solid var(--border-strong); }

.section { margin-top: 42px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head p { margin: 0; color: var(--muted); max-width: 720px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.card, .article-block, .notice, .feature, .index-card, .faq-item, .timeline-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card { padding: 16px; }
.card .media-slot { margin-bottom: 14px; }
.card p:last-child { margin-bottom: 0; }
.card-link { color: var(--brand-bright); font-weight: 700; }
.article-block { padding: 22px; margin-bottom: 16px; }
.article-block p:last-child { margin-bottom: 0; }
.notice { padding: 16px 18px; border-color: var(--border-strong); background: var(--panel-2); color: var(--text); }
.notice strong { color: var(--sand); }

.numbered-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 16px 0 0; }
.numbered-list article { padding: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.numbered-list span { display: block; margin-bottom: 6px; color: var(--brand-bright); font-size: 12px; }

.lesson-list, .directory-list, .plain-list { list-style: none; padding: 0; margin: 0; }
.lesson-list { display: grid; gap: 10px; }
.lesson-list li { padding: 13px 14px; border: 1px solid var(--border); background: var(--panel-2); border-radius: 10px; }
.lesson-list strong { color: var(--title); }

.timeline { position: relative; display: grid; gap: 14px; margin-top: 18px; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.timeline-item { position: relative; padding: 16px 16px 16px 44px; }
.timeline-item::before { content: ""; position: absolute; left: 9px; top: 22px; width: 11px; height: 11px; border-radius: 50%; background: var(--brand-bright); box-shadow: 0 0 0 4px #102217; }
.status { display: inline-flex; min-height: 26px; align-items: center; padding: 0 9px; border-radius: 999px; background: #0B100E; border: 1px solid var(--border-strong); color: var(--muted); font-size: 12px; }

.app-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0,1.2fr); gap: 18px; align-items: start; }
.app-icon { width: 48px; height: 48px; object-fit: contain; object-position: center; border-radius: 10px; }
.icon-line { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.icon-line strong { color: var(--title); }

.index-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.index-card { padding: 18px; }
.index-card small { color: var(--brand-bright); }
.index-card p:last-child { margin-bottom: 0; }

.definition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.definition-grid div { padding: 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.definition-grid dt { color: var(--sand); font-weight: 700; }
.definition-grid dd { margin: 6px 0 0; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; background: var(--panel); }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--sand); background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }

.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 18px; }
.faq-item h2 { font-size: 16px; }
.faq-item p:last-child { margin-bottom: 0; }

.site-footer { background: #050706; border-top: 1px solid var(--border-strong); color: var(--text); font-size: 13px; padding-bottom: 20px; }
.footer-grid { display: grid; grid-template-columns: 2.2fr repeat(4, 1fr); gap: 28px; padding-top: 34px; padding-bottom: 28px; }
.footer-brand p { color: var(--muted); max-width: 460px; }
.footer-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand-row strong, .footer-brand-row span { display: block; }
.footer-brand-row span { color: var(--muted); }
.footer-logo-slot:empty, .drawer-logo-slot:empty { display: none; }
.footer-nav { display: grid; align-content: start; gap: 7px; }
.footer-nav h2 { font-size: 13px; margin: 0 0 6px; color: var(--brand-bright); }
.footer-nav a { color: var(--muted); }
.footer-bottom { padding-top: 14px; border-top: 1px solid var(--border); color: var(--subtle); }

.drawer {
    position: fixed;
    z-index: 100;
    inset: 0 auto 0 0;
    width: min(400px, 86vw);
    background: #07100B;
    border-right: 1px solid var(--border-strong);
    transform: translateX(-102%);
    transition: transform .22s ease;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}
.drawer.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; }
.drawer-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.drawer-brand { display: flex; align-items: center; gap: 10px; color: var(--title); }
.icon-button { min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); background: var(--bg-deep); }
.drawer-body { overflow-y: auto; padding: 14px 14px 40px; }
.drawer-group { margin-bottom: 20px; }
.drawer-group h2 { margin: 0 0 8px; color: var(--brand-bright); font-size: 13px; }
.drawer-group a { display: block; padding: 10px 12px; border-radius: 10px; }
.drawer-group a:hover { background: var(--panel-2); }
.drawer-group strong, .drawer-group span { display: block; }
.drawer-group strong { color: var(--title); font-size: 14px; }
.drawer-group span { color: var(--muted); font-size: 12px; line-height: 1.5; }

.search-layer {
    position: fixed;
    z-index: 95;
    left: 0;
    right: 0;
    top: 82px;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: .18s ease;
}
.search-layer.is-open { visibility: visible; pointer-events: auto; opacity: 1; transform: translateY(0); }
.search-card { background: #07100B; border: 1px solid var(--border-strong); border-radius: 0 0 14px 14px; padding: 18px; box-shadow: var(--shadow); }
.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: 2px 0 0; }
.search-input-row { margin-top: 14px; }
.search-input-row label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.search-input-row input { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg-deep); color: var(--text); padding: 0 12px; outline: none; }
.search-presets { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.search-presets a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.search-empty { margin: 12px 0 0; color: var(--muted); }

.page-overlay { position: fixed; z-index: 90; inset: 0; background: rgba(0,0,0,.66); opacity: 0; visibility: hidden; pointer-events: none; transition: .18s ease; }
.page-overlay.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }

.mobile-bottom { display: none; }

.btn:hover, .app-link:hover, .drawer-toggle:hover, .tab-link:hover, .footer-nav a:hover, .card-link:hover, .index-card:hover { filter: brightness(1.08); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }

@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .footer-grid { grid-template-columns: 2fr repeat(2,1fr); }
    .footer-brand { grid-row: span 2; }
}

@media (max-width: 720px) {
    body { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
    .shell, .page-shell { width: calc(100% - 32px); }
    .tab-bar { display: none; }
    .site-main { padding-top: 82px; }
    .brand-bar-inner { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 8px; }
    .brand-link { min-width: 0; }
    .brand-fallback { font-size: 15px; white-space: nowrap; }
    .drawer-toggle { min-width: 60px; padding: 0 12px; }
    .app-link { padding: 0 10px; font-size: 13px; }
    .page-shell { padding-top: 28px; padding-bottom: 52px; }
    .grid-3, .grid-2, .app-layout, .index-grid, .definition-grid { grid-template-columns: 1fr; }
    .numbered-list { grid-template-columns: 1fr 1fr; }
    .hero-media { height: 260px; }
    .media-slot { height: 180px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 18px; }
    .footer-brand { grid-column: 1 / -1; grid-row: auto; }
    .mobile-bottom {
        position: fixed;
        z-index: 80;
        left: 0; right: 0; bottom: 0;
        min-height: calc(48px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: #050706;
        border-top: 1px solid var(--border-strong);
    }
    .mobile-bottom a { min-height: 48px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
    .mobile-bottom a.is-active { background: var(--brand); color: #08110C; font-weight: 700; }
    .search-layer { inset: 0; top: 0; background: #050706; overflow-y: auto; }
    .search-card { width: 100%; min-height: 100vh; border: 0; border-radius: 0; padding: max(20px, env(safe-area-inset-top)) 16px 80px; }
    .search-presets { display: grid; grid-template-columns: 1fr 1fr; }
    .search-presets a { min-height: 44px; }
}

@media (max-width: 480px) {
    .grid-4, .numbered-list { grid-template-columns: 1fr; }
    .hero-copy h1 { font-size: 26px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .top-line-inner { gap: 8px; }
}
