:root {
  --bg: #eef1f8;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-d: #4338ca;
  --primary-l: #eef2ff;
  --accent: #2563eb;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --line: #e6e9f0;
  --line-2: #eef1f6;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --grad: linear-gradient(135deg, #4f46e5, #2563eb);
  --grad-dark: linear-gradient(135deg, #0f172a, #312e81);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(79, 70, 229, .08), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(37, 99, 235, .07), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }

/* ---------- 顶栏 appbar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; color: #fff;
  background: var(--grad-dark);
  box-shadow: 0 6px 24px rgba(15, 23, 42, .28);
}
.appbar .brand { display: flex; align-items: center; gap: 12px; }
.appbar .logo {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--grad); box-shadow: 0 6px 16px rgba(79, 70, 229, .45);
}
.appbar .bn { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.appbar .bs { font-size: 12px; color: #c7d2fe; margin-top: -2px; }
.appbar .usr { display: flex; align-items: center; gap: 14px; }
.appbar .usr .muted { color: #cbd5e1; }
.appbar .usr button { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; }
.appbar .usr button:hover { background: rgba(255, 255, 255, .26); }

/* ---------- 分段导航 ---------- */
.pillnav {
  position: sticky; top: 62px; z-index: 39;
  display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 24px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.pillnav a {
  font-size: 13px; color: var(--ink); background: #fff; border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.pillnav a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pillnav a::before { content: "›"; color: var(--primary); margin-right: 6px; font-weight: 700; }

/* ---------- 内容容器 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 40px; }

/* ---------- KPI 英雄区 ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--primary);
}
.kpi::after {
  content: ""; position: absolute; right: -28px; top: -28px; width: 88px; height: 88px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, .14), transparent 70%);
}
.kpi:nth-child(2) { border-top-color: #0ea5e9; }
.kpi:nth-child(3) { border-top-color: #f59e0b; }
.kpi:nth-child(4) { border-top-color: #16a34a; }
.kpi:nth-child(5) { border-top-color: #9333ea; }
.kpi b { font-size: 28px; font-weight: 800; display: block; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .muted { font-size: 12.5px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); scroll-margin-top: 130px;
}
.card h2 {
  position: relative; font-size: 16px; font-weight: 700; margin: 0 0 14px; padding-left: 14px; color: var(--ink);
}
.card h2::before {
  content: ""; position: absolute; left: 0; top: 1px; bottom: 1px; width: 4px; border-radius: 4px;
  background: var(--grad);
}
.card > h2:first-child { margin-top: 2px; }
.section[id], .card[id] { scroll-margin-top: 130px; }

/* ---------- 文本/布局工具类 ---------- */
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.ck { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.ck input { width: auto; }
.hidden { display: none !important; }
.topbar { display: flex; justify-content: space-between; align-items: center; }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink); width: 100%; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .16);
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; min-height: 110px; line-height: 1.55; resize: vertical; }
::placeholder { color: #aab2c0; }

/* ---------- 按钮 ---------- */
button {
  background: var(--grad); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .28); transition: transform .12s, box-shadow .15s, filter .15s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79, 70, 229, .36); }
button:active { transform: translateY(0); }
button.ghost {
  background: #fff; color: var(--primary); border: 1px solid var(--primary); box-shadow: none;
}
button.ghost:hover { background: var(--primary-l); }
button.sm { padding: 6px 12px; font-size: 12.5px; box-shadow: none; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--primary-l); color: var(--primary-d);
}
.tag.ok { background: #dcfce7; color: var(--ok); }
.tag.pending { background: #fef3c7; color: var(--warn); }
.tag.primary { background: #dbeafe; color: var(--accent); }

/* ---------- 进度条 ---------- */
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted); font-weight: 600; background: var(--primary-l);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
tbody tr:nth-child(even) { background: #fafbff; }
tbody tr:hover { background: #f1f5ff; }
tbody td b { color: var(--ink); }

/* ---------- 日志 ---------- */
.log { font-size: 12.5px; color: var(--muted); max-height: 180px; overflow: auto; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.log div { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.log div:last-child { border-bottom: 0; }

/* ---------- 评价人评分块 ---------- */
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sc { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.sc .lab { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.sc .opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: 13px;
  background: #fff; transition: .12s; color: var(--ink);
}
.opt:hover { border-color: var(--primary); color: var(--primary); }
.opt.sel { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(79, 70, 229, .3); }

/* ---------- 评价人：可见被评价人面板 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.panel-h { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-h::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--grad); display: inline-block; }
.ev-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--line); }
.ev-row:last-child { border-bottom: 0; }
.ev-row b { font-size: 14px; }

/* ---------- 登录页（分屏） ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-hero {
  position: relative; color: #fff; padding: 56px 54px; display: flex; flex-direction: column; justify-content: center;
  background: var(--grad-dark); overflow: hidden;
}
.login-hero::before { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px;
  border-radius: 50%; background: radial-gradient(circle, rgba(79, 70, 229, .5), transparent 70%); }
.login-hero::after { content: ""; position: absolute; left: -100px; bottom: -120px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(37, 99, 235, .4), transparent 70%); }
.login-hero .lh-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-hero .lh-logo .logo { width: 52px; height: 52px; border-radius: 15px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 10px 26px rgba(79, 70, 229, .5); }
.login-hero h1 { font-size: 34px; margin: 0; line-height: 1.25; position: relative; }
.login-hero .lh-sub { font-size: 15px; color: #c7d2fe; margin-top: 12px; position: relative; }
.login-hero .lh-feats { margin-top: 36px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.login-hero .lh-feats div { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: #e2e8f0; }
.login-hero .lh-feats .ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center; font-size: 17px; }
.login-hero .lh-foot { margin-top: auto; padding-top: 30px; font-size: 12px; color: #94a3b8; position: relative; }
.login-card { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-card .lc-inner { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 22px; margin: 0 0 6px; }
.login-card .lc-sub { color: var(--muted); margin: 0 0 26px; font-size: 13.5px; }
.login-card .field { margin-bottom: 16px; }
.login-card button { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.login-card .hint { margin-top: 18px; font-size: 12px; color: var(--muted); background: #f8fafc;
  border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- toast ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; background: #111827; color: #fff;
  padding: 11px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: .25s; pointer-events: none;
  box-shadow: var(--shadow-lg); z-index: 60; }
.toast.show { opacity: .96; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .score-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .wrap { padding: 16px; }
  .appbar { padding: 0 14px; }
  .appbar .bs { display: none; }
}

/* ---------- 评分标准表格（与源表一致） ---------- */
.std-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 4px; }
.std-table { font-size: 12.5px; margin: 0; }
.std-table th { font-size: 12.5px; }
.std-table td { vertical-align: top; }
.std-note { font-size: 12px; color: var(--muted); background: var(--primary-l); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 11px; margin: 8px 0; line-height: 1.6; }
.opt-cell { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.opt-wrap { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 4px; border-radius: 8px; cursor: pointer; }
.opt-wrap:hover { background: #f1f5ff; }
.opt-wrap input { accent-color: var(--primary); }
.rng { width: 72px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.score-cell { font-weight: 700; color: var(--primary); text-align: center; white-space: nowrap; }
/* ---------- 滑块打分控件 ---------- */
.slider-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 260px; max-width: 260px; padding: 0 10px; }
/* 滑块重做：去掉原生 appearance 内缩，轨道满宽、拇指居中 → 末端无留白，可拖到最右端取到满分上限 */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
  /* 移动端：禁止浏览器默认触摸滚动/缩放手势，拖动完全由滑块接管（防止拖动时页面跟着滚导致松手值错乱） */
  touch-action: none; }
/* 已选轨道=清晰蓝，未选轨道=浅灰蓝（避免右侧过浅看不清进度）；分界由 --pct 控制，JS 实时更新 */
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--pct,0%), #e3e9f3 var(--pct,0%), #e3e9f3 100%); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--primary), 0 1px 4px rgba(0,0,0,.28); cursor: pointer; }
/* Firefox：原生 progress 表示已选轨道 */
.slider::-moz-range-track { height: 6px; border-radius: 999px; background: #e3e9f3; }
.slider::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--primary); }
.slider::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1.5px var(--primary), 0 1px 4px rgba(0,0,0,.28); cursor: pointer; }
.slider:disabled { cursor: not-allowed; opacity: .6; }
.slider-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; text-align: left; width: 100%; }
.slider-val b { color: var(--primary); font-size: 16px; }
.slider-grade { font-size: 12px; }
.slider-ticks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; align-self: stretch; }
.slider-ticks span { font-size: 11.5px; color: var(--muted); background: #f3f5fa; border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px; cursor: pointer;
  /* 移动端：消除 300ms 点击延迟与双击缩放干扰，点击档位立即触发提交 */
  touch-action: manipulation; }
.slider-ticks span:hover { background: #e7edff; color: var(--primary); }
/* 移动端增强组件（桌面端默认隐藏，仅在手机断点显示） */
.tier-toggle { display: none; align-items: center; gap: 4px; margin: 2px 0 0; padding: 5px 10px; font-size: 12px; color: var(--primary); background: #eef3ff; border: 1px solid #d6e2ff; border-radius: 8px; cursor: pointer; }
.tier-box { margin-top: 2px; }
.dim-nav { display: none; align-items: center; justify-content: center; gap: 12px; margin: 8px 0; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.dn-btn { padding: 6px 14px; font-size: 13px; color: #3730a3; background: #eef2ff; border: none; border-radius: 8px; cursor: pointer; }
.dn-btn:active { background: #e0e7ff; }
.dn-idx { font-size: 12px; }
.score-bar { display: none; }
/* 说明（2026-09-11）：不再锁死表格列宽 / table-layout:fixed。
   原因：内勤、数据中心为 perf 复合表（同一张表内既有 options 项、又有 range 项），
   锁死列宽会把 range 项的滑块挤进 80px 的"得分"列，导致滑块被压扁。
   现改为：滑块所在列宽由内容自适应（滑块控件固定 260px），同一张表内所有行共享列宽，天然左对齐。 */
.req { color: var(--warn); font-weight: 600; }
.std-block { margin-bottom: 18px; }
.std-block:last-child { margin-bottom: 0; }
.std-block-h { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.std-block-h .tag { font-size: 11px; padding: 2px 8px; }

/* ---------- 逐条提交操作列 ---------- */
.std-table th.op-col { text-align: center; width: 90px; }
.std-table td.op-col { text-align: center; white-space: nowrap; vertical-align: middle; }
.std-table .item-sub { white-space: nowrap; }

/* ---------- 实时总分面板（卡片内） ---------- */
.score-sum {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px;
  margin: 14px 0 2px; padding: 12px 16px;
  background: linear-gradient(135deg, #eef2ff, #f5f8ff);
  border: 1px solid #dbe3ff; border-radius: 14px;
}
.ss-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.ss-val { display: inline-flex; align-items: baseline; gap: 4px; }
.ss-val b {
  font-size: 26px; font-weight: 800; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ss-unit { font-size: 13px; color: var(--muted); }
.ss-cap { font-size: 13px; color: var(--muted); }
.ss-cap span { font-weight: 700; color: var(--ink); }
.ss-bar { flex: 1 1 140px; min-width: 120px; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.ss-bar > span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .2s; }
/* 卡片内实时总分（非财务展示；财务部门不展示） */
.card-total { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; flex-wrap: wrap; }
.card-total .cur-total { color: var(--primary); font-size: 17px; font-weight: 700; }
.card-total .ss-bar { flex: 1 1 120px; min-width: 120px; }

/* ---------- 底部实时总分浮条（始终可见，无需切页） ---------- */
.total-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgba(15, 23, 42, .12);
}
.tb-inner {
  max-width: 1180px; margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.tb-title { font-size: 13px; font-weight: 700; color: var(--primary-d); white-space: nowrap; }
.tb-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; overflow-x: auto; }
.tb-chip { font-size: 12px; color: var(--muted); background: #f3f5fa; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.tb-chip b { color: var(--ink); }
.tb-total { font-size: 14px; color: var(--muted); white-space: nowrap; }
.tb-total b { font-size: 20px; font-weight: 800; color: var(--primary); }
@media (max-width: 560px) {
  .tb-chips { order: 3; flex-basis: 100%; }
  .tb-inner { padding: 10px 14px; }
}
/* 为底部浮条预留空间，避免遮挡提交按钮 */
.wrap { padding-bottom: 100px; }

/* ---------- PWA 连接/同步状态条 ---------- */
.sync-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  box-shadow: var(--shadow-sm); user-select: none; white-space: nowrap;
}
.appbar .usr .sync-status { margin-right: 10px; }
/* 无顶栏页面（登录/导入）：悬浮右上角 */
.sync-status.floating { position: fixed; top: 70px; right: 12px; z-index: 60; box-shadow: var(--shadow); }
.sync-status .ss-dot { font-size: 11px; line-height: 1; }
.sync-status.on { color: var(--ok); border-color: #bbf7d0; background: #f0fdf4; }
.sync-status.on .ss-dot { color: var(--ok); }
.sync-status.pend { color: var(--warn); border-color: #fde68a; background: #fffbeb; }
.sync-status.pend .ss-dot { color: var(--warn); }
.sync-status.off { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.sync-status.off .ss-dot { color: var(--danger); }
@media (max-width: 560px) {
  .sync-status.floating { top: 64px; right: 8px; padding: 4px 9px; font-size: 11.5px; }
}

/* ---------- 待办/历史 视图切换 ---------- */
.view-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.view-tabs button {
  border: 0; background: transparent; padding: 6px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.view-tabs button.active { background: var(--primary); color: #fff; }
.view-tabs button:not(.active):hover { background: var(--primary-l); color: var(--primary); }
/* 历史归档卡片：只读、弱化 */
.card.hist { background: var(--surface-2, #f8fafc); border-style: dashed; }
.card.hist .score-sum { border-top: 1px dashed var(--line); }
.card.hist textarea { opacity: .8; }
/* 历史归档修改打分（2026-08-20） */
.btn-hist-edit {
  background: #fff; color: var(--accent); border: 1px solid var(--accent); box-shadow: none;
  padding: 5px 12px; font-size: 12.5px; border-radius: 999px; white-space: nowrap;
}
.btn-hist-edit:hover { background: #dbeafe; }
.card.hist-editing { border: 2px solid var(--accent); border-style: solid; background: #fbfcff; }
.card.hist-editing textarea { opacity: 1; }
.hist-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.hist-actions .hist-hint { font-size: 12px; margin-right: auto; }
.hist-actions button { box-shadow: none; }
.btn-ghost-hist { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost-hist:hover { border-color: var(--primary); color: var(--primary); }
.btn-hist-done { background: var(--grad); }

/* ==========================================================
   ---------- 移动端响应式适配（2026-08-18 追加） ----------
   电脑/手机同一套页面：手机无横向滚动、表格卡片化、按钮触控 ≥44px
   ========================================================== */
/* 全局防横向滚动：任何元素不得把页面撑破 */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, svg, canvas, table { max-width: 100%; }

/* 手机断点：卡片化 + 触控尺寸 */
@media (max-width: 640px) {
  /* ---------- 触控目标 ≥ 44px ---------- */
  button, .btn, .view-tabs button, .opt, .pillnav a, .slider-ticks span { min-height: 44px; }
  input, select, textarea { font-size: 16px; }   /* 防止 iOS 聚焦时自动放大 */
  .pillnav a { padding: 11px 16px; }
  .opt { padding: 12px 14px; font-size: 14px; }
  .view-tabs button { padding: 11px 16px; font-size: 14px; }
  .slider-ticks span { padding: 9px 12px; font-size: 12px; }
  .slider { height: 30px; }                       /* 加大滑块拖动区 */
  .appbar { height: 56px; padding: 0 12px; }
  .appbar .bn { font-size: 14.5px; }
  .pillnav { top: 56px; padding: 10px 12px; gap: 6px; }
  .pillnav a::before { display: none; }
  .wrap { padding: 14px 12px 100px; }
  .card { padding: 16px 14px; }
  .panel { padding: 14px 12px; }
  .topbar { align-items: flex-start; gap: 6px; }

  /* ---------- 评分标准表 → 维度卡片 ---------- */
  .std-wrap { overflow: visible; border: 0; border-radius: 0; }
  .std-table, .std-table tbody { display: block; }
  .std-table thead { display: none; }
  .std-table tbody tr {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: 6px 12px 10px; margin: 0 0 12px; box-shadow: var(--shadow-sm);
  }
  .std-table tbody tr:last-child { margin-bottom: 0; }
  .std-table td {
    display: block; border: 0; padding: 7px 2px; vertical-align: top; text-align: left;
  }
  /* 修复（2026-09-29）：theme.css 全局 table td{height:44px} 会把这里 block 化的 td 钉死成 44px，
     长说明文字、滑块、档位气泡溢出互相重叠错位 → 移动端恢复自适应高度（min-height 保触控行高） */
  .std-table td, .std-table th { height: auto; min-height: 44px; }
  #sec-scores .std-table td { height: auto; }
  /* 维度标签（由 standardTable 输出的 data-ft/data-cols 驱动） */
  .std-table td::before {
    display: block; font-size: 11px; color: var(--muted); font-weight: 600;
    margin-bottom: 4px; letter-spacing: .03em;
  }
  .std-table td.score-cell { text-align: left; font-size: 14px; }
  .std-table td.score-cell::before { content: "得分"; }
  /* 逐条提交操作列：移动端标签 + 全宽按钮 */
  .std-table td.op-col::before { content: "操作"; }
  .std-table td.op-col { text-align: center; }
  .std-table .item-sub { width: 100%; }
  /* satisfaction 表：序号/维度/内容/评分标准/得分 */
  .std-table[data-ft="satisfaction"] td:nth-child(1)::before { content: "序号"; }
  .std-table[data-ft="satisfaction"] td:nth-child(2)::before { content: "维度"; }
  .std-table[data-ft="satisfaction"] td:nth-child(3)::before { content: "内容"; }
  .std-table[data-ft="satisfaction"] td:nth-child(4)::before { content: "评分标准（点选档位或拖动滑块）"; }
  /* perf 表：分组/评分标准/得分 */
  .std-table[data-ft="perf"] td:nth-child(1)::before { content: "分组"; }
  .std-table[data-ft="perf"] td:nth-child(2)::before { content: "评分标准"; }
  /* kpi 表：指标/内容/评分/满分/权重/得分 */
  .std-table[data-ft="kpi"] td:nth-child(1)::before { content: "指标"; }
  .std-table[data-ft="kpi"] td:nth-child(2)::before { content: "内容"; }
  .std-table[data-ft="kpi"] td:nth-child(3)::before { content: "评分"; }
  .std-table[data-ft="kpi"] td:nth-child(4)::before { content: "满分"; }
  .std-table[data-ft="kpi"] td:nth-child(5)::before { content: "权重"; }
  /* grade 表：维度/评分/档位分值/得分 */
  .std-table[data-ft="grade"] td:nth-child(1)::before { content: "维度"; }
  .std-table[data-ft="grade"] td:nth-child(2)::before { content: "评分"; }
  .std-table[data-ft="grade"] td:nth-child(3)::before { content: "档位分值"; }
  /* checklist 表（4列：序号/项目/内容/得分；3列：分组/项目/得分） */
  .std-table[data-ft="checklist"][data-cols="4"] td:nth-child(1)::before { content: "序号"; }
  .std-table[data-ft="checklist"][data-cols="4"] td:nth-child(2)::before { content: "项目"; }
  .std-table[data-ft="checklist"][data-cols="4"] td:nth-child(3)::before { content: "内容"; }
  .std-table[data-ft="checklist"][data-cols="3"] td:nth-child(1)::before { content: "分组"; }
  .std-table[data-ft="checklist"][data-cols="3"] td:nth-child(2)::before { content: "项目"; }
  /* legacy（默认）表：维度/评分/得分 */
  .std-table[data-ft="legacy"] td:nth-child(1)::before { content: "维度"; }
  .std-table[data-ft="legacy"] td:nth-child(2)::before { content: "评分"; }
  /* 滑块与刻度全宽 */
  .slider-cell { min-width: 0; max-width: 100%; align-items: stretch; }
  .opt-cell { width: 100%; }
  .slider-row { width: 100%; }
  .slider-ticks { gap: 8px; align-self: stretch; }
  /* 移动端：档位说明默认收起（点「档位说明」展开），加大滑块触控区 */
  .slider { height: 34px; }                       /* 加大滑块拖动区，手指不易滑偏 */
  .slider-cell { padding: 4px 0; }
  .tier-toggle { display: inline-flex; }
  .tier-box { display: none; }
  .slider-cell.tier-open .tier-box { display: block; }
  .slider-cell.tier-open .tier-toggle { color: var(--muted); }
  /* 上/下一项导航 + 底部固定提交条 */
  .dim-nav { display: flex; }
  .score-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    align-items: center; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
  .score-bar .sb-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.2; flex: 1 1 auto; min-width: 0; }
  .score-bar .sb-who { font-weight: 600; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .score-bar .sb-prog { font-size: 12px; }
  .score-bar .sb-submit { flex: 0 0 auto; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 12px 22px; font-size: 15px; cursor: pointer; }
  .score-bar .sb-submit:active { background: #1d4ed8; }
  .std-note { font-size: 12px; line-height: 1.7; }

  /* ---------- 实时总分面板 / 底部浮条 ---------- */
  .score-sum { align-items: flex-start; flex-direction: column; gap: 6px; padding: 12px; }
  .ss-bar { align-self: stretch; flex: none; min-width: 0; }
  .tb-inner { padding: 10px 12px; }
  .tb-title { font-size: 12px; }
  .tb-chip { padding: 5px 10px; font-size: 11.5px; }

  /* ---------- 评价人：待评价对象面板 ---------- */
  .ev-row { flex-wrap: wrap; padding: 12px 0; }
  .ev-row > div:last-child { text-align: left; }
  .panel-h { font-size: 13.5px; }

  /* ---------- 登录页 ---------- */
  .login-card { padding: 28px 20px; }
  .login-card .lc-inner { max-width: 100%; }
  .login-card input { min-height: 46px; }
  .login-card button { min-height: 48px; font-size: 16px; }
}

/* ---------- 提交失败弹窗（移动端必达提示） ---------- */
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:999;display:flex;align-items:center;justify-content:center;padding:24px}
.modal-box{background:#fff;border-radius:14px;max-width:320px;width:100%;padding:20px;box-shadow:0 10px 40px rgba(0,0,0,.25);text-align:center}
.modal-title{font-weight:600;font-size:16px;margin-bottom:8px;color:#dc2626}
.modal-msg{font-size:14px;color:#333;line-height:1.6;margin-bottom:16px;word-break:break-all;white-space:pre-wrap}
.modal-box button{background:#4f46e5;color:#fff;border:none;border-radius:8px;padding:8px 28px;font-size:14px;cursor:pointer}
.modal-box button:active{opacity:.85}
