/* =========================================================
   原始记录填写界面 · 样式（逐字复用旧界面 main.css；
   旧文件 resources/static/css/main.css 已于 2026-09-30 随旧 UI 清理删除）
   仅用于保证「填写界面与旧版一模一样」。类名、取值、配色均不改动。
   ========================================================= */

@keyframes fieldShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }
.field-error { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.2) !important; animation: fieldShake 0.3s ease; }
label.field-error { color: #ef4444 !important; font-weight: 600 !important; animation: fieldShake 0.3s ease; }
table.field-error { outline: 2px solid #ef4444 !important; outline-offset: 2px; border-radius: 8px; animation: fieldShake 0.3s ease; }

.rec-page-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    padding: 8px 0 4px 0;
    letter-spacing: 2px;
}
.rec-back-btn {
    margin-bottom: 8px; padding: 5px 12px;
    border: 1px solid rgba(148,163,184,0.25); border-radius: 8px;
    background: rgba(255,255,255,0.5); color: #64748b;
    font-size: 12px; cursor: pointer;
    transition: all 0.25s;
}
.rec-back-btn:hover {
    color: #3b82f6;
    border-color: rgba(59,130,246,0.5);
    background: rgba(255,255,255,0.85);
    box-shadow: 0 0 8px 1px rgba(59,130,246,0.18), 0 0 0 1px rgba(59,130,246,0.12);
}
.rec-doc-title {
    text-align: center; font-size: 28px; font-weight: 700;
    color: #1e293b; letter-spacing: 3px; margin-top: 12px; margin-bottom: 6px;
}
.rec-doc-head {
    text-align: center; margin-bottom: 12px;
    padding-bottom: 10px; border-bottom: 1px solid rgba(148,163,184,0.15);
    font-size: 14px; color: #475569; line-height: 1.7;
}
.rec-tbl-no { font-weight: 600; }
.rec-no-pages { font-size: 13px; }
.record-info-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 12px; border: 1px solid rgba(148,163,184,0.2); border-radius: 8px; overflow: hidden; }
.record-info-table td { padding: 6px 10px; border-right: 1px solid rgba(148,163,184,0.2); border-bottom: 1px solid rgba(148,163,184,0.2); font-size: 14px; }
.record-info-table td:last-child { border-right: none; }
.record-info-table tr:last-child td { border-bottom: none; }
.record-info-table td.rl { background: rgba(148,163,184,0.06); text-align: center; font-weight: 500; width: 100px; color: #475569; font-size: 14px; }
.ri-inp { border: 1px solid rgba(100,116,139,0.55); border-radius: 5px; padding: 5px 8px; font-size: 14px; outline: none; background: #fff; color: #1e293b; text-align: center; transition: border-color 0.2s, box-shadow 0.2s; }
.ri-inp:focus {
    background: rgba(255,255,255,0.95) !important;
    border-color: rgba(59,130,246,0.6);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2), 0 0 8px 2px rgba(59,130,246,0.12);
    transform: scale(1.03);
}
.ri-inp:-webkit-autofill, .ri-inp:-webkit-autofill:hover, .ri-inp:-webkit-autofill:focus, .ri-inp:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(255,255,255,0.5) inset !important;
    -webkit-text-fill-color: #1e293b !important;
    transition: background-color 5000s ease-in-out 0s;
}
.ri-ck { font-size: 14px; white-space: nowrap; }
.record-eq-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 12px; border: 1px solid #9fb6cc; border-radius: 8px; overflow: hidden; }
.record-eq-table th, .record-eq-table td { padding: 6px 8px; border-right: 1px solid #9fb6cc; border-bottom: 1px solid #9fb6cc; font-size: 13px; text-align: center; color: #334155; opacity: 1; }
.record-eq-table th:last-child, .record-eq-table td:last-child { border-right: none; }
.record-eq-table tr:last-child td, .record-eq-table tr:last-child th { border-bottom: none; }
.record-eq-table th { background: rgba(148,163,184,0.06); font-weight: 500; color: #475569; font-size: 13px; }
.record-eq-table td.rec-cb { padding: 0; cursor: pointer; }
.rec-cb-label { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 34px; cursor: pointer; }
.rec-cb-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #3b82f6; }
.record-data-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 12px; border: 1px solid rgba(148,163,184,0.2); border-radius: 8px; overflow: hidden; }
.record-data-table th, .record-data-table td { padding: 8px 10px; border-right: 1px solid rgba(148,163,184,0.2); border-bottom: 1px solid rgba(148,163,184,0.2); font-size: 14px; text-align: center; }
.record-data-table th:last-child, .record-data-table td:last-child { border-right: none; }
.record-data-table tr:last-child td, .record-data-table tr:last-child th { border-bottom: none; }
.record-data-table th { background: rgba(148,163,184,0.06); font-weight: 500; color: #475569; font-size: 14px; }
.record-flashover { padding: 6px 10px; margin-bottom: 8px; font-size: 14px; }
.record-summary { padding: 4px 10px; margin-bottom: 8px; font-size: 14px; }
.rec-sample-block { border: 1px solid rgba(148,163,184,0.25); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: rgba(255,255,255,0.4); }
.rec-sample-title { font-weight: 600; font-size: 14px; color: #1e293b; margin-bottom: 8px; }
.rec-item-block { border-top: 1px dashed rgba(148,163,184,0.35); padding: 8px 0 4px; }
.rec-item-block:first-child { border-top: none; padding-top: 0; }
.rec-item-name { font-weight: 600; font-size: 13.5px; color: #334155; margin-bottom: 2px; }
.rec-item-standard { font-size: 12px; color: #64748b; line-height: 1.5; margin-bottom: 6px; }
.rec-item-inputs { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.rec-field { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #334155; }
.rec-field-label { white-space: nowrap; }
.rec-field .ri-inp { width: 90px; }
/* to_conclusion 字段（如「击穿、闪络、明显发热」）：**标签 + 有/无 单选框同行**。
   ⚠️ 2026-09-20（用户纠正，第二次）：标签与单选框必须在同一条水平线上左右对齐；
      旧版把它们拆开——标签独占一行、单选跑去「结论」列和「符合/不符合」挤在一行——是错误版式。
   ⚠️ 真正生效的覆盖在下方「实测结果格」一节（`.rec-detail-table .rec-res .rec-field--yn`），
      因为那里有一条更高权重的通配规则会把标签撑满整行。此处只定义基础态。
   ⚠️ 若以后要改这条版式，不要去动「结论」列，改动必须落在 `.rec-res` 内的 `--yn` 上。 */
.rec-field--yn { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.rec-field--yn .rec-field-label { white-space: nowrap; font-weight: 600; }
.rec-concl { margin-left: auto; font-weight: 600; }
/* 「结论」列只有「符合 / 不符合」一组，若该项另有标签型字段也不参与此列。
   窄格时仅收紧两个单选的间距。 */
.rec-concl .ri-ck + .ri-ck { margin-left: 6px; }
.rec-summary-bar { position: sticky; bottom: 0; background: rgba(255,255,255,0.96); border: 1px solid rgba(59,130,246,0.4); border-radius: 10px; padding: 8px 14px; margin: 10px 0; font-size: 13px; font-weight: 600; color: #1e40af; box-shadow: 0 2px 10px rgba(0,0,0,0.06); z-index: 5; }
.rec-v { display: inline-block; font-weight: 700; padding: 1px 10px; border-radius: 6px; }
.rec-v.v-pass { color: #0f7a3d; background: #e6f6ec; }
.rec-v.v-fail { color: #b42318; background: #fde8e4; }
.rec-v.v-partial { color: #a16207; background: #fef9c3; }
.rec-v.v-blank { color: #8a6d1a; background: #fbf3d8; }
.record-sign { display: flex; gap: 30px; padding: 8px 10px; font-size: 14px; }
.sig-line { display: inline-block; width: 80px; border-bottom: 1px solid rgba(148,163,184,0.3); margin: 0 4px; }
.rec-sign-btn {
    padding: 4px 12px; border: none; border-radius: 6px;
    background: #3b82f6; color: #fff; font-size: 13px; cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.rec-sign-btn:hover { background: #2563eb; transform: translateY(-1px); }
.rec-sign-btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.rec-sign-name {
    display: inline-block; min-width: 56px;
    border-bottom: 1px solid rgba(148,163,184,0.3);
    padding: 0 8px; color: #1e293b; font-weight: 500;
    vertical-align: middle;
}
.rec-sign-img {
    height: 42px; max-width: 120px;
    object-fit: contain; vertical-align: middle;
}

/* ═══ 原始记录填写模式（旧版侧栏胶囊态；新壳无 .side-nav，故此块无副作用） ═══ */
body.record-fill-mode .side-nav { width: 72px !important; height: 96px !important; border-radius: 28px !important; transition: width 0.75s cubic-bezier(0.32,0.72,0,1), height 0.75s cubic-bezier(0.32,0.72,0,1), border-radius 0.75s; }
body.record-fill-mode .nav-header { height: auto !important; padding: 16px 6px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
body.record-fill-mode .brand .dot, body.record-fill-mode .brand .num { opacity: 0 !important; max-width: 0 !important; margin: 0 !important; overflow: hidden !important; white-space: nowrap !important; }
body.record-fill-mode .brand { flex-direction: column !important; letter-spacing: 0 !important; gap: 2px !important; align-items: center !important; transition: flex-direction 0.75s, letter-spacing 0.65s, gap 0.75s !important; }
body.record-fill-mode .brand-yi, body.record-fill-mode .brand-suan { display: inline-block !important; transition: transform 0.75s cubic-bezier(0.32,0.72,0,1) !important; }
body.record-fill-mode .nav-items-wrapper, body.record-fill-mode .nav-footer, body.record-fill-mode .nav-spacer, body.record-fill-mode .current-page-indicator { display: none !important; }
body.record-fill-mode .main-content { margin-left: 116px !important; font-size: 15px; transition: margin-left 0.75s; }
body.record-fill-mode .side-nav:hover ~ .main-content { margin-left: 116px !important; filter: none !important; }
body.record-fill-mode .side-nav:hover ~ .home-overlay { filter: none !important; }

/* ═══ 原始记录表格（逐字复用 main.css 2377-2433） ═══ */
.rec-tables-wrap { overflow-x: auto; margin-top: 12px; }
.rec-tbl { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; margin: 0; color: #1e293b; border: 1px solid #94a3b8; border-radius: 8px; overflow: hidden; }
.rec-tbl + .rec-tbl { margin-top: 10px; }
.rec-tbl td, .rec-tbl th { border-right: 1px solid #94a3b8; border-bottom: 1px solid #94a3b8; padding: 4px 6px; vertical-align: middle; line-height: 1.4; }
.rec-tbl td:last-child, .rec-tbl th:last-child { border-right: none; }
.rec-tbl tr:last-child td, .rec-tbl tr:last-child th { border-bottom: none; }
.rec-tbl .rl { background: #eef2f7; font-weight: 600; text-align: center; }
.rec-mx-head td, .rec-mx-smp { background: #eef2f7; font-weight: 600; text-align: center; }
.rec-std { font-size: 13px; line-height: 1.5; }
.rec-res-line { display: flex; flex-direction: column; gap: 4px; margin: 7px 0; }
.rec-res-label { font-size: 13px; line-height: 1.35; color: #334155; font-weight: 600; white-space: normal; }
.rec-res-inpwrap { display: flex; align-items: center; gap: 6px; }
.rec-res-inp { width: 112px; min-width: 64px; max-width: 100%; margin: 0; flex: 0 1 auto; text-align: center; font-size: 13px; height: 28px; }
.rec-res-unit { font-size: 12px; color: #64748b; white-space: nowrap; }
.rec-res-yn { display: flex; gap: 14px; align-items: center; }
.rec-res-yn .ri-ck { font-size: 13px; }
.rec-res-note { font-size: 12px; line-height: 1.5; color: #475569; margin: 4px 0; padding: 4px 8px; background: rgba(148,163,184,0.10); border-radius: 5px; }
.rec-concl-cell { text-align: center; }.rec-concl-cell .ri-ck { font-size: 13px; white-space: nowrap; }
.rec-mx-summary td { font-weight: 600; }
.rec-matrix-table td { min-width: 34px; }
.rec-matrix-table .rec-concl-cell { min-width: 88px; }
.rec-head-table { width: 100%; }
.rec-detail-table { width: 100%; }
.rec-sec-head td { background: #eef2f7; font-weight: 600; text-align: center; }
.rec-detail-table .rec-th { background: #f8fafc; font-weight: 600; text-align: center; font-size: 13px; color: #475569; }
.rec-detail-table .rl { background: #eef2f7; font-weight: 600; text-align: center; vertical-align: middle; font-size: 13px; }
.rec-samno-row td { background: #f1f5f9; border: 1px solid #94a3b8; }
.rec-samno-cell { font-weight: 600; text-align: left; font-size: 14px; color: #1e293b; padding: 6px 10px; }
.rec-detail-table .rec-std { font-size: 13px; line-height: 1.5; }
.rec-detail-table .rec-res-line { display: flex; flex-direction: column; gap: 4px; margin: 7px 0; }
.rec-detail-table .rec-res-label { font-size: 13px; white-space: normal; }
.rec-detail-table .rec-res-inp { width: 112px; min-width: 64px; font-size: 13px; height: 28px; }
.rec-detail-table .rec-concl-cell { text-align: center; white-space: nowrap; }
.rec-detail-table .rec-concl-cell .ri-ck { font-size: 13px; }
.rec-detail-table .rec-res { overflow: hidden; }
/* 实测结果格内的标签和控件必须受本格宽度约束，避免宽输入框压入“结论”列。 */
.rec-detail-table .rec-res .rec-field {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    margin: 5px 0;
}
.rec-detail-table .rec-res .rec-field-label { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
.rec-detail-table .rec-res .ri-inp {
    box-sizing: border-box;
    width: min(112px, 100%);
    max-width: 100%;
    min-width: 0;
    flex: 0 1 112px;
}
.rec-detail-table .rec-res .ri-ck { max-width: 100%; white-space: normal; }
/* ⚠️ 2026-09-20（用户纠正，第二次）：「标签 + 有/无」必须同行左右对齐。
   上面第 184 行 `.rec-detail-table .rec-res .rec-field-label { flex: 1 1 100%; white-space: normal }`
   会把标签撑满整行、把「有/无」挤到下一行 —— 该规则是**故意**为数值输入字段写的
   （宽输入框要独占一行，避免压进「结论」列），不能改。
   因此这里只对 `--yn` 这一种字段类型做同权重覆盖：
     · 标签不再占满整行（flex 收缩 + nowrap）
     · 容器 nowrap，保证标签与两个单选框锁死在同一行
   权重与第 184 行相同（0,4,0），靠**后出现**取胜，无需 !important。
   ⚠️ 实测方式：tmp/_probe_yn_inline.py（Edge 无头 + getBoundingClientRect 断言垂直重叠）。 */
.rec-detail-table .rec-res .rec-field--yn { flex-wrap: nowrap; margin: 6px 0; }
.rec-detail-table .rec-res .rec-field--yn .rec-field-label {
    flex: 0 1 auto; white-space: nowrap; overflow-wrap: normal; margin-right: 6px;
}
.rec-detail-table .rec-res .rec-field--yn .ri-ck { flex: 0 0 auto; white-space: nowrap; }
.record-eq-table .rec-eq-title { background: #eef2f7; font-weight: 600; text-align: center; writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 4px; min-width: 30px; }
.record-eq-table td.rec-cb { padding: 0; cursor: pointer; }
.record-eq-table .rec-cb-label { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; cursor: pointer; }
.record-eq-table .rec-cb-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #3b82f6; }
.rec-detail-table tr.rec-samno-row > td { background: #d2e0ec; font-weight: 700; color: #1e3a52; border-top: 3px solid #9fb6cc; }
.rec-detail-table tr.rec-item-label > td { border-top: 2px solid #c2d2e0; }
.rec-detail-table tr.rec-item-0 > td { background: #e9f1f8; }
.rec-detail-table tr.rec-item-1 > td { background: #e6f3f4; }
.rec-detail-table tr.rec-item-2 > td { background: #edeef9; }
.rec-detail-table tr.rec-sam-0 > td:first-child { box-shadow: inset 4px 0 0 #6b8cb8; }
.rec-detail-table tr.rec-sam-1 > td:first-child { box-shadow: inset 4px 0 0 #4f9aa8; }
.rec-detail-table tr.rec-sam-2 > td:first-child { box-shadow: inset 4px 0 0 #7a78b0; }
.rec-detail-table tr.rec-sam-0.rec-samno-row > td { background: #6b8cb8; color: #fff; }
.rec-detail-table tr.rec-sam-1.rec-samno-row > td { background: #4f9aa8; color: #fff; }
.rec-detail-table tr.rec-sam-2.rec-samno-row > td { background: #7a78b0; color: #fff; }
/* 子表头格（标准要求 / 实测结果 / 结论）底色 = 本项内容色加深一档，保留各自色相。
   不要换成一个统一的新蓝 —— 那会和左侧「检测项目」列的身份色割裂。
   只染 .rec-th：左侧 rowspan 的格子必须与右侧内容行同色，否则丢掉交替色。
   选择器写成 td.rec-th，权重 0,3,2 高于 rec-item-N 的 0,2,2，不依赖书写顺序。 */
.rec-detail-table tr.rec-item-0 > td.rec-th { background: #c3d9ee; }
.rec-detail-table tr.rec-item-1 > td.rec-th { background: #c2dcdd; }
.rec-detail-table tr.rec-item-2 > td.rec-th { background: #d0d2ec; }
.rec-detail-table tr.rec-item-label .rec-th { color: #334155; }

/* ===== 原始记录填写弹窗（index.html / records.html 共用） ===== */
.rec-modal {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: stretch; justify-content: stretch;
  padding: 0; overflow: hidden;
  opacity: 0; transition: opacity .26s var(--ease, cubic-bezier(.22,.61,.36,1));
}
.rec-modal.is-open { opacity: 1; }
.rec-modal__sheet {
  width: 100%; max-width: none; min-height: 100%; background: #f1f5f9; border-radius: 0;
  box-shadow: none; padding: 0 28px 32px; margin: 0; overflow: auto;
  transform: translateY(18px) scale(.985); opacity: 0;
  transition: transform .3s var(--ease, cubic-bezier(.22,.61,.36,1)), opacity .3s var(--ease, cubic-bezier(.22,.61,.36,1));
}
.rec-modal.is-open .rec-modal__sheet { transform: translateY(0) scale(1); opacity: 1; }
/* 全屏工作区的固定顶栏：左「返回」/ 中标题 / 右留白。
   用户要求：全屏用「返回」退出（非右上角叉）、顶栏固定置顶、返回按钮放大 + 显眼蓝色 + 交互动画。
   sticky top:0（sheet 本身是滚动容器 → 等同于固定顶栏，且不受 transform 祖先的 fixed 陷阱影响）。 */
.rec-modal__bar {
  position: sticky; top: 0; z-index: 12;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 14px;
  margin: 0 -28px 18px; padding: 11px 20px;
  background: rgba(241, 245, 249, .93);
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.rec-modal__back {
  grid-column: 1; justify-self: start;
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 20px 0 15px;
  font-family: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: .5px; line-height: 1;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: 0; border-radius: 12px;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .34), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .2s cubic-bezier(.34, 1.4, .64, 1), box-shadow .22s ease, filter .2s ease;
}
.rec-modal__back svg {
  width: 21px; height: 21px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .22s cubic-bezier(.34, 1.4, .64, 1);
}
.rec-modal__back:hover { transform: translateY(-2px) scale(1.035); box-shadow: 0 13px 28px rgba(37, 99, 235, .46), inset 0 1px 0 rgba(255, 255, 255, .3); filter: saturate(1.14); }
.rec-modal__back:hover svg { transform: translateX(-4px); }
.rec-modal__back:active { transform: scale(.95); box-shadow: 0 4px 10px rgba(37, 99, 235, .3); }
.rec-modal__back:focus-visible { outline: 3px solid rgba(37, 99, 235, .38); outline-offset: 2px; }
.rec-modal__title { grid-column: 2; text-align: center; min-width: 0; font-size: 15px; font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 只读态「申请修改原始记录」（2026-09-22）：放顶栏第 3 列 = 右上角。
   顶栏是 3 列 grid（返回 / 标题 / 留白），第 3 列原本只留给已隐藏的关闭按钮
   → 这里天然靠右，无需改顶栏结构。
   ⚠️ 必须显式写 [hidden]：下面的 display:inline-flex 会盖掉 hidden 属性自带的
      display:none，不写这条「默认隐藏」就失效。 */
.rec-modal__apply {
  grid-column: 3; justify-self: end;
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px;
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: .3px; line-height: 1;
  color: #b45309; cursor: pointer;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74; border-radius: 12px;
  box-shadow: 0 6px 16px rgba(234, 88, 12, .18), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .2s cubic-bezier(.34, 1.4, .64, 1), box-shadow .22s ease, filter .2s ease;
}
.rec-modal__apply[hidden] { display: none; }
.rec-modal__apply:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 11px 24px rgba(234, 88, 12, .28); filter: saturate(1.1); }
.rec-modal__apply:active { transform: scale(.97); }
.rec-modal__apply:disabled { cursor: not-allowed; opacity: .62; transform: none; box-shadow: none; filter: none; }
.rec-modal__apply:focus-visible { outline: 3px solid rgba(234, 88, 12, .38); outline-offset: 2px; }
@media (max-width: 640px) {
  .rec-modal__bar { gap: 8px; padding: 9px 14px; }
  .rec-modal__back { height: 40px; padding: 0 15px 0 12px; font-size: 14.5px; }
  .rec-modal__back svg { width: 19px; height: 19px; }
  .rec-modal__title { font-size: 13.5px; }
  .rec-modal__apply { height: 36px; padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .rec-modal__back, .rec-modal__back svg { transition: none; }
  .rec-modal__back:hover, .rec-modal__back:hover svg { transform: none; }
}
.rec-modal__close {
  border: none; background: rgba(148, 163, 184, .18); color: var(--ink-2, #3a3a3c);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1;
  transition: background .2s var(--ease, ease), transform .2s var(--ease, ease);
}
.rec-modal__close:hover { background: rgba(148, 163, 184, .32); }
#records-container { font-family: "Inter", "Noto Sans SC", -apple-system, "PingFang SC", sans-serif; }
#records-container .record-form { max-width: 100%; }
.rec-eq-hint { margin: -4px 0 12px; color: #475569; font-size: 13px; }
.rec-empty { text-align: center; padding: 60px 0; color: var(--gray-2, #7a7a7a); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) {
  .rec-modal, .rec-modal__sheet { transition: none; }
  .rec-modal__close:hover { transform: none; }
}
.rec-modal__close { display:grid; place-items:center; padding:0; }
.rec-modal__close svg { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; transform-box:view-box; transform-origin:50% 50%; transition:transform .28s cubic-bezier(.16,1,.3,1); }
.rec-modal__close:hover { transform:none; }
.rec-modal__close:hover svg { transform:rotate(90deg); }
@media (prefers-reduced-motion:reduce) { .rec-modal__close svg { transition:none; } .rec-modal__close:hover svg { transform:none; } }

/* 全屏工作区改用左上角「返回」退出 → 右上角叉号只留在 DOM 里（保存 / 删除 / 返回等关闭链路
   全都走 .rec-modal__close.click()），视觉上藏掉。
   ⚠️ 必须 !important：上面的 .rec-modal__close 有 display:grid，会盖掉 UA 的 [hidden]{display:none}。 */
.rec-modal__close[hidden] { display: none !important; }

/* ===== 结论单选框（符合 / 不合格）交互 =====
   用户反馈：小圆点太小，鼠标停上去没有任何反馈，不确定点不点得中。
   处理：把整个 label 变成可点区域，并给出 悬停 / 按下 / 选中 三态 + 圆点放大。
   ⚠️ :has() 与项目里已在大量使用的 color-mix() 属同代特性（Chrome 105+ / 111+），不必降级。 */
.ri-ck {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  margin: 0 1px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease,
              box-shadow .18s ease, transform .16s cubic-bezier(.34, 1.56, .64, 1);
}
.ri-ck input[type="radio"] {
  width: 16px; height: 16px; margin: 0; flex: none;
  cursor: pointer;
  accent-color: #2563eb;
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1);
}
.ri-ck:hover { background: rgba(37, 99, 235, .09); border-color: rgba(37, 99, 235, .34); color: #1d4ed8; }
.ri-ck:hover input[type="radio"] { transform: scale(1.24); }
.ri-ck:active { transform: scale(.955); background: rgba(37, 99, 235, .16); border-color: rgba(37, 99, 235, .5); }
.ri-ck:focus-within { border-color: rgba(37, 99, 235, .58); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.ri-ck:has(input[type="radio"]:checked) {
  color: #1d4ed8; font-weight: 600;
  background: rgba(37, 99, 235, .13);
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .16);
}
.ri-ck:has(input[type="radio"]:checked) input[type="radio"] { transform: scale(1.1); }
/* 只读（已提交 / 已生成 / 授权外的记录）→ 不给可点暗示 */
.ri-ck:has(input[type="radio"]:disabled) { cursor: not-allowed; opacity: .62; }
.ri-ck:has(input[type="radio"]:disabled):hover { background: transparent; border-color: transparent; color: inherit; }
.ri-ck:has(input[type="radio"]:disabled):hover input[type="radio"] { transform: none; }
.ri-ck:has(input[type="radio"]:disabled):active { transform: none; }
/* 结论格里的两个选项并排，间距别把「结论」列撑破 */
.rec-concl .ri-ck, .rec-concl-cell .ri-ck { padding: 3px 6px; gap: 4px; }
.rec-detail-table .rec-res .ri-ck { padding: 3px 6px; }
@media (prefers-reduced-motion: reduce) {
  .ri-ck, .ri-ck input[type="radio"] { transition: none; }
  .ri-ck:hover input[type="radio"] { transform: none; }
  .ri-ck:active { transform: none; }
}

/* ===== 「删除原始记录」按钮 =====
   它原来是个**没有任何 class 的原生灰按钮**，夹在「保存」「生成报告」两个彩色胶囊后面，
   很不起眼 —— 用户报「没看到任何删除原始记录的地方」。改为显式危险操作胶囊，
   并且 margin-left:auto 推到行尾，和主操作拉开距离，防误点。 */
.rec-del-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; margin-left: auto;
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1;
  color: #b42318; cursor: pointer;
  background: #fff;
  border: 1px solid rgba(180, 35, 24, .35);
  border-radius: 10px;
  transition: background .2s ease, color .2s ease, border-color .2s ease,
              box-shadow .2s ease, transform .16s cubic-bezier(.34, 1.56, .64, 1);
}
.rec-del-btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rec-del-btn:hover { color: #fff; background: #dc2626; border-color: #dc2626; box-shadow: 0 6px 14px rgba(220, 38, 38, .28); transform: translateY(-1px); }
.rec-del-btn:active { transform: scale(.96); box-shadow: 0 2px 6px rgba(220, 38, 38, .24); }
.rec-del-btn:focus-visible { outline: 3px solid rgba(220, 38, 38, .3); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .rec-del-btn { transition: none; }
  .rec-del-btn:hover, .rec-del-btn:active { transform: none; }
}

/* =========================================================
   暗色主题适配（2026-09-19）
   原则：不改上方任何亮色规则（亮色 = 与备案模板一致的原貌），
   只在 [data-theme="dark"] 下覆盖颜色；选择器带主题属性，
   权重高于上方单类名规则，必定生效。
   ========================================================= */
[data-theme="dark"] .rec-page-title,
[data-theme="dark"] .rec-doc-title { color: var(--ink); }
[data-theme="dark"] .rec-doc-head,
[data-theme="dark"] .rec-eq-hint { color: var(--gray); }

[data-theme="dark"] .rec-back-btn {
  background: var(--card); color: var(--gray); border-color: var(--line);
}
[data-theme="dark"] .rec-back-btn:hover {
  background: var(--blue-050); color: var(--blue);
  border-color: var(--blue); box-shadow: 0 0 8px 1px rgba(59, 130, 246, .22);
}

/* 信息表 / 数据表 */
[data-theme="dark"] .record-info-table,
[data-theme="dark"] .record-data-table,
[data-theme="dark"] .record-info-table td,
[data-theme="dark"] .record-data-table th,
[data-theme="dark"] .record-data-table td { border-color: var(--line); }
[data-theme="dark"] .record-info-table td,
[data-theme="dark"] .record-data-table td { color: var(--ink-2); }
[data-theme="dark"] .record-info-table td.rl,
[data-theme="dark"] .record-data-table th,
[data-theme="dark"] .record-eq-table th { background: rgba(148, 163, 184, .10); color: var(--gray); }

/* 设备表（原边框写死 #9fb6cc） */
[data-theme="dark"] .record-eq-table,
[data-theme="dark"] .record-eq-table th,
[data-theme="dark"] .record-eq-table td { border-color: var(--line); color: var(--ink-2); }
[data-theme="dark"] .record-eq-table .rec-eq-title { background: rgba(148, 163, 184, .10); }

/* 输入框 */
[data-theme="dark"] .ri-inp {
  background: var(--card); color: var(--ink); border-color: var(--gray-3);
}
[data-theme="dark"] .ri-inp:focus { background: var(--card) !important; }
[data-theme="dark"] .ri-inp:-webkit-autofill,
[data-theme="dark"] .ri-inp:-webkit-autofill:hover,
[data-theme="dark"] .ri-inp:-webkit-autofill:focus,
[data-theme="dark"] .ri-inp:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #171a20 inset !important;
  -webkit-text-fill-color: #f2f2f4 !important;
}

/* 样品块 / 检测项 */
[data-theme="dark"] .rec-sample-block { background: rgba(255, 255, 255, .04); border-color: var(--line); }
[data-theme="dark"] .rec-sample-title { color: var(--ink); }
[data-theme="dark"] .rec-item-name,
[data-theme="dark"] .rec-field,
[data-theme="dark"] .rec-res-label { color: var(--ink-2); }
[data-theme="dark"] .rec-item-standard,
[data-theme="dark"] .rec-res-unit,
[data-theme="dark"] .rec-item-block,
[data-theme="dark"] .rec-sample-block .rec-item-block { border-color: rgba(148, 163, 184, .22); }
[data-theme="dark"] .rec-item-standard { color: var(--gray); }
[data-theme="dark"] .rec-res-note { background: rgba(148, 163, 184, .12); color: var(--gray); }

/* 汇总条 */
[data-theme="dark"] .rec-summary-bar {
  background: var(--card); color: var(--blue); border-color: var(--blue);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

/* 结论徽章四态（深底亮字） */
[data-theme="dark"] .rec-v.v-pass { color: #4ade80; background: rgba(48, 209, 88, .16); }
[data-theme="dark"] .rec-v.v-fail { color: #ff8a80; background: rgba(255, 91, 82, .18); }
[data-theme="dark"] .rec-v.v-partial { color: #fbbf24; background: rgba(255, 194, 71, .16); }
[data-theme="dark"] .rec-v.v-blank { color: #e8d48b; background: rgba(255, 194, 71, .10); }

/* 签名区 */
[data-theme="dark"] .sig-line { border-color: var(--line); }
[data-theme="dark"] .rec-sign-name { border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .rec-sign-btn:disabled { background: #3a3a41; color: #9a9aa2; }

/* 表格族（rec-tbl 系，原边框 #94a3b8 / 表头 #eef2f7） */
[data-theme="dark"] .rec-tbl { border-color: var(--gray-3); color: var(--ink); }
[data-theme="dark"] .rec-tbl td,
[data-theme="dark"] .rec-tbl th { border-color: var(--gray-3); }
[data-theme="dark"] .rec-tbl .rl,
[data-theme="dark"] .rec-mx-head td,
[data-theme="dark"] .rec-mx-smp,
[data-theme="dark"] .rec-sec-head td { background: #232833; }
[data-theme="dark"] .rec-detail-table .rec-th { background: #1e222a; color: var(--gray); }
[data-theme="dark"] .rec-detail-table .rl { background: #232833; }

/* 检测项目交替色（蓝/青/紫浅底 → 同色相深底） */
[data-theme="dark"] .rec-detail-table tr.rec-item-0 > td { background: #152638; }
[data-theme="dark"] .rec-detail-table tr.rec-item-1 > td { background: #122b2d; }
[data-theme="dark"] .rec-detail-table tr.rec-item-2 > td { background: #1d1f38; }
[data-theme="dark"] .rec-detail-table tr.rec-item-0 > td.rec-th { background: #1c3a58; }
[data-theme="dark"] .rec-detail-table tr.rec-item-1 > td.rec-th { background: #173f44; }
[data-theme="dark"] .rec-detail-table tr.rec-item-2 > td.rec-th { background: #282b52; }
[data-theme="dark"] .rec-detail-table tr.rec-item-label .rec-th { color: var(--ink-2); }
[data-theme="dark"] .rec-detail-table tr.rec-item-label > td { border-top-color: var(--line); }
[data-theme="dark"] .rec-detail-table tr.rec-samno-row > td {
  background: #253243; color: #d8e4f2; border-color: var(--gray-3); border-top-color: var(--gray-3);
}
[data-theme="dark"] .rec-samno-cell { color: var(--ink); }

/* 填写弹窗壳 / 顶栏 */
[data-theme="dark"] .rec-modal__sheet { background: var(--bg); }
[data-theme="dark"] .rec-modal__bar {
  background: rgba(23, 26, 32, .92);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .rec-modal__title { color: var(--ink); }

/* 结论单选（符合/不合格）：选中态文字暗色下提亮为主蓝 */
[data-theme="dark"] .ri-ck:hover { color: var(--blue); }
[data-theme="dark"] .ri-ck:has(input[type="radio"]:checked) { color: var(--blue); }

/* 删除按钮 */
[data-theme="dark"] .rec-del-btn { background: var(--card); color: var(--red); border-color: rgba(255, 91, 82, .4); }


/* ── 原始记录只读状态提示（2026-09-24）────────────────────────────────
   把「为什么不能改」直接写在按钮下方：
     issued   报告已签发，结论生效 → 需先撤销签发或走申请流程
     applying 已提交申请，等待管理员同意（同意后本页自动解锁）
     locked   已提交并生成报告，可点右上角「申请修改原始记录」
   参照 .rec-eq-hint 的字号与间距，保持同一视觉层级。 */
/* 同一原始记录的检测项选择：每个样品都显示同一复选状态，任一处切换会同步整条记录。 */
.rec-detail-table caption.rec-item-selection-hint { caption-side: top; padding: 5px 7px; color: #64748b; text-align: left; font-size: 12px; line-height: 1.5; }
.rec-item-select-cell { padding: 3px 6px !important; }
.rec-item-toggle { display: flex; align-items: flex-start; justify-content: flex-start; gap: 7px; width: 100%; cursor: pointer; text-align: left; }
.rec-item-toggle__check { flex: 0 0 auto; width: 16px; height: 16px; margin: 1px 0 0; accent-color: #2563eb; cursor: pointer; }
.rec-item-toggle > span { min-width: 0; font-size: 12px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.rec-item-toggle:has(input:disabled) { cursor: not-allowed; opacity: .62; }
.rec-item-toggle input:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.rec-detail-table tr.is-item-disabled > td { filter: grayscale(.35); color: #8491a2; }
.rec-detail-table tr.is-item-disabled .rec-th,
.rec-detail-table tr.is-item-disabled .rec-std,
.rec-detail-table tr.is-item-disabled .rec-res,
.rec-detail-table tr.is-item-disabled .rec-concl { opacity: .52; }
.rec-detail-table tr.is-item-disabled .rec-res input:disabled,
.rec-detail-table tr.is-item-disabled .rec-concl input:disabled { cursor: not-allowed; }
[data-theme="dark"] .rec-detail-table tr.is-item-disabled > td { filter: grayscale(.4); color: #7f8794; }
[data-theme="dark"] .rec-detail-table caption.rec-item-selection-hint { color: var(--gray); }
[data-theme="dark"] .rec-item-toggle__check { accent-color: #70a7ff; }

.rec-state-hint { margin: 10px 0 0; color: #475569; font-size: 13px; line-height: 1.6; }
.rec-state-hint--issued { color: #b45309; }
[data-theme="dark"] .rec-state-hint { color: var(--gray); }
[data-theme="dark"] .rec-state-hint--issued { color: var(--amber); }
