:root {
    --bg: #0C100E;
    --bg-deep: #080A09;
    --surface: #141A16;
    --surface-2: #1A2420;
    --title: #E8F6EE;
    --text: #CDE3D6;
    --muted: #8FB3A0;
    --soft: #6E8F7E;
    --green: #2A9D5C;
    --green-bright: #3CB371;
    --green-dark: #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);
    --max: 1120px;
    --topline: 22px;
    --header: 60px;
    --tabs: 40px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg-deep); }
body { margin: 0; min-width: 0; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.7; }
body.menu-open, body.search-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 9999; padding: 8px 12px; background: var(--sand); color: var(--bg-deep); border-radius: 8px; }
.skip-link:focus { top: 8px; }
.topline { position: fixed; inset: 0 0 auto 0; height: var(--topline); z-index: 1200; background: #050706; border-bottom: 1px solid var(--border); color: var(--green-bright); font-size: 12px; }
.topline-inner { max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.text-button { min-width: 44px; min-height: 22px; padding: 0 4px; border: 0; background: transparent; color: var(--green-bright); cursor: pointer; }
.site-header { position: fixed; top: var(--topline); left: 0; right: 0; height: var(--header); z-index: 1180; background: var(--bg-deep); border-bottom: 1px solid var(--border-strong); }
.site-header-inner { max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.brand-link { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; max-width: 160px; }
.brand-logo { height: 28px; width: auto; object-fit: contain; object-position: left center; }
.brand-text { font-size: 16px; font-weight: 800; color: var(--title); letter-spacing: .04em; }
.menu-button, .app-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 14px; }
.menu-button { min-width: 72px; padding: 0 18px; border: 1px solid var(--border-strong); background: #0A0E0C; color: var(--text); cursor: pointer; }
.app-link { justify-self: end; padding: 0 16px; background: linear-gradient(135deg,#3CB371 0%,#2A9D5C 55%,#146B3A 100%); color: #08110C; font-weight: 800; }
.section-tabs { position: fixed; top: calc(var(--topline) + var(--header)); left: 0; right: 0; height: var(--tabs); z-index: 1160; display: flex; align-items: stretch; justify-content: center; background: #0D2116; border-bottom: 1px solid var(--border-strong); font-size: 13px; }
.section-tabs a { min-width: 110px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: var(--text); }
.section-tabs a.is-active { background: var(--green); color: #08110C; font-weight: 800; }
.page-main { max-width: var(--max); margin: 0 auto; padding: calc(var(--topline) + var(--header) + var(--tabs) + 24px) 16px 72px; min-height: 70vh; }
.hero, .page-hero { padding: 0 0 28px; }
.hero-copy, .page-hero-copy { max-width: 820px; margin: 18px auto 0; text-align: center; }
.eyebrow { margin: 0 0 7px; color: var(--green-bright); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
h1, h2, h3 { margin-top: 0; color: var(--title); line-height: 1.3; }
h1 { margin-bottom: 12px; font-size: 24px; }
h2 { margin-bottom: 12px; font-size: 20px; }
h3 { margin-bottom: 8px; font-size: 16px; }
p { margin: 0 0 14px; }
.lead { color: var(--text); }
.muted { color: var(--muted); }
.section { margin: 0 0 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.media-slot { width: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-deep); box-shadow: var(--shadow); }
.media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.media-slot.banner { height: 260px; }
.media-slot.medium { height: 200px; }
.media-slot.card-image { height: 180px; }
.media-slot.app-image { height: min(360px, 68vw); max-height: 360px; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.btn-primary { background: linear-gradient(135deg,#3CB371 0%,#2A9D5C 55%,#146B3A 100%); color: #08110C; }
.btn-secondary { background: #0A0E0C; border-color: var(--border-strong); color: var(--text); }
.btn:hover, .menu-button:hover, .app-link:hover, .search-presets a:hover, .drawer a:hover { transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card, .content-card, .note-card, .faq-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.card { overflow: hidden; }
.card-body { padding: 18px; }
.card-body p:last-child { margin-bottom: 0; }
.content-card { padding: 20px; }
.content-card p:last-child { margin-bottom: 0; }
.note-card { padding: 16px 18px; background: var(--surface-2); border-color: var(--border-strong); }
.number-list, .lesson-list, .index-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.number-list div, .lesson-list a, .index-list a { min-height: 74px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.number-list strong { display: block; color: var(--green-bright); font-size: 13px; }
.number-list span, .lesson-list span, .index-list span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.lesson-list a:hover, .index-list a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.timeline { position: relative; margin-left: 8px; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.timeline-item { position: relative; padding: 0 0 24px; }
.timeline-item::before { content: ""; position: absolute; left: -23px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 5px rgba(42,157,92,.12); }
.timeline-item:last-child { padding-bottom: 0; }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; margin-bottom: 8px; border-radius: 999px; background: var(--green); color: #08110C; font-size: 12px; font-weight: 800; }
.status.pending { background: var(--sand); color: #16150F; }
.status.working { background: #1F7E4A; color: var(--title); }
.app-feature { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 18px; align-items: center; }
.icon-inline { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--bg-deep); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); margin-bottom: 12px; }
.icon-inline img { width: 48px; height: 48px; object-fit: contain; }
.page-hero { border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.page-hero-copy { text-align: left; margin-left: 0; }
.prose-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.prose-grid .content-card { min-height: 100%; }
.term-list { display: grid; gap: 10px; }
.term-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.term-row:last-child { border-bottom: 0; }
.term-row strong { color: var(--sand); }
.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 18px 20px; }
.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: 12px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 28px 16px 18px; display: grid; grid-template-columns: 1.1fr 1.9fr; gap: 28px; }
.footer-brand p { color: var(--muted); max-width: 520px; }
.footer-brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-logo { height: 28px; width: auto; object-fit: contain; }
.footer-brand-row div { display: flex; flex-direction: column; line-height: 1.3; }
.footer-brand-row strong { color: var(--title); font-size: 16px; }
.footer-brand-row span { color: var(--muted); font-size: 12px; }
.footer-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.footer-links h2 { font-size: 13px; color: var(--green-bright); margin-bottom: 9px; }
.footer-links a { display: block; min-height: 30px; color: var(--text); }
.footer-links a:hover { color: var(--sand); }
.footer-bottom { max-width: var(--max); margin: 0 auto; padding: 12px 16px 0; border-top: 1px solid var(--border); color: var(--soft); }
.site-overlay { position: fixed; inset: 0; z-index: 1400; background: rgba(0,0,0,.62); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.site-overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.drawer { position: fixed; z-index: 1500; top: 0; bottom: 0; left: 0; width: 400px; max-width: 86vw; padding: 18px; overflow-y: auto; background: #070A08; border-right: 1px solid var(--border-strong); box-shadow: var(--shadow); transform: translateX(-102%); visibility: hidden; pointer-events: none; transition: transform .24s ease, visibility .24s ease; }
body.menu-open .drawer { transform: translateX(0); visibility: visible; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.drawer-brand { display: flex; align-items: center; gap: 10px; }
.drawer-brand img { height: 28px; width: auto; object-fit: contain; }
.drawer-brand div { display: flex; flex-direction: column; line-height: 1.3; }
.drawer-brand strong { color: var(--title); }
.drawer-brand span { color: var(--muted); font-size: 12px; }
.icon-button { min-width: 44px; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-deep); color: var(--text); cursor: pointer; }
.drawer-groups { padding: 8px 0 24px; }
.drawer-groups section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.drawer-groups section:last-child { border-bottom: 0; }
.drawer-groups h2 { margin: 0 0 8px; color: var(--green-bright); font-size: 13px; }
.drawer-groups a { display: block; padding: 10px 12px; margin: 4px 0; border-radius: 10px; border: 1px solid transparent; }
.drawer-groups a:hover { background: var(--surface); border-color: var(--border); }
.drawer-groups a strong, .drawer-groups a span { display: block; }
.drawer-groups a strong { color: var(--title); font-size: 14px; }
.drawer-groups a span { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 2px; }
.search-panel { position: fixed; z-index: 1520; top: calc(var(--topline) + var(--header)); left: 50%; width: min(720px, calc(100% - 32px)); transform: translate(-50%, -18px); opacity: 0; visibility: hidden; pointer-events: none; transition: .2s ease; }
body.search-open .search-panel { transform: translate(-50%, 10px); opacity: 1; visibility: visible; pointer-events: auto; }
.search-card { padding: 18px; background: #070A08; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-head strong { color: var(--title); font-size: 16px; }
.search-card p { color: var(--muted); }
.search-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.search-presets a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.mobile-bottom { display: none; }
@media (max-width: 860px) {
    .grid-3, .prose-grid { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .number-list, .lesson-list, .index-list { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-links { grid-template-columns: repeat(2, 1fr); }
    .app-feature { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    :root { --tabs: 0px; }
    body { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
    .section-tabs { display: none; }
    .page-main { padding-top: calc(var(--topline) + var(--header) + 22px); padding-left: 16px; padding-right: 16px; padding-bottom: 42px; }
    .site-header-inner { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
    .brand-link { max-width: 110px; min-width: 44px; overflow: hidden; }
    .brand-logo { max-width: 104px; }
    .menu-button { min-width: 64px; padding: 0 12px; }
    .app-link { padding: 0 10px; font-size: 13px; }
    .media-slot.banner { height: 260px; }
    .media-slot.medium { height: 200px; }
    .media-slot.card-image { height: 180px; }
    .hero-copy { text-align: left; }
    .button-row { justify-content: flex-start; }
    .number-list, .lesson-list, .index-list { grid-template-columns: 1fr; }
    .term-row { grid-template-columns: 1fr; gap: 4px; }
    .footer-links { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
    .site-footer { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    .mobile-bottom { position: fixed; z-index: 1250; 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-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text); }
    .mobile-bottom a.is-active { background: var(--green); color: #08110C; font-weight: 800; }
    body.menu-open .mobile-bottom, body.search-open .mobile-bottom { z-index: 1300; }
    .search-panel { inset: 0; width: 100%; transform: none; background: #070A08; padding: calc(18px + env(safe-area-inset-top)) 16px 16px; }
    body.search-open .search-panel { transform: none; }
    .search-card { border: 0; box-shadow: none; padding: 0; background: transparent; }
    .search-presets { display: grid; grid-template-columns: 1fr 1fr; }
    .search-presets a { justify-content: center; }
}
