* { box-sizing: border-box; }
body { margin: 0; font: 14px system-ui, -apple-system, "Segoe UI", sans-serif; color: #172033; background: #f4f7fb; }
button, select, input { font: inherit; }
button { cursor: pointer; border: 1px solid #c8d0dc; background: #fff; border-radius: 6px; padding: 4px 10px; }
button:hover { border-color: #1552b0; }
button:focus-visible, select:focus-visible, input:focus-visible, .timeline:focus-visible { outline: 2px solid #1552b0; outline-offset: 1px; }
.grow { flex: 1; }
.mono { font-family: ui-monospace, monospace; }
.pill { font: 12px ui-monospace, monospace; background: #eef2f7; border-radius: 999px; padding: 3px 10px; color: #344054; }

.bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 14px; background: #fff; border-bottom: 1px solid #e4e7ec; position: sticky; top: 0; z-index: 5; }
.bar label { display: flex; gap: 6px; align-items: center; color: #475467; }
.bar select { max-width: 260px; }
.jump { display: flex; gap: 6px; align-items: center; }

main { padding: 0 14px 60px; }
/* 顶部吸附区：--bar-h / --video-h 由 review.js 设置 */
.stage { position: sticky; top: var(--bar-h, 49px); z-index: 4; background: #f4f7fb; padding-top: 8px; }
.videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #000; padding: 6px; }
.videos figure { margin: 0; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }
.videos figcaption { position: absolute; top: 4px; left: 6px; color: #fff; font-size: 12px; text-shadow: 0 0 3px #000; z-index: 1; }
.videos video { width: 100%; height: var(--video-h, 26vh); object-fit: contain; background: #000; }

.ctrl { display: flex; gap: 12px; align-items: center; padding: 8px 0; flex-wrap: wrap; }
.ctrl label { display: flex; gap: 4px; align-items: center; }

.timeline { position: relative; height: 26px; background: #e4e7ec; border-radius: 4px; cursor: pointer; }
.tl-segs { position: absolute; inset: 0; }
.tl-seg { position: absolute; top: 0; bottom: 0; border-right: 1px solid #fff; }
.tl-seg.cur { box-shadow: inset 0 0 0 2px #172033; }
/* 段重叠：时间轴分层画（每层占 1/lanes 高），有重叠的段加边框标识 */
.tl-seg.ovl { border: 1px solid #fff; }
/* 播放头：深色 + 白描边。原来是红色 2px，压在调色板第一色（浅红）的段上就看不见了 */
.tl-head { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: #101828; box-shadow: 0 0 0 1px #fff; border-radius: 1px; pointer-events: none; z-index: 1; }

.hl { margin: 6px 0 2px; font-weight: 600; }
.msg { min-height: 1.4em; margin: 0; padding-bottom: 4px; color: #b42318; }
.msg.ok { color: #067647; }

.segs { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e4e7ec; }
.segs th { text-align: left; font-weight: 600; background: #f2f4f7; padding: 8px; position: sticky; top: var(--th-top, 49px); z-index: 2; }
/* 键盘切段时 scrollIntoView 别把当前行滚到吸附区下面 */
.segs tr { scroll-margin-top: calc(var(--th-top, 49px) + 40px); }
.segs td { padding: 6px 8px; border-top: 1px solid #eef0f3; vertical-align: middle; }
.segs tr.seg { cursor: pointer; }
.segs tr.seg:hover { background: #f8fafc; }
.segs tr.cur { background: #e8f0fd; }
/* 左边蓝条 = 当前段，画在 # 格上：对照模式下 # 跨这一段的所有模型行，蓝条也就画满整段 */
.segs tr.cur > td.num { box-shadow: inset 3px 0 0 #1552b0; }
/* 对照模式下数字键判的那一行颜色更深；跨行的 # / 时间格属于整段，不跟着变 */
.compare .segs tr.act > td:not([rowspan]) { background: #cfdffb; }
body:not(.compare) .cmp-only { display: none; }
.compare .segs tr.first td { border-top: 2px solid #98a2b3; }
.segs td.slot { width: 64px; white-space: nowrap; font-weight: 600; color: #344054; }
.segs td.slot .model { font-size: 11px; font-weight: 400; color: #6941c6; white-space: normal; word-break: break-all; }
.segs tr.unann td { color: #98a2b3; background: #f9fafb; }
/* 参考行：已审过的模型，只读，给人工校正标注当样板 */
.segs tr.ref > td:not([rowspan]) { background: #fffaeb; color: #475467; }
.segs tr.ref td.slot { color: #b54708; }
.segs tr.ref .why { color: #b54708; font-size: 12px; }
.segs .ref-fix { margin-top: 4px; color: #067647; font-size: 13px; }
/* 只用红色提示：保存失败 / 选「其他」没写描述 → 整行三个框标红；选了有错误还没选类型 → 错误类型框标红 */
.segs tr.err .judge, .segs tr.err .etype, .segs tr.err .note,
.segs tr.pending .etype, .segs tr.err .fix,
.segs tr.nofix .fix:not(:disabled) { border-color: #f04438; background: #fef3f2; }
.segs td.num { width: 52px; color: #667085; }
/* 与别的段时间重叠（FLORA 的 retry / 兜底路径会产出包含关系的区间） */
.segs td.num .ovl { margin-left: 3px; color: #b54708; cursor: help; }
.segs td.t { width: 70px; font-family: ui-monospace, monospace; white-space: nowrap; }
.segs td.cap { line-height: 1.5; }
.segs .judge { width: 96px; padding: 3px 4px; border: 1px solid #c8d0dc; border-radius: 6px; }
.segs .etype { width: 190px; padding: 3px 4px; border: 1px solid #c8d0dc; border-radius: 6px; }
.segs .etype:disabled { background: #f2f4f7; color: #98a2b3; }
.segs .note { width: 200px; padding: 3px 6px; border: 1px solid #c8d0dc; border-radius: 6px; }
.segs .fix { width: 340px; padding: 3px 6px; border: 1px solid #c8d0dc; border-radius: 6px;
             font: inherit; line-height: 1.4; resize: vertical; vertical-align: middle; }
.segs .fix:disabled { background: #f2f4f7; color: #98a2b3; }
.segs .why { font-size: 12px; color: #98a2b3; }
.help { color: #667085; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 8px; font-size: 12px; color: #475467; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 22px; height: 14px; border-radius: 3px; border: 1px solid #c8d0dc; }
.sw-cur { background: #e8f0fd; border-color: #e8f0fd; box-shadow: inset 3px 0 0 #1552b0; }
.sw-act { background: #cfdffb; border-color: #cfdffb; }
.sw-err { background: #fef3f2; border-color: #f04438; }
.sw-unann { background: #f9fafb; border-color: #e4e7ec; }
.sw-ref { background: #fffaeb; border-color: #fedf89; }
.sw-ovl { color: #b54708; font-size: 14px; }

/* 登录页（templates/login.html） */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { background: #fff; border: 1px solid #e4e7ec; border-radius: 10px; padding: 28px 32px; max-width: 420px; width: 100%; }
.login-box h1 { margin: 0 0 10px; font-size: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 6px; }
.login-box label { color: #475467; font-size: 13px; }
.login-box input { padding: 8px 10px; border: 1px solid #c8d0dc; border-radius: 6px; width: 100%; }
.login-box button { margin-top: 10px; padding: 8px; background: #1552b0; color: #fff; border-color: #1552b0; }
.login-box button:hover { background: #10418d; }
.login-hint { color: #475467; font-size: 13px; line-height: 1.5; margin: 0 0 18px; }
.login-err { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 6px; padding: 6px 10px; margin: 6px 0 0; font-size: 13px; }
.login-foot { color: #98a2b3; font-size: 12px; margin: 18px 0 0; }

/* 顶栏身份标识 */
.who { font-size: 12px; color: #475467; display: flex; align-items: center; gap: 8px; }
.who .ro { background: #fffaeb; border: 1px solid #fedf89; color: #b54708; border-radius: 999px; padding: 2px 8px; }
.who form { display: inline; }
.who button { padding: 2px 8px; font-size: 12px; }
