/* ============================================================
   触屏测试 · 验机工单 / 电路板质感
   前缀 tst- · 冷瓷白 + 电路青 + 荧光柠，浅色为默认；深色整套覆盖
   ============================================================ */
.tst-page, .tst-modal, .tst-toast {
    --tst-bg: #f1f6f6;
    --tst-bg2: #e4efee;
    --tst-panel: #ffffff;
    --tst-panel2: #eaf3f2;
    --tst-ink: #102f36;
    --tst-sub: #5b767a;
    --tst-line: #d5e5e3;
    --tst-line2: #b6d3cf;
    --tst-teal: #0b7d78;
    --tst-teal-deep: #075d59;
    --tst-lime: #b8e515;
    --tst-coral: #e2604a;
    --tst-amber: #d79a20;
    --tst-cell: #e3efee;
    --tst-cell-on: #0b7d78;
    --tst-shadow: 0 18px 42px rgba(10, 66, 66, .11);
    --tst-shadow-sm: 0 3px 12px rgba(10, 66, 66, .08);
    --tst-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
:root[data-theme="dark"] .tst-page, :root[data-theme="dark"] .tst-modal, :root[data-theme="dark"] .tst-toast {
    --tst-bg: #0b1719;
    --tst-bg2: #10282a;
    --tst-panel: #112224;
    --tst-panel2: #173234;
    --tst-ink: #e2f4f1;
    --tst-sub: #93b6b5;
    --tst-line: #224244;
    --tst-line2: #35605f;
    --tst-teal: #45d6c8;
    --tst-teal-deep: #7ff0e2;
    --tst-lime: #d3f35c;
    --tst-coral: #ff947c;
    --tst-amber: #f0c268;
    --tst-cell: #173234;
    --tst-cell-on: #45d6c8;
    --tst-shadow: 0 18px 42px rgba(0, 0, 0, .5);
    --tst-shadow-sm: 0 3px 12px rgba(0, 0, 0, .34);
}
.tst-page {
    background:
        linear-gradient(135deg, transparent 0 46%, var(--tst-bg2) 46% 54%, transparent 54%) 0 0 / 34px 34px,
        radial-gradient(900px 420px at 88% -8%, var(--tst-bg2), transparent 64%), var(--tst-bg);
    color: var(--tst-ink); padding: 0 0 58px; min-height: 60vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px; line-height: 1.78;
}
.tst-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 0; }
.tst-page .detail-breadcrumb { font-size: 13px; color: var(--tst-sub); margin: 10px 0 18px; }
.tst-page .detail-breadcrumb a { color: var(--tst-sub); text-decoration: none; }
.tst-page .detail-breadcrumb a:hover { color: var(--tst-teal); }
.tst-page .detail-breadcrumb .current { color: var(--tst-teal); font-weight: 700; }
.tst-page .detail-breadcrumb .sep { margin: 0 8px; opacity: .55; }

/* ---------- 首屏：左工单 / 右矩阵板 ---------- */
.tst-hero { display: grid; grid-template-columns: 1fr 1.04fr; gap: 24px; align-items: stretch; margin-bottom: 22px; }
.tst-hero > * { min-width: 0; }
.tst-kicker {
    display: inline-block; font: 700 11px var(--tst-mono); letter-spacing: 1.4px;
    color: var(--tst-teal); background: var(--tst-panel); border: 1px dashed var(--tst-line2);
    border-radius: 3px; padding: 6px 12px; margin-bottom: 16px;
}
.tst-page h1 { font-size: 34px; line-height: 1.22; font-weight: 820; margin: 0 0 14px; letter-spacing: -.6px; }
.tst-sub { font-size: 15px; line-height: 1.98; color: var(--tst-sub); margin: 0 0 18px; }
.tst-sub b { color: var(--tst-ink); font-weight: 750; }
.tst-hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tst-hero-facts > div {
    background: var(--tst-panel); border: 1px solid var(--tst-line); border-top: 3px solid var(--tst-teal);
    border-radius: 8px; padding: 10px 12px; box-shadow: var(--tst-shadow-sm);
}
.tst-hero-facts > div:nth-child(2) { border-top-color: var(--tst-lime); }
.tst-hero-facts > div:nth-child(3) { border-top-color: var(--tst-coral); }
.tst-hero-facts b { display: block; font: 800 24px/1.2 var(--tst-mono); letter-spacing: -.5px; }
.tst-hero-facts span { font-size: 11.5px; color: var(--tst-sub); }
.tst-hero-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.tst-hero-tip { font-size: 12px; color: var(--tst-sub); }
.tst-btn {
    border: 1px solid var(--tst-line2); background: var(--tst-panel); color: var(--tst-ink);
    border-radius: 7px; padding: 9px 15px; font-size: 13.5px; font-weight: 680;
    cursor: pointer; font-family: inherit; transition: transform .12s, box-shadow .12s, background .12s;
}
.tst-btn:hover { transform: translateY(-1px); border-color: var(--tst-teal); box-shadow: var(--tst-shadow-sm); }
.tst-btn--main { background: var(--tst-teal); border-color: var(--tst-teal-deep); color: #fff; }
:root[data-theme="dark"] .tst-btn--main { color: #06201f; }
.tst-btn--main:hover { background: var(--tst-teal-deep); }

.tst-board-box {
    background: var(--tst-panel); border: 1px solid var(--tst-line2); border-radius: 12px;
    padding: 14px; box-shadow: var(--tst-shadow); display: flex; flex-direction: column;
}
.tst-board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.tst-board-head b { font: 700 11px var(--tst-mono); letter-spacing: 1.2px; color: var(--tst-teal); }
.tst-board-head span { font: 600 11px var(--tst-mono); color: var(--tst-sub); border: 1px solid var(--tst-line); padding: 3px 8px; border-radius: 4px; }
.tst-board {
    position: relative; flex: 1; min-height: 260px; display: grid; gap: 3px;
    background: var(--tst-panel2); border: 1px solid var(--tst-line); border-radius: 8px;
    padding: 7px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair;
}
.tst-cell { background: var(--tst-cell); border-radius: 3px; transition: background .08s; min-width: 0; }
.tst-cell.is-edge { box-shadow: inset 0 0 0 1px var(--tst-line2); }
.tst-cell.is-on { background: var(--tst-cell-on); }
.tst-cell.is-miss { background: var(--tst-coral); opacity: .55; }
.tst-pin {
    position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
    background: var(--tst-lime); border: 3px solid var(--tst-panel); box-shadow: 0 0 0 2px var(--tst-teal), 0 0 18px var(--tst-lime);
    pointer-events: none; z-index: 3; font: 700 10px/20px var(--tst-mono); text-align: center; color: #17340a;
}
.tst-board-foot { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--tst-sub); }
.tst-board-foot span { display: inline-flex; align-items: center; gap: 5px; }
.tst-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--tst-line2); }
.tst-dot--off { background: var(--tst-cell); }
.tst-dot--on { background: var(--tst-cell-on); }
.tst-dot--edge { background: var(--tst-amber); }

/* ---------- 主体：左参数 / 右结果 ---------- */
.tst-body { display: grid; grid-template-columns: 292px 1fr; gap: 20px; align-items: start; }
.tst-body > * { min-width: 0; }
.tst-panel {
    background: var(--tst-panel); border: 1px solid var(--tst-line); border-radius: 12px;
    padding: 18px; box-shadow: var(--tst-shadow-sm); position: sticky; top: 14px;
}
.tst-panel h2, .tst-main h2 { font-size: 18px; margin: 0 0 4px; font-weight: 780; letter-spacing: -.2px; }
.tst-hint { font-size: 12.5px; color: var(--tst-sub); margin: 0 0 16px; line-height: 1.7; }
.tst-field { margin-bottom: 16px; }
.tst-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.tst-label em { font-style: normal; font: 500 11px var(--tst-mono); color: var(--tst-sub); }
.tst-seg { display: flex; gap: 5px; flex-wrap: wrap; }
.tst-seg button {
    flex: 1; min-width: 72px; border: 1px solid var(--tst-line2); background: var(--tst-panel2);
    color: var(--tst-sub); border-radius: 6px; padding: 7px 4px; font: 600 12px var(--tst-mono);
    cursor: pointer; font-family: var(--tst-mono);
}
.tst-seg button.is-on { background: var(--tst-teal); color: #fff; border-color: var(--tst-teal-deep); }
:root[data-theme="dark"] .tst-seg button.is-on { color: #06201f; }
.tst-input {
    width: 100%; box-sizing: border-box; border: 1px solid var(--tst-line2); background: var(--tst-panel2);
    color: var(--tst-ink); border-radius: 7px; padding: 9px 11px; font-size: 13.5px; font-family: inherit; outline: none;
}
.tst-input:focus { border-color: var(--tst-teal); box-shadow: 0 0 0 3px rgba(11, 125, 120, .13); }
.tst-inline { display: flex; align-items: center; gap: 8px; }
.tst-inline .tst-input { width: 92px; }
.tst-unit { font-size: 12px; color: var(--tst-sub); }
.tst-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tst-actions .tst-btn--main { grid-column: 1 / -1; }
.tst-actions--row { display: flex; flex-wrap: wrap; margin: 12px 0; }
.tst-err { color: var(--tst-coral); font-size: 12.5px; margin: 10px 0 0; }
.tst-err[hidden] { display: none; }
.tst-main { display: flex; flex-direction: column; gap: 18px; }
.tst-checks, .tst-log, .tst-batch {
    background: var(--tst-panel); border: 1px solid var(--tst-line); border-radius: 12px;
    padding: 18px; box-shadow: var(--tst-shadow-sm);
}
.tst-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.tst-check {
    border: 1px solid var(--tst-line); border-left: 4px solid var(--tst-sub); border-radius: 7px;
    padding: 11px 12px; background: var(--tst-panel2);
}
.tst-check.is-ok { border-left-color: var(--tst-teal); }
.tst-check.is-bad { border-left-color: var(--tst-coral); }
.tst-check b { display: block; font-size: 13.5px; }
.tst-check span { font-size: 12px; color: var(--tst-sub); }
.tst-check i { font: 700 11px var(--tst-mono); font-style: normal; float: right; }
.tst-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tst-section-head span { font-size: 12px; color: var(--tst-sub); }
.tst-scroll { overflow-x: auto; margin-top: 12px; }
.tst-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 480px; }
.tst-table th { text-align: left; font: 700 11px var(--tst-mono); letter-spacing: .5px; color: var(--tst-sub); border-bottom: 1px solid var(--tst-line2); padding: 7px 9px; }
.tst-table td { border-bottom: 1px solid var(--tst-line); padding: 7px 9px; font-family: var(--tst-mono); }
.tst-table tbody tr:hover { background: var(--tst-panel2); }
.tst-table .tst-mini { border: 0; background: transparent; color: var(--tst-coral); cursor: pointer; font-size: 12px; }
.tst-badge { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.tst-badge.is-ok { background: rgba(11,125,120,.14); color: var(--tst-teal); }
.tst-badge.is-bad { background: rgba(226,96,74,.15); color: var(--tst-coral); }

/* 浮层：仅在点「生成验机报告」后出现 */
.tst-modal[hidden] { display: none !important; }
.tst-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(6, 28, 30, .58); }
.tst-sheet { width: min(520px, 100%); max-height: 86vh; overflow: auto; background: var(--tst-panel); border: 1px solid var(--tst-line2); border-radius: 12px; padding: 20px; box-shadow: var(--tst-shadow); }
.tst-sheet-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed var(--tst-line2); padding-bottom: 10px; margin-bottom: 12px; }
.tst-sheet-head b { font: 800 17px var(--tst-mono); letter-spacing: .5px; }
.tst-modal-x { border: 0; background: transparent; color: var(--tst-sub); font-size: 24px; line-height: 1; cursor: pointer; }
.tst-sheet p { font-size: 13.5px; line-height: 1.9; margin: 6px 0; }
.tst-sheet-acts { margin-top: 16px; text-align: right; }
.tst-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(18px); z-index: 10000; background: var(--tst-ink); color: var(--tst-panel); padding: 9px 18px; border-radius: 99px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.tst-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
    .tst-hero, .tst-body { grid-template-columns: 1fr; }
    .tst-panel { position: static; }
    .tst-page h1 { font-size: 28px; }
    .tst-board { min-height: 240px; }
}
@media (max-width: 560px) {
    .tst-wrap { padding: 12px 10px 0; }
    .tst-hero-facts { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .tst-hero-facts b { font-size: 19px; }
    .tst-board { min-height: 210px; gap: 2px; padding: 5px; }
    .tst-table { min-width: 430px; }
}
