/* ============================================================
   计算机化系统密码自助管理平台 · 赛博 HUD 深色皮肤
   依据：design/01-visual-spec.md（token 即变量名，禁止裸 hex）
   性能红线：无 backdrop-filter、无循环动画、无 filter: blur、纹理 ≤5%
   ============================================================ */

:root {
  /* ——— 基底层级（蓝黑，非纯黑）——— */
  --bg-base:      #070b12;
  --bg-surface:   #0c121c;
  --bg-elevated:  #121a28;
  --bg-inset:     #090e17;
  --bg-topbar:    #0a0f1a;

  /* ——— 主色 / 霓虹强调 ——— */
  --accent-cyan:        #22d3ee;
  --accent-cyan-bright: #67e8f9;
  --accent-cyan-dim:    #0e7490;
  --accent-magenta:     #e879f9;

  /* ——— 功能色 ——— */
  --success: #34d399;
  --warning: #fbbf24;
  --danger:  #fb7185;
  --danger-strong: #f43f5e;

  /* ——— 文字层级 ——— */
  --text-primary:   #e8eef7;
  --text-secondary: #a9b6c9;
  --text-muted:     #7c8ba1;
  --text-on-accent: #041018;
  --text-on-danger: #1c060c;

  /* ——— 描边 / 发光 ——— */
  --border-subtle:   #1c2838;
  --border-strong:   #2a3a52;
  --border-glow-cyan: rgba(34, 211, 238, .35);
  --border-glow-mag:  rgba(232, 121, 249, .30);
  --glow-cyan: 0 0 12px rgba(34, 211, 238, .25);
  --glow-cyan-strong: 0 0 20px rgba(34, 211, 238, .40);
  --glow-danger: 0 0 12px rgba(251, 113, 133, .30);

  /* ——— 字体栈（系统字体，零外链）——— */
  --font-cn:   "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-ui:   "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Courier New", monospace;

  /* ——— 字号阶梯（9 档，14px 基准）——— */
  --fs-display: 28px;
  --fs-h1: 22px;
  --fs-h2: 17px;
  --fs-body: 14px;
  --fs-table: 13px;
  --fs-meta: 12px;
  --fs-hud: 11px;
  --fs-stat: 32px;
  --fs-secret: 22px;
}

/* ========== Reset & Base ========== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui), var(--font-cn);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  /* 全站 32px 网格纹理，透明度 ≤5%（7.1） */
  background-image:
    repeating-linear-gradient(0deg,  rgba(34,211,238,.04) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(34,211,238,.04) 0 1px, transparent 1px 32px);
  min-height: 100vh;
}
/* 扫描线（静态，透明度 ≤3%，禁止位移动画） */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
  z-index: 0;
}
.container, .topbar { position: relative; z-index: 1; }

a { color: var(--accent-cyan); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--accent-cyan-bright); text-decoration: underline; }
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--border-glow-cyan);
  border-radius: 2px;
  text-decoration: underline;
}

::selection { background: rgba(34,211,238,.28); color: var(--text-primary); }

::placeholder { color: var(--text-muted); opacity: 1; }

/* ========== Typography ========== */
h1 {
  font-size: var(--fs-h1);
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
}
h1:focus { outline: none; }
h2 {
  font-size: var(--fs-h2);
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-primary);
}
h2.with-dot::before {
  content: ""; display: inline-block;
  width: 8px; height: 8px; margin-right: 8px;
  background: var(--accent-magenta); border-radius: 1px;
  vertical-align: 1px;
}
h2.section-rule {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.muted  { color: var(--text-muted); font-size: var(--fs-meta); }
.mono   { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.hud-label {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ========== 顶栏 .topbar ========== */
.topbar {
  background: var(--bg-topbar);
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(34,211,238,.18);
  box-shadow: 0 1px 12px rgba(34,211,238,.12);
}
.topbar .brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .brand::before {
  content: ""; width: 8px; height: 8px;
  background: var(--accent-cyan); border-radius: 1px;
  flex: none;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar nav a {
  color: var(--text-secondary);
  font-size: var(--fs-table);
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.topbar nav a:hover {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  text-decoration: none;
}
.topbar nav a.active {
  color: var(--accent-cyan-bright);
  border-bottom-color: var(--accent-cyan);
}
.topbar nav a.active::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; margin-right: 6px;
  background: var(--accent-magenta); border-radius: 1px;
  vertical-align: 1px;
}
.topbar nav a.logout { color: var(--text-muted); }
.topbar nav a.logout:hover { color: var(--danger); border-bottom-color: var(--danger); }
.topbar nav a.logout .uname {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
}

/* ========== 布局容器 ========== */
.container {
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 24px;
}

/* ========== 卡片 .card（核心容器） ========== */
.card {
  position: relative;
  background-color: var(--bg-surface);
  /* 顶部光条："仪表舱上缘信号灯"（background 实现，省出伪元素给角标） */
  background-image: linear-gradient(90deg, rgba(34,211,238,.5), transparent 40%);
  background-size: 40% 1px;
  background-position: 24px 0;
  background-repeat: no-repeat;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 0 0 1px rgba(34,211,238,.06), 0 8px 24px rgba(0,0,0,.45);
}
/* HUD 角标（每页 ≤2 卡片；统计四宫格内部放宽） */
.card.hud::before {
  content: ""; position: absolute; bottom: 8px; left: 8px;
  width: 12px; height: 12px;
  border-left: 2px solid var(--accent-magenta);
  border-bottom: 2px solid var(--accent-magenta);
  opacity: .6; pointer-events: none;
}
.card.hud::after {
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 12px; height: 12px;
  border-top: 2px solid var(--accent-magenta);
  border-right: 2px solid var(--accent-magenta);
  opacity: .6; pointer-events: none;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-block;
  background: var(--accent-cyan);
  color: var(--text-on-accent);
  border: 1px solid var(--accent-cyan);
  padding: 10px 20px;
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease,
              color 150ms ease, box-shadow 150ms ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--accent-cyan-bright);
  border-color: var(--accent-cyan-bright);
  color: var(--text-on-accent);
  box-shadow: var(--glow-cyan-strong);
  text-decoration: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--border-glow-cyan);
}
.btn:disabled {
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan-dim);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn.secondary {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan-dim);
  font-weight: 500;
}
.btn.secondary:hover {
  background: transparent;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan-bright);
  box-shadow: var(--glow-cyan);
}
.btn.secondary:focus-visible {
  box-shadow: 0 0 0 3px var(--border-glow-cyan);
}
.btn.secondary:disabled {
  border-color: var(--border-subtle);
  color: var(--text-muted);
  background: transparent;
  box-shadow: none;
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-weight: 600;
}
.btn.danger:hover {
  background: var(--danger-strong);
  color: var(--text-on-danger);
  box-shadow: var(--glow-danger);
}
.btn.danger:focus-visible {
  box-shadow: 0 0 0 3px var(--border-glow-mag);
}

.btn.sm {
  padding: 5px 12px;
  font-size: var(--fs-meta);
  border-radius: 4px;
  font-weight: 500;
}

/* 表单提交区（统一间距） */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ========== 表单控件 ========== */
label {
  display: block;
  margin: 16px 0 8px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--text-secondary);
}
label .req { color: var(--danger); margin-left: 2px; }
label .hint {
  display: block;
  font-size: var(--fs-meta);
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

input[type=text],
input[type=password],
input[type=email],
input[type=file],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--fs-body);
  color: var(--text-primary);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:hover, select:hover, textarea:hover {
  border-color: #3a4f6e;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--border-glow-cyan);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--bg-surface);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
textarea {
  resize: vertical;
  min-height: 72px;
}

input[type=file] {
  padding: 8px 12px;
  cursor: pointer;
}
input[type=file]::file-selector-button {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 4px 12px;
  margin-right: 12px;
  font-family: inherit;
  font-size: var(--fs-meta);
  cursor: pointer;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2322d3ee'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.mono-field input, input.mono-field {
  font-family: var(--font-mono);
}

/* 密码显示/隐藏切换 */
.pwd-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.pwd-wrap input { flex: 1; }
.pwd-toggle {
  flex: none;
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: inherit;
  font-size: var(--fs-meta);
  font-weight: 500;
  cursor: pointer;
  padding: 0 4px;
  transition: color 150ms ease;
}
.pwd-toggle:hover { color: var(--accent-cyan-bright); text-decoration: underline; }
.pwd-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--border-glow-cyan);
  border-radius: 2px;
}

.form-row { display: flex; gap: 16px; }
.form-row > div { flex: 1; min-width: 0; }

/* ========== 表格（全站最核心组件） ========== */
.table-wrap {
  overflow-x: auto;
  position: relative;
}
/* <720px 可滚动提示 */
.table-wrap::before {
  content: "← 左右滑动查看全部列 →";
  display: none;
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  color: var(--text-muted);
  letter-spacing: .04em;
  padding-bottom: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-table);
  line-height: 1.5;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
thead th {
  background: var(--bg-inset);
  font-family: var(--font-ui), var(--font-cn);
  font-size: var(--fs-table);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--accent-cyan-dim);
}
thead th .col-hud {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
tbody tr:hover td {
  background: var(--bg-elevated);
}
tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--accent-cyan);
}
/* 停用行：muted + inset 背景（禁 opacity） */
tbody tr.row-off td {
  background: var(--bg-inset);
  color: var(--text-muted);
}
tbody tr.row-off:hover td { background: var(--bg-inset); }
tbody tr.row-off:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--text-muted);
}

td .mono, td.mono, th.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
td.num, th.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
td.detail-clip {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.masked {
  font-family: var(--font-mono);
  letter-spacing: 3px;
  color: var(--text-muted);
}

.actions {
  white-space: nowrap;
}
.actions form { display: inline; vertical-align: middle; }
.actions .btn, .actions a.btn { vertical-align: middle; }
.actions > * { margin-left: 4px; }
.actions > *:first-child { margin-left: 0; }

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-table);
  padding: 24px 12px;
}
.empty-hud {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  letter-spacing: .08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

/* ========== Flash 消息 ========== */
.flash-wrap { margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: var(--fs-table);
  line-height: 1.5;
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(34,211,238,.08);
  border-top: 1px solid rgba(34,211,238,.30);
  border-right: 1px solid rgba(34,211,238,.30);
  border-bottom: 1px solid rgba(34,211,238,.30);
}
.flash .fi {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  flex: none;
  color: var(--accent-cyan);
}
.flash.success {
  border-left-color: var(--success);
  background: rgba(52,211,153,.08);
  border-top-color: rgba(52,211,153,.30);
  border-right-color: rgba(52,211,153,.30);
  border-bottom-color: rgba(52,211,153,.30);
}
.flash.success .fi { color: var(--success); }
.flash.warn {
  border-left-color: var(--warning);
  background: rgba(251,191,36,.08);
  border-top-color: rgba(251,191,36,.30);
  border-right-color: rgba(251,191,36,.30);
  border-bottom-color: rgba(251,191,36,.30);
}
.flash.warn .fi { color: var(--warning); }
.flash.error {
  border-left-color: var(--danger);
  background: rgba(251,113,133,.08);
  border-top-color: rgba(251,113,133,.30);
  border-right-color: rgba(251,113,133,.30);
  border-bottom-color: rgba(251,113,133,.30);
  color: var(--danger);
}
.flash.error .fi { color: var(--danger); }

/* ========== 状态标签 .tag ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-ui), var(--font-cn);
  font-size: var(--fs-hud);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.5;
  white-space: nowrap;
}
.tag.ok {
  background: rgba(52,211,153,.12);
  color: var(--success);
  border: 1px solid rgba(52,211,153,.30);
}
.tag.off {
  background: rgba(124,139,161,.12);
  color: var(--text-muted);
  border: 1px solid rgba(124,139,161,.30);
}
.tag.warn {
  background: rgba(251,191,36,.12);
  color: var(--warning);
  border: 1px solid rgba(251,191,36,.30);
}
.tag.danger {
  background: rgba(251,113,133,.12);
  color: var(--danger);
  border: 1px solid rgba(251,113,133,.30);
}
.tag.info {
  background: rgba(34,211,238,.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(34,211,238,.30);
}
.tag.mag {
  background: rgba(232,121,249,.12);
  color: var(--accent-magenta);
  border: 1px solid rgba(232,121,249,.30);
}
/* 管理端 HUD 小标签（ONE-SHOT 等） */
.tag.hud-tag {
  font-family: var(--font-mono);
  letter-spacing: .10em;
  text-transform: uppercase;
}

/* ========== 认证页 .auth-box ========== */
.auth-box {
  max-width: 420px;
  margin: 64px auto;
}
/* 登录舱：顶部光条加宽至 60% */
.auth-box.card {
  background-image: linear-gradient(90deg, rgba(34,211,238,.5), transparent 60%);
  background-size: 60% 1px;
}
.auth-box h1 {
  font-size: var(--fs-display);
  line-height: 1.3;
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.5;
}
.auth-links {
  margin-top: 16px;
  text-align: center;
  font-size: var(--fs-meta);
}
.auth-footer {
  text-align: center;
  font-size: var(--fs-hud);
  color: var(--text-muted);
  margin: 32px 0 0;
  line-height: 1.5;
}
.auth-box .btn[type=submit],
.auth-box button.btn {
  width: 100%;
}
.auth-box .form-actions .btn { width: auto; }
.auth-box .form-actions { justify-content: center; }

.form-section-title {
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.auth-box form + .form-section-title { margin-top: 24px; }

.form-note {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 8px 0 0;
}

/* ========== 统计数字块 .stat ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(34,211,238,.06), 0 8px 24px rgba(0,0,0,.45);
  /* 顶部光条（统计区允许 4 色区分） */
  background-image: linear-gradient(90deg, rgba(34,211,238,.5), transparent 40%);
  background-size: 40% 1px;
  background-position: 24px 0;
  background-repeat: no-repeat;
}
.stat:nth-child(2) {
  background-image: linear-gradient(90deg, rgba(232,121,249,.5), transparent 40%);
}
.stat:nth-child(3) {
  background-image: linear-gradient(90deg, rgba(52,211,153,.5), transparent 40%);
}
.stat:nth-child(4) {
  background-image: linear-gradient(90deg, rgba(251,191,36,.5), transparent 40%);
}
.stat::after {
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 10px; height: 10px;
  border-top: 2px solid var(--accent-magenta);
  border-right: 2px solid var(--accent-magenta);
  opacity: .6; pointer-events: none;
}
.stat .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-stat);
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent-cyan-bright);
  text-shadow: 0 0 16px rgba(34,211,238,.35);
}
.stat .num.long { font-size: 28px; }
.stat .lbl {
  font-size: var(--fs-meta);
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* ========== 警示框 .reveal-box（全站戏剧时刻） ========== */
.reveal-box {
  position: relative;
  background: var(--bg-inset);
  border: 1px solid rgba(251,191,36,.35);
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
}
.reveal-box::before {
  content: ""; position: absolute; top: 8px; left: 8px;
  width: 12px; height: 12px;
  border-top: 2px solid var(--accent-magenta);
  border-left: 2px solid var(--accent-magenta);
  opacity: .7; pointer-events: none;
}
.reveal-box::after {
  content: ""; position: absolute; bottom: 8px; right: 8px;
  width: 12px; height: 12px;
  border-bottom: 2px solid var(--accent-magenta);
  border-right: 2px solid var(--accent-magenta);
  opacity: .7; pointer-events: none;
}
.reveal-hud {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--warning);
  margin: 0 0 12px;
}
.reveal-box p {
  margin: 0 0 16px;
  font-size: var(--fs-body);
}

/* 密码明文展示 .pwd-display（终端读数感） */
.pwd-display {
  font-family: var(--font-mono);
  font-size: var(--fs-secret);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 1px;
  background: #060a10;
  border: 1px dashed var(--accent-cyan-dim);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--accent-cyan-bright);
  user-select: all;
  word-break: break-all;
}
.pwd-display:focus { outline: none; box-shadow: 0 0 0 3px var(--border-glow-cyan); }
.pwd-display-label {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  color: var(--text-muted);
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.warn-text {
  color: var(--warning);
  font-size: var(--fs-meta);
  line-height: 1.5;
  margin: 12px 0 0;
}
.warn-text .hud-prefix { color: var(--warning); }

.btn.copied-ok { color: var(--success); border-color: var(--success); }
.btn.copied-fail { color: var(--warning); border-color: var(--warning); }

/* ========== 筛选栏 .search-bar（控制台条） ========== */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}
.search-bar input { flex: 1; min-width: 180px; margin-top: 0; }
.search-bar select { width: 140px; flex: none; margin-top: 0; }
.search-bar .btn { margin-top: 0; flex: none; }
.result-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 8px 0 12px;
}

/* ========== 键值对明细 .detail-grid ========== */
.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin: 0;
}
.detail-grid dt {
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
}
.detail-grid dt::before {
  content: "▸ ";
  font-family: var(--font-mono);
  color: var(--accent-cyan-dim);
}
.detail-grid dd {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--text-primary);
}
.detail-grid dd.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.detail-grid dd .dash, .dash {
  color: var(--text-muted);
}
/* 长表单防串行：每 4 行分段线（8 个 dt/dd = 4 行） */
.detail-grid dt:nth-of-type(4n):not(:last-of-type),
.detail-grid dd:nth-of-type(4n):not(:last-of-type) {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

/* ========== 页面工具条 .toolbar ========== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar h1 { margin: 0; }
.toolbar .btn { margin-top: 0; }
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ========== 返回链 / 提示行 ========== */
.back-link {
  display: inline-block;
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin-bottom: 8px;
}
.back-link:hover { color: var(--accent-cyan); }

.audit-hint {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.5;
}
.policy-hint {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.5;
}
.immutable-hint {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.5;
}
.crypto-hint {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  margin: 16px 0 0;
  line-height: 1.5;
}
/* HUD 前缀标签（real text，非伪元素，保证读屏与检索） */
.hud-prefix {
  font-family: var(--font-mono);
  font-size: var(--fs-hud);
  letter-spacing: .08em;
  font-weight: 500;
}
.audit-hint .hud-prefix { color: var(--warning); }
.policy-hint .hud-prefix { color: var(--accent-magenta); }
.immutable-hint .hud-prefix { color: var(--warning); }
.crypto-hint .hud-prefix { color: var(--accent-cyan); }

/* ========== 系统铭牌 h1 ========== */
.nameplate .code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-cyan);
  font-size: var(--fs-body);
  font-weight: 500;
  margin-right: 8px;
}
.nameplate { font-size: var(--fs-h1); }

/* reveal 页铭牌 */
.reveal-nameplate {
  margin: 0 0 16px;
}
.reveal-nameplate .code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-body);
  color: var(--accent-cyan);
}
.reveal-nameplate .sys-name {
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--text-primary);
}
.reveal-nameplate .account {
  font-size: var(--fs-meta);
  color: var(--text-muted);
}

/* ========== 表单页容器 ========== */
.form-page {
  max-width: 560px;
  margin: 0 auto;
}
.form-page.wide { max-width: 640px; }

/* ========== 空态引导 ========== */
.empty-guide {
  color: var(--text-muted);
  font-size: var(--fs-table);
  line-height: 1.6;
}

/* ========== 响应式（唯一点 720px） ========== */
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .num { font-size: 28px; }
  .stat .num.long { font-size: 22px; }
  .form-row { flex-direction: column; gap: 0; }
  .table-wrap::before { display: block; }
  .search-bar select { width: 100%; }
  .auth-box { max-width: calc(100% - 32px); margin: 32px auto; }
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 16px;
    gap: 8px;
  }
  .topbar nav {
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
  }
  /* 触控增强：sm 按钮命中区 ≥44px */
  .btn.sm {
    padding: 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .actions { white-space: normal; }
  .actions form, .actions a.btn, .actions button {
    margin-bottom: 4px;
  }
  .detail-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .detail-grid dt { margin-top: 8px; }
  .detail-grid dt:nth-of-type(4n):not(:last-of-type),
  .detail-grid dd:nth-of-type(4n):not(:last-of-type) {
    border-bottom: none;
    padding-bottom: 0;
  }
  .toolbar { flex-direction: column; align-items: flex-start; }
}

/* ========== 动效约束 ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

.req { color: #fb7185; }
