/* 篮球体测数据平台 —— 样式表（零依赖、浅色专业风） */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #26313f;
  --ink-2: #5b6b80;
  --muted: #8a97a8;
  --line: #e3e8ef;
  --line-2: #eef1f6;
  --brand: #4a90d9;
  --ok: #3fb08b;
  --warn: #e8b13c;
  --err: #e0674a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(38, 49, 63, .04), 0 6px 20px rgba(38, 49, 63, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-soft); padding: 1px 5px; border-radius: 4px; }
h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.pos { color: var(--ok); }
.neg { color: var(--err); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- 布局（微软设置风格：左侧分类导航 + 右侧内容） ---------- */
#app { display: flex; min-height: 100vh; }
#side {
  width: 268px; flex: 0 0 268px; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #4a90d9, #3fb08b);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.brand-title { font-weight: 700; font-size: 14px; }
.brand-sub { font-size: 11px; color: var(--muted); }

/* 搜索框 */
.nav-search-wrap {
  position: relative; margin: 0 12px 10px; display: flex; align-items: center;
}
.nav-search-icon { position: absolute; left: 11px; color: var(--muted); font-size: 15px; pointer-events: none; }
#nav-search {
  width: 100%; padding: 8px 46px 8px 32px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-soft); font-size: 13px; color: var(--ink); outline: none; font-family: inherit;
}
#nav-search:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,144,217,.12); }
#nav-search::-webkit-search-cancel-button { cursor: pointer; }
.nav-kbd {
  position: absolute; right: 8px; font-size: 10px; color: var(--muted); background: var(--line-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; pointer-events: none;
}

#nav { padding: 0 8px 8px; flex: 1; overflow: auto; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em;
  padding: 12px 12px 5px; text-transform: none;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface-soft); text-decoration: none; }
.nav-item.active { background: rgba(74, 144, 217, .10); color: var(--brand); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; opacity: .85; flex: 0 0 18px; font-size: 14px; }
.nav-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nav-title { font-size: 13.5px; line-height: 1.35; }
.nav-desc {
  font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-item.active .nav-desc { color: var(--brand); opacity: .75; }
.nav-tag {
  font-size: 10px; color: var(--muted); background: var(--surface-soft); border-radius: 4px;
  padding: 1px 6px; flex: 0 0 auto;
}
.nav-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); }

/* 页面标题区 */
#page-head { padding: 4px 26px 0; }
.page-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-desc { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
#crumb { padding: 8px 26px 0; font-size: 12px; color: var(--muted); }
#crumb a { color: var(--muted); }
.crumb-sep { margin: 0 6px; opacity: .6; }
.crumb-cur { color: var(--ink-2); font-weight: 600; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#view { padding: 12px 26px 48px; }

/* 设置项行列表（微软设置那种"标题+说明 在左，控件 在右"） */
.setting-row {
  display: flex; align-items: center; gap: 16px; padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.setting-row:last-child { border-bottom: none; }
.setting-main { flex: 1; min-width: 0; }
.setting-name { font-size: 13.5px; font-weight: 600; }
.setting-hint { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.setting-ctrl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* 可折叠分组：默认收起，减少信息压迫感 */
.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 12px; overflow: hidden; }
.acc-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer;
  user-select: none; background: var(--card);
}
.acc-head:hover { background: var(--surface-soft); }
.acc-head h3 { margin: 0; flex: 1; font-size: 14px; }
.acc-arrow { color: var(--muted); font-size: 12px; transition: transform .15s; }
.acc.open .acc-arrow { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line-2); }
.acc.open .acc-body { display: block; }
.acc-badge { font-size: 11px; color: var(--muted); background: var(--surface-soft); border-radius: 10px; padding: 1px 8px; }
#toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 22px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.tb-left { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tb-right { display: flex; gap: 12px; align-items: center; }
.tb-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
#view { padding: 22px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.legend { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- 统计卡 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
.stat-sub { font-size: 12px; color: var(--ink-2); }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.grid th { background: var(--surface-soft); color: var(--ink-2); font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 1; }
table.grid tbody tr:hover { background: var(--surface-soft); }
table.grid td.empty { text-align: center; color: var(--muted); padding: 24px; }

.ovr { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; text-align: center; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: rgba(74, 144, 217, .12); color: var(--brand); font-size: 11px; }

/* ---------- 录入表 ---------- */
.entry-wrap { overflow: auto; max-height: 68vh; }
table.entry-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.entry-table th {
  background: var(--surface-soft); padding: 6px 8px; border: 1px solid var(--line-2); font-weight: 600;
  font-size: 11px; color: var(--ink-2); text-align: center; min-width: 82px;
}
table.entry-table th .unit { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
table.entry-table th.derived { background: var(--surface-soft); color: var(--muted); }
table.entry-table td { border: 1px solid var(--line-2); padding: 0; }
table.entry-table td.sticky, table.entry-table th.sticky {
  position: sticky; left: 0; background: var(--card); z-index: 3; text-align: left; padding: 0 12px; min-width: 128px;
  border-right: 2px solid var(--line);
}
table.entry-table th.sticky { background: var(--surface-soft); z-index: 4; }
input.cell { width: 100%; min-width: 78px; border: 0; padding: 7px 8px; font-size: 12px; background: transparent; outline: none; text-align: right; }
input.cell:focus { background: rgba(74, 144, 217, .08); }
input.cell.derived { background: var(--surface-soft); color: var(--ink-2); text-align: right; cursor: default; }
input.cell.bad { background: rgba(224, 103, 74, .15); }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress { flex: 1; height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #4a90d9, #3fb08b); transition: width .3s; }

/* ---------- 表单 ---------- */
.input {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px;
  background: var(--card); color: var(--ink); outline: none; font-family: inherit; min-width: 120px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74, 144, 217, .12); }
.input.num { text-align: right; }
.tiny-in { min-width: 72px; padding: 4px 6px; font-size: 12px; }
textarea.input { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); }
.field.wide { grid-column: 1 / -1; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.lbl { font-size: 12px; color: var(--ink-2); }
.btn-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #3d80c4; color: #fff; }
.btn.danger { color: var(--err); border-color: rgba(224, 103, 74, .4); }
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer;
  width: 26px; height: 26px; line-height: 1; font-size: 14px; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--err); color: var(--err); }

/* ---------- 评分方案编辑区 ---------- */
tr.edit-row > td { background: var(--surface-soft); padding: 16px !important; }
.edit-area { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
@media (max-width: 1000px) { .edit-area { grid-template-columns: 1fr; } }
.ea-left { display: flex; flex-direction: column; gap: 10px; }
.stops { display: flex; flex-direction: column; gap: 6px; }
.stop-row { display: flex; align-items: center; gap: 6px; }
.stop-row .input { min-width: 74px; }
.stop-row .arrow { color: var(--muted); }
.stop-row .lbl { font-size: 12px; color: var(--muted); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.curve-box { background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; }
.preview-wrap { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 18px; align-items: center; }
@media (max-width: 1000px) { .preview-wrap { grid-template-columns: 1fr; } }
.pv-score { text-align: center; }

/* ---------- 球员头部 ---------- */
.player-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.ph-left .ph-name { font-size: 22px; font-weight: 700; }
.ph-meta { color: var(--ink-2); font-size: 13px; }
.ph-right { text-align: center; }
.ph-ovr {
  font-size: 34px; font-weight: 800; color: #fff; border-radius: 12px;
  min-width: 92px; padding: 6px 14px; display: inline-block; line-height: 1.1;
}
.ph-band { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ---------- 模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(38, 49, 63, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: var(--card); border-radius: 14px; width: 100%; max-width: 760px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 加载 ---------- */
#loading { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; z-index: 200; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.help ol { padding-left: 20px; line-height: 1.9; }
.todo { margin: 0; padding-left: 20px; line-height: 1.9; color: var(--ink-2); }

/* ---------- 协作 / 选择 / 日志 ---------- */
.mode-tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.mode-tag.on { background: rgba(63, 176, 139, .14); color: var(--ok); font-weight: 600; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.log-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  background: var(--surface-soft); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px;
  max-height: 220px; overflow: auto; color: var(--ink-2); line-height: 1.8;
}
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 20px; font-size: 13px; cursor: pointer; background: var(--card);
}
.pick:hover { border-color: var(--brand); }
.pick.on { background: rgba(74, 144, 217, .10); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.pick input { margin: 0; }

/* ---------- 启动兜底 ---------- */
.boot-fail { max-width: 560px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.boot-fail .boot-title { font-size: 16px; font-weight: 700; }
.boot-fail .btn-row { justify-content: center; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px; border: 1px solid var(--line); background: var(--card); border-radius: 20px;
  font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 迷你条 ---------- */
.mini-bar { width: 100%; height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.mini-bar > div { height: 100%; border-radius: 4px; }

/* ---------- 报告 ---------- */
.report { background: var(--card); padding: 4px 0; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  border-bottom: 2px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.rp-title h2 { margin: 0 0 4px; font-size: 22px; }
.rp-score { text-align: center; }
.rp-ovr {
  font-size: 30px; font-weight: 800; color: #fff; border-radius: 12px;
  padding: 8px 22px; display: inline-block; line-height: 1.1;
}
.rp-band { font-weight: 700; margin-top: 6px; }
.rp-sec { margin-bottom: 22px; page-break-inside: avoid; }
.rp-sec h4 { font-size: 15px; margin: 0 0 8px; padding-left: 9px; border-left: 3px solid var(--brand); }
.rp-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.rp-foot { border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; line-height: 1.7; }
.tiny-in { width: 74px; }

/* ---------- 打印：只留报告主体 ---------- */
@media print {
  #side, #toolbar, .no-print, .tabs, .btn, .btn-row { display: none !important; }
  body { background: var(--card); }
  #main { padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  .rp-sec { page-break-inside: avoid; }
  .report { font-size: 12px; }
}

/* ---------- 变化标注 ---------- */
.delta-pos { color: var(--ok); font-weight: 600; }
.delta-neg { color: var(--err); font-weight: 600; }
.qcard { border-left: 3px solid var(--brand); padding-left: 12px; margin: 10px 0; }
.warn-box {
  background: rgba(232, 177, 60, .12); border: 1px solid rgba(232, 177, 60, .35);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #8a6316; margin-bottom: 14px;
}

/* ---------- 球商测评 ---------- */
.quiz-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-prog { flex: 1; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.quiz-prog > div { height: 100%; background: var(--brand); transition: width .2s; }
.quiz-q { font-size: 16px; font-weight: 600; line-height: 1.6; margin: 6px 0 16px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; background: var(--card); line-height: 1.5;
}
.quiz-opt:hover { border-color: var(--brand); background: var(--surface-soft); }
.quiz-opt.on { border-color: var(--brand); background: rgba(74,144,217,.07); }
.quiz-opt input { margin-top: 3px; }
.quiz-mark {
  flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--line-2); color: var(--ink-2);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.quiz-opt.on .quiz-mark { background: var(--brand); color: #fff; }
.bq-score-row { display: flex; align-items: center; gap: 24px; margin-bottom: 8px; }
.bq-score { text-align: center; }
.bq-num { font-size: 40px; font-weight: 800; line-height: 1; color: var(--brand); }
.bq-band { font-weight: 700; margin-top: 5px; }
.bq-meta { flex: 1; line-height: 1.8; }
.bq-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.bq-item-q { font-weight: 600; margin-bottom: 8px; line-height: 1.55; }
.bq-item-opts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.bq-opt-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.bq-opt-line.right { color: var(--ok); font-weight: 600; }
.bq-opt-line.wrong { color: var(--err); }
.bq-why { font-size: 13px; color: var(--ink-2); background: var(--surface-soft); border-radius: 8px; padding: 9px 11px; line-height: 1.6; }

/* ---------- 权限矩阵 ---------- */
.perm-wrap { overflow-x: auto; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { border-bottom: 1px solid var(--line-2); padding: 9px 10px; text-align: left; }
.perm-table thead th { color: var(--ink-2); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); }
.perm-act { min-width: 260px; }
.perm-name { font-weight: 600; }
.perm-hint { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.perm-role { width: 86px; text-align: center !important; }
.perm-cell { text-align: center !important; }
.perm-cell input { width: 16px; height: 16px; cursor: pointer; }

/* ---------- 本次测什么 ---------- */
.mt-group { margin-bottom: 14px; }
.mt-group-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.mt-pick { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; }
.mt-tag {
  font-size: 10px; color: var(--muted); background: var(--surface-soft); border-radius: 9px; padding: 1px 7px;
}
.mt-tag.ok { color: var(--ok); background: rgba(63,176,139,.12); }
.mt-tag.warn { color: var(--warn); background: rgba(232,177,60,.14); }

/* ---------- 报告列表 ---------- */
.score-chip {
  display: inline-block; min-width: 46px; padding: 3px 9px; border-radius: 7px; color: #fff;
  font-weight: 700; font-size: 13px; text-align: center;
}

/* 本次不测的列：淡化但不隐藏（随时可以再测） */
th.col-off, td.col-off { background: repeating-linear-gradient(-45deg, #fafbfd, #fafbfd 6px, #f2f4f8 6px, #f2f4f8 12px); }
th.col-off { opacity: .62; }
td.col-off input { background: transparent; color: var(--muted); }
.tag.off { background: var(--line-2); color: var(--muted); }

/* ---------- 数据完整性 ---------- */
input.cell.bad-val {
  background: rgba(224, 103, 74, .12);
  border: 1px solid var(--err);
  color: var(--err);
  font-weight: 600;
}
input.cell.bad-val:focus { box-shadow: 0 0 0 2px rgba(224, 103, 74, .18); }
.issue-bar {
  background: var(--card); border: 1px solid var(--warn); border-left: 4px solid var(--warn);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
}
.issue-bar.has-err { border-color: var(--err); border-left-color: var(--err); }
.issue-bar > b { display: block; margin-bottom: 6px; }
.issue-list { font-size: 12.5px; line-height: 1.7; }
.audit-sec { margin-bottom: 14px; }
.audit-item { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.audit-item:last-child { border-bottom: none; }

/* ---- 云端设置向导 ---- */
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.wstep { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 13px; }
.wstep .wnum { display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--line); font-size: 12px; font-weight: 600; }
.wstep.done { background: rgba(63,176,139,.12); border-color: #bfe3c9; color: #1a7f37; }
.wstep.done .wnum { background: #1a7f37; color: #fff; }
.wstep.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wstep.on .wnum { background: rgba(255,255,255,.28); color: #fff; }

.guide-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; background: var(--surface-soft); }
.guide-steps { margin: 10px 0 0; padding-left: 22px; line-height: 1.9; font-size: 14px; }
.guide-steps li { margin-bottom: 4px; }
.guide-steps code, .guide-box code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.code-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; font-size: 13px; }
.code-box { width: 100%; box-sizing: border-box; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; background: var(--card); resize: vertical; }

.btn.small { padding: 3px 10px; font-size: 12px; }
.issue-bar.has-ok { border-color: var(--ok); background: rgba(63,176,139,.12); }
.issue-bar.has-ok b { color: var(--ok); }

/* ============================================================
   深色主题 —— 只覆盖变量，不动任何布局
   切换靠 <html data-theme="dark">，无需重排，配合 transition 平滑过渡
   ============================================================ */
[data-theme="dark"] {
  /* 真深色：背景接近纯黑，卡片只比背景亮一点点，层次靠边框而非阴影 */
  --bg: #0a0c10;
  --card: #12151b;
  --surface-soft: #171b22;
  --ink: #e8edf5;
  --ink-2: #9aa8bb;
  --muted: #6b7889;
  --line: #232833;
  --line-2: #1a1e26;
  --brand: #5aa2e8;
  --ok: #3fb98c;
  --warn: #e8b13c;
  --err: #ef6a4d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] code, [data-theme="dark"] .mono { background: var(--surface-soft); color: var(--ink-2); }
[data-theme="dark"] input.cell { color: var(--ink); }
[data-theme="dark"] table.grid th { background: var(--surface-soft); }
[data-theme="dark"] table.entry-table th { background: var(--surface-soft); color: var(--ink-2); }
[data-theme="dark"] table.entry-table td.sticky { background: var(--card); }
[data-theme="dark"] .nav-kbd { background: var(--surface-soft); }
[data-theme="dark"] #nav-search { background: var(--surface-soft); color: var(--ink); }
[data-theme="dark"] .modal-mask { background: rgba(0,0,0,.6); }
[data-theme="dark"] .input { background: var(--card); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .btn { background: var(--card); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .btn:hover { border-color: var(--brand); color: var(--brand); }
[data-theme="dark"] #loading { background: var(--bg); }

/* 主题切换：颜色平滑过渡（只过渡颜色，不触发重排） */
body, #app, .card, #side, #toolbar, #main {
  transition: background-color 260ms cubic-bezier(.4,0,.2,1),
              color 260ms cubic-bezier(.4,0,.2,1),
              border-color 260ms cubic-bezier(.4,0,.2,1);
}

/* 深色细节：确保列表、表头、输入、滚动条都跟着变深，不留浅色斑块 */
[data-theme="dark"] #side { background: #0d1015; border-right-color: var(--line); }
[data-theme="dark"] #toolbar { background: #0d1015; border-bottom-color: var(--line); }
[data-theme="dark"] .acc { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .acc-head { background: var(--card); }
[data-theme="dark"] .acc-head:hover { background: var(--surface-soft); }
[data-theme="dark"] .stat-card { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .nav-item:hover { background: var(--surface-soft); }
[data-theme="dark"] .nav-item.active { background: rgba(90,162,232,.16); }
[data-theme="dark"] table.grid tbody tr:hover { background: var(--surface-soft); }
[data-theme="dark"] table.entry-table td.sticky { background: var(--card); color: var(--ink); }
[data-theme="dark"] input.cell { color: var(--ink); }
[data-theme="dark"] input.cell:focus { background: rgba(90,162,232,.18); }
[data-theme="dark"] .tag { background: rgba(90,162,232,.18); color: var(--brand); }
[data-theme="dark"] .empty { color: var(--muted); }
[data-theme="dark"] ::selection { background: rgba(90,162,232,.35); }
[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a303b; border-radius: 5px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #37404e; }

/* ============================================================
   简洁模式（紧凑密度）
   只收间距与字号，不删任何功能与内容
   ============================================================ */
[data-density="compact"] .card { padding: 12px 14px; }
[data-density="compact"] .card-head { margin-bottom: 10px; }
[data-density="compact"] #view { padding: 10px 18px 32px; gap: 12px; }
[data-density="compact"] #toolbar { padding: 8px 18px; }
[data-density="compact"] table.grid th,
[data-density="compact"] table.grid td { padding: 6px 8px; font-size: 12.5px; }
[data-density="compact"] .stat-card { padding: 12px 14px; }
[data-density="compact"] .stat-value { font-size: 22px; }
[data-density="compact"] .legend { font-size: 11.5px; line-height: 1.6; margin-top: 7px; }
[data-density="compact"] .nav-item { padding: 5px 10px; font-size: 13px; }
[data-density="compact"] .nav-desc { display: none; }   /* 搜索仍可用，说明文字收起 */
[data-density="compact"] .setting-row { padding: 9px 0; }
[data-density="compact"] h3 { margin-bottom: 10px; font-size: 14px; }
[data-density="compact"] .btn { padding: 5px 11px; font-size: 12.5px; }
[data-density="compact"] .input { padding: 5px 9px; font-size: 12.5px; }
[data-density="compact"] .page-title { font-size: 19px; }
[data-density="compact"] .page-desc { font-size: 12px; }
[data-density="compact"] #side { width: 236px; flex: 0 0 236px; }
[data-density="compact"] .acc-head { padding: 10px 14px; }
[data-density="compact"] .modal-body { padding: 16px; }

/* 后端选择按钮上的难度标记 */
.be-tag {
  display: inline-block; font-size: 10px; padding: 0 5px; margin-left: 4px;
  border-radius: 8px; background: rgba(255,255,255,.22); opacity: .9; font-weight: 600;
}
.btn.primary .be-tag { background: rgba(255,255,255,.28); }
[data-theme="dark"] .be-tag { background: rgba(255,255,255,.16); }

/* ============================================================
   顶部下拉导航
   ============================================================ */
.topnav { display: flex; gap: 2px; align-items: stretch; flex-wrap: wrap; }
.tn-group { position: relative; }
.tn-head {
  background: transparent; border: 0; color: var(--ink-2); font: inherit;
  font-size: 13.5px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.tn-head:hover { background: var(--surface-soft); color: var(--ink); }
.tn-caret { font-size: 9px; opacity: .7; transition: transform 200ms var(--ease-out); }
.tn-group.open .tn-caret { transform: rotate(180deg); }
.tn-group.open .tn-head { background: var(--surface-soft); color: var(--brand); }

.tn-drop {
  position: absolute; top: 100%; left: 0; z-index: 60;
  min-width: 230px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.tn-group.open .tn-drop { opacity: 1; transform: none; pointer-events: auto; }
.tn-drop .nav-item { border-radius: 7px; }

/* 当前所在分组给个提示点 */
.tn-group.open-here .tn-head { color: var(--ink); font-weight: 600; }

/* 窄屏时下拉不溢出 */
@media (max-width: 900px) {
  .tn-drop { min-width: 200px; }
  .topnav { overflow-x: auto; }
}

/* ============================================================
   首页大字报
   ============================================================ */
.headline {
  display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap;
  border-radius: 14px; padding: 18px 22px; margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--card);
  animation: hlIn 420ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes hlIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hl-left { flex: 1 1 240px; }
.hl-right { flex: 1 1 260px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hl-kind { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.hl-title { font-size: 22px; font-weight: 800; margin: 2px 0; line-height: 1.2; }
.hl-main { font-size: 30px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.hl-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.hl-detail { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.hl-ops { display: flex; gap: 6px; }
.hl-dots { display: flex; gap: 5px; margin-top: 2px; }
.hl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background-color 200ms; }
.hl-dot.on { background: var(--brand); }
.headline.tone-gold .hl-main { color: #d9a441; }
.headline.tone-green .hl-main { color: var(--ok); }
.headline.tone-amber .hl-main { color: var(--warn); }
[data-density="compact"] .hl-main { font-size: 24px; }
[data-density="compact"] .hl-title { font-size: 18px; }
[data-density="compact"] .headline { padding: 13px 16px; }


/* 留言板 */
.fm-item { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.fm-item:last-child { border-bottom: 0; }
.fm-item.pinned { background: rgba(232,177,60,.06); border-radius: 8px; padding: 12px 10px; }
.fm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.fm-name { font-weight: 700; font-size: 14px; }
.fm-role { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--line-2); color: var(--ink-2); }
.fm-pin { font-size: 11px; color: var(--warn); font-weight: 700; }
.fm-time { font-size: 11.5px; margin-left: auto; }
.fm-text { font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }

/* ============================================================
   登录门
   ============================================================ */
.lg-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: lgIn 320ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes lgIn { from { opacity: 0 } to { opacity: 1 } }
.lg-card {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px 26px;
  box-shadow: var(--shadow);
  animation: lgCard 380ms cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes lgCard { from { opacity:0; transform: translateY(16px) scale(.97) } to { opacity:1; transform:none } }
.lg-brand { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.lg-sub { font-size: 13px; color: var(--ink-2); text-align: center; margin-bottom: 18px; }
.lg-note {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.7;
  background: var(--surface-soft); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 14px;
}
.lg-in { display: block; width: 100%; margin-bottom: 10px; padding: 10px 12px; }
.lg-btn { display: block; width: 100%; margin-bottom: 8px; padding: 10px; }
.lg-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }

/* 工具栏当前身份 */
.tb-who { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; font-size: 12.5px; }
.tb-who b { color: var(--ink); }
.tb-role {
  font-size: 10.5px; padding: 1px 7px; border-radius: 9px;
  background: var(--line-2); color: var(--ink-2);
}

/* 预设方案卡片 */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.preset-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: var(--surface-soft); display: flex; flex-direction: column; gap: 6px;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.preset-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.preset-card.rec { border-color: var(--ok); background: rgba(63,185,140,.07); }
.pc-name { font-weight: 700; font-size: 14.5px; }
.pc-tag { font-size: 10.5px; padding: 1px 8px; border-radius: 9px; align-self: flex-start; background: var(--line-2); color: var(--ink-2); }
.pc-tag.strict { background: rgba(239,106,77,.15); color: var(--err); }
.pc-tag.relax { background: rgba(63,185,140,.18); color: var(--ok); }
.pc-tag.age { background: rgba(90,162,232,.18); color: var(--brand); }
.pc-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; flex: 1; }

/* 登录门：分隔线与勾选 */
.lg-sep { position: relative; text-align: center; margin: 16px 0 12px; }
.lg-sep::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
.lg-sep span { position: relative; background: var(--card); padding: 0 10px; font-size: 11.5px; color: var(--muted); }
.lg-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); margin: -2px 0 10px; cursor: pointer; }
.lg-check input { width: auto; margin: 0; cursor: pointer; }

/* 危险操作区（恢复出厂设置） */
.danger-card { border-color: rgba(239,106,77,.45); }
.btn.danger { color: var(--err); border-color: rgba(239,106,77,.5); }
.btn.danger:hover { background: rgba(239,106,77,.12); border-color: var(--err); }

/* ── 锁屏：未输码时整页打灰、模糊、点不动 ── */
body.locked #app,
body.locked #sidebar,
body.locked #topbar {
  filter: blur(9px) grayscale(1);
  opacity: .5;
  pointer-events: none;
  user-select: none;
}
body.locked #sidebar { filter: blur(9px) grayscale(1); }
.lock-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .82);
  backdrop-filter: blur(3px);
}
.lock-card {
  width: 340px; max-width: 92vw; padding: 30px 26px 24px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.lock-icon { font-size: 34px; margin-bottom: 6px; }
.lock-title { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.lock-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 18px; }
.lock-in { text-align: center; font-size: 16px; letter-spacing: 3px; margin-bottom: 12px; }
.lock-btn { width: 100%; }
.lock-tip { margin-top: 14px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.lock-warn { color: var(--warn); }
.lock-card.shake { animation: lockShake .32s; }
@keyframes lockShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* ── 解锁面板（不全屏锁，背景保持可见） ── */
.lock-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .55);
  backdrop-filter: blur(2px);
}
.lock-note {
  font-size: 11.5px; color: var(--muted); line-height: 1.55;
  margin: 0 0 14px; padding: 8px 10px;
  background: var(--bg2, rgba(128,128,128,.08));
  border-radius: 8px; text-align: left;
}
/* 访客：所有"新增/删除/保存/导入"类按钮置灰点不动 */
body.is-guest [data-act="add"],
body.is-guest [data-act="del"],
body.is-guest .btn.primary[data-act="save"],
body.is-guest [data-act="wipe"],
body.is-guest [data-act="import"] {
  opacity: .35;
  pointer-events: none;
  filter: grayscale(1);
}
body.is-guest .tb-role { color: var(--muted); }

/* ============================================================
   动效与水印增强层
   风格取向：快、微妙、有反馈（苹果那套），不炫技、不拖慢操作
   原则：只加动画与视觉修饰，不改任何布局属性，可一键整体关闭
   ============================================================ */

:root {
  --ease-out: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 160ms;
  --dur: 260ms;
  --dur-slow: 380ms;
}

/* ---------- 水印 ---------- */
/* 放在内容之下、背景之上：只在留白处透出来，不干扰阅读，截图时能标识来源 */
#motion-watermark {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 300px 190px;
  opacity: var(--wm-opacity, .05);
  transition: opacity var(--dur) var(--ease-out);
}
#motion-watermark[hidden] { display: none; }
/* 内容层抬到水印之上 */
#app { position: relative; z-index: 1; }

/* ---------- 视图切换 ---------- */
.m-view-in { animation: mViewIn var(--dur) var(--ease-out) both; }
@keyframes mViewIn {
  from { opacity: 0; transform: translateY(10px) scale(.994); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 卡片渐入（逐个错开，苹果列表的节奏感） ---------- */
.m-reveal { opacity: 0; transform: translateY(12px); }
.m-reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--m-delay, 0ms);
}

/* ---------- 卡片悬浮：轻微抬起 + 阴影加深 ---------- */
.card {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(38, 49, 63, .06), 0 12px 32px rgba(38, 49, 63, .10);
}

/* ---------- 按钮反馈：按下去真的会"缩一下" ---------- */
.btn, .btn.small {
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(.97); }

/* ---------- 侧栏导航：悬停时轻微右移 ---------- */
#side a, #side button {
  transition: background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
#side a:hover, #side button:hover { transform: translateX(2px); }

/* ---------- 弹层：弹性出现 ---------- */
.modal, .dialog, .modal-card, .sheet {
  animation: mPopIn var(--dur-slow) var(--ease-spring) both;
}
@keyframes mPopIn {
  from { opacity: 0; transform: scale(.94) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* 遮罩：毛玻璃 */
.modal-mask, .mask, .overlay, .sheet-mask {
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

/* ---------- 顶栏/侧栏毛玻璃（滚动时更像原生应用） ---------- */
#side { backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }

/* ---------- 焦点环：苹果那种柔和的外发光 ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, .28);
  border-radius: 8px;
}

/* ---------- 首屏进入 ---------- */
body { animation: mBodyIn var(--dur-slow) var(--ease-out) both; }
@keyframes mBodyIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 关闭动效（设置里可关） ---------- */
body.motion-off .m-reveal { opacity: 1 !important; transform: none !important; }
body.motion-off .m-view-in { animation: none !important; }
body.motion-off * {
  animation: none !important;
  transition: none !important;
}
body.motion-off .card:hover { transform: none; }

/* ---------- 尊重系统的"减弱动态效果" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .m-reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   丝滑转场衔接（本轮新增）
   ============================================================ */

/* 整页切换：淡入 + 轻微上浮，比原来更柔和 */
.m-view-in { animation: mViewIn 340ms cubic-bezier(.22,.61,.36,1) both; }
@keyframes mViewIn {
  from { opacity: 0; transform: translateY(14px) scale(.988); }
  to   { opacity: 1; transform: none; }
}

/* 卡片逐个浮现：拉长间隔差，营造连续感 */
.m-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms cubic-bezier(.22,.61,.36,1),
              transform 420ms cubic-bezier(.22,.61,.36,1);
}
.m-reveal.is-in { opacity: 1; transform: none; }

/* 侧栏导航：点击有滑入反馈 */
.nav-item { transition: background-color 200ms var(--ease-out),
                        color 200ms var(--ease-out),
                        transform 200ms var(--ease-out); }
.nav-item:active { transform: scale(.98); }

/* 按钮：按下回弹 */
.btn, .icon-btn { transition: all 180ms var(--ease-out); }
.btn:active { transform: scale(.965); }
.icon-btn:active { transform: scale(.9); }

/* 表格行：悬停柔和过渡 */
table.grid tbody tr { transition: background-color 180ms var(--ease-out); }

/* 输入框聚焦：光晕扩散 */
.input, #nav-search {
  transition: border-color 200ms var(--ease-out),
              box-shadow 200ms var(--ease-out),
              background-color 200ms var(--ease-out);
}

/* 模态框：弹性出现 + 遮罩淡入 */
.modal-mask { animation: mMaskIn 220ms var(--ease-out) both; }
.modal-box { animation: mBoxIn 320ms var(--ease-spring) both; }
@keyframes mMaskIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes mBoxIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* 下拉箭头、可折叠分组：展开平滑 */
.acc-arrow { transition: transform 260ms var(--ease-out); }
.acc-body { transition: opacity 200ms var(--ease-out); }

/* 进度条 */
.progress > div { transition: width 420ms cubic-bezier(.22,.61,.36,1); }

/* 全局滚动平滑（不影响性能，只在锚点跳转时生效） */
html { scroll-behavior: smooth; }

/* 尊重系统"减弱动态效果" */
@media (prefers-reduced-motion: reduce) {
  .m-view-in, .modal-mask, .modal-box { animation: none !important; }
  .m-reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* SID 页面与既有主题兼容样式 */
/* 篮球体测数据平台 —— 样式表（零依赖、浅色专业风） */
:root {
  color-scheme: light;
  --surface-soft: #f1f4f9;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #26313f;
  --ink-2: #5b6b80;
  --muted: #8a97a8;
  --line: #e3e8ef;
  --line-2: #eef1f6;
  --brand: #4a90d9;
  --ok: #3fb08b;
  --warn: #e8b13c;
  --err: #e0674a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(38, 49, 63, .04), 0 6px 20px rgba(38, 49, 63, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-soft); padding: 1px 5px; border-radius: 4px; }
h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.pos { color: var(--ok); }
.neg { color: var(--err); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- 布局（微软设置风格：左侧分类导航 + 右侧内容） ---------- */
#app { display: flex; min-height: 100vh; }
#side {
  width: 268px; flex: 0 0 268px; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #4a90d9, #3fb08b);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.brand-title { font-weight: 700; font-size: 14px; }
.brand-sub { font-size: 11px; color: var(--muted); }

/* 搜索框 */
.nav-search-wrap {
  position: relative; margin: 0 12px 10px; display: flex; align-items: center;
}
.nav-search-icon { position: absolute; left: 11px; color: var(--muted); font-size: 15px; pointer-events: none; }
#nav-search {
  width: 100%; padding: 8px 46px 8px 32px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-soft); font-size: 13px; color: var(--ink); outline: none; font-family: inherit;
}
#nav-search:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74,144,217,.12); }
#nav-search::-webkit-search-cancel-button { cursor: pointer; }
.nav-kbd {
  position: absolute; right: 8px; font-size: 10px; color: var(--muted); background: var(--surface-soft);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; pointer-events: none;
}

#nav { padding: 0 8px 8px; flex: 1; overflow: auto; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em;
  padding: 12px 12px 5px; text-transform: none;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface-soft); text-decoration: none; }
.nav-item.active { background: rgba(74, 144, 217, .10); color: var(--brand); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; opacity: .85; flex: 0 0 18px; font-size: 14px; }
.nav-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nav-title { font-size: 13.5px; line-height: 1.35; }
.nav-desc {
  font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-item.active .nav-desc { color: var(--brand); opacity: .75; }
.nav-tag {
  font-size: 10px; color: var(--muted); background: var(--surface-soft); border-radius: 4px;
  padding: 1px 6px; flex: 0 0 auto;
}
.nav-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); }

/* 页面标题区 */
#page-head { padding: 4px 26px 0; }
.page-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-desc { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
#crumb { padding: 8px 26px 0; font-size: 12px; color: var(--muted); }
#crumb a { color: var(--muted); }
.crumb-sep { margin: 0 6px; opacity: .6; }
.crumb-cur { color: var(--ink-2); font-weight: 600; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#view { padding: 12px 26px 48px; }

/* 设置项行列表（微软设置那种"标题+说明 在左，控件 在右"） */
.setting-row {
  display: flex; align-items: center; gap: 16px; padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
}
.setting-row:last-child { border-bottom: none; }
.setting-main { flex: 1; min-width: 0; }
.setting-name { font-size: 13.5px; font-weight: 600; }
.setting-hint { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.setting-ctrl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* 可折叠分组：默认收起，减少信息压迫感 */
.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 12px; overflow: hidden; }
.acc-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer;
  user-select: none; background: var(--card);
}
.acc-head:hover { background: var(--surface-soft); }
.acc-head h3 { margin: 0; flex: 1; font-size: 14px; }
.acc-arrow { color: var(--muted); font-size: 12px; transition: transform .15s; }
.acc.open .acc-arrow { transform: rotate(90deg); }
.acc-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line-2); }
.acc.open .acc-body { display: block; }
.acc-badge { font-size: 11px; color: var(--muted); background: var(--surface-soft); border-radius: 10px; padding: 1px 8px; }
#toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 22px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.tb-left { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tb-right { display: flex; gap: 12px; align-items: center; }
.tb-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
#view { padding: 22px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.legend { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- 统计卡 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
.stat-sub { font-size: 12px; color: var(--ink-2); }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.grid th { background: var(--surface-soft); color: var(--ink-2); font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 1; }
table.grid tbody tr:hover { background: var(--surface-soft); }
table.grid td.empty { text-align: center; color: var(--muted); padding: 24px; }

.ovr { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; text-align: center; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; background: rgba(74, 144, 217, .12); color: var(--brand); font-size: 11px; }

/* ---------- 录入表 ---------- */
.entry-wrap { overflow: auto; max-height: 68vh; }
table.entry-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.entry-table th {
  background: var(--surface-soft); padding: 6px 8px; border: 1px solid var(--line-2); font-weight: 600;
  font-size: 11px; color: var(--ink-2); text-align: center; min-width: 82px;
}
table.entry-table th .unit { display: block; font-weight: 400; color: var(--muted); font-size: 10px; }
table.entry-table th.derived { background: var(--surface-soft); color: var(--muted); }
table.entry-table td { border: 1px solid var(--line-2); padding: 0; }
table.entry-table td.sticky, table.entry-table th.sticky {
  position: sticky; left: 0; background: var(--card); z-index: 3; text-align: left; padding: 0 12px; min-width: 128px;
  border-right: 2px solid var(--line);
}
table.entry-table th.sticky { background: var(--surface-soft); z-index: 4; }
input.cell { width: 100%; min-width: 78px; border: 0; padding: 7px 8px; font-size: 12px; background: transparent; outline: none; text-align: right; }
input.cell:focus { background: rgba(74, 144, 217, .08); }
input.cell.derived { background: var(--surface-soft); color: var(--ink-2); text-align: right; cursor: default; }
input.cell.bad { background: rgba(224, 103, 74, .15); }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress { flex: 1; height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #4a90d9, #3fb08b); transition: width .3s; }

/* ---------- 表单 ---------- */
.input {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px;
  background: var(--card); color: var(--ink); outline: none; font-family: inherit; min-width: 120px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(74, 144, 217, .12); }
.input.num { text-align: right; }
.tiny-in { min-width: 72px; padding: 4px 6px; font-size: 12px; }
textarea.input { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); }
.field.wide { grid-column: 1 / -1; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.lbl { font-size: 12px; color: var(--ink-2); }
.btn-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #3d80c4; color: #fff; }
.btn.danger { color: var(--err); border-color: rgba(224, 103, 74, .4); }
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer;
  width: 26px; height: 26px; line-height: 1; font-size: 14px; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--err); color: var(--err); }

/* ---------- 评分方案编辑区 ---------- */
tr.edit-row > td { background: var(--surface-soft); padding: 16px !important; }
.edit-area { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
@media (max-width: 1000px) { .edit-area { grid-template-columns: 1fr; } }
.ea-left { display: flex; flex-direction: column; gap: 10px; }
.stops { display: flex; flex-direction: column; gap: 6px; }
.stop-row { display: flex; align-items: center; gap: 6px; }
.stop-row .input { min-width: 74px; }
.stop-row .arrow { color: var(--muted); }
.stop-row .lbl { font-size: 12px; color: var(--muted); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.curve-box { background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; }
.preview-wrap { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 18px; align-items: center; }
@media (max-width: 1000px) { .preview-wrap { grid-template-columns: 1fr; } }
.pv-score { text-align: center; }

/* ---------- 球员头部 ---------- */
.player-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.ph-left .ph-name { font-size: 22px; font-weight: 700; }
.ph-meta { color: var(--ink-2); font-size: 13px; }
.ph-right { text-align: center; }
.ph-ovr {
  font-size: 34px; font-weight: 800; color: #fff; border-radius: 12px;
  min-width: 92px; padding: 6px 14px; display: inline-block; line-height: 1.1;
}
.ph-band { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ---------- 模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(38, 49, 63, .45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-box { background: var(--card); border-radius: 14px; width: 100%; max-width: 760px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 加载 ---------- */
#loading { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; z-index: 200; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.help ol { padding-left: 20px; line-height: 1.9; }
.todo { margin: 0; padding-left: 20px; line-height: 1.9; color: var(--ink-2); }

/* ---------- 协作 / 选择 / 日志 ---------- */
.mode-tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.mode-tag.on { background: rgba(63, 176, 139, .14); color: var(--ok); font-weight: 600; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.log-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  background: var(--surface-soft); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px;
  max-height: 220px; overflow: auto; color: var(--ink-2); line-height: 1.8;
}
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 20px; font-size: 13px; cursor: pointer; background: var(--card);
}
.pick:hover { border-color: var(--brand); }
.pick.on { background: rgba(74, 144, 217, .10); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.pick input { margin: 0; }

/* ---------- 启动兜底 ---------- */
.boot-fail { max-width: 560px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.boot-fail .boot-title { font-size: 16px; font-weight: 700; }
.boot-fail .btn-row { justify-content: center; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px; border: 1px solid var(--line); background: var(--card); border-radius: 20px;
  font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 迷你条 ---------- */
.mini-bar { width: 100%; height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.mini-bar > div { height: 100%; border-radius: 4px; }

/* ---------- 报告 ---------- */
.report { background: var(--card); padding: 4px 0; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  border-bottom: 2px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.rp-title h2 { margin: 0 0 4px; font-size: 22px; }
.rp-score { text-align: center; }
.rp-ovr {
  font-size: 30px; font-weight: 800; color: #fff; border-radius: 12px;
  padding: 8px 22px; display: inline-block; line-height: 1.1;
}
.rp-band { font-weight: 700; margin-top: 6px; }
.rp-sec { margin-bottom: 22px; page-break-inside: avoid; }
.rp-sec h4 { font-size: 15px; margin: 0 0 8px; padding-left: 9px; border-left: 3px solid var(--brand); }
.rp-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.rp-foot { border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; line-height: 1.7; }
.tiny-in { width: 74px; }

/* ---------- 打印：只留报告主体 ---------- */
@media print {
  #side, #toolbar, .no-print, .tabs, .btn, .btn-row { display: none !important; }
  body { background: var(--card); }
  #main { padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  .rp-sec { page-break-inside: avoid; }
  .report { font-size: 12px; }
}

/* ---------- 变化标注 ---------- */
.delta-pos { color: var(--ok); font-weight: 600; }
.delta-neg { color: var(--err); font-weight: 600; }
.qcard { border-left: 3px solid var(--brand); padding-left: 12px; margin: 10px 0; }
.warn-box {
  background: rgba(232, 177, 60, .12); border: 1px solid rgba(232, 177, 60, .35);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #8a6316; margin-bottom: 14px;
}

/* ---------- 球商测评 ---------- */
.quiz-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-prog { flex: 1; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.quiz-prog > div { height: 100%; background: var(--brand); transition: width .2s; }
.quiz-q { font-size: 16px; font-weight: 600; line-height: 1.6; margin: 6px 0 16px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; background: var(--card); line-height: 1.5;
}
.quiz-opt:hover { border-color: var(--brand); background: var(--surface-soft); }
.quiz-opt.on { border-color: var(--brand); background: rgba(74,144,217,.07); }
.quiz-opt input { margin-top: 3px; }
.quiz-mark {
  flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--surface-soft); color: var(--ink-2);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.quiz-opt.on .quiz-mark { background: var(--brand); color: #fff; }
.bq-score-row { display: flex; align-items: center; gap: 24px; margin-bottom: 8px; }
.bq-score { text-align: center; }
.bq-num { font-size: 40px; font-weight: 800; line-height: 1; color: var(--brand); }
.bq-band { font-weight: 700; margin-top: 5px; }
.bq-meta { flex: 1; line-height: 1.8; }
.bq-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.bq-item-q { font-weight: 600; margin-bottom: 8px; line-height: 1.55; }
.bq-item-opts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.bq-opt-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.bq-opt-line.right { color: var(--ok); font-weight: 600; }
.bq-opt-line.wrong { color: var(--err); }
.bq-why { font-size: 13px; color: var(--ink-2); background: var(--surface-soft); border-radius: 8px; padding: 9px 11px; line-height: 1.6; }

/* ---------- 权限矩阵 ---------- */
.perm-wrap { overflow-x: auto; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { border-bottom: 1px solid var(--line-2); padding: 9px 10px; text-align: left; }
.perm-table thead th { color: var(--ink-2); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); }
.perm-act { min-width: 260px; }
.perm-name { font-weight: 600; }
.perm-hint { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.perm-role { width: 86px; text-align: center !important; }
.perm-cell { text-align: center !important; }
.perm-cell input { width: 16px; height: 16px; cursor: pointer; }

/* ---------- 本次测什么 ---------- */
.mt-group { margin-bottom: 14px; }
.mt-group-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.mt-pick { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; }
.mt-tag {
  font-size: 10px; color: var(--muted); background: var(--surface-soft); border-radius: 9px; padding: 1px 7px;
}
.mt-tag.ok { color: var(--ok); background: rgba(63,176,139,.12); }
.mt-tag.warn { color: var(--warn); background: rgba(232,177,60,.14); }

/* ---------- 报告列表 ---------- */
.score-chip {
  display: inline-block; min-width: 46px; padding: 3px 9px; border-radius: 7px; color: #fff;
  font-weight: 700; font-size: 13px; text-align: center;
}

/* 本次不测的列：淡化但不隐藏（随时可以再测） */
th.col-off, td.col-off { background: repeating-linear-gradient(-45deg, #fafbfd, #fafbfd 6px, #f2f4f8 6px, #f2f4f8 12px); }
th.col-off { opacity: .62; }
td.col-off input { background: transparent; color: var(--muted); }
.tag.off { background: var(--surface-soft); color: var(--muted); }

/* ---------- 数据完整性 ---------- */
input.cell.bad-val {
  background: rgba(224, 103, 74, .12);
  border: 1px solid var(--err);
  color: var(--err);
  font-weight: 600;
}
input.cell.bad-val:focus { box-shadow: 0 0 0 2px rgba(224, 103, 74, .18); }
.issue-bar {
  background: var(--card); border: 1px solid var(--warn); border-left: 4px solid var(--warn);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
}
.issue-bar.has-err { border-color: var(--err); border-left-color: var(--err); }
.issue-bar > b { display: block; margin-bottom: 6px; }
.issue-list { font-size: 12.5px; line-height: 1.7; }
.audit-sec { margin-bottom: 14px; }
.audit-item { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.audit-item:last-child { border-bottom: none; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#101722; --card:#192331; --surface-soft:#202d3d;
  --ink:#edf3fc; --ink-2:#bdcce0; --muted:#9bacc2;
  --line:#354459; --line-2:#2a394c; --brand:#79b9fa;
  --shadow:0 4px 20px rgba(0,0,0,.18);
}
.brand-sub,.page-desc,.nav-desc,.nav-group-title { display:none; }
#nav { padding-top:12px; }
@media print { :root[data-theme="dark"] {color-scheme:light;--bg:#fff;--card:#fff;--surface-soft:#f1f4f9;--ink:#26313f;--ink-2:#5b6b80;--muted:#68788a;--line:#e3e8ef;--line-2:#eef1f6;} }

.stat-row {margin-bottom:18px;grid-template-columns:repeat(3,minmax(0,1fr));}
.weight-chart svg {max-width:720px;display:block;margin:auto;}
[data-theme="dark"] svg text[fill="#5b6b80"], [data-theme="dark"] svg text[fill="#8a97a8"] {fill:var(--ink-2);}
[data-theme="dark"] svg [fill="#f1f4f9"], [data-theme="dark"] svg [fill="#fbfcfe"] {fill:var(--surface-soft);}
@media(max-width:600px){.stat-row{grid-template-columns:1fr;}}

[data-theme="dark"] svg text[fill="#3a4a5e"], [data-theme="dark"] svg text[fill="#26313f"] {fill:var(--ink);}


/* Test-day review: keep long explanations readable and actions visible. */
.workflow-review table.grid { table-layout:fixed; min-width:680px; }
.workflow-review table.grid td, .workflow-review table.grid th { white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
.workflow-review th:nth-child(1) { width:12%; }
.workflow-review th:nth-child(2) { width:40%; }
.workflow-review th:nth-child(3) { width:12%; }
.workflow-review th:nth-child(4) { width:24%; }
.workflow-review th:nth-child(5) { width:12%; }
@media print { .m-reveal {opacity:1!important;transform:none!important;} }

.growth-page .table-wrap td {vertical-align:top;}
.growth-page .card-head {gap:12px;flex-wrap:wrap;}
.growth-page #growth-chart {max-width:900px;margin:auto;}
.growth-page .stat-row {margin:14px 0;}
@media print { .growth-page .no-print {display:none!important;} .growth-page .card {break-inside:avoid;} }

.growth-page .stat-row {grid-template-columns:repeat(4,minmax(0,1fr));}
@media(max-width:800px){.growth-page .stat-row{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:480px){.growth-page .stat-row{grid-template-columns:1fr;}}

#save-status {padding:6px 24px;font-size:12px;color:var(--muted);min-height:28px;}
#save-status[data-state="error"] {color:#c54935;background:rgba(224,103,74,.12);}
#save-status .btn {margin-left:12px;}
