/* classic.css —— 01 经典模式 #classic（任务 3）。只写本节的选择器（以本节 id 或本节专用类名开头）。
   静态标记即终态（R10）：无 JS / 减弱动效 / 模块失败时不钉住、界面停在终态、六条说明排在界面下方；
   JS 在非减弱动效时给本节加 .live 并按 C4 公式驱动 data-beat（0–6）与各提示点。 */

/* ── 节内杂项 ── */
#classic .demo-skip { margin-bottom: 10px; font-size: 14px; line-height: 22px; }
#classic .demo-note { margin-top: 28px; color: var(--text-4); font-size: 14px; line-height: 22px; }

/* ── 钉住结构（默认静态：不钉住） ── */
#classic .pin-track { height: auto; }
#classic .pin { position: relative; padding: 0 16px; }
/* 视口高不是 5 的倍数时 460vh 是小数（768→3532.8），会把 #classic 之后所有节顶到半像素上；
   取整到 1px，回退照 .nf 的写法（classic.js 的进度公式读实际高度，不受影响） */
#classic.live .pin-track { height: 460vh; height: round(down, 460vh, 1px); }
#classic.live .pin {
  position: sticky; top: 56px; height: calc(100svh - 56px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#classic .stage { position: relative; }
#classic.live .stage {
  transform: scale(calc(.92 + .08 * var(--enter, 1)));
  opacity: var(--enter, 1);
}
#classic.live[data-fit="full"] .stage {
  flex: none;
  width: calc(1280px * var(--s, 1));
  height: calc(760px * var(--s, 1));
}


/* ── 界面框（.app 内部照产品用细线矢量图标与系统字体，R11） ── */
#classic .app {
  position: relative; margin: 0 auto; max-width: 1280px;
  background: var(--bg); border: 1px solid var(--line-1); border-radius: 14px;
  overflow: visible; color: var(--text-1);
  font-size: 13px; line-height: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
#classic .hud-x { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
#classic .app.hud::before, #classic .app.hud::after, #classic .hud-x::before, #classic .hud-x::after { z-index: 8; }

@media (min-width: 1024px) {
  #classic .app { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; height: 760px; }
}
#classic.live[data-fit="full"] .app {
  width: 1280px; height: 760px; max-width: none;
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px;
  transform: scale(var(--s, 1)); transform-origin: 0 0;
}
#classic.live[data-fit="compact"] .app { border-radius: 12px; }

/* 界面内的细线矢量图标 */
#classic .ai {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── 左栏：会话 ── */
#classic .col-l {
  background: var(--sidebar); border-right: 1px solid var(--line-1);
  display: flex; flex-direction: column; padding: 10px 10px 8px; min-height: 0;
}
#classic .sb-brand { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
#classic .sb-brand img { border-radius: 3px; }
#classic .sb-name { font-size: 14px; font-weight: 700; }
#classic .sb-brand .ai { margin-left: auto; color: var(--text-3); }
#classic .sb-new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; margin-bottom: 6px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); font-weight: 600;
}
#classic .sb-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; color: var(--text-2); }
#classic .sb-group { margin: 12px 6px 2px; color: var(--text-4); display: flex; align-items: center; gap: 6px; }
#classic .sb-gacts { margin-left: auto; display: flex; gap: 10px; color: var(--text-4); }
#classic .sb-gacts .ai { width: 14px; height: 14px; }
#classic .sb-ws { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; color: var(--text-2); }
#classic .sb-ws .ai { width: 15px; height: 15px; color: var(--text-3); }
#classic .sb-ws.is-open { color: var(--text-1); font-weight: 600; }
#classic .sb-ws.is-open .ai { color: var(--accent); }
#classic .sb-sess { display: flex; align-items: center; gap: 8px; margin-left: 14px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); }
#classic .sb-sess.is-cur { background: var(--raised); color: var(--text-1); }
#classic .sb-sess-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#classic .sb-sess time { margin-left: auto; flex: none; color: var(--text-4); }
#classic .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-4); }
#classic .dot[data-state="running"] { background: var(--success); animation: c-dot 1.2s var(--ease-io) infinite; }
@keyframes c-dot { 50% { opacity: .45; } }
#classic .sb-foot { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line-1); }

/* ── 中栏：会话头与页签 ── */
#classic .col-m { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#classic .ch-head {
  display: flex; align-items: center; gap: 10px; flex: none;
  height: 46px; padding: 0 16px; border-bottom: 1px solid var(--line-1);
}
#classic .ch-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#classic .ch-tag {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border: 1px solid var(--line-1); border-radius: 999px;
  color: var(--text-3); font-size: 12px; line-height: 16px;
}
#classic .ch-tag .ai { width: 13px; height: 13px; }
#classic .ch-acts { margin-left: auto; display: flex; gap: 14px; color: var(--text-3); }
#classic .ch-tabs {
  display: flex; gap: 18px; flex: none; height: 38px; padding: 0 16px;
  border-bottom: 1px solid var(--line-1);
}
#classic .ch-tab { position: relative; display: flex; align-items: center; height: 100%; color: var(--text-3); }
#classic .ch-tab.is-on { color: var(--text-1); }
#classic .ch-tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }

/* ── 中栏：对话流 ── */
#classic .ch-scroll {
  position: relative;
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
#classic.live .ch-scroll { justify-content: flex-start; }
#classic.live .ch-scroll {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
}
#classic .ch-flow {
  position: relative; padding: 14px 20px 16px;
  width: 100%; max-width: 740px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 4px;
}
#classic .msg-u { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-bottom: 10px; }
#classic .bubble {
  max-width: 82%; padding: 8px 12px;
  background: var(--raised); border-radius: 12px;
  font-size: 14px; line-height: 22px;
}
#classic .msg-acts { display: flex; align-items: center; gap: 10px; color: var(--text-4); }
#classic .msg-acts .ai { width: 15px; height: 15px; }
#classic .ma-time { color: var(--text-4); }

/* 回合过程块：顶部用时行 / 组头 / 紧凑步骤行 */
#classic .took {
  display: flex; align-items: center; gap: 4px;
  margin: 0 0 4px; padding: 0 0 6px; border-bottom: 1px solid var(--line-1);
  color: var(--text-3); font-size: 12px; line-height: 18px;
}
#classic .took .ai { width: 14px; height: 14px; }
#classic .turn-hd {
  display: flex; align-items: center; gap: 6px;
  margin: 4px 0 6px; color: var(--text-3); font-size: 12px; line-height: 18px;
}
#classic .turn-hd .th-ch { width: 14px; height: 14px; color: var(--text-4); }
#classic .turn-hd .th-ic { width: 14px; height: 14px; }
#classic .turn-hd span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#classic .step { padding-left: 20px; }
#classic .t-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
#classic .t-ic { width: 15px; height: 15px; flex: none; color: var(--text-3); }
#classic .t-title { flex: none; font-weight: 600; white-space: nowrap; }
#classic .t-sep { flex: none; color: var(--text-4); }
#classic .t-sum { min-width: 0; flex: 1; color: var(--text-2); font-family: var(--f-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#classic .t-path { min-width: 0; flex: 1; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#classic .t-diff { flex: none; display: inline-flex; gap: 6px; font-family: var(--f-mono); font-size: 12px; }
#classic .t-diff .d-a { color: var(--success); font-style: normal; }
#classic .t-diff .d-d { color: var(--danger); font-style: normal; }
#classic .t-src { margin: 1px 0 0 22px; color: var(--text-4); font-size: 12px; line-height: 16px; }
#classic .t-body { margin: 6px 0 2px 22px; }

/* 代码 / 差异块 / 输入输出卡 */
#classic .code, #classic .diff, #classic .io {
  background: var(--stage); border: 1px solid var(--line-1); border-radius: 8px;
  font-family: var(--f-mono); font-size: 13px; line-height: 20px;
  overflow-x: auto;
}
#classic .code { padding: 8px 10px; color: var(--text-2); }
#classic .code-ln { white-space: pre; }
/* 通用工具行展开后的「输入 / 输出」卡：照实机 ToolRow 的 ioCard（标签一列、内容一列，中间一道细线）。
   terminal_send 在网页里就是这样显示的：输入是参数，输出是工具返回的 JSON 原文。 */
#classic .io { display: flex; flex-direction: column; overflow-x: visible; }
#classic .io-sec { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; align-items: baseline; padding: 8px 10px; }
#classic .io-l { color: var(--text-4); }
#classic .io-t { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
#classic .io-div { display: block; height: 1px; background: var(--line-1); }
#classic .io-x { font-weight: inherit; border-radius: 3px; }
#classic .d-hd {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 4px 10px; border-bottom: 1px solid var(--line-1); color: var(--text-3);
}
#classic .d-badge { display: flex; gap: 8px; font-style: normal; }
#classic .d-badge .d-a { color: var(--success); font-style: normal; }
#classic .d-badge .d-d { color: var(--danger); font-style: normal; }
#classic .d-ln { padding: 0 10px; white-space: pre; transition: background-color var(--t-s) var(--ease-out); }
#classic .d-ln.d-ctx { color: var(--text-4); }
#classic .d-ln.d-add { color: var(--success); }
#classic .d-ln.d-del { color: var(--danger); }
#classic .d-ln.d-add.is-hl { background: var(--success-soft); }
#classic .d-ln.d-del.is-hl { background: var(--danger-soft); }

/* 回合尾 / 助手正文 / 助手动作行 / 运行状态 */
#classic .msg-a { max-width: 92%; margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-1); }
#classic .done { margin-top: 6px; color: var(--text-3); font-size: 12px; line-height: 18px; }
#classic .a-acts { display: flex; align-items: center; gap: 12px; margin-top: 2px; color: var(--text-4); }
#classic .a-acts .ai { width: 15px; height: 15px; }
#classic .aa-tok { margin-left: 2px; }
#classic .aa-time { margin-left: auto; }
/* 运行状态：钉在对话区底部（覆盖层，不进对话流布局，保证运行时始终可见） */
#classic .running { display: none; }
#classic.live .running {
  position: absolute; z-index: 3; left: 20px; right: 20px; bottom: 10px;
  max-width: 700px; margin: 0 auto;
  display: block;
  padding: 8px 2px 0; border-top: 1px solid var(--line-2);
  color: var(--accent); font-weight: 600;
}

/* 输入框 */
#classic .composer {
  flex: none; margin: 0 16px 8px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface);
}
#classic .cm-box { padding: 10px 12px 4px; min-height: 40px; font-size: 14px; line-height: 22px; }
#classic .cm-typed { white-space: pre-wrap; }
#classic .cm-typed:not(:empty)::after {
  content: ""; display: inline-block; width: 2px; height: 15px;
  margin-left: 1px; vertical-align: -2px; background: var(--accent);
  animation: c-blink 1s steps(2) infinite;
}
@keyframes c-blink { 50% { opacity: 0; } }
#classic .cm-typed:not(:empty) + .cm-ph { display: none; }
#classic .cm-ph { color: var(--text-4); }
#classic .cm-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 8px 8px; }
#classic .cm-plus {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 8px; color: var(--text-2);
}
#classic .cm-sel {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line-1); border-radius: 8px; padding: 3px 8px; color: var(--text-2);
}
#classic .cm-sel .ai { width: 14px; height: 14px; }
#classic .cm-model { margin-left: auto; }
#classic .cm-send {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; background: var(--accent); color: var(--on-accent);
  opacity: .45;
  transition: opacity var(--t-s) var(--ease-out), transform var(--t-xs) var(--ease-out);
}
#classic .cm-send.is-armed { opacity: 1; }
#classic .cm-send.is-press { transform: scale(.85); }
#classic .cm-send .ai { width: 15px; height: 15px; }

/* 底部统计行 */
#classic .ch-stats {
  flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px;
  padding: 0 20px 8px; color: var(--text-4);
}
#classic .ch-stats .st { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
#classic .ch-stats .ai { width: 14px; height: 14px; flex: none; }
#classic .ring { display: inline-flex; align-items: center; gap: 4px; }
#classic .ring-svg { width: 15px; height: 15px; }
#classic .ring-bg { fill: none; stroke: var(--raised); stroke-width: 2.5; }
#classic .ring-fg {
  fill: none; stroke: var(--text-3); stroke-width: 2.5;
  stroke-dasharray: 1.32 44; transform: rotate(-90deg); transform-origin: center;
}

/* ── 右栏：会话详情 ── */
#classic .col-r {
  background: var(--sidebar); border-left: 1px solid var(--line-1);
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
}
#classic .rc-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line-1);
}
#classic .rc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px; background: var(--raised); font-weight: 600;
}
#classic .rc-tab .rc-x { width: 12px; height: 12px; color: var(--text-3); }
#classic .rc-head-acts { margin-left: auto; display: flex; gap: 12px; color: var(--text-3); }
#classic .rc-view {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
#classic.live .rc-view { justify-content: flex-start; }
#classic .rc-flow { position: relative; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
/* 三栏：日志带停在右栏底部，右栏内容区在它上方结束（见「日志带」一节），卡片不会被盖住 */
@media (min-width: 1024px) {
  #classic .col-r { padding-bottom: 196px; }
}
#classic .rc-grp { margin: 4px 2px -4px; color: var(--text-4); font-size: 12px; line-height: 18px; }
#classic .rc-grp:first-child { margin-top: 0; }
#classic .rc-card { background: var(--surface); border: 1px solid var(--line-1); border-radius: 10px; padding: 10px 12px; }
#classic .rc-card-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; color: var(--text-3); }
#classic .rc-card-t b { color: var(--text-1); font-weight: 400; font-family: var(--f-mono); }
#classic .rc-note { font-family: var(--f-sans); font-size: 12px; line-height: 18px; color: var(--text-4); }
#classic .rc-v { font-size: 14px; font-weight: 600; }
#classic .rc-mono { margin-top: 2px; font-family: var(--f-mono); color: var(--text-4); }
#classic .rc-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; color: var(--text-3); }
#classic .rc-row > b { color: var(--text-1); font-weight: 400; text-align: right; }
#classic .rc-none { color: var(--text-4); }
#classic .ef-row { display: flex; flex-wrap: wrap; gap: 6px; }
#classic .ef {
  border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px;
  font-family: var(--f-mono); color: var(--text-3);
}
#classic .ef.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-text); }
#classic .ef.is-off { border-style: dashed; border-color: var(--line-1); color: var(--text-4); }
#classic .ctx-bar { position: relative; height: 6px; margin: 8px 0 6px; border-radius: 3px; background: var(--raised); }
#classic .ctx-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: calc(var(--ctxp, 3) * 1%); border-radius: 3px; background: var(--text-2);
}
#classic .ctx-tick { position: absolute; left: 68%; top: -2px; bottom: -2px; width: 2px; background: var(--line-3); }

/* 输出里的退出码闪红 / 审批请求高亮 */
#classic [data-flash].is-flash { animation: c-flash var(--t-s) var(--ease-out) 1; }
@keyframes c-flash { 0% { background: var(--danger-soft); box-shadow: 0 0 0 4px var(--danger-soft); } }
#classic .rc-row.is-pulse { animation: c-pulse var(--t-l) var(--ease-out) 1; border-radius: 6px; background: var(--accent-soft); }
@keyframes c-pulse { 0% { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); } }

/* ── 日志带：停在三栏版右栏底部（占满右栏宽度），内容区上方不被遮挡 ── */
#classic .rail {
  position: absolute; z-index: 5; right: 0; bottom: 0; width: 340px; height: 196px;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-1); border-left: 1px solid var(--line-1); border-radius: 0;
  background: rgba(17, 13, 12, .92); backdrop-filter: blur(6px);
  font-family: var(--f-mono); overflow: hidden;
}
#classic .rail-hd {
  flex: none; display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 10px; border-bottom: 1px solid var(--line-1); color: var(--text-4);
}
#classic .rail-view { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
#classic.live .rail-view { justify-content: flex-start; }
/* 日志带顶部淡出：滚出视口的上一条不做生硬的半行裁切 */
#classic .rail-view {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
}
#classic .rail-flow { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; }
#classic .rev, #classic .rev-dots { color: var(--text-3); white-space: nowrap; transition: color var(--t-s); }
#classic .rev-dots { color: var(--text-4); }
#classic .rev.is-new { color: var(--brass); }

/* ── 像素小手（只在小节 1 的演示里出现） ── */
#classic .hand { display: none; }
#classic.live .hand {
  display: block; position: absolute; z-index: 7; left: 0; top: 0;
  opacity: 0; pointer-events: none;
}

/* ── 节拍推进（只在 live 时隐藏待出场元素；静态标记就是终态） ── */
#classic.live .cue {
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--t-s) var(--ease-out), transform var(--t-s) var(--ease-out), visibility 0s var(--t-s);
}
#classic.live .cue.is-in {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--t-s) var(--ease-out), transform var(--t-s) var(--ease-out), visibility 0s;
}
#classic.live .io-sec.cue, #classic.live .io-div.cue, #classic.live .rev.cue, #classic.live .rev-dots.cue { transform: none; }

/* ── 节拍说明 ol.beats ── */
/* 静态兜底：六条排成列表放在界面下方，完整可读 */
#classic .beats {
  list-style: none; margin: 28px auto 0; padding: 0 4px; max-width: 680px;
  display: grid; gap: 12px;
}
/* 奇数宽下居中的序号（像素字）落在 x.5：margin 取整，同 .wrap 的写法 */
@supports (width: round(1px, 1px)) {
  #classic .beats { margin-left: max(0px, round(down, (100% - 680px) / 2, 1px)); margin-right: max(0px, round(up, (100% - 680px) / 2, 1px)); }
}
#classic .beats li { border: 1px solid var(--line-1); border-radius: 12px; background: var(--overlay); padding: 12px 16px; }
#classic .b-hd { display: flex; align-items: baseline; gap: 10px; }
#classic .b-no { color: var(--brass); }
#classic .b-t { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
#classic .b-ck { display: none; margin-left: auto; align-self: center; color: var(--success); }
#classic .b-d { margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 22px; }
#classic .beats .ev { display: inline-block; margin-top: 8px; }

/* 三栏缩放版：浮在左栏下部空白处的说明板（不缩放，R9） */
#classic.live[data-fit="full"] .beats {
  position: absolute; z-index: 5; margin: 0; padding: 8px 10px; gap: 0;
  left: calc(50% - 628px * var(--s, 1));
  left: round(down, calc(50% - 628px * var(--s, 1)), 1px);
  bottom: calc(50% - 288px * var(--s, 1));
  width: calc(256px * var(--s, 1));
  max-height: calc(330px * var(--s, 1));
  overflow: hidden;
  background: var(--overlay); border: 1px solid var(--line-2); border-radius: 12px;
}
#classic.live[data-fit="full"] .beats li { border: 0; border-radius: 8px; background: transparent; padding: 5px 8px; }
#classic.live[data-fit="full"] .b-t { font-size: 14px; line-height: 20px; color: var(--text-2); font-weight: 400; }
#classic.live[data-fit="full"] .beats li.is-cur { background: var(--raised); }
#classic.live[data-fit="full"] .beats li.is-cur .b-t { color: var(--text-1); font-weight: 600; }
#classic.live[data-fit="full"] .beats li.is-done .b-t { color: var(--text-3); }
#classic.live[data-fit="full"] .b-ck { display: block; opacity: 0; transition: opacity var(--t-s); width: 14px; height: 14px; }
#classic.live[data-fit="full"] .beats li.is-done .b-ck { opacity: 1; }
#classic.live[data-fit="full"] .b-more {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows var(--t-m) var(--ease-out), opacity var(--t-s);
}
#classic.live[data-fit="full"] .b-more-in { min-height: 0; overflow: hidden; }
#classic.live[data-fit="full"] .beats li.is-cur .b-more { grid-template-rows: 1fr; opacity: 1; }
#classic.live[data-fit="full"] .b-d { font-size: 13px; line-height: 20px; }

/* 紧凑版：钉住区底部一条说明栏，只显示当前节拍；说明不截断，栏高由内容撑开、演示区相应缩小（R5） */
#classic.live[data-fit="compact"] .pin {
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding: 8px; gap: 8px;
}
#classic.live[data-fit="compact"] .stage { flex: 1 1 auto; width: 100%; height: auto; min-height: 0; }
#classic.live[data-fit="compact"] .beats {
  position: static; flex: none; z-index: auto;
  margin: 0; padding: 9px 12px; max-width: none;
  display: block; min-height: 106px;
  background: rgba(40, 35, 33, .92); backdrop-filter: blur(10px);
  border: 1px solid var(--line-1); border-radius: 10px;
}
#classic.live[data-fit="compact"] .beats li { display: none; border: 0; padding: 0; background: none; }
#classic.live[data-fit="compact"] .beats li.is-cur { display: block; }
#classic.live[data-fit="compact"] .b-hd { display: flex; align-items: baseline; gap: 6px; }
#classic.live[data-fit="compact"] .b-no { flex: none; font-size: 12px; line-height: 18px; }
#classic.live[data-fit="compact"] .b-ck { display: none; }
#classic.live[data-fit="compact"] .beats .ev { display: inline-block; margin-top: 4px; }
#classic.live[data-fit="compact"] .b-t { margin: 0; font-size: 13px; line-height: 18px; white-space: normal; }
#classic.live[data-fit="compact"] .b-more { display: block; opacity: 1; }
#classic.live[data-fit="compact"] .b-more-in { overflow: visible; }
#classic.live[data-fit="compact"] .b-d {
  margin: 3px 0 0; font-size: 12px; line-height: 17px; color: var(--text-2);
  display: block; overflow: visible;
}

/* ── 紧凑版布局 ── */
/* 缺陷修复：静态移动端规则 .col-m{height:620px} 会盖过 inset:0，使中栏比界面框高出一截，
   输入框和统计行溢出到说明栏下面；这里显式回到 inset:0 的高度，并裁掉钉住区外的溢出 */
#classic.live[data-fit="compact"] .stage { display: flex; overflow: hidden; }
#classic.live[data-fit="compact"] .app {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  width: auto; max-width: none; height: auto; border-radius: 12px;
  overflow: hidden;
}
#classic.live[data-fit="compact"] .col-l { display: none; }
#classic.live[data-fit="compact"] .col-m { position: absolute; inset: 0; height: auto; }
/* 单行日志条放进底部说明栏（JS 在紧凑版把它移进 ol.beats），任何时候都不盖对话 */
#classic.live[data-fit="compact"] .rail {
  position: static; width: auto; height: 24px; margin: 0 0 6px;
  flex-direction: row; align-items: center; gap: 8px;
  padding: 0 8px; border: 1px solid var(--line-1); border-radius: 6px;
  background: rgba(17, 13, 12, .72);
  font-size: 12px; line-height: 16px;
}
#classic.live[data-fit="compact"] .rail-hd { flex: none; padding: 0; border: 0; }
#classic.live[data-fit="compact"] .rail-view {
  flex: 1; min-width: 0; display: block; overflow: hidden;
  -webkit-mask-image: none; mask-image: none;
}
#classic.live[data-fit="compact"] .rail-flow {
  display: block; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#classic.live[data-fit="compact"] .rev,
#classic.live[data-fit="compact"] .rev-dots { display: none; }
#classic.live[data-fit="compact"] .rev.is-latest { display: inline; }
/* 节拍 5：会话详情以底部抽屉滑出 */
#classic.live[data-fit="compact"] .col-r {
  position: absolute; z-index: 6; left: 8px; right: 8px; bottom: 0; height: 92%;
  border-radius: 12px 12px 0 0;
  padding-bottom: 0;
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
  transform: translateY(calc(100% + 16px));
  transition: transform var(--t-m) var(--ease-out);
}
#classic.live[data-fit="compact"] .app[data-beat="5"] .col-r { transform: none; }
#classic.live[data-fit="compact"] .cm-bar { gap: 5px; padding: 6px 4px 8px; }
#classic.live[data-fit="compact"] .cm-sel { padding: 3px 6px; font-size: 13px; }
#classic.live[data-fit="compact"] .cm-model { font-size: 12px; }
#classic.live[data-fit="compact"] .cm-sel .ai:last-child { display: none; }
#classic.live[data-fit="compact"] .t-src, #classic.live[data-fit="compact"] .t-body { margin-left: 14px; }
#classic.live[data-fit="compact"] .step { padding-left: 12px; }
#classic.live[data-fit="compact"] .rc-flow { padding: 10px; gap: 8px; }
#classic.live[data-fit="compact"] .rc-card { padding: 7px 9px; }
#classic.live[data-fit="compact"] .rc-row { padding: 0; line-height: 18px; }
#classic.live[data-fit="compact"] .rc-card-t { margin-bottom: 4px; }
/* 矮屏（1024×640 一类）抽屉内容再收紧一点，保证上下文 + 统计两张一起露出 */
@media (max-height: 720px) {
  #classic.live[data-fit="compact"] .rc-card { padding: 6px 8px; }
  #classic.live[data-fit="compact"] .rc-row { line-height: 17px; }
  #classic.live[data-fit="compact"] .rc-card-t { margin-bottom: 3px; }
  #classic.live[data-fit="compact"] .rc-flow { gap: 6px; }
}

/* 静态紧凑（无 JS / 减弱动效 / 模块失败）：三栏纵向堆叠 */
@media (max-width: 1023px) {
  #classic .app { display: block; }
  #classic .col-l { border-right: 0; border-bottom: 1px solid var(--line-1); }
  #classic .col-m { height: 620px; border-bottom: 1px solid var(--line-1); }
  #classic .col-r { border-left: 0; }
  #classic .rail { position: static; width: auto; height: auto; margin: 12px; }
  #classic .rail-view { max-height: 220px; }
}
