/* ============================================================
   ServerLab 3D 测试沙盘 —— 暗色控制台风格
   ============================================================ */
:root {
  --bg: #070b12;
  --panel: rgba(11, 16, 26, .92);
  --line: #1a2434;
  --txt: #cbd5e1;
  --dim: #64748b;
  --accent: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --mono: 'Cascadia Mono', Consolas, 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--txt);
  font-family: system-ui, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-size: 13px;
}

/* ---------- 顶栏 ---------- */
#topbar {
  height: 54px; flex: none; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 21, .95); z-index: 10;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: .5px; white-space: nowrap; }
.brand .mark {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  box-shadow: 0 0 10px rgba(34, 211, 238, .6);
}
.brand em { font-style: normal; color: var(--dim); font-weight: 400; margin-left: 6px; }
.dev { flex: 1; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
button {
  background: #101a29; color: var(--txt); border: 1px solid #24334a;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  transition: border-color .15s, background .15s;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost.on { color: var(--accent); border-color: #1e4553; }
#btn-full {
  font-weight: 700; color: #06131a;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9); border: none;
}
#btn-full:hover { filter: brightness(1.12); }
.chk { color: var(--dim); font-size: 12px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--err); vertical-align: -2px; }
.model-sel {
  background: #101a29; color: var(--accent); border: 1px solid #1e4553;
  padding: 6px 8px; border-radius: 8px; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.model-sel:hover { border-color: var(--accent); }
#fault-badge {
  color: var(--err); border: 1px solid #7f1d1d; background: #1f1212;
  padding: 3px 10px; border-radius: 20px; font-size: 11.5px;
  animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: .55; } }

/* ---------- 主体 ---------- */
main { flex: 1; display: flex; min-height: 0; }
aside { background: var(--panel); z-index: 5; }
#left { width: 352px; flex: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; }
#right { width: 408px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-title {
  font-size: 11.5px; color: var(--dim); letter-spacing: 1.5px;
  padding: 4px 2px 8px; user-select: none;
}
.panel-title .live { color: var(--err); animation: blink 1.4s infinite; font-size: 9px; }

#stage { flex: 1; position: relative; min-width: 0; }
#stage canvas { display: block; cursor: grab; }

/* 部件标注（CSS2D 层，标注开关用 body.labels-off 控制） */
.tag {
  transform: translate(-50%, -130%); transition: opacity .3s;
  background: rgba(8, 12, 20, .88); border: 1px solid #24334a; border-radius: 6px;
  padding: 1px 7px; font-size: 10.5px; white-space: nowrap;
  display: flex; align-items: center; gap: 5px; pointer-events: none;
}
body.labels-off .tag { opacity: 0; }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: #475569; }
.tag.testing .dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: blink .8s infinite; }
.tag.pass .dot { background: var(--ok); }
.tag.warn .dot { background: var(--warn); }
.tag.testing { border-color: #155e75; color: var(--accent); }
.tag.warn { border-color: #78350f; color: var(--warn); }

/* ---------- 部件清单 ---------- */
.row {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 9px; cursor: pointer; border: 1px solid transparent;
}
.row:hover { background: #0f1929; }
.row.active { background: #101d2e; border-color: #1e4553; }
.row .dot { width: 8px; height: 8px; border-radius: 50%; background: #3b4759; flex: none; }
.row.testing .dot { background: var(--accent); animation: blink .7s infinite; }
.row.pass .dot { background: var(--ok); }
.row.warn .dot { background: var(--warn); }
.row > div { flex: 1; min-width: 0; }
.row b { display: block; font-size: 12.5px; }
.row em { font-style: normal; color: var(--dim); font-size: 10.5px; }
.chip {
  font-size: 10.5px; color: var(--dim); border: 1px solid #233149;
  border-radius: 12px; padding: 1px 8px; white-space: nowrap;
}
.chip.pass { color: var(--ok); border-color: #14532d; }
.chip.warn { color: var(--warn); border-color: #78350f; }
.chip.testing { color: var(--accent); border-color: #155e75; }

/* ---------- 详情 / 测试卡片 ---------- */
.d-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 2px 6px; }
.d-head b { font-size: 14px; }
.d-head em { font-style: normal; color: var(--dim); font-size: 11px; flex: 1; }
.d-desc { color: #8fa0b5; font-size: 12px; line-height: 1.5; padding-bottom: 8px; }
.test {
  background: #0d1420; border: 1px solid #1b2738; border-radius: 11px;
  padding: 10px 11px; margin-bottom: 10px;
}
.test.warn { border-color: #6d4410; }
.t-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.t-head b { font-size: 12.5px; }
.ext {
  font-style: normal; font-size: 10px; color: #c4b5fd;
  border: 1px solid #4c3a86; border-radius: 4px;
  padding: 0 5px; margin-left: 6px; vertical-align: 1px;
}
.t-spec { font-size: 11px; color: #7dd3fc; margin-bottom: 6px; }
.t-spec span {
  color: var(--dim); font-size: 10px; border: 1px solid #233149;
  border-radius: 4px; padding: 0 5px; margin-right: 6px;
}
.chip.fail { color: var(--err); border-color: #7f1d1d; }
.row.fail .dot { background: var(--err); }
.tag.fail { border-color: #7f1d1d; color: var(--err); }
.tag.fail .dot { background: var(--err); }
.test.fail { border-color: #7f1d1d; }
.test.fail .t-note { color: var(--err); background: #170d0d; border-color: #5c1a1a; }
.t-tool {
  display: block; font-family: var(--mono); font-size: 10.5px; color: #7dd3fc;
  background: #0a0f18; border-radius: 6px; padding: 5px 8px; margin: 4px 0 7px;
  word-break: break-all;
}
.t-criteria { font-size: 11.5px; color: #8fa0b5; line-height: 1.5; margin-bottom: 7px; }
.t-criteria span {
  color: var(--dim); font-size: 10px; border: 1px solid #233149;
  border-radius: 4px; padding: 0 5px; margin-right: 6px;
}
.t-metrics { display: grid; gap: 5px; margin-bottom: 6px; }
.metric {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  background: #0a111d; border-left: 3px solid var(--ok);
  padding: 5px 9px; border-radius: 5px;
}
.metric span { color: var(--dim); font-size: 11px; }
.metric b { font-size: 11.5px; text-align: right; }
.metric.bad { border-left-color: var(--warn); }
.metric.bad b { color: var(--warn); }
.curve { margin: 6px 0; }
.curve em { font-style: normal; font-size: 10.5px; color: var(--dim); display: block; margin-bottom: 2px; }
.curve svg { width: 100%; background: #0a0f18; border-radius: 6px; }
.curve .gl { stroke: #1b2738; }
.curve .gt { fill: #546478; font-size: 8.5px; }
.curve .mk { stroke: var(--warn); stroke-dasharray: 3 3; }
.t-note {
  font-size: 11.5px; color: var(--warn); background: #17120a;
  border: 1px solid #4a330d; border-radius: 7px; padding: 7px 9px; margin-bottom: 7px;
  line-height: 1.5;
}
.run-one {
  width: 100%; background: #0e1a2a; border-color: #1e4553; color: #7dd3fc;
  font-size: 12px; padding: 6px;
}
.run-one:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

/* ---------- 终端 ---------- */
#right { position: relative; }
#term {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  background: #05080e; font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
}
#term-jump {
  position: absolute; right: 14px; bottom: 14px; z-index: 6;
  display: none; padding: 6px 12px; font-size: 12px; font-weight: 700;
  color: #06131a; background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  border: none; border-radius: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
#term-jump.show { display: inline-block; }
.ln { white-space: pre-wrap; word-break: break-all; display: flex; gap: 7px; }
.ln i { color: #31435c; font-style: normal; flex: none; }
.ln u { color: var(--accent); text-decoration: none; flex: none; }
.ln.cmd code { color: #7dd3fc; }
.ln.cmd { color: #7dd3fc; }
.ln.dim span { color: #55637a; }
.ln.info span { color: #9fb2c8; }
.ln.ok span { color: var(--ok); }
.ln.warn span { color: var(--warn); }
.ln.err span { color: var(--err); }
.ln.sep {
  color: var(--accent); font-weight: 700; margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed #1e3245; display: block;
}

/* ---------- 底部进度 ---------- */
#bottom {
  position: relative; z-index: 20;   /* z 高于内容层 .ld-wrap(2)，保证备案号可见 */
  height: 46px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; border-top: 1px solid var(--line); background: rgba(9, 13, 21, .95);
}
#progress { flex: 1; height: 6px; background: #101a29; border-radius: 4px; overflow: hidden; }
#bar {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  transition: width .45s ease; box-shadow: 0 0 8px rgba(34, 211, 238, .55);
}
#bar-label { color: var(--dim); font-size: 12px; white-space: nowrap; }
/* 工信部 ICP 备案号（首页底部中间位置，合规要求） */
#icp {
  position: absolute; left: 50%; transform: translateX(-50%);
  color: #8ea3bd; font-size: 12px; text-decoration: none; letter-spacing: .4px;
  z-index: 2;
}
#icp:hover { color: var(--accent); }

/* ---------- 悬停提示 ---------- */
#tip {
  position: fixed; z-index: 30; pointer-events: none;
  background: rgba(8, 12, 20, .95); border: 1px solid #24334a; border-radius: 8px;
  padding: 6px 10px; font-size: 12px;
}
#tip b { color: var(--accent); margin-right: 7px; }
#tip em { font-style: normal; color: var(--dim); font-size: 11px; }

/* ---------- 启动画面 ---------- */
#splash {
  position: fixed; inset: 0; z-index: 60; background: #05080e;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: opacity .7s;
}
#splash.bye { opacity: 0; pointer-events: none; }
.s-logo { font-size: 34px; font-weight: 800; letter-spacing: 2px; color: var(--accent); text-shadow: 0 0 24px rgba(34, 211, 238, .5); }
.s-sub { color: var(--dim); font-size: 13px; letter-spacing: 3px; }

/* ---------- 验收报告 ---------- */
#report-modal {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(2, 6, 12, .72); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; padding: 24px;
}
#report-modal.open { display: flex; }
#report {
  width: min(940px, 94vw); max-height: 92vh; overflow-y: auto;
  background: #f8fafc; color: #0f172a; border-radius: 14px; padding: 30px 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.r-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }
.r-actions button { background: #0f172a; color: #e2e8f0; border: none; }
.r-actions #btn-close { background: #e2e8f0; color: #0f172a; border: 1px solid #cbd5e1; }
#report-body h2 { font-size: 20px; margin-bottom: 10px; letter-spacing: 1px; }
.r-meta { font-size: 12px; color: #475569; line-height: 1.7; margin-bottom: 14px; }
.r-meta b { color: #0f172a; }
#report-body table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
#report-body th, #report-body td { border: 1px solid #cbd5e1; padding: 6px 8px; text-align: left; vertical-align: top; line-height: 1.5; }
#report-body th { background: #e2e8f0; white-space: nowrap; }
#report-body td:first-child { color: #64748b; }
#report-body .mono { font-family: var(--mono); font-size: 10.5px; }
#report-body .v { font-weight: 800; white-space: nowrap; }
#report-body .v.pass { color: #059669; }
#report-body .v.warn { color: #d97706; }
.r-sum { margin: 14px 0 4px; font-size: 13px; }
.r-sum b { color: #0f172a; }
.r-env { font-size: 12px; color: #475569; margin: 8px 0 12px; line-height: 1.7; }
.r-env b { color: #0f172a; }
.r-note { font-size: 12px; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 7px 10px; margin: 6px 0; line-height: 1.6; }
.r-note.fail { color: #b91c1c; background: #fee2e2; }
#report-body .v.fail { color: #dc2626; }
.r-ev { margin-top: 12px; font-size: 12px; }
.r-ev ul { margin: 6px 0 0 18px; color: #475569; }
.r-ev code { font-family: var(--mono); font-size: 10.5px; }

/* ---------- 回归对比 ---------- */
.regression { margin: 12px 0 4px; }
.regression summary {
  cursor: pointer; font-size: 12.5px; color: #0f172a; background: #eef2f7;
  border: 1px solid #cbd5e1; border-radius: 7px; padding: 7px 10px; user-select: none; list-style: none;
}
.regression summary::-webkit-details-marker { display: none; }
.regression summary::before { content: '▸ '; }
.regression[open] summary::before { content: '▾ '; }
.regression[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.regression table.rg { width: 100%; border-collapse: collapse; font-size: 11.5px; border: 1px solid #cbd5e1; border-top: none; }
.regression .rg th, .regression .rg td { border: 1px solid #e2e8f0; padding: 5px 8px; text-align: left; }
.regression .rg th { background: #f1f5f9; }
.regression .rg-d { font-weight: 700; white-space: nowrap; }
.regression .rg-d.reg { color: #dc2626; }
.regression .rg-d.fix { color: #059669; }
.regression .rg-d.add { color: #2563eb; }
.regression .rg-d.flat, .regression .rg-d.chg { color: #64748b; }
.regression .v.na { color: #94a3b8; }
.r-std { margin-top: 12px; font-size: 11.5px; color: #475569; line-height: 1.7; }
.r-std b { color: #0f172a; }
.r-sig { margin-top: 16px; font-size: 12px; color: #334155; display: flex; gap: 28px; border-top: 1px solid #e2e8f0; padding-top: 10px; }
.r-footnote { margin-top: 14px; font-size: 11px; color: #94a3b8; border-top: 1px dashed #cbd5e1; padding-top: 8px; }

/* ---------- 知识面板（用例折叠） ---------- */
.kb {
  margin: 8px 0; background: #0a1626; border: 1px solid #173048; border-radius: 9px;
  overflow: hidden;
}
.kb summary {
  cursor: pointer; padding: 7px 10px; font-size: 11.5px; color: #7dd3fc;
  user-select: none; list-style: none;
}
.kb summary::-webkit-details-marker { display: none; }
.kb summary::before { content: '▸ '; }
.kb[open] summary::before { content: '▾ '; }
.kb[open] summary { border-bottom: 1px solid #173048; }
.kb-row { display: flex; gap: 8px; padding: 7px 10px; border-top: 1px dashed #142636; }
.kb-row:first-of-type { border-top: none; }
.kb-row b { flex: none; width: 62px; font-size: 10.5px; color: var(--accent); padding-top: 1px; }
.kb-row span { font-size: 11px; color: #9fb2c8; line-height: 1.65; }

/* ---------- 站内搜索 ---------- */
#search-modal {
  position: fixed; inset: 0; z-index: 45; display: none;
  background: rgba(2, 6, 12, .6); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding-top: 96px;
}
#search-modal.open { display: flex; }
#search-panel {
  width: min(620px, 92vw); background: rgba(9, 14, 23, .97);
  border: 1px solid #1e4553; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
#search-input {
  width: 100%; padding: 14px 18px; font-size: 14px; color: var(--txt);
  background: #05080e; border: none; outline: none;
  border-bottom: 1px solid #1a2434; font-family: inherit;
}
#search-input::placeholder { color: var(--dim); }
#search-results { max-height: 380px; overflow-y: auto; padding: 6px; }
.s-item {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 12px;
  border-radius: 8px; cursor: pointer;
}
.s-item:hover, .s-item.sel { background: #101d2e; }
.s-item.sel { outline: 1px solid #1e4553; }
.s-item b { font-size: 12.5px; color: var(--txt); white-space: nowrap; }
.s-item span { font-size: 11px; color: var(--dim); white-space: nowrap; }
.s-item code { font-family: var(--mono); font-size: 10.5px; color: #7dd3fc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-empty { padding: 18px 14px; color: var(--dim); font-size: 12px; text-align: center; }
.s-hint { padding: 8px 14px; border-top: 1px solid #1a2434; color: var(--dim); font-size: 11px; }

/* 跳转闪烁 */
.test.flash { animation: tflash 1.4s ease; }
@keyframes tflash {
  0%, 60% { outline: 2px solid rgba(34, 211, 238, .8); outline-offset: 2px; }
  100% { outline: 2px solid transparent; }
}

/* ---------- 测试域步骤条（stage 底部浮层） ---------- */
#steps {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 7px 12px; border-radius: 12px;
  background: rgba(7, 11, 18, .82); border: 1px solid #1a2434;
  backdrop-filter: blur(6px); z-index: 4;
}
#steps .step {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; padding: 2px 6px; cursor: pointer; border-radius: 7px;
}
#steps .step:hover { background: #101a29; }
#steps .step i {
  width: 10px; height: 10px; border-radius: 50%; background: #3b4759;
  transition: box-shadow .2s, background .2s;
}
#steps .step span { font-size: 10px; color: var(--dim); }
#steps .step.active span { color: var(--txt); }
#steps .step.active i { box-shadow: 0 0 0 2px rgba(34, 211, 238, .55); }
#steps .step.testing i { background: var(--accent); animation: blink .8s infinite; }
#steps .step.pass i { background: var(--ok); }
#steps .step.warn i { background: var(--warn); }
#steps .step.fail i { background: var(--err); }

/* ---------- 首次引导 ---------- */
#guide {
  position: absolute; top: 16px; right: 16px; z-index: 6; display: none;
  width: 320px; flex-direction: column; gap: 8px;
  background: rgba(8, 13, 22, .94); border: 1px solid #1e4553; border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
#guide.show { display: flex; }
#guide b { color: var(--accent); font-size: 13.5px; margin-bottom: 2px; }
#guide span { color: #9fb2c8; font-size: 12px; line-height: 1.6; }
#guide em { font-style: normal; color: var(--accent); }
#guide i { font-style: normal; font-family: var(--mono); color: #7dd3fc; background: #0a0f18; border-radius: 4px; padding: 0 5px; }
#guide button {
  margin-top: 6px; align-self: flex-end; background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #06131a; font-weight: 700; border: none;
}

/* ---------- 报告环形图 ---------- */
.r-verdict { display: flex; align-items: center; gap: 26px; margin: 14px 0 4px; }
.r-verdict .donut { position: relative; width: 120px; height: 120px; flex: none; }
.r-verdict .donut svg { width: 120px; height: 120px; }
.r-verdict .d-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.r-verdict .d-num b { font-size: 26px; }
.r-verdict .d-num span { font-size: 11px; color: #64748b; }
.r-verdict .r-sum { margin: 0; line-height: 1.9; }

/* ---------- 响应式（扫码访客 / 窄屏投屏） ---------- */
@media (max-width: 1280px) {
  #left { width: 300px; }
  #right { width: 330px; }
  .dev { display: none; }
}
@media (max-width: 980px) {
  #left { width: 264px; padding: 10px; }
  #right { width: 280px; }
  .actions .chk { display: none; }
  #steps .step span { display: none; }
}
@media (max-width: 780px) {
  main { position: relative; }
  #topbar { height: auto; min-height: 54px; flex-wrap: wrap; padding: 8px 12px; }
  aside { position: absolute; top: 0; bottom: 0; z-index: 12; width: min(88vw, 360px); }
  #left, #right { display: none; overflow-y: auto; }
  #left { left: 0; border-right: 1px solid var(--line); box-shadow: 14px 0 40px rgba(0,0,0,.5); }
  #right { right: 0; border-left: 1px solid var(--line); box-shadow: -14px 0 40px rgba(0,0,0,.5); }
  body.show-left #left, body.show-right #right { display: flex; flex-direction: column; }
  /* 低频按钮收进 ⋯ 更多；核心动作置前自动换行 */
  .tb-low { display: none !important; }
  .tb-high { display: inline-block !important; }
  .actions { flex-wrap: wrap; row-gap: 6px; }
  #btn-all { order: -3; }
  #btn-full { order: -3; }
  #more-menu { order: -2; }
  .drawer-btn { order: -1; }
  #model-sel { order: -1; max-width: 150px; }
  /* 报告/弹层表格窄屏横滚 */
  #report-body, #tools-body, #plan-body, #defect-body { overflow-x: auto; }
  #report-body table, #tools-body table, #plan-body table, #defect-body table { min-width: 620px; }
  .r-actions { flex-wrap: wrap; }
  #steps { bottom: 8px; }
  #guide { right: 8px; left: 8px; width: auto; }
}
/* 抽屉开关按钮与更多菜单（仅窄屏显示） */
.drawer-btn, #more-menu { display: none; }
@media (max-width: 780px) {
  .drawer-btn, .tb-high { display: inline-block; }
}
/* ⋯ 更多菜单（窄屏下拉，fixed 避免被顶栏裁剪） */
#more-menu { position: relative; }
#more-menu summary {
  list-style: none; cursor: pointer; background: #101a29; color: var(--txt);
  border: 1px solid #24334a; padding: 6px 12px; border-radius: 8px; font-size: 12px;
}
#more-menu summary::-webkit-details-marker { display: none; }
#more-menu[open] summary { border-color: var(--accent); color: var(--accent); }
#more-menu .more-list {
  position: fixed; top: 96px; right: 10px; z-index: 35;
  display: flex; flex-direction: column; gap: 2px; min-width: 200px;
  background: rgba(9, 14, 23, .97); border: 1px solid #24334a; border-radius: 12px;
  padding: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
#more-menu .more-list button {
  width: 100%; text-align: left; background: none; border: none;
  padding: 8px 10px; border-radius: 8px; font-size: 12.5px;
}
#more-menu .more-list button:hover { background: #101d2e; color: var(--accent); }
/* 抽屉开关按钮（仅窄屏显示） */
.drawer-btn, #more-menu { display: none; }
@media (max-width: 780px) {
  .drawer-btn, .tb-high { display: inline-block; }
}
/* ⋯ 更多菜单（窄屏下拉） */
#more-menu { position: relative; }
#more-menu summary {
  list-style: none; cursor: pointer; background: #101a29; color: var(--txt);
  border: 1px solid #24334a; padding: 6px 12px; border-radius: 8px; font-size: 12px;
}
#more-menu summary::-webkit-details-marker { display: none; }
#more-menu[open] summary { border-color: var(--accent); color: var(--accent); }
#more-menu .more-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: flex; flex-direction: column; gap: 2px; min-width: 190px;
  background: rgba(9, 14, 23, .97); border: 1px solid #24334a; border-radius: 12px;
  padding: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
#more-menu .more-list button {
  width: 100%; text-align: left; background: none; border: none;
  padding: 8px 10px; border-radius: 8px; font-size: 12.5px;
}
#more-menu .more-list button:hover { background: #101d2e; color: var(--accent); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #1c2838; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #27374d; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 工具矩阵 / 计划 / 缺陷单 弹窗 ---------- */
#tools-modal, #plan-modal, #defect-modal {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(2, 6, 12, .72); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; padding: 24px;
}
#tools-modal.open, #plan-modal.open, #defect-modal.open { display: flex; }
#tools-panel, #plan-panel, #defect-panel {
  width: min(860px, 94vw); max-height: 88vh; overflow-y: auto;
  background: #f8fafc; color: #0f172a; border-radius: 14px; padding: 26px 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
#tools-panel h2, #plan-panel h2, #defect-panel h2 { font-size: 18px; margin-bottom: 8px; letter-spacing: 1px; }
#tools-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
#tools-body th, #tools-body td { border: 1px solid #cbd5e1; padding: 6px 9px; text-align: left; line-height: 1.5; }
#tools-body th { background: #e2e8f0; white-space: nowrap; }
#tools-body .mono { font-family: var(--mono); font-size: 11px; }

/* 测试计划文档 */
#plan-panel h3 {
  margin: 16px 0 6px; font-size: 14px;
  border-left: 4px solid #0f172a; padding-left: 8px;
}
#plan-panel ul { margin: 0 0 4px 20px; font-size: 12.5px; color: #334155; line-height: 1.85; }
#plan-panel .p-p { font-size: 12.5px; color: #334155; line-height: 1.8; margin: 4px 0; }
#plan-panel table { width: 100%; border-collapse: collapse; font-size: 12px; }
#plan-panel th, #plan-panel td { border: 1px solid #cbd5e1; padding: 6px 9px; text-align: left; line-height: 1.5; }
#plan-panel th { background: #e2e8f0; white-space: nowrap; }

/* 缺陷报告单 */
#defect-panel table.d-grid { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#defect-panel table.d-grid th, #defect-panel table.d-grid td {
  border: 1px solid #cbd5e1; padding: 7px 10px; text-align: left; vertical-align: top; line-height: 1.6;
}
#defect-panel table.d-grid th { background: #e2e8f0; white-space: nowrap; width: 92px; }
#defect-panel .sev { font-weight: 800; }
#defect-panel .sev.fail { color: #dc2626; }
#defect-panel .sev.warn { color: #d97706; }
#defect-panel td.steps code { font-family: var(--mono); font-size: 11px; background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
#defect-panel .flow {
  display: inline-block; font-size: 11px; color: #64748b;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 0 8px; margin: 2px 0;
}
#defect-panel .flow.cur { color: #b91c1c; border-color: #fca5a5; background: #fee2e2; font-weight: 700; }

/* 详情卡片：缺陷单按钮 */
.defect-one {
  width: 100%; margin-bottom: 6px; background: #1c1214; border-color: #5c1a1a; color: #fca5a5;
  font-size: 12px; padding: 6px;
}
.defect-one:hover { border-color: var(--err); color: var(--err); }

/* 仿真标识 */
.sim {
  font-style: normal; font-size: 9.5px; color: #64748b;
  border: 1px solid rgba(100, 116, 139, .45); border-radius: 4px; padding: 0 4px;
  margin-left: 5px; vertical-align: 1px;
}
#report-body .sim, #defect-panel .sim { color: #64748b; }

/* ---------- 投影模式：高对比大字号 ---------- */
body.projection { --txt: #eef4fb; font-size: 14.5px; }
body.projection #term { font-size: 13.5px; }
body.projection #tags .tag { font-size: 12.5px; padding: 2px 10px; }
body.projection .row b { font-size: 14px; }
body.projection .row em { font-size: 11.5px; }
body.projection .t-head b { font-size: 13.5px; }
body.projection .panel-title { font-size: 13px; }
body.projection button { padding: 7px 15px; font-size: 13.5px; }
body.projection .model-sel { font-size: 13.5px; padding: 7px 10px; }
body.projection #bar-label { font-size: 13.5px; }
/* 知识面板窄屏换行 */
@media (max-width: 900px) {
  .kb-row { flex-direction: column; gap: 3px; }
  .kb-row b { width: auto; }
}

/* ---------- 打印：只输出当前打开的文档 ---------- */
@media print {
  body > *:not(#report-modal):not(#defect-modal):not(#plan-modal) { display: none !important; }
  #report-modal, #defect-modal, #plan-modal {
    position: static !important; background: #fff; backdrop-filter: none; padding: 0; display: none;
  }
  #report-modal.open, #defect-modal.open, #plan-modal.open { display: block !important; }
  #report, #plan-panel, #defect-panel {
    width: 100%; max-height: none; box-shadow: none; border-radius: 0; padding: 0; background: #fff;
  }
  .r-actions { display: none !important; }
}

/* 顶栏流程分区（机型→执行→AI/真机→工具收纳） */
.tb-sep{display:inline-block;width:1px;height:22px;background:#24334a;margin:0 4px;vertical-align:middle}
.more-list hr{border:none;border-top:1px solid #1c2942;margin:6px 4px}
.more-list .ml-a{display:block;width:100%;text-align:left;padding:8px 12px;color:#9fb2c8;font-size:12.5px;text-decoration:none;border-radius:8px}
.more-list .ml-a:hover{background:#13203a;color:#7dd3fc}
