:root{
  --bg0:#070A14;
  --bg1:#0B1020;
  --card:#0E1630;
  --card2:#0C1328;
  --text:#EAF0FF;
  --muted:#A8B2D6;
  --line:rgba(255,255,255,.08);
  --brand:#2F7CF6;
  --accent:#22C55E;
  --danger:#EF4444;
  --ok:#22C55E;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 18px;
  --radius2: 14px;
  --wrap: 1100px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

[data-theme="light"]{
  --bg0:#F5F7FF;
  --bg1:#FFFFFF;
  --card:#FFFFFF;
  --card2:#F1F4FF;
  --text:#0B1020;
  --muted:#4A5568;
  --line:rgba(12,18,32,.10);
  --shadow: 0 22px 60px rgba(12,18,32,.10);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background: radial-gradient(1200px 800px at 15% -10%, rgba(47,124,246,.22), transparent 55%),
              radial-gradient(900px 700px at 90% 0%, rgba(34,197,94,.18), transparent 55%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  color:var(--text);
  line-height:1.55;
}
a{color:inherit; text-decoration:none}
a:hover{opacity:.92}
img{max-width:100%; height:auto}
.wrap{width:min(var(--wrap), calc(100% - 40px)); margin:0 auto}
.skip{
  position:absolute; left:-999px; top:auto;
  width:1px; height:1px; overflow:hidden
}
.skip:focus{left:18px; top:18px; width:auto; height:auto; padding:10px 12px; background:var(--card); border:1px solid var(--line); border-radius:12px; z-index:99}

.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg1) 72%, transparent);
  border-bottom:1px solid var(--line);
}
.topbar__inner{display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0}
.brand{display:flex; align-items:center; gap:10px}
.brand span{font-weight:800; letter-spacing:.2px}
.brand em{font-style:normal; color:var(--muted); font-size:12px; display:none}
@media (min-width:840px){ .brand em{display:inline} }

.nav{display:flex; gap:16px; align-items:center}
.nav a{color:var(--muted); font-weight:600; font-size:14px; padding:10px 10px; border-radius:12px}
.nav a:hover{background:rgba(255,255,255,.06); color:var(--text)}
.iconbtn{
  width:44px; height:44px; border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  display:grid; place-items:center;
  cursor:pointer
}
.iconbtn:hover{transform:translateY(-1px)}
.icon{
  width:18px; height:18px; display:block;
  background: linear-gradient(180deg, var(--text), var(--muted));
  -webkit-mask: url('/assets/img/moon.svg') center/contain no-repeat;
          mask: url('/assets/img/moon.svg') center/contain no-repeat;
}
[data-theme="light"] .icon{
  -webkit-mask: url('/assets/img/sun.svg') center/contain no-repeat;
          mask: url('/assets/img/sun.svg') center/contain no-repeat;
}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:12px 16px;
  border-radius:14px;
  background:linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--accent)));
  border:1px solid rgba(255,255,255,.10);
  font-weight:800;
  color:white;
  box-shadow: 0 14px 40px rgba(47,124,246,.25);
}
.btn:hover{transform:translateY(-1px)}
.btn--ghost{
  background:rgba(255,255,255,.06);
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:none;
}
.btn--wide{width:100%}

.hero{padding:36px 0 10px}
.hero__grid{display:grid; gap:24px; align-items:center}
@media (min-width:940px){ .hero__grid{grid-template-columns: 1.05fr .95fr; padding:14px 0} }

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  color:var(--muted);
  font-size:12px; font-weight:700
}
.badge::before{
  content:''; width:9px; height:9px; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, white, color-mix(in srgb, var(--accent) 70%, black));
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}
.hero h1{font-size: clamp(30px, 3.6vw, 52px); line-height:1.05; margin:14px 0 10px; letter-spacing:-.6px}
.lead{color:var(--muted); font-size:16px; max-width:54ch}
.hero__actions{display:flex; gap:12px; flex-wrap:wrap; margin-top:16px}

.hero__stats{display:flex; gap:12px; margin-top:18px; flex-wrap:wrap}
.stat{
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px 14px; min-width:140px
}
.stat strong{display:block; font-size:18px}
.stat span{display:block; color:var(--muted); font-weight:700; font-size:12px}

.section{padding:28px 0}
.section--tight{padding:22px 0 36px}
.section__head{display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:14px}
.section__head h2{margin:0; letter-spacing:-.3px}
.muted{color:var(--muted)}
.panel{
  display:grid; gap:18px; align-items:center;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  padding:22px;
}
@media(min-width:880px){ .panel{grid-template-columns: 1.05fr .95fr} }
.panel__copy p{max-width:65ch}

.cards{
  display:grid; gap:14px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media(min-width:700px){ .cards{grid-template-columns: repeat(2, minmax(0, 1fr));}}
@media(min-width:1000px){ .cards{grid-template-columns: repeat(3, minmax(0, 1fr));}}

.card{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 16px 50px rgba(0,0,0,.25);
  overflow:hidden;
}
.card__link{display:block; padding:18px}
.card__top{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.pill{
  display:inline-flex; align-items:center;
  padding:6px 10px; border-radius:999px;
  background:rgba(47,124,246,.12);
  border:1px solid rgba(47,124,246,.28);
  color:color-mix(in srgb, var(--brand) 60%, var(--text));
  font-weight:800; font-size:12px
}
.meta{color:var(--muted); font-size:12px; font-weight:700}
.card h3{margin:0 0 8px; letter-spacing:-.25px}
.card p{margin:0 0 12px; color:var(--muted)}
.card__cta{display:inline-flex; gap:6px; align-items:center; font-weight:800; color:var(--text)}
.card:hover{transform:translateY(-2px); transition: .18s ease; border-color:rgba(255,255,255,.14)}

.pagehead h1{margin:0; font-size: clamp(28px, 3vw, 42px); letter-spacing:-.5px}
.pagehead p{margin:10px 0 0}

.toolbar{
  margin-top:18px;
  display:grid; gap:12px;
}
@media(min-width:840px){ .toolbar{grid-template-columns: 1fr auto; align-items:center} }
.search{position:relative}
.search input{
  width:100%;
  padding:14px 14px 14px 44px;
  border-radius: 16px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--line);
  color:var(--text);
  outline:none;
  font-weight:700;
}
.search input:focus{border-color:rgba(47,124,246,.45); box-shadow:0 0 0 4px rgba(47,124,246,.12)}
.search__icon{
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  width:18px; height:18px;
  background: linear-gradient(180deg, var(--muted), var(--text));
  -webkit-mask: url('/assets/img/search.svg') center/contain no-repeat;
          mask: url('/assets/img/search.svg') center/contain no-repeat;
  opacity:.9
}
.filters{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}
.chip{
  padding:10px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--line);
  color:var(--muted);
  font-weight:800;
  cursor:pointer;
}
.chip:hover{border-color:rgba(255,255,255,.15); color:var(--text)}
.chip.is-on{
  background:rgba(34,197,94,.10);
  border-color:rgba(34,197,94,.26);
  color:color-mix(in srgb, var(--accent) 70%, var(--text));
}

.crumbs{display:flex; gap:10px; align-items:center; color:var(--muted); font-weight:800; font-size:12px; margin-bottom:10px}
.crumbs a{color:var(--muted)}
.article{padding-top:6px}
.article__head .meta{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px}
.article__head h1{margin:0 0 8px; letter-spacing:-.6px; line-height:1.12}
.article__grid{display:grid; gap:18px; margin-top:18px}
@media(min-width:980px){ .article__grid{grid-template-columns: 1fr 320px} }
.article__body{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  padding:18px;
}
.article__side{display:grid; gap:12px; align-content:start}
.sidecard{
  border-radius: var(--radius);
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  padding:16px;
}
.sidecard__title{font-weight:900; margin-bottom:10px}
.sidecard__list{display:grid; gap:10px}
.sidecard__list a{color:var(--muted); font-weight:800}
.sidecard__list a:hover{color:var(--text)}

.prose h2{margin-top:18px; letter-spacing:-.3px}
.prose h3{margin-top:14px}
.prose p{color:var(--text)}
.prose ul, .prose ol{color:var(--muted)}
.prose a{color:color-mix(in srgb, var(--brand) 80%, var(--text)); text-decoration:underline; text-underline-offset:3px}
.prose hr{border:0; height:1px; background:var(--line); margin:18px 0}
.callout{
  border-radius: var(--radius2);
  border:1px solid rgba(47,124,246,.25);
  background:linear-gradient(180deg, rgba(47,124,246,.10), rgba(255,255,255,.02));
  padding:14px 14px;
}
.callout p{margin:8px 0 0; color:var(--muted)}
.grid2{display:grid; gap:10px}
@media(min-width:720px){ .grid2{grid-template-columns: 1fr 1fr} }
.mini{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  border-radius: var(--radius2);
  padding:12px;
}
.mini h3{margin:0 0 6px}
.mini p{margin:0; color:var(--muted)}

.codeblock{
  position:relative;
  margin:12px 0;
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius: var(--radius2);
  overflow:hidden;
}
.codeblock pre{
  margin:0;
  padding:16px;
  font-family:var(--mono);
  font-size:13px;
  white-space:pre-wrap;
  color:color-mix(in srgb, var(--text) 85%, var(--muted));
}
.copy{
  position:absolute; right:10px; top:10px;
  border-radius: 12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-weight:900;
  padding:8px 10px;
  cursor:pointer;
}
.copy:hover{transform:translateY(-1px)}

.checklist{list-style:none; padding-left:0}
.checklist li{position:relative; padding-left:28px; margin:10px 0; color:var(--muted); font-weight:700}
.checklist li::before{
  content:''; position:absolute; left:0; top:6px;
  width:18px; height:18px; border-radius:8px;
  background: radial-gradient(circle at 30% 30%, white, color-mix(in srgb, var(--accent) 70%, black));
  opacity:.95;
}

.chips{display:flex; flex-wrap:wrap; gap:10px; padding-left:0; list-style:none}
.chips li{
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  border-radius: 999px;
  padding:10px 12px;
  color:var(--muted);
  font-weight:800;
  font-size:13px;
}

.form{
  margin-top:18px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  padding:18px;
  box-shadow: var(--shadow);
}
.field{display:grid; gap:8px; margin-bottom:14px}
.field label{font-weight:900}
.field input, .field textarea, .field select{
  border-radius: 14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:12px 12px;
  outline:none;
  font-weight:700;
}
.field input:focus, .field textarea:focus, .field select:focus{border-color:rgba(47,124,246,.45); box-shadow:0 0 0 4px rgba(47,124,246,.12)}
.hint{margin:0; color:var(--muted); font-size:12px; font-weight:700}
.hp{position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden}
.mt{margin-top:18px}

.notice{
  border-radius: var(--radius2);
  border:1px solid var(--line);
  padding:14px;
  margin-top:18px;
}
.notice--ok{border-color:rgba(34,197,94,.22); background:rgba(34,197,94,.07)}
.notice--bad{border-color:rgba(239,68,68,.22); background:rgba(239,68,68,.07)}
.notice ul{margin:8px 0 0; color:var(--muted)}

.footer{margin-top:26px; border-top:1px solid var(--line); background:rgba(255,255,255,.02)}
.footer__grid{display:grid; gap:18px; padding:26px 0}
@media(min-width:900px){ .footer__grid{grid-template-columns: 1.4fr 1fr 1fr 1fr} }
.footer__brand{display:flex; align-items:center; gap:10px; margin-bottom:10px}
.footer__grid h4{margin:0 0 10px}
.footer__grid a{display:block; color:var(--muted); font-weight:800; margin:8px 0}
.footer__grid a:hover{color:var(--text)}
.footer__bottom{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 0 26px; flex-wrap:wrap}

.toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  background:rgba(0,0,0,.70);
  color:white;
  border:1px solid rgba(255,255,255,.12);
  padding:10px 12px;
  border-radius: 14px;
  font-weight:900;
  opacity:0; pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-on{opacity:1; transform:translateX(-50%) translateY(-2px)}
