:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --line: #e3e5e8;
  --line-strong: #cfd3d8;
  --text: #1b1f24;
  --muted: #6b7280;
  --muted-2: #9aa1a9;
  --accent: #b23a2e;
  --green: #2f6b46;
  --amber: #8a5a1f;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: 13px; color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 58px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  font-weight: 700; font-size: 13px; letter-spacing: .06em;
  color: #fff; background: var(--accent);
  padding: 4px 7px; border-radius: 3px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 14px; font-weight: 600; }
.brand-text span { font-size: 11.5px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 14px; }
.inline-field { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.inline-field select {
  height: 32px; padding: 0 28px 0 9px; border: 1px solid var(--line-strong);
  border-radius: 3px; background: #fff; color: var(--text);
}

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: #3c8a5f; }
.sync.off i { background: #b23a2e; }
.sync.off { color: var(--accent); }

/* ---------- 参数栏 ---------- */
.subbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.params { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.params label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.params input {
  width: 68px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: 3px; background: #fff; font-variant-numeric: tabular-nums;
}
.params input:focus { outline: none; border-color: #8b9098; }
.file-tools { display: flex; align-items: center; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 12px; border: 1px solid var(--line-strong);
  background: #fff; border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f3f4f5; }
.btn-dark { background: #1f2328; border-color: #1f2328; color: #fff; }
.btn-dark:hover { background: #33383e; }
.btn:disabled { opacity: .55; cursor: default; }
.link {
  border: 0; background: none; padding: 0; color: var(--muted);
  cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 2px;
}
.link:hover { color: var(--accent); }

/* ---------- 布局 ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 296px;
  gap: 18px; max-width: 1480px; margin: 0 auto; padding: 18px 20px 48px;
}
.main { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 概览 ---------- */
.summary {
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 18px;
}
.summary .cell { padding: 12px 16px; border-left: 1px solid var(--line); }
.summary .cell:first-child { border-left: 0; }
.summary .cell.clickable { cursor: pointer; }
.summary .cell.clickable:hover { background: #fafbfc; }
.summary .k { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.summary .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.summary .v small {
  display: block; margin-top: 3px; font-size: 11px; font-weight: 400;
  color: var(--muted); letter-spacing: 0;
}

/* ---------- 区块标题 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; }
.section-head h2 { font-size: 13px; font-weight: 600; margin: 0; }
.legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.qual { background: var(--green); }
.dot.ff { background: #a8adb3; }
.dot.adj { background: var(--amber); }
.dot.wait { background: #b5892f; }

/* ---------- 小组 ---------- */
.group {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.group.flash { box-shadow: 0 0 0 2px #d9b26a; }
.sub { color: var(--muted); font-size: 11px; font-weight: 400; }
.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fcfcfd;
}
.gh-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.gno {
  font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums;
}
.group-head h3 { font-size: 13.5px; font-weight: 600; margin: 0; white-space: nowrap; }
.gmeta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghead-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.gtag { font-size: 11.5px; color: var(--muted); }
.gtag.ok { color: var(--green); }
.gtag.pending { color: var(--amber); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 11px; color: var(--muted);
  padding: 7px 10px; border-bottom: 1px solid var(--line); background: #fff;
}
.tbl td { padding: 7px 10px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }

td.rank { width: 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
td.name .pname { font-weight: 500; }
td.name .pid { color: var(--muted-2); font-size: 11.5px; margin-left: 6px; }
td.name .pid.same { display: none; }
td.pts { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
td.pts .adj { color: var(--amber); font-weight: 500; font-size: 11px; margin-left: 3px; }

tr.row.qual td.rank { box-shadow: inset 2px 0 0 var(--green); }
tr.row.qual td.pts { color: var(--green); }
tr.row.ff td { color: var(--muted-2); background: #fafafa; }
tr.row.ff td.pts { color: var(--muted-2); font-weight: 400; }
tr.row.wait td.rank { box-shadow: inset 2px 0 0 #b5892f; }

.tag { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tag.qual { color: var(--green); }
.tag.ff { color: var(--muted-2); }
.tag.wait { color: var(--amber); }
.tag.manual { color: var(--amber); }

td.ops { width: 52px; text-align: right; }
td.ops .link { color: var(--muted-2); text-decoration: none; }
tr.row:hover td.ops .link { color: var(--accent); text-decoration: underline; }

/* ---------- 逐局明细 ---------- */
.races { border-top: 1px solid var(--line); background: #fcfcfd; padding: 10px 14px 14px; }
.races .loading { color: var(--muted); font-size: 12px; padding: 6px 0; }
.race { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.race:last-child { border-bottom: 0; }
.race-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.race-head b { font-size: 12px; font-variant-numeric: tabular-nums; }
.race-head span { color: var(--muted); font-size: 11.5px; }
.race-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 18px; }
.race-row { display: grid; grid-template-columns: 22px 1fr 44px; gap: 6px; font-size: 11.5px; padding: 1px 0; }
.race-row .r { color: var(--muted); font-variant-numeric: tabular-nums; }
.race-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-row .p { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.race-row.dnf .p { color: var(--accent); }

/* ---------- 侧栏 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { font-size: 12px; font-weight: 600; margin: 0; letter-spacing: .02em; }
.count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.todo-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; }
.todo-group { border-top: 1px solid #f0f1f3; padding-top: 8px; }
.todo-group:first-child { border-top: 0; padding-top: 0; }
.todo-title { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; margin-bottom: 5px; }
.todo-title span { color: var(--muted); font-weight: 400; }
.todo-item {
  display: flex; width: 100%; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 3px;
  padding: 5px 8px; margin-bottom: 4px; cursor: pointer; font-size: 11.5px; text-align: left;
}
.todo-item:hover { border-color: #b9bdc3; background: #fafafa; }
.todo-item .id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-item .go { color: var(--muted); }
.todo-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 2px; }

.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.file-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fmeta { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-item .del { border: 0; background: none; color: var(--muted-2); cursor: pointer; padding: 0 2px; }
.file-item .del:hover { color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: 11.5px; line-height: 1.7; }
.meta-list { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 10px 0 0; font-size: 11.5px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.empty { background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0; font-size: 12px; }

/* ---------- 弹窗 ---------- */
dialog {
  width: 440px; max-width: calc(100vw - 32px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
dialog::backdrop { background: rgba(20, 22, 25, .38); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.dlg-close { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.dlg-close:hover { color: var(--text); }
.dlg-close:focus { outline: none; }
.dlg-sub { margin: 0; padding: 10px 16px 0; font-size: 11.5px; color: var(--muted); }
#editForm { padding-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; padding: 10px 16px 0; font-size: 12px; color: var(--muted); }
.field input, .field select {
  height: 34px; padding: 0 9px; border: 1px solid var(--line-strong);
  border-radius: 3px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: #8b9098; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 16px 0; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #1f2328; color: #fff; font-size: 12px;
  padding: 8px 14px; border-radius: 3px; z-index: 50;
}

/* ---------- 视图切换 ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab {
  border: 0; background: none; padding: 6px 10px; cursor: pointer;
  color: var(--muted); font-size: 12.5px; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }

.filterbar { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 3px;
  padding: 4px 10px; font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: #1f2328; border-color: #1f2328; color: #fff; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-wrap .tbl th { background: #fcfcfd; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafbfc; }
.tbl td .sub { color: var(--muted); font-size: 11px; }

/* ---------- 选手 / 赛道弹窗 ---------- */
dialog.wide { width: 760px; }
.dlg-body { padding: 14px 16px 0; max-height: 64vh; overflow: auto; }
.pd-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 14px; }
.pd-stats .cell { padding: 9px 11px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.pd-stats .cell:nth-child(-n+4) { border-top: 0; }
.pd-stats .cell:nth-child(4n+1) { border-left: 0; }
.pd-stats .k { font-size: 11px; color: var(--muted); }
.pd-stats .v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pd-note { background: #fbf7ef; border: 1px solid #eadfc8; color: #6d5323; border-radius: 3px; padding: 8px 10px; font-size: 11.5px; margin-bottom: 12px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 5px 8px; border-bottom: 1px solid #f2f3f5; vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-table tr.clickable:hover td { background: #fafbfc; }
.mini-table .dnf { color: var(--accent); }

.anomaly-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.anomaly-item {
  display: flex; gap: 8px; width: 100%; text-align: left; align-items: baseline;
  border: 0; border-bottom: 1px solid #f0f1f3; background: none;
  padding: 9px 12px; font-size: 12px; color: var(--text); cursor: default;
}
.anomaly-item:last-child { border-bottom: 0; }
.anomaly-item.goto { cursor: pointer; }
.anomaly-item.goto:hover { background: #fafbfc; }
.anomaly-item .idx { color: var(--muted-2); font-size: 11px; min-width: 22px; font-variant-numeric: tabular-nums; }
.anomaly-item .txt { flex: 1; line-height: 1.6; }
.anomaly-item .go { color: var(--muted); font-size: 11px; }

/* ================================================================
   文档版式：显式方框（2026-12 改版）
   目标：每个视图 / 每个小组 / 每张表 / 每个侧栏块都有一眼可辨的边框
   ================================================================ */
:root {
  --box: #aeb6c0;
  --box-soft: #d3d8de;
  --box-head: #edf0f3;
  --box-head-2: #e3e8ee;
  --box-shadow: 0 1px 2px rgba(16, 20, 24, .06), 0 6px 18px rgba(16, 20, 24, .06);
}

.topbar { border-bottom: 2px solid var(--box-soft); }
.subbar { border-bottom: 2px solid var(--box-soft); }

/* 页签：带编号徽章，未选中也有边框 */
.tabs { gap: 6px; }
.tab {
  border: 1px solid var(--box-soft); background: #fff; border-radius: 5px;
  padding: 5px 10px; color: #4a5360;
}
.tab em {
  font-style: normal; font-size: 10px; line-height: 1.2; color: #7a828c;
  border: 1px solid var(--box-soft); border-radius: 3px; padding: 1px 4px;
  margin-right: 6px; font-variant-numeric: tabular-nums;
}
.tab:hover { border-color: var(--box); color: var(--text); }
.tab.active {
  background: #20252b; border-color: #20252b; color: #fff; font-weight: 500;
}
.tab.active em { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 视图 = 一页文档 */
.view.doc {
  background: #fff; border: 2px solid var(--box); border-radius: 10px;
  box-shadow: var(--box-shadow); overflow: hidden;
}
.doc-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--box-head); border-bottom: 2px solid var(--box);
  border-left: 6px solid var(--accent);
}
.doc-no {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 26px; padding: 0 7px; border-radius: 4px;
  background: #20252b; color: #fff; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.doc-title { flex: 1; min-width: 0; }
.doc-title h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.doc-title span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.doc-tag {
  flex: none; padding: 3px 10px; border: 1px solid var(--box-soft); border-radius: 999px;
  background: #fff; font-size: 11.5px; color: #46505c; font-variant-numeric: tabular-nums;
}
.doc-body { padding: 14px; }

/* 小组卡片 */
.group {
  background: #fff; border: 2px solid var(--box); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, .05); margin-bottom: 16px; overflow: hidden;
}
.group.closed { border-left: 6px solid #2f6b46; }
.group.open { border-left: 6px solid #b5892f; }
.group-head { padding: 9px 14px; background: var(--box-head); border-bottom: 2px solid var(--box); }
.group-head h3 { font-size: 14px; }
.gno { background: #20252b; color: #fff; border-radius: 3px; padding: 1px 5px; font-size: 10.5px; }

/* 表格：表头加深、网格线可见 */
.table-wrap {
  border: 2px solid var(--box); border-radius: 9px; overflow: auto;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 20, 24, .04);
}
.table-wrap.bare { border: 0; border-radius: 0; box-shadow: none; }
.tbl th {
  background: var(--box-head-2); color: #333b45; font-weight: 600;
  border-bottom: 1px solid var(--box-soft); border-right: 1px solid #e2e6ea;
  padding: 8px 10px; white-space: nowrap;
}
.tbl th:last-child { border-right: 0; }
.tbl td { border-bottom: 1px solid #e8ebef; border-right: 1px solid #f1f3f6; }
.tbl td:last-child { border-right: 0; }
.tbl tbody tr:nth-child(even) td { background: #fbfcfd; }
.tbl tbody tr:hover td { background: #f3f6fa; }
.tbl .pid-cell { color: #5a626d; font-size: 11.5px; }
.tbl .note-cell { color: #6b7280; font-size: 11.5px; }

/* 概览 */
.summary { border: 2px solid var(--box); border-radius: 9px; overflow: hidden; box-shadow: var(--box-shadow); }
.summary .cell { border-left: 1px solid var(--box-soft); }

/* 侧栏每块也是独立方框 */
.panel {
  padding: 0; background: #fff; border: 2px solid var(--box); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, .05); overflow: hidden;
}
.panel-head {
  margin: 0 0 12px; padding: 9px 12px; background: var(--box-head);
  border-bottom: 2px solid var(--box); border-left: 6px solid var(--accent);
}
.panel-head h3 { font-size: 12.5px; }
.panel > *:not(.panel-head) { margin-left: 13px; margin-right: 13px; }
.panel > *:last-child { margin-bottom: 12px; }

/* 其他独立块 */
.anomaly-list { border: 2px solid var(--box); border-radius: 9px; overflow: auto; box-shadow: 0 1px 2px rgba(16, 20, 24, .04); }
.empty { border: 2px dashed var(--box); border-radius: 9px; }
.chip { border: 1px solid var(--box-soft); }
.races { border-top: 2px solid var(--box-soft); background: #f7f9fb; }

/* 编辑按钮：小方块，不再是淡链接 */
td.ops .link {
  display: inline-block; border: 1px solid var(--box-soft); border-radius: 4px;
  padding: 2px 8px; background: #fff; color: #46505c; text-decoration: none;
  white-space: nowrap;
}
/* 备注列与操作列给足宽度，避免被挤成一条缝 */
.tbl th.ops, .tbl td.ops { width: 68px; min-width: 68px; text-align: center; }
.tbl th.note, .tbl td.note-cell { min-width: 110px; }
tr.row:hover td.ops .link { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; order: 2; }
  .side .panel:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .summary { grid-template-columns: repeat(3, 1fr); }
  .summary .cell:nth-child(4) { border-left: 0; }
  .summary .cell:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .hide-sm { display: none; }
  .race-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .subbar { padding: 10px 14px; }
  .layout { padding: 14px; }
  .side { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary .cell:nth-child(3) { border-left: 0; }
  .summary .cell:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  td.ops .link { visibility: visible; }
}

/* ---------- 赛道顺序编辑 ---------- */
.track-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; padding: 8px 12px; background: #fafbfc;
  border: 2px solid var(--box); border-radius: 8px;
}
.track-bar.editing { border-color: var(--accent); background: #fff8f6; }
.track-hint { font-size: 12px; color: var(--muted); }
.track-actions { display: flex; gap: 8px; flex-shrink: 0; }
.track-actions .btn { padding: 4px 10px; font-size: 12px; }
.drag-handle { width: 34px; text-align: center; color: #9aa3ad; cursor: grab; user-select: none; }
th.drag-handle { cursor: default; }
tr.sort-row { cursor: default; }
tr.sort-row.dragging { opacity: .4; }
tr.sort-row.drop-target td { border-top: 2px solid var(--accent); }
.sort-ops { width: 80px; text-align: center; white-space: nowrap; }
button.mini {
  width: 26px; height: 24px; margin: 0 1px; padding: 0; line-height: 1;
  border: 1px solid var(--box-soft); border-radius: 4px; background: #fff;
  color: #46505c; cursor: pointer;
}
button.mini:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button.mini:disabled { opacity: .32; cursor: default; }
/* hidden 属性优先于 .btn 的 display */
[hidden] { display: none !important; }
