:root{
  --bg1:#020617;
  --bg2:#0b1224;
  --card:rgba(255,255,255,.06);
  --line:rgba(255,255,255,.10);
  --muted:rgba(255,255,255,.70);
  --muted2:rgba(255,255,255,.55);
  --text:#e5e7eb;
  --accent:#34d399;
  --warn:#fbbf24;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x:hidden;
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(52,211,153,.12), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(900px 500px at 50% 90%, rgba(236,72,153,.08), transparent 60%);
  pointer-events:none;
}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; gap:16px; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background: rgba(2,6,23,.70);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:700;
}
.dot{
  width:10px; height:10px; border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 0 6px rgba(52,211,153,.12);
}

.nav{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.tab{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-size: 13px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.tab:hover{ transform: translateY(-1px); background: rgba(255,255,255,.07); }
.tab.active{ border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.10); }

.wrap{ max-width:1100px; margin:0 auto; padding:24px 16px 60px; }

.hero{ padding:10px 0 14px; }
.pill{
  display:inline-flex; align-items:center;
  gap:8px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--muted);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}
.hero h1{ margin:14px 0 8px; font-size:36px; letter-spacing:-.02em; }
.hero p{ margin:0; color:var(--muted); max-width:720px; line-height:1.6; }

.panel{ display:none; animation: fadeUp .26s ease both; }
.panel.show{ display:block; }

@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top:14px;
}

.card-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
  flex-wrap:wrap;
  margin-bottom: 12px;
}
.card h2{ margin:0; font-size:18px; }
.muted{ color:var(--muted2); margin:6px 0 0; font-size:13px; line-height:1.5; }

.badge{
  font-size:12px;
  color: rgba(255,255,255,.80);
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  padding:6px 10px;
  border-radius:999px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
  .hero h1{ font-size:30px; }
}

.field label{
  display:block;
  font-size:12px;
  color: rgba(255,255,255,.80);
  margin: 0 0 6px;
  font-weight:600;
}
.field input, .field select{
  width:100%;
  border:1px solid var(--line);
  background: rgba(2,6,23,.35);
  color:var(--text);
  padding: 11px 12px;
  border-radius: 14px;
  outline:none;
  transition: border-color .15s ease, transform .15s ease;
}
.field input:focus, .field select:focus{ border-color: rgba(255,255,255,.22); }
.help{ margin-top:6px; font-size:12px; color: var(--muted2); }
.help.warn{ color: rgba(251,191,36,.95); }

.output{
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(2,6,23,.35);
  padding: 12px;
}
.output-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom: 10px;
}
.output-title{ font-size:13px; font-weight:700; color: rgba(255,255,255,.9); }
.actions{ display:flex; gap:8px; }

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.08);
  color:var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-size: 13px;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.12); }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
.btn.ghost{ background: rgba(255,255,255,.05); }

.code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  border-radius: 14px;
  padding: 12px;
  overflow:auto;
  word-break: break-word;
  white-space: pre-wrap;
}
.code.small{ font-size: 12px; }

.examples{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top: 10px;
}
@media (max-width: 860px){
  .examples{ grid-template-columns: 1fr; }
}

.ex{
  border:1px solid var(--line);
  background: rgba(0,0,0,.20);
  border-radius: 16px;
  padding: 12px;
  cursor:pointer;
  transition: transform .15s ease, background .15s ease;
}
.ex:hover{ transform: translateY(-1px); background: rgba(0,0,0,.28); }
.ex h4{ margin:0 0 8px; font-size: 13px; }
.ex .kv{ font-size:12px; color: var(--muted); line-height:1.55; }

.note{
  margin-top:12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height:1.6;
}
.note.warn{ border-color: rgba(251,191,36,.25); }

.related{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top: 12px;
}
@media (max-width: 860px){
  .related{ grid-template-columns: 1fr; }
}
.rel-card{
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 12px;
}
.rel-card h3{ margin:0; font-size:14px; }
.rel-card p{ margin:8px 0 0; }

.two{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
  margin-top: 12px;
}
@media (max-width: 860px){
  .two{ grid-template-columns: 1fr; }
}
.box{
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius: 16px;
  padding: 12px;
}
.box-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom: 10px;
}
.box-title{ font-size:13px; font-weight:700; color: rgba(255,255,255,.9); }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(2,6,23,.85);
  border: 1px solid var(--line);
  color: rgba(255,255,255,.92);
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}
