/* =========================================================================
   标注 / 质检 实时进度大屏
   ========================================================================= */

:root {
  --bg: #05090f;
  --panel: rgba(15, 24, 41, 0.86);
  --panel-2: rgba(10, 17, 31, 0.9);
  --line: rgba(90, 160, 230, 0.16);
  --line-soft: rgba(120, 170, 220, 0.1);
  --text: #e8f1ff;
  --muted: #7f93ad;
  --ann: #22d3ee;
  --qc: #a78bfa;
  --i2: #60a5fa;
  --acc: #fbbf24;
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] { display: none; }

#app {
  position: relative;
  max-width: 2100px;
  margin: 0 auto;
  padding: 18px 26px 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --------------------------------------------------------- 背景装饰 */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(34, 211, 238, 0.13), transparent 62%),
    radial-gradient(900px 560px at 92% 0%, rgba(167, 139, 250, 0.13), transparent 60%),
    radial-gradient(1200px 700px at 50% 115%, rgba(59, 130, 246, 0.12), transparent 65%),
    linear-gradient(180deg, #05090f 0%, #060c16 45%, #04070d 100%);
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 180, 240, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 240, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 12%, transparent 78%);
}

#app > *:not(.bg-grid):not(.detail-mask) { position: relative; z-index: 1; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 2px 14px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 16px; }

.logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.24), rgba(167, 139, 250, 0.22));
  border: 1px solid rgba(125, 211, 252, 0.35);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 10px;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.25);
}

.logo span {
  border-radius: 2px;
  background: linear-gradient(140deg, #67e8f9, #22d3ee);
  animation: blink 3.2s ease-in-out infinite;
}
.logo span:nth-child(2) { animation-delay: .4s; background: linear-gradient(140deg, #c4b5fd, #a78bfa); }
.logo span:nth-child(3) { animation-delay: .8s; background: linear-gradient(140deg, #c4b5fd, #a78bfa); }
.logo span:nth-child(4) { animation-delay: 1.2s; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.brand-text h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 1.5px;
  font-weight: 650;
  background: linear-gradient(92deg, #e8f6ff 12%, #7dd3fc 52%, #c4b5fd 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text .sub {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .4px;
}
.brand-text .sub b { color: #a5e8ff; font-weight: 600; }

.top-right { display: flex; align-items: center; gap: 16px; }

.source-chips { display: flex; gap: 8px; }

.src-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #a9c2dc;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(30, 48, 74, 0.6);
  border: 1px solid var(--line);
}
.src-chip em { font-style: normal; color: #6f89a6; }
.src-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.src-chip.bad { border-color: rgba(248, 113, 113, .5); color: #fca5a5; }
.src-chip.bad .dot { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.clock { text-align: right; line-height: 1.15; }
.clock .time {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #eaf6ff;
  text-shadow: 0 0 20px rgba(56, 189, 248, .35);
}
.clock .date { font-size: 11.5px; color: var(--muted); letter-spacing: .6px; }

.refresh { position: relative; width: 44px; height: 44px; }
.refresh .ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.refresh .ring-bg { fill: none; stroke: rgba(120, 170, 220, 0.16); stroke-width: 3; }
.refresh .ring-fg {
  fill: none;
  stroke: url(#g);
  stroke: #22d3ee;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset .95s linear;
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, .7));
}
.refresh .ring-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #9fe9ff;
  font-weight: 600;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 28, 46, 0.75);
  color: #a9c2dc;
}
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.conn.ok { border-color: rgba(52, 211, 153, .38); color: #86efac; }
.conn.ok .dot { animation: pulse 2s ease-in-out infinite; }
.conn.warn { border-color: rgba(251, 191, 36, .42); color: #fcd34d; }
.conn.warn .dot { background: var(--warn); box-shadow: 0 0 9px var(--warn); }
.conn.bad { border-color: rgba(248, 113, 113, .45); color: #fca5a5; }
.conn.bad .dot { background: var(--bad); box-shadow: 0 0 9px var(--bad); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .55; }
}

/* ------------------------------------------------------------ KPI 卡片 */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
}

.kpi {
  position: relative;
  padding: 14px 16px 13px;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(20, 32, 53, 0.92), rgba(9, 15, 27, 0.92));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 26px -18px rgba(0, 0, 0, .9);
  overflow: hidden;
  transition: border-color .3s, transform .3s;
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(120, 170, 220, .25);
}
.kpi.accent-ann::before { background: linear-gradient(180deg, var(--ann), transparent); }
.kpi.accent-qc::before { background: linear-gradient(180deg, var(--qc), transparent); }
.kpi.accent-done::before { background: linear-gradient(180deg, var(--ok), transparent); }
.kpi.accent-eta::before { background: linear-gradient(180deg, var(--acc), transparent); }

.kpi-label { font-size: 12px; color: var(--muted); letter-spacing: .6px; }

.kpi-value {
  margin-top: 7px;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: .5px;
  color: #f2f9ff;
}
.kpi-value small {
  font-size: 12.5px;
  font-weight: 400;
  color: #6f89a6;
  margin-left: 6px;
  letter-spacing: 0;
}
.kpi-value-clock { font-size: 25px; color: #fde68a; text-shadow: 0 0 18px rgba(251, 191, 36, .32); }

.kpi-bar {
  margin-top: 10px;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .16);
  overflow: hidden;
}
.kpi-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .8s cubic-bezier(.22, .61, .36, 1);
}
.accent-ann .kpi-bar i { background: linear-gradient(90deg, rgba(34, 211, 238, .5), var(--ann)); }
.accent-qc .kpi-bar i { background: linear-gradient(90deg, rgba(167, 139, 250, .5), var(--qc)); }
.accent-done .kpi-bar i { background: linear-gradient(90deg, rgba(52, 211, 153, .5), var(--ok)); }

.kpi-foot {
  margin-top: 8px;
  font-size: 11.5px;
  color: #7d93ae;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-pair { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: #cfe2f5; }
.kpi-pair > div { display: flex; align-items: center; gap: 7px; }

.tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: .5px;
}
.tag-ann { color: #67e8f9; background: rgba(34, 211, 238, .14); border: 1px solid rgba(34, 211, 238, .3); }
.tag-qc { color: #c4b5fd; background: rgba(167, 139, 250, .14); border: 1px solid rgba(167, 139, 250, .3); }

/* --------------------------------------------------------- 工作流区块 */

.wf-wrap { flex: 1; display: flex; flex-direction: column; gap: 12px; }

.wf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.wf-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #d7e8fb;
}
.wf-head h2 em {
  font-style: normal;
  margin-left: 8px;
  font-size: 12px;
  color: #0b1220;
  background: linear-gradient(120deg, #67e8f9, #a78bfa);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.wf-legend { display: flex; gap: 16px; font-size: 11.5px; color: #8298b3; }
.wf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.lg-ann { background: var(--ann); box-shadow: 0 0 8px rgba(34, 211, 238, .7); }
.lg-qc { background: var(--qc); box-shadow: 0 0 8px rgba(167, 139, 250, .7); }
.lg-i2 { background: var(--i2); }
.lg-acc { background: var(--acc); }

.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 15px;
  align-content: start;
}

.wf-card {
  position: relative;
  padding: 15px 17px 13px;
  border-radius: 16px;
  background: linear-gradient(168deg, rgba(19, 30, 50, 0.94), rgba(9, 15, 26, 0.95));
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px -26px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, .045);
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
  animation: cardIn .45s ease both;
}

.wf-card:hover {
  transform: translateY(-3px);
  border-color: rgba(103, 232, 249, .38);
  box-shadow: 0 22px 40px -24px rgba(0, 0, 0, 1), 0 0 0 1px rgba(103, 232, 249, .12), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.wf-card.finished { opacity: .82; }
.wf-card.finished::after {
  content: "已完成";
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 10.5px;
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, .4);
  background: rgba(52, 211, 153, .1);
  border-radius: 999px;
  padding: 2px 8px;
  display: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.wf-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.wf-title { min-width: 0; }
.wf-title h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #f0f8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-meta {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: #7590ad;
  flex-wrap: wrap;
}
.wf-meta .badge {
  color: #7dd3fc;
  background: rgba(56, 189, 248, .12);
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 6px;
  padding: 1px 7px;
  letter-spacing: .5px;
}

.wf-state {
  flex: none;
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #9fb6cf;
  background: rgba(30, 48, 74, .5);
  white-space: nowrap;
}
.wf-state.st-ann { color: #67e8f9; border-color: rgba(34, 211, 238, .4); background: rgba(34, 211, 238, .1); }
.wf-state.st-qc { color: #c4b5fd; border-color: rgba(167, 139, 250, .4); background: rgba(167, 139, 250, .1); }
.wf-state.st-done { color: #6ee7b7; border-color: rgba(52, 211, 153, .42); background: rgba(52, 211, 153, .1); }

.wf-overall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 11px;
  background: linear-gradient(120deg, rgba(34, 211, 238, .07), rgba(167, 139, 250, .07));
  border: 1px solid var(--line-soft);
}
.wf-overall-num { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: #7f97b2; }
.wf-overall-num b { font-size: 22px; color: #eaf6ff; font-weight: 650; letter-spacing: .5px; }
.wf-overall-num em {
  font-style: normal;
  margin-left: 4px;
  font-size: 12px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, .12);
  padding: 1px 7px;
  border-radius: 6px;
}

.spark { width: 120px; height: 26px; flex: none; overflow: visible; }
.spark path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark-ann { stroke: rgba(34, 211, 238, .85); }
.spark-done { stroke: rgba(52, 211, 153, .8); }

/* ------------------------------------------------------------ 阶段进度 */

.stage { display: flex; flex-direction: column; gap: 6px; }

.stage-head { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.stage-name { display: inline-flex; align-items: center; gap: 6px; color: #c3d7ea; letter-spacing: .4px; }
.stage-num { color: #93a9c2; margin-left: auto; }
.stage-num b { color: #f0f8ff; font-size: 14px; font-weight: 650; }
.stage-num .muted { color: #62798f; }
.stage-pct { font-size: 13px; font-weight: 650; letter-spacing: .3px; }

.bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
}
.bar-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  transition: width .85s cubic-bezier(.22, .61, .36, 1);
  box-shadow: 0 0 12px rgba(56, 189, 248, .45);
  overflow: hidden;
}
.bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%);
  animation: shine 2.6s ease-in-out infinite;
}
@keyframes shine {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(220%); }
}

.stage-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: #6f88a3;
  letter-spacing: .2px;
}
.stage-sub b { color: #b9cee2; font-weight: 600; }

/* --------------------------------------------------------- 迷你指标行 */

.wf-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(9, 16, 28, .6);
  border: 1px solid var(--line-soft);
}
.mini { display: flex; flex-direction: column; gap: 3px; }
.mini-label { font-size: 10.5px; color: #6c839c; letter-spacing: .3px; }
.mini-value { font-size: 15px; font-weight: 600; color: #d9e9f8; }

/* ------------------------------------------------------------ 预计完成 */

.wf-eta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-soft);
}
.eta-line { display: flex; align-items: center; gap: 9px; font-size: 12px; white-space: nowrap; }
.eta-key { flex: none; width: 92px; color: #7c93ad; }
.eta-key.eta-ann { color: #4fd6ea; }
.eta-key.eta-qc { color: #b9a5fb; }
.eta-val {
  font-size: 14px;
  font-weight: 650;
  color: #ffe9a8;
  letter-spacing: .6px;
  text-shadow: 0 0 14px rgba(251, 191, 36, .28);
}
.eta-rest { color: #6f88a3; font-size: 11.5px; margin-left: auto; white-space: nowrap; }

/* ------------------------------------------------------------- 空状态 */

.empty {
  flex: 1;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(12, 20, 34, .5);
  color: #8aa2bb;
}
.empty-icon { font-size: 42px; color: rgba(103, 232, 249, .5); animation: pulse 2.6s ease-in-out infinite; }
.empty p { margin: 0; font-size: 14px; }
.empty-sub { font-size: 12px; color: #64798f; }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 10px 2px 4px;
  font-size: 11px;
  color: #5f7488;
  border-top: 1px solid var(--line-soft);
  letter-spacing: .3px;
}
.footer code {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color: #8fb7d6;
  background: rgba(56, 189, 248, .08);
  padding: 1px 6px;
  border-radius: 5px;
}
.footer .token { color: #7f97b2; }
.footer .mock-flag {
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, .4);
  background: rgba(251, 191, 36, .1);
  border-radius: 999px;
  padding: 1px 9px;
}

/* ------------------------------------------------------ 实测 / 估算标签 */

.measured,
.estimated {
  font-style: normal;
  font-size: 9.5px;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: 1px;
}
.measured {
  color: #6ee7b7;
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .32);
}
.estimated {
  color: #9fb3c8;
  background: rgba(148, 163, 184, .12);
  border: 1px solid rgba(148, 163, 184, .3);
}

.wf-stages { display: flex; flex-direction: column; gap: 11px; }

/* --------------------------------------------------------- 详情入口按钮 */

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

.detail-btn {
  border: 1px solid rgba(103, 232, 249, .32);
  background: rgba(34, 211, 238, .1);
  color: #9fe9ff;
  font-family: inherit;
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.detail-btn:hover {
  background: rgba(34, 211, 238, .2);
  border-color: rgba(103, 232, 249, .6);
  color: #eaf7ff;
  box-shadow: 0 0 14px rgba(34, 211, 238, .25);
}

/* ------------------------------------------------------------- 详情面板 */

.detail-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 14, .74);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease both;
}

.detail {
  width: min(1180px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(168deg, rgba(17, 27, 45, .98), rgba(8, 13, 23, .99));
  border: 1px solid rgba(103, 232, 249, .22);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(103, 232, 249, .06);
  animation: popIn .22s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.detail-title h2 { margin: 0; font-size: 19px; letter-spacing: .5px; color: #f0f8ff; }
.detail-sub {
  margin: 6px 0 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #7590ad;
}
.detail-sub .badge {
  color: #7dd3fc;
  background: rgba(56, 189, 248, .12);
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 6px;
  padding: 1px 7px;
}
.detail-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.detail-live { font-size: 11.5px; color: #7f93ad; }
.detail-live.ok { color: #6ee7b7; }

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(30, 48, 74, .55);
  color: #b6cde2;
  font-family: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}
.ghost-btn:hover:not(:disabled) {
  color: #eaf7ff;
  border-color: rgba(103, 232, 249, .45);
  background: rgba(34, 211, 238, .12);
}
.ghost-btn:disabled { opacity: .4; cursor: not-allowed; }

.detail-scroll {
  padding: 16px 20px 20px;
  overflow: auto;
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fca5a5;
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .3);
  font-size: 12.5px;
}

.detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dk {
  position: relative;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 21, 36, .75);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dk > span { font-size: 11.5px; color: #7590ad; }
.dk b { font-size: 22px; font-weight: 650; color: #eaf6ff; letter-spacing: .5px; }
.dk b i { font-style: normal; font-size: 12px; color: #6f89a6; margin-left: 4px; }
.dk b.small { font-size: 13px; font-weight: 500; color: #cfe2f5; }
.dk em { position: absolute; right: 14px; top: 12px; font-style: normal; font-size: 12px; }
.dk-ann em { color: #67e8f9; }
.dk-qc em { color: #c4b5fd; }
.dk-eta b.small { color: #ffe9a8; }

.chart-panel,
.task-panel {
  border-radius: 14px;
  background: rgba(10, 17, 29, .7);
  border: 1px solid var(--line-soft);
  padding: 14px 16px 10px;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.chart-head.second { margin-top: 14px; }
.chart-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: #d7e8fb; letter-spacing: .5px; }
.chart-head h3 em {
  font-style: normal;
  margin-left: 6px;
  font-size: 11px;
  color: #0b1220;
  background: linear-gradient(120deg, #67e8f9, #a78bfa);
  padding: 1px 8px;
  border-radius: 999px;
}
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: #8298b3; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

.chart { width: 100%; height: 180px; display: block; }
.chart-speed { height: 132px; }
.chart .grid line { stroke: rgba(120, 170, 220, .12); stroke-width: 1; }
.chart .axis text { fill: #6f88a3; font-size: 11px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.dashed { stroke-dasharray: 5 4; opacity: .9; }
.chart-empty { padding: 22px 0; text-align: center; font-size: 12px; color: #6f88a3; }

.table-wrap {
  overflow: auto;
  max-height: 340px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
}
.task-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.task-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0d1522;
  color: #7f93ad;
  font-weight: 500;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.task-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(120, 170, 220, .07);
  color: #c3d7ea;
  white-space: nowrap;
}
.task-table tbody tr:hover td { background: rgba(34, 211, 238, .05); }
.task-table .num { text-align: right; }
.task-table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; color: #93a9c2; }
.task-table .name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.task-table .empty-row { text-align: center; color: #6f88a3; padding: 18px; }

.st { font-size: 10.5px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: #9fb6cf; }
.st-1 { color: #67e8f9; border-color: rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .1); }
.st-2 { color: #c4b5fd; border-color: rgba(167, 139, 250, .35); background: rgba(167, 139, 250, .1); }
.st-3 { color: #93c5fd; border-color: rgba(96, 165, 250, .35); background: rgba(96, 165, 250, .1); }
.st-4 { color: #fcd34d; border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .1); }
.st-5 { color: #6ee7b7; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .1); }

.flag {
  font-style: normal;
  margin-left: 6px;
  font-size: 9.5px;
  padding: 0 5px;
  border-radius: 4px;
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .1);
}
.flag.warn { color: #fcd34d; border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .1); }

.pager { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #8298b3; }
/* ------------------------------------------------------------- 响应式 */

@media (max-width: 1560px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  #app { padding: 14px 14px 8px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .top-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .wf-mini { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------- 可靠度 / 设置面板 */

.rel {
  font-style: normal;
  font-size: 9.5px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 4px;
  vertical-align: 1px;
}
.rel-high { color: #6ee7b7; background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .35); }
.rel-mid { color: #fcd34d; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .35); }
.rel-low { color: #fca5a5; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); }

.hint { margin: 4px 0 0; font-size: 11px; color: #6f88a3; }
.hint.warn { color: #fcd34d; }
.hint code { background: rgba(56, 189, 248, .1); padding: 1px 5px; border-radius: 4px; color: #8fb7d6; }

.settings-panel { width: min(860px, 96vw); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-grid label,
.token-block label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: #7f93ad;
}
.settings-grid input,
.token-block input {
  background: rgba(9, 16, 28, .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #e8f1ff;
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  outline: none;
}
.settings-grid input:focus,
.token-block input:focus { border-color: rgba(103, 232, 249, .5); }
.settings-grid input:disabled,
.token-block input:disabled { opacity: .55; cursor: not-allowed; }

.token-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.token-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 21, 36, .75);
  border: 1px solid var(--line-soft);
}
.token-block h4 { margin: 0; font-size: 13px; font-weight: 600; color: #d7e8fb; }
.token-block h4 em { font-style: normal; color: #6f88a3; font-size: 11px; }

.settings-actions { display: flex; align-items: center; gap: 12px; }

.primary-btn {
  border: 1px solid rgba(103, 232, 249, .45);
  background: linear-gradient(120deg, rgba(34, 211, 238, .22), rgba(167, 139, 250, .22));
  color: #eaf7ff;
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 16px;
  border-radius: 9px;
  cursor: pointer;
}
.primary-btn:hover { box-shadow: 0 0 16px rgba(34, 211, 238, .3); }

.log-panel { border-radius: 12px; background: rgba(10, 17, 29, .7); border: 1px solid var(--line-soft); padding: 12px 14px; }
.log-lines {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  color: #9fb3c8;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 860px) {
  .settings-grid, .token-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------- 停滞预警 / 显示已完成 */

.wf-head-right { display: flex; align-items: center; gap: 18px; }

.head-alert {
  margin-left: 10px;
  font-size: 11.5px;
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .12);
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: 2px;
  animation: alertPulse 1.8s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(248, 113, 113, 0); }
  50% { box-shadow: 0 0 14px rgba(248, 113, 113, .45); }
}

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: #8298b3; cursor: pointer; }
.switch input { accent-color: #22d3ee; width: 14px; height: 14px; cursor: pointer; }
.switch i { font-style: normal; color: #6f88a3; }

.wf-card.alert {
  border-color: rgba(248, 113, 113, .5);
  box-shadow: 0 16px 34px -26px rgba(0, 0, 0, 1), 0 0 0 1px rgba(248, 113, 113, .18), inset 0 1px 0 rgba(255, 255, 255, .045);
}
.wf-card.alert::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(248, 113, 113, .10), transparent 45%);
}

.wf-alert {
  font-size: 11px;
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, .45);
  background: rgba(248, 113, 113, .12);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  animation: alertPulse 1.8s ease-in-out infinite;
}

.alert-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 21, 36, .75);
  border: 1px solid var(--line-soft);
}
.alert-block h4 { margin: 0; font-size: 13px; font-weight: 600; color: #d7e8fb; }

/* ------------------------------------------------- 任务明细筛选条 */

.task-count { margin-left: 8px; font-size: 11px; color: #7f93ad; font-weight: 400; }

.task-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 10px;
  border-bottom: 1px dashed var(--line-soft);
  margin-bottom: 8px;
}
.task-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #7f93ad; }
.task-filters label.grow { flex: 1; min-width: 180px; }
.task-filters select,
.task-filters input {
  background: rgba(9, 16, 28, .9);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #e8f1ff;
  font-family: inherit;
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  min-width: 120px;
}
.task-filters select:focus,
.task-filters input:focus { border-color: rgba(103, 232, 249, .5); }

/* 待处理（按任务总数口径） */
.sub-pending { color: #93a9c2; }
.sub-pending .upstream { font-style: normal; color: #6f88a3; font-size: 10px; margin-left: 2px; }
