:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent2: #3fb950;
  --danger: #f85149;
  --warn: #d29922;
  --radius: 10px;
  --font: 'Segoe UI', Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); }
code, pre { font-family: Consolas, monospace; font-size: 0.9em; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card.inner { background: var(--bg3); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
h1,h2,h3 { margin: 0 0 0.75rem; }
label { display: block; margin: 0.6rem 0 0.25rem; font-size: 0.85rem; color: var(--muted); }
input, select, textarea { width: 100%; padding: 0.55rem 0.7rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn { border: 1px solid var(--border); background: var(--bg3); color: var(--text); padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.btn:hover { filter: brightness(1.1); }
.btn-primary { background: #238636; border-color: #2ea043; color: #fff; }
.btn-secondary { background: var(--bg3); }
.btn-danger { background: #da3633; border-color: var(--danger); color: #fff; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; margin-top: 1rem; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.hidden { display: none !important; }
.alert { padding: 0.75rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.err { background: #3d1214; border: 1px solid var(--danger); }
.alert.ok { background: #12261a; border: 1px solid var(--accent2); }
.badge { background: var(--bg3); border: 1px solid var(--border); padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.75rem; color: var(--muted); }
.tag { background: #1f3d5c; color: var(--accent); padding: 0.15rem 0.45rem; border-radius: 6px; font-size: 0.8rem; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg2); border-left: 1px solid var(--border); padding: 1rem; display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 1.1rem; margin-bottom: 1.5rem; }
.nav-item { display: block; width: 100%; text-align: right; background: none; border: none; color: var(--muted); padding: 0.65rem 0.75rem; border-radius: 8px; cursor: pointer; margin-bottom: 0.25rem; text-decoration: none; }
.nav-item:hover, .nav-item.active { background: var(--bg3); color: var(--text); }
.nav-item.logout { margin-top: auto; color: var(--danger); }
.content { padding: 1.25rem 1.5rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.tab { display: none; }
.tab.active { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } .sidebar { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; } }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 0.55rem; text-align: right; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; }
.result-meta { background: var(--bg3); padding: 0.75rem; border-radius: 8px; margin-bottom: 0.75rem; font-size: 0.85rem; }
.meta-box { margin-top: 0.75rem; padding: 0.75rem; background: var(--bg3); border-radius: 8px; font-size: 0.85rem; }
.panel-item { margin-bottom: 0.75rem; }
.panel-item .block { display: block; margin: 0.35rem 0; word-break: break-all; }
.test-result { font-size: 0.8rem; background: var(--bg); padding: 0.5rem; border-radius: 6px; margin-top: 0.5rem; max-height: 120px; overflow: auto; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); color: var(--text); padding: 1.25rem; max-width: 520px; width: 92vw; }
dialog::backdrop { background: rgba(0,0,0,.65); }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { max-width: 420px; width: 100%; }
#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--border); padding: 0.65rem 1rem; border-radius: 8px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 99; }
#toast.show { opacity: 1; }
.history-item { border-bottom: 1px solid var(--border); padding: 0.75rem 0; }
.history-item .sub-url { display:block; word-break:break-all; margin: 6px 0; color: var(--accent); }
