/* ============================================================
   SSL 证书批量检测平台 — 主题与布局样式
   亮色 / 暗色主题基于 [data-theme] CSS 变量切换
   ============================================================ */

:root {
  --font-sans: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-sm: 9px;

  --ok: #16a34a;
  --ok-strong: #15803d;
  --warn: #d97706;
  --crit: #ea580c;
  --danger: #dc2626;
  --info: #0284c7;
}

/* ---------- 亮色主题（默认） ---------- */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f7;
  --bg-tint: rgba(99, 102, 241, 0.07);
  --card: #ffffff;
  --card-2: #f6f8fc;
  --border: #e3e8f0;
  --border-strong: #cbd5e1;
  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.09);
  --accent-border: rgba(79, 70, 229, 0.35);
  --ok-soft: rgba(22, 163, 74, 0.1);
  --warn-soft: rgba(217, 119, 6, 0.12);
  --crit-soft: rgba(234, 88, 12, 0.12);
  --danger-soft: rgba(220, 38, 38, 0.1);
  --info-soft: rgba(2, 132, 199, 0.1);
  --neutral-soft: rgba(100, 116, 139, 0.12);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -14px rgba(16, 24, 40, 0.14);
  --shadow-pop: 0 12px 40px -12px rgba(16, 24, 40, 0.28);
  --scrollbar: #c4ccd9;
  --topbar-bg: rgba(255, 255, 255, 0.82);
}

/* ---------- 暗色主题 ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c111f;
  --bg-tint: rgba(99, 102, 241, 0.1);
  --card: #151c2e;
  --card-2: #1a2338;
  --border: #26314a;
  --border-strong: #38455f;
  --text: #e6eaf2;
  --text-2: #a5b0c3;
  --text-3: #6e7a92;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-contrast: #0c111f;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-border: rgba(129, 140, 248, 0.45);
  --ok: #4ade80;
  --ok-strong: #86efac;
  --warn: #fbbf24;
  --crit: #fb923c;
  --danger: #f87171;
  --info: #38bdf8;
  --ok-soft: rgba(74, 222, 128, 0.13);
  --warn-soft: rgba(251, 191, 36, 0.13);
  --crit-soft: rgba(251, 146, 60, 0.14);
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info-soft: rgba(56, 189, 248, 0.12);
  --neutral-soft: rgba(148, 163, 184, 0.14);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 14px 48px -12px rgba(0, 0, 0, 0.6);
  --scrollbar: #33405c;
  --topbar-bg: rgba(12, 17, 31, 0.85);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 85% -10%, var(--bg-tint), transparent 60%),
    radial-gradient(700px 360px at -10% 0%, var(--bg-tint), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

::selection { background: var(--accent-soft); }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.container { max-width: 1240px; margin: 0 auto; padding: 16px 24px 56px; }

[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #0ea5e9);
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.55);
  flex: none;
}

.brand h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.brand .subtitle { margin: 1px 0 0; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* 小屏更多面板内的分组分隔线(仅展开态显示) */
.topbar-divider { display: none; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.card + .card, .card + *, .stats + .card { margin-top: 16px; }
.stats + .view-switch-row, .view-switch-row + .card { margin-top: 16px; }

/* 结果视图切换(全部 / SSL / WHOIS):胶囊分段控件 */
.view-switch-row { display: flex; justify-content: center; }
.view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.view-switch .vtab {
  border: none;
  background: transparent;
  padding: 5px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.view-switch .vtab:hover { color: var(--text); }
.view-switch .vtab.active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px 0;
}

.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { color: var(--accent); }
.card-body { padding: 14px 18px 18px; }

.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent-border); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent-border); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* 按钮组:SSL 检测 + WHOIS 检测拼接为一体 */
.btn-group { display: inline-flex; align-items: stretch; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group > .btn:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.btn-group > .btn:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.btn-group > .btn:hover, .btn-group > .btn:focus-visible { z-index: 1; }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px -8px var(--accent-border);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); color: #fff; }

.btn.danger-ghost { color: var(--danger); }
.btn.danger-ghost:hover { border-color: var(--danger); background: var(--danger-soft); }

.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.sm .icon { width: 13px; height: 13px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: inline-grid;
  grid-auto-flow: column;
  place-items: center;
  cursor: pointer;
  transition: all 0.16s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

.icon { width: 16px; height: 16px; flex: none; }

/* ---------- 语言切换(弹出面板式,参考 ParseURL) ---------- */
/* 定位包装层:面板锚定在按钮正下方,而非整个顶栏 */
.lang-wrap { position: relative; display: inline-flex; flex: none; }
.lang-toggle { width: auto; min-width: 36px; padding: 0 9px; gap: 2px; }
.lang-toggle .lang-label { font-size: 13px; font-weight: 700; line-height: 1; }
.lang-toggle .lang-caret { width: 11px; height: 11px; opacity: 0.6; }
.lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 150px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-item {
  border: none;
  background: none;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.lang-item:hover { background: var(--accent-soft); color: var(--text); }
.lang-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.lang-item.active::after { content: "✓"; margin-left: 7px; }

/* 表单 */
textarea, input[type="text"], input[type="password"], input[type="number"], input[type="search"], select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--text);
  padding: 8px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea#input {
  resize: vertical;
  min-height: 110px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}

/* 选项行 */
.options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.options label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.options .num { width: 64px; padding: 5px 8px; }
.options select { width: auto; padding: 5px 8px; }
.options .sep { width: 1px; height: 18px; background: var(--border); }
.options .checkbox { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.options input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* 解析摘要 + chips */
.parse-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-2);
}
.parse-summary .s-item { display: inline-flex; align-items: center; gap: 5px; }
.parse-summary .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }
.dot.dup { background: var(--warn); }
.dot.ex { background: var(--text-3); }
.parse-summary .bulk { margin-left: auto; display: flex; gap: 6px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  max-height: 132px;
  overflow-y: auto;
  padding: 2px;
}
.chips:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card-2);
  font-size: 12.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.14s ease;
  user-select: none;
}
.chip:hover { border-color: var(--accent-border); color: var(--accent); }
.chip .port { color: var(--text-3); font-size: 11px; }

.chip.invalid {
  border-style: dashed;
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
  cursor: not-allowed;
}
.chip.excluded {
  border-color: var(--border);
  color: var(--text-3);
  background: transparent;
  text-decoration: line-through;
  opacity: 0.75;
}
.chip.excluded:hover { color: var(--accent); }

.chip-more { font-size: 12px; color: var(--text-3); padding: 3px 6px; }

.hint { margin-top: 10px; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: flex-start; }
.hint svg { width: 13px; height: 13px; margin-top: 2px; flex: none; }

.input-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.input-actions .spacer { flex: 1; }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--neutral-soft);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text-2);
}

/* ---------- 进度条 ---------- */
.progress-card { padding: 13px 18px 15px; }
.progress-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.progress-row .latest { font-family: var(--font-mono); font-size: 12px; color: var(--accent); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-row .pct { margin-left: auto; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.progress-bar { margin-top: 10px; height: 7px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; position: relative; }
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width 0.25s ease;
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: var(--shadow-card);
  text-align: left;
}
.stat:hover { transform: translateY(-2px); border-color: var(--accent-border); }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat.s-ok .num { color: var(--ok); }
.stat.s-warn .num { color: var(--warn); }
.stat.s-expired .num { color: var(--danger); }
.stat.s-err .num { color: var(--crit); }
.stat.s-info .num { color: var(--info); }
.stat.plain { cursor: default; }
.stat.plain:hover { transform: none; border-color: var(--border); }

/* ---------- 结果区 ---------- */
.results-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px 0;
}

.tabs { display: inline-flex; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tab {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12); }
[data-theme="dark"] .tab.active { background: var(--accent-soft); }
.tab .cnt { opacity: 0.65; font-size: 11px; margin-left: 3px; font-variant-numeric: tabular-nums; }

.search-box { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }
.search-box input { padding-left: 32px; font-size: 13px; }

.results-meta { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 4px; }

/* 表格 */
.table-wrap { overflow: auto; margin: 12px 6px 6px; border-radius: 10px; }

table.results { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1020px; font-size: 13px; }

table.results thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
table.results thead th.sortable { cursor: pointer; }
table.results thead th.sortable:hover { color: var(--accent); }
table.results thead th .arrow { font-size: 10px; margin-left: 3px; opacity: 0.9; }
table.results thead th.sorted { color: var(--accent); }

table.results tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
table.results tbody tr { transition: background-color 0.12s ease; }
table.results tbody tr:hover { background: var(--accent-soft); }
table.results tbody tr.clickable { cursor: pointer; }
table.results tbody tr.row-excluded { opacity: 0.55; }
table.results tbody tr.row-excluded:hover { background: var(--neutral-soft); }
table.results tbody tr:last-child td { border-bottom: none; }

/* WHOIS 原始应答(详情弹窗) */
.whois-raw {
  margin: 0;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
  overflow: auto;
}

.td-host { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; text-align: right; }
.td-host .port-tag { color: var(--text-3); font-weight: 400; font-size: 11.5px; }
.td-host .ex-tag {
  display: inline-block;
  margin-left: 7px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--neutral-soft);
  border-radius: 5px;
  padding: 1px 6px;
  vertical-align: 1px;
}
/* 服务端缓存标记(悬停显示查询/缓存期时间) */
.td-host .cache-tag {
  display: inline-block;
  margin-left: 7px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--info);
  background: var(--info-soft);
  border-radius: 5px;
  padding: 1px 6px;
  vertical-align: 1px;
  cursor: help;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok-strong); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.crit { color: var(--crit); background: var(--crit-soft); }
.pill.expired { color: var(--danger); background: var(--danger-soft); }
.pill.err { color: var(--danger); background: var(--danger-soft); }
.pill.neutral { color: var(--text-2); background: var(--neutral-soft); }
[data-theme="dark"] .pill.ok { color: var(--ok); }

.days-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.daysbar { width: 64px; height: 6px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; flex: none; }
.daysbar .fill { height: 100%; border-radius: 99px; }
.daysbar .fill.c-ok { background: var(--ok); }
.daysbar .fill.c-warn { background: var(--warn); }
.daysbar .fill.c-crit { background: var(--crit); }
.daysbar .fill.c-expired { background: var(--danger); }
.days-text { font-variant-numeric: tabular-nums; color: var(--text-2); }
.days-text.t-ok { color: var(--ok-strong); }
.days-text.t-warn { color: var(--warn); }
.days-text.t-crit, .days-text.t-expired { color: var(--danger); font-weight: 600; }
[data-theme="dark"] .days-text.t-ok { color: var(--ok); }

td.date-cell { color: var(--text-2); font-variant-numeric: tabular-nums; }

.tls-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1.5px 8px;
  border-radius: 6px;
  background: var(--info-soft);
  color: var(--info);
  font-weight: 600;
}
.tls-tag.old { background: var(--warn-soft); color: var(--warn); }

.row-actions { display: flex; gap: 5px; }
.row-actions .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.row-actions .icon-btn svg { width: 14px; height: 14px; }
.row-actions .icon-btn.active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.row-actions .icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { padding: 46px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty-state svg { width: 42px; height: 42px; opacity: 0.4; margin-bottom: 10px; }

/* ---------- 模态框 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 12, 24, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.16s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 760px;
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.modal-head .host-name { font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .close { margin-left: auto; }

.modal-body { padding: 16px 20px 20px; overflow-y: auto; }

.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 18px; flex-wrap: wrap; }

/* 证书详情 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; }
.d-item { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.d-item .k { font-size: 11.5px; color: var(--text-3); }
.d-item .v { font-size: 13px; font-weight: 600; margin-top: 1px; word-break: break-all; }
.d-item .v.mono { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.d-item .v small { color: var(--text-3); font-weight: 400; }

.section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  margin: 20px 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.3px;
}
.section-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent); }
.section-title:first-child { margin-top: 0; }

.san-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.san-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 2.5px 9px;
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  word-break: break-all;
}
.san-chip.match { border-color: var(--ok); color: var(--ok-strong); background: var(--ok-soft); font-weight: 600; }
[data-theme="dark"] .san-chip.match { color: var(--ok); }

.diag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.diag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 8px;
}
.diag svg { width: 13px; height: 13px; }
.diag.good { color: var(--ok-strong); background: var(--ok-soft); }
.diag.bad { color: var(--danger); background: var(--danger-soft); }
.diag.warn { color: var(--warn); background: var(--warn-soft); }
.diag.neutral { color: var(--text-2); background: var(--neutral-soft); }
[data-theme="dark"] .diag.good { color: var(--ok); }

.chain-list { display: flex; flex-direction: column; gap: 0; }
.chain-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.chain-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 26px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.chain-node {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
  position: relative;
  z-index: 1;
}
.chain-main { min-width: 0; }
.chain-main .subj { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.chain-main .meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; }
.chain-main .tag { background: var(--neutral-soft); padding: 0 7px; border-radius: 5px; }
.chain-main .tag.good { color: var(--ok-strong); background: var(--ok-soft); }
.chain-main .tag.bad { color: var(--danger); background: var(--danger-soft); }

.mono-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 8px;
}
.mono-box .icon-btn { width: 26px; height: 26px; border-radius: 6px; margin-left: auto; flex: none; }
.mono-box .icon-btn svg { width: 13px; height: 13px; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 20px; font-size: 12.5px; }
.kv-grid .kv { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.kv-grid .kv .k { color: var(--text-3); min-width: 92px; flex: none; }
.kv-grid .kv .v { word-break: break-all; min-width: 0; }

.err-block {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 12px 15px;
}
.err-block .code { font-family: var(--font-mono); font-size: 12px; color: var(--danger); font-weight: 700; }
.err-block .msg { font-weight: 600; margin-top: 3px; }
.err-block .hintline { color: var(--text-2); margin-top: 5px; font-size: 12.5px; }

/* 证书申请向导 */
.wiz-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px 0;
  font-size: 12.5px;
  color: var(--text-3);
}
.wiz-steps .on { color: var(--accent); font-weight: 700; }
.wiz-steps .done { color: var(--ok); }
.wiz-steps .arrow { opacity: 0.5; }

.wiz-field .k { font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.wiz-field select { width: 100%; }
.wiz-radios { display: flex; flex-direction: column; gap: 7px; }
.wiz-radios .checkbox { cursor: pointer; }
.wiz-wildcard-tip { color: var(--warn); font-weight: 600; margin-left: 6px; }

.wiz-banner {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text-2);
}
.wiz-banner.info { border-color: var(--accent-border); background: var(--accent-soft); }
.wiz-banner.ok { border-color: var(--ok); background: var(--ok-soft); }
.wiz-banner.warn { border-color: var(--warn); background: var(--warn-soft); }

.wiz-authz {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card-2);
}
.wiz-authz.bad { border-color: var(--danger); }
.wa-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.wa-domain { font-family: var(--font-mono); font-size: 13px; font-weight: 600; word-break: break-all; }
.wiz-authz .kv { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.wiz-authz .kv:last-of-type { border-bottom: none; }
.wiz-authz .kv .k { color: var(--text-3); min-width: 72px; flex: none; }
.wiz-authz .kv .v { word-break: break-all; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wiz-authz .kv .v.mono { font-family: var(--font-mono); font-size: 12px; }
.wiz-copy { width: 26px; height: 26px; border-radius: 6px; }
.wiz-copy svg { width: 13px; height: 13px; }

.wiz-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wiz-actions-row input { max-width: 220px; }

.spinning { animation: spin 0.9s linear infinite; }
.spinning-big { width: 34px; height: 34px; color: var(--accent); animation: spin 0.9s linear infinite; }

/* 账号体系 */
.role-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 7px;
  vertical-align: 1px;
  white-space: nowrap;
}
#account-area .btn { max-width: 260px; overflow: hidden; }
#account-area .btn { white-space: nowrap; }

.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1; min-width: 120px; font-family: var(--font-mono); letter-spacing: 1px; }
.captcha-box {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0;
  background: #f2f4f9;
  cursor: pointer;
  flex: none;
  line-height: 0;
  transition: border-color 0.15s ease;
}
.captcha-box:hover { border-color: var(--accent-border); }

.menu-list { display: flex; flex-direction: column; gap: 9px; }
.menu-list .btn { justify-content: flex-start; }

.pill.warn { color: var(--warn); background: var(--warn-soft); }

.hist-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card-2);
}
.hi-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hi-domains { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; word-break: break-all; }
.hi-meta { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.hi-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.env-tag {
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 7px;
  background: var(--neutral-soft);
  color: var(--text-2);
}
.env-tag.production { background: var(--ok-soft); color: var(--ok-strong); }

/* 系统管理:页签 + 设置卡片 + 表单栅格 */
.admin-tabs { margin-bottom: 14px; }
.admin-tab-page > .set-card:first-child { margin-top: 0; }

.set-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--card-2);
}
.set-card-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
}
.set-card-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.set-card-title small { font-weight: 400; color: var(--text-3); }

.switch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.switch-grid .checkbox { align-items: flex-start; }

.form-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 12px;
  align-items: center;
}
.form-grid .fg-k {
  font-size: 12.5px;
  color: var(--text-2);
  text-align: right;
  line-height: 1.4;
}
.form-grid .fg-k small { display: block; color: var(--text-3); font-size: 11px; }
.form-grid input, .form-grid select { width: 100%; }

.stat-line { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }

/* 访问日志 */
.log-list { display: flex; flex-direction: column; }
.log-row {
  display: grid;
  grid-template-columns: 118px auto minmax(90px, auto) 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--card-2);
  font-size: 12.5px;
}
.log-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.log-user { font-weight: 600; word-break: break-all; }
.log-detail { color: var(--text-2); word-break: break-all; }
.log-meta { grid-column: 1 / -1; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.log-row .pill { font-size: 11px; padding: 1.5px 8px; white-space: nowrap; }

@media (max-width: 760px) {
  .switch-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .fg-k { text-align: left; }
}

/* 历史列表 */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .info { min-width: 0; flex: 1; }
.list-item .name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.list-item .ops { display: flex; gap: 6px; flex: none; }

.name-input { margin: 4px 0 2px; }

/* 订单生命周期日志时间线 */
.evt-timeline { display: flex; flex-direction: column; gap: 8px; }
.evt-item { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; background: var(--card-2); }
.evt-item .evt-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.evt-item .evt-ts { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.evt-item .evt-msg { font-size: 13px; color: var(--text); margin-top: 6px; word-break: break-all; }
.evt-item .evt-hint { margin-top: 7px; font-size: 12.5px; color: var(--ok-strong); background: var(--ok-soft); border-radius: 8px; padding: 7px 10px; word-break: break-all; }
.evt-item .evt-detail { margin-top: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); word-break: break-all; }

/* 两步验证恢复码(一次性展示) */
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 4px; }
.recovery-code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 8px 10px;
  background: var(--card-2);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  user-select: all;
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 10px 16px 10px 13px;
  font-size: 13px;
  min-width: 220px;
  max-width: 380px;
  animation: slideIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  pointer-events: auto;
}
.toast.out { animation: slideOut 0.2s ease forwards; }
.toast svg { width: 16px; height: 16px; flex: none; }
.toast.success { border-left-color: var(--ok); }
.toast.success svg { color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--accent); }
.toast.warn { border-left-color: var(--warn); }
.toast.warn svg { color: var(--warn); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- 页脚 ---------- */
.foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 26px 0 8px; }
.foot .stack { display: inline-flex; align-items: center; gap: 6px; }

/* 管理后台:部署与运行参数说明 */
.dep-help { display: flex; flex-direction: column; gap: 12px; }
.dep-item .dep-k { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.dep-item .dep-v { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.dep-item .dep-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 9px;
  margin-top: 5px;
  word-break: break-all;
}
.dep-item code {
  font-family: var(--font-mono);
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11.5px;
}

/* ---------- 用户手册 ---------- */
.docs-layout { display: grid; grid-template-columns: 168px 1fr; gap: 20px; }
.docs-nav { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.docs-nav a:hover { color: var(--text); background: var(--card-2); }
.docs-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.docs-content section { scroll-margin-top: 6px; padding-bottom: 4px; margin-bottom: 16px; border-bottom: 1px dashed var(--border); }
.docs-content section:last-child { border-bottom: none; }
.docs-content h4 { margin: 18px 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.docs-content h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); }
.docs-content p, .docs-content li { font-size: 13px; color: var(--text-2); line-height: 1.75; margin: 5px 0; }
.docs-content ul { padding-left: 19px; margin: 6px 0; }
.docs-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  word-break: break-all;
}
.docs-content .doc-note {
  background: var(--info-soft);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin: 8px 0;
  color: var(--text-2);
}

/* ---------- 响应式 ---------- */
.btn-topbar-more { display: none; }
/* 展开后按钮变为关闭图标 */
.btn-topbar-more .icon-closebar { display: none; }
.topbar.expanded .btn-topbar-more .icon-menubar { display: none; }
.topbar.expanded .btn-topbar-more .icon-closebar { display: block; }

@media (max-width: 760px) {
  .container { padding: 12px 14px 40px; }
  .topbar-inner { padding: 10px 14px; }
  .brand .subtitle { display: none; }
  .progress-row .latest { display: none; }
  .modal { max-width: 100%; }
  .search-box { max-width: none; }
  .parse-summary .bulk { margin-left: 0; }

  /* 小屏:顶栏功能按钮收纳进弹出面板;语言按钮独立保留在「更多」左侧 */
  .btn-topbar-more { display: inline-grid; }
  .topbar-actions > .btn,
  .topbar-actions > #account-area { display: none; }
  .topbar.expanded .topbar-inner > .topbar-actions {
    position: absolute;
    top: calc(100% + 6px);
    right: 12px;
    z-index: 60;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    width: 224px;
    max-width: calc(100vw - 24px);
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-pop);
  }
  /* 重排版:✕ 关闭 → 主操作(申请证书) → 次操作(手册/常用列表) → 账号 → 分隔线 → 语言 | 主题 双列 */
  /* ✕ 靠右:row 布局下主轴推右用 margin-left:auto(align-self 是纵轴,无效) */
  .topbar.expanded .btn-topbar-more { order: 0; margin-left: auto; }
  .topbar.expanded #btn-cert { order: 1; }
  .topbar.expanded #btn-docs { order: 2; }
  .topbar.expanded #btn-history { order: 3; }
  .topbar.expanded #account-area { order: 4; }
  .topbar.expanded .topbar-divider { order: 5; }
  .topbar.expanded .lang-wrap { order: 6; }
  .topbar.expanded #btn-theme { order: 7; }

  .topbar.expanded .topbar-actions > .btn,
  .topbar.expanded .topbar-actions > #account-area { display: flex; }
  .topbar.expanded .topbar-actions > .btn,
  .topbar.expanded .topbar-actions > .icon-btn:not(.btn-topbar-more) { width: 100%; }
  .topbar.expanded .topbar-actions > #account-area {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .topbar.expanded #account-area .btn,
  .topbar.expanded #account-area .icon-btn { width: 100%; }
  .topbar.expanded .topbar-divider {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--border);
  }
  /* 末行双列:语言切换 | 主题切换 */
  .topbar.expanded .lang-wrap,
  .topbar.expanded #btn-theme { width: calc(50% - 4px); }
  .topbar.expanded .lang-wrap .lang-toggle { width: 100%; }
  .topbar.expanded .btn-topbar-more { display: inline-grid; }
  .switch-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .fg-k { text-align: left; }
  /* 手册:小屏导航横向排列 */
  .docs-layout { grid-template-columns: 1fr; gap: 10px; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   管理中心(登录后的全屏工作台,hash 路由 #/admin/<page>)
   ============================================================ */
#admin-root { max-width: 1440px; margin: 0 auto; padding: 16px 24px 56px; }
.admin-shell { display: flex; gap: 18px; align-items: flex-start; }

/* 侧边栏:分组导航 + 计数徽标 */
.admin-side {
  width: 220px;
  flex: none;
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  box-shadow: var(--shadow-card);
}
.admin-side-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); padding: 2px 10px 8px; }
.admin-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-2); padding: 10px 10px 4px; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7.5px 10px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.admin-nav-item:hover { color: var(--text); background: var(--card-2); }
.admin-nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.admin-nav-item .icon { width: 15px; height: 15px; }
.admin-cnt {
  margin-left: auto;
  font-size: 10.5px;
  background: var(--neutral-soft);
  color: var(--text-2);
  border-radius: 999px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.admin-cnt.warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }

/* 内容区:页头 + 页面 */
.admin-main { flex: 1; min-width: 0; }
.admin-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-page-head h2 { margin: 0; font-size: 16.5px; font-weight: 700; }
.admin-page-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.admin-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-page-actions .search-box { flex: 0 1 220px; min-width: 160px; }

/* 概览:双栏卡片 / 待办 / 开关行 */
.admin-2col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; align-items: start; }
.admin-kvrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-kvrow:last-child { border-bottom: none; }
.admin-kvrow .k { color: var(--text-2); }
.admin-todo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 8px;
  cursor: pointer;
  background: var(--card);
  transition: all 0.14s ease;
}
.admin-todo:hover { border-color: var(--accent-border); color: var(--text); }
.admin-todo .pill { flex: none; }

/* 概览:统计卡片与下方双栏卡片的间距 */
#admin-root .stats { margin-bottom: 14px; }

/* 分页组件(证书订单 / 域名 / DNS 账号 / 用户 / 日志通用) */
.admin-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.admin-pager .pg-info { font-size: 12px; color: var(--text-3); margin-right: 6px; font-variant-numeric: tabular-nums; }
.admin-pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.14s ease;
  font-variant-numeric: tabular-nums;
}
.admin-pg-btn:hover:not(:disabled):not(.active) { border-color: var(--accent-border); color: var(--accent); }
.admin-pg-btn.active { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; }
.admin-pg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.admin-pg-dots { color: var(--text-3); padding: 0 2px; font-size: 12px; }
/* 翻页后滚动定位时避开吸顶顶栏 */
#orders-list, #dm-list, #users-list, #dns-list, #log-list { scroll-margin-top: 84px; }

/* 设置页:部署参数折叠为参考文档 */
details.set-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; }
details.set-card > summary::-webkit-details-marker { display: none; }
details.set-card > summary .set-card-title { margin-bottom: 0; flex: 1; }
details.set-card > summary::after { content: "▾"; color: var(--text-3); margin-left: 8px; }
details.set-card[open] > summary { margin-bottom: 11px; }
details.set-card[open] > summary::after { content: "▴"; }

/* 域名新增 / 编辑抽屉:遮罩 + 右滑面板,列表位置不动 */
.admin-drawer-mask, .admin-drawer { position: fixed; top: 0; bottom: 0; right: 0; }
.admin-drawer-mask {
  left: 0;
  z-index: 90;
  background: rgba(8, 12, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.admin-drawer-mask.open { opacity: 1; pointer-events: auto; }
.admin-drawer {
  z-index: 95;
  width: min(440px, 94vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  transform: translateX(103%);
  transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.admin-drawer.open { transform: none; }
.admin-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); }
.admin-drawer-head h3 { margin: 0; font-size: 15px; }
.admin-drawer-body { padding: 15px 18px 20px; overflow-y: auto; }
.admin-drawer-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 18px 15px; border-top: 1px solid var(--border); }
.admin-drawer .form-grid { grid-template-columns: 1fr; }
.admin-drawer .form-grid .fg-k { text-align: left; }
.admin-drawer .hint { margin-top: 4px; }

/* 管理中心响应式:小屏侧边栏折叠为顶部横向标签 */
@media (max-width: 920px) {
  #admin-root { padding: 12px 14px 40px; }
  .admin-shell { flex-direction: column; }
  .admin-side {
    position: static;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 10px;
  }
  .admin-side-title, .admin-group { display: none; }
  .admin-nav-item { width: auto; padding: 7px 12px; }
  .admin-cnt { margin-left: 4px; }
  .admin-2col { grid-template-columns: 1fr; }
}
