/* ============================================================
   ZZ99 Web Index · 门户前端样式
   设计目标：移动优先、轻量、可离线（不依赖任何外部 CDN）
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* 关键：作者样式里的 display 会覆盖 [hidden] 的 UA 规则 */
[hidden] { display: none !important; }

:root {
  --accent: #4f7cff;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(79, 124, 255, .1);
  --ok: #16a34a;
  --warn: #f59e0b;
  --err: #ef4444;

  --bg: #f3f5f9;
  --bg-2: #e9edf5;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --text: #141821;
  --text-2: #4a5364;
  --muted: #8a93a4;
  --line: rgba(20, 24, 33, .08);
  --line-2: rgba(20, 24, 33, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .07), 0 12px 28px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 50px rgba(16, 24, 40, .16);
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 62px;
}

html[data-theme="dark"] {
  --accent: #6d95ff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(109, 149, 255, .16);
  --bg: #0d1016;
  --bg-2: #12161f;
  --panel: #171c26;
  --panel-2: #1b212c;
  --text: #e8ecf3;
  --text-2: #aeb8c8;
  --muted: #7d8798;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
}

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 8% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(900px 460px at 96% -18%, rgba(139, 92, 246, .09), transparent 60%);
}

a { color: inherit; text-decoration: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  background: var(--line-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: .88em;
}
button { font-family: inherit; }

.page {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ───────────────────────── 顶栏 ───────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 2px;
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.topbar::after {
  content: "";
  position: absolute;
  left: -16px; right: -16px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.logo {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px rgba(79, 124, 255, .35);
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.brand-text p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.searchbox {
  position: relative;
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px 0 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s;
}
.searchbox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchbox .ico {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round;
}
.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--panel-2);
}

.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ───────────────────────── 按钮 ───────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, background .16s, border-color .16s, box-shadow .16s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: rgba(79, 124, 255, .4); background: var(--panel-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 124, 255, .3);
}
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn.primary .play { font-size: 10px; transform: translateY(-.5px); }

.btn.icon {
  width: 36px;
  padding: 0;
  font-size: 14px;
  color: var(--text-2);
}
.btn.ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

/* ───────────────────────── 状态条 ───────────────────────── */

.statbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 2px 4px;
  color: var(--text-2);
  font-size: 12.5px;
}
.stat { display: flex; align-items: baseline; gap: 5px; }
.stat b { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat b.ok { color: var(--ok); }
.stat span { color: var(--muted); }
.statbar-spacer { flex: 1; }

/* ───────────────────────── 分组 & 网格 ───────────────────────── */

#main { min-height: 40vh; }

.group { margin-top: 22px; }
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0 2px;
}
.group-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--text-2);
  text-transform: uppercase;
}
.group-head .count {
  font-size: 11px;
  color: var(--muted);
  background: var(--line-2);
  border-radius: 20px;
  padding: 1px 7px;
}
.group-head .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 11px;
}

/* ───────────────────────── 站点卡片 ───────────────────────── */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 13px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .16s cubic-bezier(.2,.8,.3,1), box-shadow .18s, border-color .18s;
  overflow: hidden;
  min-height: 116px;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 124, 255, .35);
}
.card:hover::after { opacity: 1; }

.card.pinned { border-color: rgba(79, 124, 255, .28); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }

.card-ic {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 19px;
  flex-shrink: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.card-ic img { width: 100%; height: 100%; object-fit: cover; }
.card-ic.gen {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  letter-spacing: -.5px;
}

.card-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: -4px;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  min-height: 18px;
}
.tag {
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--line-2);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 88px;
  text-overflow: ellipsis;
}
.tag.kind {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.tag.kind.link { background: rgba(139, 92, 246, .12); color: var(--accent-2); }

/* 状态点 */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 0 0 3px transparent;
}
.dot.online { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.dot.static { background: #94a3b8; }
.dot.external { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.dot.stopped { background: #cbd5e1; }
.dot.starting { background: var(--warn); animation: pulse 1.1s infinite; }
.dot.error { background: var(--err); box-shadow: 0 0 0 3px rgba(239, 68, 68, .14); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* 卡片上的更多按钮 */
.card-more {
  position: absolute;
  top: 9px; right: 9px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s, background .16s, color .16s;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.card:hover .card-more { opacity: 1; }
.card-more:hover { color: var(--text); background: var(--panel-2); }
@media (hover: none) {
  .card-more { opacity: 1; }
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.empty-ic { font-size: 34px; margin-bottom: 10px; opacity: .6; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--text-2); }
.empty p { margin: 0 0 16px; font-size: 13px; }

/* 页脚 */
.foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.foot a:hover { color: var(--accent); }
.foot .sep { opacity: .5; }

/* ───────────────────────── 内嵌运行器 ───────────────────────── */

.runner {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: dropIn .22s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.runner-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 8px 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.runner-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.runner-actions { display: flex; gap: 6px; }
.runner-actions .btn {
  font-size: 15px;
  color: var(--text);
  line-height: 1;
}
.runner-actions .btn:hover { color: var(--accent); }
.runner iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  display: block;
}
html[data-theme="dark"] .runner iframe { background: #0d1016; }

/* ───────────────────────── 设置抽屉 ───────────────────────── */

.mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 14, 22, .42);
  backdrop-filter: blur(2px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 50;
  width: min(440px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideIn {
  from { transform: translateX(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  flex-shrink: 0;
}
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 700; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  padding: 9px 12px 11px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .16s, border-color .16s;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 40px; }
.pane { display: none; }
.pane.active { display: block; animation: fade .18s; }
.pane-title { margin: 0 0 12px; font-size: 15px; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 8px 0 0; }
.hint code { font-size: 11px; }
.hint a, .tip-card a { color: var(--accent); text-decoration: none; }
.hint a:hover, .tip-card a:hover { text-decoration: underline; }

.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 11.5px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* 管理列表 */
.manage-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}
.mrow-ic {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
}
.mrow-ic img { width: 100%; height: 100%; object-fit: cover; }
.mrow-main { flex: 1; min-width: 0; }
.mrow-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mrow-sub {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mrow-acts { display: flex; gap: 3px; flex-shrink: 0; }
.mbtn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.mbtn:hover { background: var(--accent-soft); color: var(--accent); border-color: rgba(79,124,255,.3); }
.mbtn.danger:hover { background: rgba(239,68,68,.1); color: var(--err); border-color: rgba(239,68,68,.3); }
.mbtn:disabled { opacity: .35; cursor: default; }

.badge-pin {
  font-size: 9.5px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 4px;
  vertical-align: 1px;
}

/* 表单 */
.form { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field > span i { color: var(--err); font-style: normal; }
.field input, .field select {
  height: 37px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  width: 100%;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--panel);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  user-select: none;
}
.switch input { display: none; }
.switch .track {
  width: 36px; height: 21px;
  border-radius: 20px;
  background: var(--line);
  position: relative;
  transition: background .18s;
  flex-shrink: 0;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(15px); }

.form-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 2px; }

/* 文件夹上传 */
.pub-box {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--panel-2);
}
.pub-row { display: flex; align-items: center; gap: 10px; }
.pub-count { font-size: 12px; color: var(--muted); }
.pub-count.has { color: var(--accent); }
.pub-input {
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.pub-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bar-progress {
  height: 5px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.bar-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .2s;
}

.tip-card {
  padding: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 124, 255, .18);
}.tip-card h4 { margin: 0 0 6px; font-size: 13px; }
.tip-card p { margin: 0 0 8px; font-size: 12px; color: var(--text-2); line-height: 1.65; }
.tip-card p:last-child { margin-bottom: 0; }

.code {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #141a24;
  color: #d6e2f5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.step {
  display: flex;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.step:last-of-type { border-bottom: 0; }
.step .num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
  margin-top: 1px;
}
.step h4 { margin: 0 0 5px; font-size: 13px; }
.step p { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.65; }

/* ───────────────────────── 弹出菜单 ───────────────────────── */

.menu {
  position: fixed;
  z-index: 70;
  min-width: 168px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  animation: fade .12s;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.menu button:hover { background: var(--accent-soft); color: var(--accent); }
.menu button.danger { color: var(--err); }
.menu button.danger:hover { background: rgba(239, 68, 68, .1); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu .mi { width: 15px; text-align: center; opacity: .8; }

/* ───────────────────────── 日志弹层 ───────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 14, 22, .5);
  animation: fade .16s;
}
.modal-box {
  width: min(680px, 100%);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 15px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 14px; }
.log {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  background: #0f141c;
  color: #c8d6ea;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  flex: 1;
}

/* ───────────────────────── Toast ───────────────────────── */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 9px 16px;
  border-radius: 10px;
  background: #151b26;
  color: #f2f5fa;
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .2s cubic-bezier(.2,.8,.3,1);
  max-width: 100%;
}
html[data-theme="dark"] .toast { background: #232c3a; }
.toast.ok::before { content: "✓"; color: #4ade80; }
.toast.err::before { content: "!"; color: #fb7185; font-weight: 700; }
.toast.warn::before { content: "·"; color: #fbbf24; font-weight: 700; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.toast.out { animation: toastOut .18s forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(.97); }
}

/* ───────────────────────── 响应式 ───────────────────────── */

@media (max-width: 860px) {
  .searchbox { max-width: none; }
  .searchbox kbd { display: none; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 56px; }
  .page { padding: 0 12px 34px; }
  .topbar {
    height: auto;
    padding: 10px 0 9px;
    flex-wrap: wrap;
    gap: 9px;
    row-gap: 9px;
  }
  .topbar::after { left: -12px; right: -12px; }
  .brand { order: 1; flex: 1; }
  .brand-text h1 { font-size: 15px; max-width: 150px; }
  .brand-text p { max-width: 150px; font-size: 11px; }
  .logo { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .top-actions { order: 2; }
  .top-actions .btn.primary .label { display: none; }
  .top-actions .btn.primary { width: 36px; padding: 0; }
  .searchbox { order: 3; width: 100%; flex-basis: 100%; height: 36px; }
  .statbar { gap: 12px; padding-top: 8px; flex-wrap: wrap; }
  .stat b { font-size: 14px; }
  .stat span { font-size: 11.5px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
  .card { padding: 12px; min-height: 108px; border-radius: 14px; }
  .group { margin-top: 18px; }
  .drawer { width: 100vw; }
  .row2 { grid-template-columns: 1fr; }
  .foot { font-size: 11.5px; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-name { font-size: 12.5px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
