:root {
  --bg: #0f0a1f; --bg2: #18102e; --card: #1e1538; --line: #2f2552;
  --text: #f1edf9; --muted: #b3a8cf; --pink: #ff2d95; --cyan: #22d3ee; --amber: #fbbf24;
  --ok: #34d399; --radius: 14px; --w: 1120px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #fbf9ff; --bg2: #f3effc; --card: #ffffff; --line: #e4ddf3; --text: #1b1430;
          --muted: #5c5274; --pink: #d6136f; --cyan: #0e7490; --amber: #b45309; --ok: #047857; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font); }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--pink); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: var(--pink); color: #fff; padding: 8px 12px; border-radius: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
       backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--cyan)); }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 15px; font-weight: 600; }
.nav a:hover, .nav a[aria-current] { color: var(--text); background: var(--card); }
.top-tools { display: flex; gap: 8px; align-items: center; }
.search { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 7px 12px; width: 180px; font: inherit; font-size: 15px; }
.lang { font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid var(--line); padding: 5px 9px; border-radius: 8px; color: var(--muted); }
.search-results { padding-bottom: 12px; }
.search-results a { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.search-results small { display: block; color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; padding-top: 24px; padding-bottom: 48px; }
.side { position: sticky; top: 84px; align-self: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; gap: 0; } .side { position: static; } .toc { display: none; } .search { width: 130px; } }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 10px 0 8px; }
h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.25; margin: 40px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 20px; margin: 28px 0 6px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.prose p, .prose li { max-width: 70ch; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose blockquote { margin: 16px 0; padding: 4px 16px; border-left: 4px solid var(--pink); background: var(--bg2); border-radius: 0 10px 10px 0; }

/* facts */
.fact { font-weight: 650; }
.fact .src { font-size: 11px; font-weight: 600; vertical-align: super; margin-left: 2px; text-decoration: none; opacity: .75; }
.fact .unv { color: var(--amber); font-style: normal; font-size: 13px; font-weight: 600; }

/* hero */
.hero { padding: 20px 0 8px; }
.kicker { color: var(--pink); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 0; }
.tpl-home .prose .countdown .cd-value { font-size: clamp(28px, 6vw, 44px); }
.countdown { display: inline-flex; flex-direction: column; gap: 2px; margin: 12px 0; padding: 12px 18px; border-radius: var(--radius);
             background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 22%, var(--card)), color-mix(in srgb, var(--cyan) 18%, var(--card)));
             border: 1px solid var(--line); }
.cd-label { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.cd-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown.big .cd-value { font-size: clamp(28px, 6vw, 44px); }

/* boxes */
.box, .pending, .aff { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 16px 18px; margin: 24px 0; }
.box p, .pending p { margin: 6px 0 12px; color: var(--muted); }
.pending { border-style: dashed; }
.pending strong::before { content: "⏳ "; }
.nl { border-color: color-mix(in srgb, var(--pink) 50%, var(--line)); }
.btn { display: inline-block; background: var(--pink); color: #fff; font-weight: 700; text-decoration: none; padding: 9px 16px; border-radius: 10px; }
.btn:hover { color: #fff; filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.aff { display: flex; gap: 12px; align-items: center; }
.aff a { font-weight: 700; }
.aff-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; }
.ad { margin: 16px auto; text-align: center; min-height: 0; }

/* video */
.yt { position: relative; aspect-ratio: 16/9; margin: 20px 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.yt-play { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; position: relative; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.yt-play span { position: absolute; inset: 0; margin: auto; width: 76px; height: 54px; display: grid; place-items: center;
                background: var(--pink); color: #fff; border-radius: 14px; font-size: 26px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* data */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 14px; align-items: center; }
.chip { font: inherit; font-size: 14px; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip.on { background: var(--pink); color: #fff; border-color: var(--pink); }
.tfilter, .cfilter, .calc input { font: inherit; font-size: 15px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card p { margin: 6px 0; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg2); color: var(--amber); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--amber); }
.code { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.plat { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 84px; }
.code code { background: var(--bg2); padding: 4px 8px; border-radius: 8px; font-size: 14px; word-break: break-word; }
.copy { font: inherit; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: transparent; color: var(--cyan); border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.note, .src-line { font-size: 13px; color: var(--muted); }
.unv-list { padding-left: 18px; }
.tscroll { overflow-x: auto; }
table.sortable { width: 100%; border-collapse: collapse; font-size: 15px; }
table.sortable th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px 10px; white-space: nowrap; }
table.sortable th[data-k] { cursor: pointer; }
table.sortable th[data-k]::after { content: " ↕"; opacity: .4; }
table.sortable td { border-bottom: 1px solid var(--line); padding: 9px 10px; }
#map { height: min(75vh, 720px); border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg2); }
.map-pending { min-height: 220px; display: grid; place-content: center; text-align: center;
               background: radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--pink) 18%, transparent), transparent 60%),
                           radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 55%), var(--card); }

/* faq + lists */
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: var(--card); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--muted); margin: 8px 0 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--pink); color: var(--text); }
.tile span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.latest { list-style: none; padding: 0; }
.latest li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.latest time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 8px; }
.related ul { padding-left: 18px; }
.toc { font-size: 14px; border-left: 2px solid var(--line); padding-left: 14px; }
.toc ol { padding-left: 16px; margin: 8px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 15px; background: var(--bg2); }
.foot .links { display: flex; gap: 14px; flex-wrap: wrap; }
.small { font-size: 13px; }
