:root{
  --bg:#0b0e14; --surface:#131822; --surface2:#171d2a; --ink:#e8ecf4; --muted:#8b94a7;
  --accent:#7c8cff; --accent-soft:rgba(124,140,255,.14);
  --line:rgba(255,255,255,.08); --max:1080px;
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  background:var(--bg); color:var(--ink);
  font:400 15.5px/1.7 -apple-system,"Segoe UI",Roboto,"Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit}
.wrap{max-width:var(--max); margin:0 auto; padding:0 24px}

/* ===== header ===== */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(11,14,20,.82); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.nav{display:flex; align-items:center; justify-content:space-between; min-height:60px; gap:16px; flex-wrap:wrap; padding:8px 0}
.logo{display:flex; align-items:center; gap:10px; font-weight:700; font-size:17px; text-decoration:none; letter-spacing:.2px; white-space:nowrap}
.logo svg{width:26px; height:26px}
.nav-links{display:flex; gap:24px; font-size:13.5px; color:var(--muted); flex-wrap:wrap}
.nav-links a{text-decoration:none; transition:color .15s; padding:4px 0; border-bottom:1.5px solid transparent}
.nav-links a:hover{color:var(--ink)}
.nav-links a.active{color:var(--ink); border-bottom-color:var(--accent)}

/* ===== hero ===== */
.hero{position:relative; padding:84px 0 56px; overflow:hidden}
.hero.page{padding:64px 0 40px}
.hero-glow{
  position:absolute; inset:-40% 20% auto -10%; height:420px; pointer-events:none;
  background:radial-gradient(ellipse at 30% 40%, rgba(124,140,255,.18), transparent 65%);
  filter:blur(8px);
}
.kicker{
  display:inline-flex; align-items:center; gap:8px;
  font:500 11px/1 ui-monospace,"SF Mono",Consolas,monospace;
  letter-spacing:.18em; color:var(--accent); text-transform:uppercase;
  margin-bottom:22px;
}
.kicker::before{content:""; width:28px; height:1px; background:var(--accent)}
h1{font-size:clamp(32px,4.8vw,48px); line-height:1.14; font-weight:700; letter-spacing:-.015em; max-width:820px}
.lead{margin-top:20px; max-width:660px; font-size:16.5px; color:var(--muted); line-height:1.75}
.hero-meta{margin-top:30px; display:flex; gap:28px; flex-wrap:wrap; font-size:12.5px; color:var(--muted)}
.hero-meta b{color:var(--ink); font-weight:600}

/* ===== sections & prose ===== */
section{padding:64px 0}
.sec-head{display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin-bottom:34px; flex-wrap:wrap}
h2{font-size:clamp(21px,2.8vw,26px); font-weight:650; letter-spacing:-.01em}
.sec-note{font-size:13px; color:var(--muted)}
.prose{max-width:760px}
.prose h3{font-size:18px; font-weight:650; margin:34px 0 12px}
.prose p{color:var(--muted); margin-bottom:14px}
.prose strong{color:var(--ink); font-weight:600}
.prose ul{margin:0 0 16px 20px; color:var(--muted)}
.prose li{margin-bottom:8px}

/* ===== video grid ===== */
.grid{display:grid; grid-template-columns:repeat(2,1fr); gap:28px}
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  overflow:hidden; display:flex; flex-direction:column;
  transition:transform .25s ease, border-color .25s ease;
}
.card:hover{transform:translateY(-4px); border-color:rgba(124,140,255,.35)}
.thumb{position:relative; aspect-ratio:16/9; background:#0d1119}
.thumb iframe{position:absolute; inset:0; width:100%; height:100%; border:0}
.card-body{padding:20px 22px 24px; display:flex; flex-direction:column; gap:10px; flex:1}
.tag{
  font:500 10.5px/1 ui-monospace,"SF Mono",Consolas,monospace;
  letter-spacing:.16em; color:var(--accent); text-transform:uppercase;
}
.card h3{font-size:16.5px; font-weight:650; line-height:1.4; letter-spacing:-.005em}
.card p{font-size:13.5px; color:var(--muted); line-height:1.65; flex:1}
.src{
  display:inline-flex; align-items:center; gap:6px; margin-top:6px;
  font-size:12.5px; color:var(--accent); text-decoration:none; font-weight:500;
}
.src:hover{text-decoration:underline}
.src .arrow{transition:transform .15s}
.src:hover .arrow{transform:translateX(3px)}

/* ===== tables ===== */
.table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--surface)}
table{border-collapse:collapse; width:100%; min-width:760px; font-size:13.5px}
th, td{padding:12px 16px; text-align:left; border-bottom:1px solid var(--line); vertical-align:top}
th{
  font:600 11px/1.4 ui-monospace,"SF Mono",Consolas,monospace;
  letter-spacing:.12em; text-transform:uppercase; color:var(--accent);
  background:var(--surface2); white-space:nowrap;
}
tr:last-child td{border-bottom:0}
td:first-child{font-weight:600; color:var(--ink); white-space:nowrap}
td{color:var(--muted)}
tbody tr:hover td{background:rgba(124,140,255,.05)}
.table-note{margin-top:12px; font-size:12px; color:var(--muted)}

/* ===== diagrams ===== */
.diagram{
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  padding:28px 24px; margin:28px 0;
}
.diagram h4{
  font:500 11px/1 ui-monospace,"SF Mono",Consolas,monospace;
  letter-spacing:.16em; text-transform:uppercase; color:var(--accent); margin-bottom:18px;
}
.diagram svg{width:100%; height:auto; display:block}
.diagram .cap{margin-top:14px; font-size:12.5px; color:var(--muted)}

/* ===== info note ===== */
.note{
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  padding:22px 24px; font-size:13.5px; color:var(--muted);
}
.note b{color:var(--ink)}
.about{display:grid; grid-template-columns:1.2fr 1fr; gap:48px; align-items:start}

/* ===== sources ===== */
.src-list{display:grid; grid-template-columns:repeat(2,1fr); gap:12px 28px; list-style:none}
.src-list a{
  display:flex; justify-content:space-between; gap:12px; padding:13px 2px;
  border-bottom:1px solid var(--line); text-decoration:none; font-size:14px;
  transition:color .15s;
}
.src-list a:hover{color:var(--accent)}
.src-list .host{color:var(--muted); font-size:12px; font-family:ui-monospace,Consolas,monospace; white-space:nowrap}

/* ===== pager ===== */
.pager{display:flex; justify-content:space-between; gap:16px; margin:8px 0 24px; flex-wrap:wrap}
.pager a{
  flex:1; min-width:220px; text-decoration:none; background:var(--surface);
  border:1px solid var(--line); border-radius:12px; padding:18px 20px;
  transition:border-color .2s, transform .2s;
}
.pager a:hover{border-color:rgba(124,140,255,.35); transform:translateY(-2px)}
.pager .dir{font:500 10.5px/1 ui-monospace,Consolas,monospace; letter-spacing:.16em; text-transform:uppercase; color:var(--accent)}
.pager .t{margin-top:8px; font-size:15px; font-weight:600}
.pager a.next{text-align:right}

/* ===== footer ===== */
footer{border-top:1px solid var(--line); padding:36px 0 48px; color:var(--muted); font-size:12.5px}
.foot{display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; align-items:center}

/* ===== responsive ===== */
@media (max-width:820px){
  .grid{grid-template-columns:1fr}
  .about{grid-template-columns:1fr}
  .src-list{grid-template-columns:1fr}
  .hero{padding:56px 0 40px}
  .hero.page{padding:44px 0 28px}
  section{padding:46px 0}
  .nav-links{gap:16px}
  .pager a{min-width:100%}
}
