/* 绳墨司 GAUGE 控制台 — 深色任务控制台主题
   概念：绳墨（墨线 / 准绳）—— 墨黑底、蓝图网格、朱砂准线、鎏金锚点、青色数据。
   无外部字体与资源：系统字体栈 + 纯 CSS 纹理。 */

:root {
  --bg: #0a0e14;
  --bg-2: #0b1017;
  --bg-3: #070a0f;
  --panel: rgba(19, 26, 38, 0.68);
  --panel-2: rgba(24, 32, 46, 0.6);
  --panel-solid: #121a26;
  --line: rgba(122, 150, 186, 0.16);
  --line-2: rgba(122, 150, 186, 0.28);
  --line-3: rgba(122, 150, 186, 0.42);

  --text: #e7eef7;
  --text-2: #9db0c8;
  --text-3: #6c7f98;

  --cinnabar: #e04a3a;
  --cinnabar-soft: rgba(224, 74, 58, 0.14);
  --gold: #d4a24e;
  --gold-soft: rgba(212, 162, 78, 0.14);
  --cyan: #39c5cf;
  --cyan-soft: rgba(57, 197, 207, 0.13);
  --green: #43b581;
  --green-soft: rgba(67, 181, 129, 0.14);
  --violet: #8b7cf6;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.3);
  --nav-h: 62px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a.link { color: var(--cyan); border-bottom: 1px solid rgba(57, 197, 207, 0.35); }
a.link:hover { border-bottom-color: var(--cyan); }

code, kbd, .mono { font-family: var(--mono); font-variant-ligatures: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
::-webkit-scrollbar-thumb { background: rgba(122, 150, 186, 0.22); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(122, 150, 186, 0.4); background-clip: padding-box; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.is-hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- 背景层 */

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(122, 150, 186, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 150, 186, 0.055) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 25%, transparent 78%);
}

.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 12% -5%, rgba(224, 74, 58, 0.14), transparent 62%),
    radial-gradient(55% 40% at 92% 4%, rgba(57, 197, 207, 0.11), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(212, 162, 78, 0.07), transparent 65%);
}

.topbar, .view, .footer { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: var(--nav-h); padding: 0 22px;
  background: rgba(9, 13, 19, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(224, 74, 58, 0.16), rgba(57, 197, 207, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-cn { font-size: 16px; font-weight: 700; letter-spacing: 0.16em; }
.brand-en { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.42em; color: var(--gold); }

.nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  position: relative; padding: 8px 13px; border-radius: 8px; white-space: nowrap;
  color: var(--text-2); font-size: 13.5px; transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-link.is-active { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--cinnabar), var(--gold));
  box-shadow: 0 0 12px rgba(224, 74, 58, 0.6);
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.facet-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.dot.ok { background: var(--green); box-shadow: 0 0 9px rgba(67, 181, 129, 0.8); }
.dot.bad { background: var(--cinnabar); box-shadow: 0 0 9px rgba(224, 74, 58, 0.8); }
.dot.warn { background: var(--gold); box-shadow: 0 0 9px rgba(212, 162, 78, 0.8); }
.dot.busy { background: var(--cyan); animation: pulse 1.3s infinite; }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px; max-width: 260px;
}
.avatar {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(150deg, var(--cinnabar), var(--gold));
  color: #14100c; font-weight: 700; font-size: 11px; flex: 0 0 auto;
}
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 视图容器 */

.view { min-height: calc(100vh - var(--nav-h) - 46px); padding: 24px 22px 40px; max-width: 1520px; margin: 0 auto; }

.page { animation: pageIn 0.42s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: 0.02em; }
.page-title .accent { color: var(--gold); }
.page-sub { margin: 4px 0 0; color: var(--text-2); font-size: 13px; max-width: 76ch; }
.page-head-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--cyan); }
.crumbs .sep { opacity: 0.5; }

/* ---------------------------------------------------------------- 卡片 / 栅格 */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(13px) saturate(1.25);
  -webkit-backdrop-filter: blur(13px) saturate(1.25);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  padding: 18px;
}
.card.tight { padding: 14px; }
.card-title {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 14px; font-size: 13.5px; font-weight: 650; letter-spacing: 0.06em; color: var(--text);
}
.card-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cinnabar), var(--gold));
}
.card-title .hint { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-3); letter-spacing: 0; }
.card.hoverable { transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.card.hoverable:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }

.grid { display: grid; gap: 16px; }
.grid.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.plans { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- KPI */

.kpi { display: flex; flex-direction: column; gap: 6px; min-height: 132px; }
.kpi-label { font-size: 12px; letter-spacing: 0.14em; color: var(--text-3); text-transform: uppercase; }
.kpi-value { font-family: var(--mono); font-size: 32px; font-weight: 600; line-height: 1.1; }
.kpi-value .unit { font-size: 14px; color: var(--text-3); margin-left: 4px; }
.kpi-note { font-size: 12px; color: var(--text-2); }
.kpi-canvas { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; }
.kpi-split { display: flex; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.kpi-split b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.045); color: var(--text);
  font-family: var(--sans); font-size: 13px; cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease), color 0.18s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-primary {
  background: linear-gradient(140deg, rgba(224, 74, 58, 0.9), rgba(196, 62, 48, 0.9));
  border-color: rgba(224, 74, 58, 0.75); color: #fff8f6; font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(140deg, #e35742, #c84434); border-color: #e86a56; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn-cyan { border-color: rgba(57, 197, 207, 0.45); color: #d3f6f9; background: rgba(57, 197, 207, 0.1); }
.btn-cyan:hover { background: rgba(57, 197, 207, 0.2); }
.btn .spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.plan-btn { justify-content: flex-start; width: 100%; text-align: left; padding: 9px 12px; }
.plan-btn .plan-name { font-family: var(--mono); font-size: 12.5px; }
.plan-btn .plan-meta { margin-left: auto; font-size: 11px; color: var(--text-3); }
.plan-btn.is-running { border-color: var(--cyan); color: var(--cyan); }

/* ---------------------------------------------------------------- 徽标 / 标签 */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--text-2);
  white-space: nowrap;
}
.badge.ok { color: #b6f0d4; border-color: rgba(67, 181, 129, 0.45); background: var(--green-soft); }
.badge.bad { color: #ffcfc8; border-color: rgba(224, 74, 58, 0.5); background: var(--cinnabar-soft); }
.badge.warn { color: #f6e0b8; border-color: rgba(212, 162, 78, 0.5); background: var(--gold-soft); }
.badge.info { color: #c8f4f8; border-color: rgba(57, 197, 207, 0.45); background: var(--cyan-soft); }
.badge.mute { color: var(--text-3); }
.badge.mono { font-family: var(--mono); letter-spacing: 0; }
.badge.solid-bad { background: rgba(224, 74, 58, 0.92); color: #fff5f3; border-color: transparent; font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 7px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); color: var(--text-2);
}
.chip.mono { font-family: var(--mono); font-size: 11.5px; }
.chip.on { border-color: rgba(57, 197, 207, 0.42); background: var(--cyan-soft); color: #d6f7fa; }
.chip.crit { border-color: rgba(224, 74, 58, 0.5); background: var(--cinnabar-soft); color: #ffd3cc; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.tier { font-family: var(--mono); font-size: 11px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-2); }
.tier.T1 { color: #cbb8ff; border-color: rgba(139, 124, 246, 0.45); }
.tier.T2 { color: #c8f4f8; border-color: rgba(57, 197, 207, 0.4); }
.tier.T3 { color: #f6e0b8; border-color: rgba(212, 162, 78, 0.42); }
.tier.T4 { color: #ffd0c9; border-color: rgba(224, 74, 58, 0.42); }
.tier.T5 { color: var(--text-3); }

/* ---------------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  padding: 9px 12px; text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--text-3); text-transform: uppercase;
  background: rgba(12, 17, 25, 0.96); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
table.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(122, 150, 186, 0.09); vertical-align: middle; }
table.tbl tbody tr { transition: background 0.15s var(--ease); }
table.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.028); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tr.expanded { background: rgba(57, 197, 207, 0.06); }
table.tbl .num { font-family: var(--mono); text-align: right; }
table.tbl .nowrap { white-space: nowrap; }
.tbl-empty { padding: 26px; text-align: center; color: var(--text-3); }

.detail-row td { background: rgba(8, 12, 18, 0.6); padding: 0; border-bottom: 1px solid var(--line); }
.detail-box { padding: 14px 16px; display: grid; gap: 10px; }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 3px 12px; font-size: 12.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

pre.code {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(6, 9, 14, 0.86); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; line-height: 1.62;
  color: #cfe0f2; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word;
}
pre.code.tall { max-height: 62vh; }

/* ---------------------------------------------------------------- 进度条 / 分值 */

.bar { position: relative; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  transition: width 0.9s var(--ease);
  background: linear-gradient(90deg, rgba(224, 74, 58, 0.9), var(--gold));
}
.bar.ok > i { background: linear-gradient(90deg, rgba(67, 181, 129, 0.9), var(--cyan)); }
.bar.bad > i { background: linear-gradient(90deg, #b8382b, var(--cinnabar)); }
.bar.thin { height: 5px; }

.rank-row { display: grid; grid-template-columns: 96px 1fr 92px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(122, 150, 186, 0.08); }
.rank-row:last-child { border-bottom: 0; }
.rank-code { font-family: var(--mono); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.rank-code .warn-icon { display: inline-flex; align-items: center; color: var(--gold); cursor: help; }
.rank-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rank-name { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-family: var(--mono); text-align: right; font-size: 13px; }

.score-row { display: grid; grid-template-columns: 210px 1fr 104px; gap: 12px; align-items: center; padding: 7px 0; }
.score-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; }
.score-name .dom { font-family: var(--mono); color: var(--gold); flex: 0 0 auto; }
.score-name .name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-val { font-family: var(--mono); text-align: right; font-size: 12.5px; }

/* ---------------------------------------------------------------- 热力图 */

.heat { display: grid; gap: 4px; align-items: center; }
.heat-head { font-size: 11px; color: var(--text-3); font-family: var(--mono); text-align: center; }
.heat-row-label { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.heat-cell {
  height: 26px; border-radius: 6px; border: 1px solid rgba(122, 150, 186, 0.1);
  display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; color: rgba(255, 255, 255, 0.82);
  cursor: pointer; transition: transform 0.14s var(--ease), border-color 0.14s var(--ease);
}
.heat-cell:hover { transform: scale(1.09); border-color: rgba(255, 255, 255, 0.5); z-index: 2; }
.heat-cell.void { cursor: default; color: var(--text-3); background: rgba(255, 255, 255, 0.025); }
.heat-cell.void:hover { transform: none; border-color: rgba(122, 150, 186, 0.1); }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: 12px; }
.heat-scale { display: flex; gap: 3px; }
.heat-scale i { width: 20px; height: 9px; border-radius: 3px; }

/* ---------------------------------------------------------------- 图表 */

.chart-box { position: relative; }
.chart-cap { font-size: 11.5px; color: var(--text-3); }
canvas { display: block; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.legend .item { display: flex; align-items: center; gap: 7px; }
.legend .swatch { width: 9px; height: 9px; border-radius: 3px; }
.legend b { font-family: var(--mono); color: var(--text); font-weight: 600; }

.formula {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2); background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono); font-size: 15px;
}
.formula .op { color: var(--text-3); }
.formula .term { padding: 2px 8px; border-radius: 6px; }
.formula .term.raw { color: #d6f7fa; background: var(--cyan-soft); }
.formula .term.trust { color: #f6e0b8; background: var(--gold-soft); }
.formula .term.health { color: #ffd3cc; background: var(--cinnabar-soft); font-weight: 600; }

.verdict-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}
.verdict-banner.pass { border-color: rgba(67, 181, 129, 0.45); background: linear-gradient(120deg, rgba(67, 181, 129, 0.16), rgba(255, 255, 255, 0.02)); }
.verdict-banner.fail { border-color: rgba(224, 74, 58, 0.5); background: linear-gradient(120deg, rgba(224, 74, 58, 0.18), rgba(255, 255, 255, 0.02)); }
.verdict-banner.abort { border-color: rgba(212, 162, 78, 0.5); background: linear-gradient(120deg, rgba(212, 162, 78, 0.16), rgba(255, 255, 255, 0.02)); }
.verdict-big { font-size: 26px; font-weight: 700; letter-spacing: 0.08em; }
.verdict-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-2); }
.verdict-meta b { font-family: var(--mono); color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- 表单 */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); letter-spacing: 0.04em; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px;
  background: rgba(7, 11, 17, 0.72); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 9px;
  font-family: var(--sans); font-size: 13.5px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: rgba(57, 197, 207, 0.6); box-shadow: 0 0 0 3px rgba(57, 197, 207, 0.13); background: rgba(9, 14, 21, 0.9); }
select.input { appearance: none; cursor: pointer; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--panel-solid); color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { min-width: 150px; }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 30px; }
.search-wrap::before { content: "⌕"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; }

.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 268px; overflow: auto;
  background: rgba(10, 15, 22, 0.98); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 4px;
}
.combo-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.combo-item:hover, .combo-item.is-active { background: rgba(57, 197, 207, 0.13); }
.combo-item .rid { font-family: var(--mono); font-size: 12px; color: var(--text); }
.combo-item .rmeta { margin-left: auto; color: var(--text-3); font-size: 11px; }
.combo-empty { padding: 10px; color: var(--text-3); font-size: 12.5px; text-align: center; }

.form-error {
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid rgba(224, 74, 58, 0.5); background: var(--cinnabar-soft);
  color: #ffd3cc; font-size: 12.5px; word-break: break-word;
}
.form-note { font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- 登录页 */

.login-shell { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; min-height: calc(100vh - 130px); }
.hero { display: flex; flex-direction: column; gap: 20px; padding: 10px 6px; }
.hero-mark { display: flex; align-items: center; gap: 16px; }
.hero-title { margin: 0; font-size: 44px; line-height: 1.1; letter-spacing: 0.1em; font-weight: 700; }
.hero-title .en { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.6em; color: var(--gold); margin-top: 10px; }
.hero-tag { font-size: 17px; color: var(--text); letter-spacing: 0.02em; }
.hero-tag .sep { color: var(--cinnabar); margin: 0 8px; }
.hero-desc { color: var(--text-2); font-size: 13.5px; max-width: 60ch; }
.hero-feats { display: grid; gap: 10px; }
.hero-feat { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.hero-feat .tick { color: var(--cyan); font-family: var(--mono); flex: 0 0 auto; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; padding-top: 8px; border-top: 1px solid var(--line); }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat b { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--text); }
.hero-stat span { font-size: 12px; color: var(--text-3); }
.hero-line { position: relative; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--cinnabar), var(--gold), transparent); overflow: hidden; }
.hero-line::after { content: ""; position: absolute; top: 0; bottom: 0; width: 90px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent); animation: sweep 3.6s var(--ease) infinite; }
@keyframes sweep { 0% { left: -90px; } 100% { left: 100%; } }

.login-card { padding: 26px; }
.login-card .field + .field { margin-top: 14px; }
.login-submit { width: 100%; margin-top: 18px; padding: 11px; font-size: 14px; }
.facet-status { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.facet-status .url { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- 骨架 / 空态 / 错误 */

.sk { border-radius: 7px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)); background-size: 220% 100%; animation: shimmer 1.5s infinite linear; }
.sk.line { height: 11px; margin: 7px 0; }
.sk.line.w40 { width: 40%; } .sk.line.w60 { width: 60%; } .sk.line.w80 { width: 80%; }
.sk.block { height: 96px; }
.sk.card-sk { height: 128px; }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

.empty, .error-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 20px; text-align: center; color: var(--text-3); font-size: 13px;
  border: 1px dashed var(--line-2); border-radius: var(--radius); background: rgba(255, 255, 255, 0.015);
}
.empty .big, .error-box .big { font-size: 26px; color: var(--line-3); font-family: var(--mono); }
.error-box { border-style: solid; border-color: rgba(224, 74, 58, 0.42); background: var(--cinnabar-soft); color: #ffd8d2; }
.error-box .big { color: var(--cinnabar); }
.banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid rgba(224, 74, 58, 0.45); background: var(--cinnabar-soft); color: #ffd8d2;
}
.banner.warn { border-color: rgba(212, 162, 78, 0.45); background: var(--gold-soft); color: #f7e3bd; }
.banner.info { border-color: rgba(57, 197, 207, 0.4); background: var(--cyan-soft); color: #d3f5f8; }

/* ---------------------------------------------------------------- Toast / Tooltip / Modal */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: rgba(13, 18, 26, 0.96); border: 1px solid var(--line-2); border-left: 3px solid var(--cyan);
  box-shadow: var(--shadow); font-size: 13px;
  animation: toastIn 0.28s var(--ease) both;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--cinnabar); }
.toast.warn { border-left-color: var(--gold); }
.toast.out { animation: toastOut 0.24s var(--ease) both; }
.toast .t-body { flex: 1 1 auto; word-break: break-word; }
.toast .t-close { cursor: pointer; color: var(--text-3); background: none; border: 0; font-size: 15px; line-height: 1; padding: 0 2px; }
.toast .t-close:hover { color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

.tooltip {
  position: fixed; z-index: 95; pointer-events: none;
  max-width: 320px; padding: 8px 11px; border-radius: 8px;
  background: rgba(8, 12, 18, 0.97); border: 1px solid var(--line-3);
  box-shadow: var(--shadow); font-size: 12px; color: var(--text-2);
}
.tooltip b { color: var(--text); font-family: var(--mono); }

.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 26px; background: rgba(4, 6, 10, 0.66); backdrop-filter: blur(3px); animation: fadeIn 0.2s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(980px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(17, 24, 34, 0.99), rgba(12, 17, 25, 0.99));
  border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: modalIn 0.26s var(--ease) both;
}
.modal.wide { width: min(1220px, 100%); }
.modal.narrow { width: min(560px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.modal-title .sub { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-weight: 400; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02);
  cursor: pointer; transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.file-item:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.045); }
.file-item.is-open { border-color: rgba(57, 197, 207, 0.5); background: var(--cyan-soft); }
.file-item .fname { font-family: var(--mono); font-size: 12.5px; }
.file-item .fsize { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }

/* ---------------------------------------------------------------- 折叠 / 分组 */

details.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
details.acc + details.acc { margin-top: 12px; }
details.acc > summary {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer;
  list-style: none; transition: background 0.16s var(--ease);
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary:hover { background: rgba(255, 255, 255, 0.03); }
details.acc > summary::after { content: "＋"; margin-left: auto; color: var(--text-3); font-family: var(--mono); }
details.acc[open] > summary::after { content: "－"; color: var(--cyan); }
details.acc[open] > summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 14px 16px; }
.acc-dom { font-family: var(--mono); color: var(--gold); font-size: 13px; }
.acc-name { font-weight: 600; font-size: 13.5px; }
.acc-desc { color: var(--text-2); font-size: 12.5px; }
.acc-count { margin-left: auto; }

.point-row { display: grid; grid-template-columns: 132px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgba(122, 150, 186, 0.08); }
.point-row:last-child { border-bottom: 0; }
.point-id { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.point-name { font-size: 13px; }
.point-note { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.point-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.spec-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.spec-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: rgba(255, 255, 255, 0.018); }
.spec-block h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; }
.spec-kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; font-size: 12.5px; }
.spec-kv .k { color: var(--text-3); word-break: break-all; }
.spec-kv .v { font-family: var(--mono); color: var(--text); text-align: right; word-break: break-all; }

/* ---------------------------------------------------------------- 页脚 */

.footer {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 22px 26px; margin: 0 auto; max-width: 1520px;
  font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line);
}
.footer-model { font-family: var(--mono); color: var(--gold); }
.footer-right { margin-left: auto; }

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .login-shell { grid-template-columns: 1fr; gap: 26px; }
  .hero-title { font-size: 34px; }
  .grid.two { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 150px 1fr 92px; }
  .footer-right { display: none; }
}
@media (max-width: 760px) {
  .view { padding: 16px 13px 30px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .facet-chip .facet-label { display: none; }
  .rank-row { grid-template-columns: 78px 1fr 74px; }
  .point-row { grid-template-columns: 1fr; }
  .point-meta { justify-content: flex-start; }
  .kv { grid-template-columns: 1fr; }
}

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