/* ============================================================
 * 英语口语训练平台 Demo v2 - 主样式
 * 严格对齐《建设方案 V0.4》界面示意图的视觉语言
 * ============================================================ */

:root {
  /* 主色（方案图深蓝） */
  --nav: #16355c;
  --nav-2: #1e4680;
  --primary: #2563eb;
  --primary-soft: #eff4ff;
  --primary-line: #c9d9f5;

  /* 中性 */
  --bg: #eef1f6;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-2: #cfd8e6;
  --text: #1c2b3f;
  --text-2: #5b6b80;
  --text-3: #93a2b5;

  /* 语义 */
  --green: #16a34a;
  --green-bg: #e8f7ee;
  --green-line: #b9e3c8;
  --amber: #b45309;
  --amber-bg: #fdf3e3;
  --amber-line: #f2d7a8;
  --red: #d92d20;
  --red-bg: #fdecea;
  --red-line: #f6c6c0;
  --slate: #64748b;

  --sh-1: 0 1px 2px rgba(22, 53, 92, .06);
  --sh-2: 0 2px 8px rgba(22, 53, 92, .08);
  --sh-3: 0 8px 28px rgba(22, 53, 92, .14);
  --r: 10px;
  --r-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============ 顶栏 ============ */
.topbar {
  height: 56px;
  background: var(--nav);
  display: flex; align-items: center;
  padding: 0 var(--s-pad, 20px);
  gap: 12px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 2px 10px rgba(0, 0, 0, .12);
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-size: 15px; font-weight: 700; }
.brand .mk {
  width: 28px; height: 28px; border-radius: 7px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.topbar .unit-chip {
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
}
.topbar .unit-chip .en { color: #a8c4f0; margin-right: 6px; font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .me { color: #fff; font-size: 12.5px; opacity: .92; }
.topbar .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #4d8ef7, #2563eb);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .25);
}
.topbar .btn-ghost {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; padding: 5px 12px; border-radius: 6px; font-size: 12.5px;
  cursor: pointer; font-family: inherit;
}
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .18); }

/* 端标识（非跳转，仅标明当前所在端） */
.portal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; padding: 5px 13px; border-radius: 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
  white-space: nowrap;
}
.portal-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110, 231, 183, .22);
}

/* ============ 步骤条（方案图2/3 顶部） ============ */
.steps {
  display: flex; gap: 6px; padding: 12px var(--s-pad, 20px);
  background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; position: sticky; top: 56px; z-index: 90;
}
.step {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text-3);
  border: 1px solid transparent; white-space: nowrap;
  transition: all .16s ease;
}
.step:hover { background: var(--primary-soft); color: var(--primary); }
.step.done { color: var(--green); }
.step.done .idx { background: var(--green-bg); color: var(--green); }
.step.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}
.step.active .idx { background: rgba(255, 255, 255, .22); color: #fff; }
.step .idx {
  width: 20px; height: 20px; border-radius: 50%;
  background: #f1f5f9; color: var(--text-3);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.step-sep { color: var(--line-2); display: grid; place-items: center; }

/* ============ 布局 ============ */
.wrap { padding: var(--s-pad, 20px); max-width: 1400px; margin: 0 auto; }
.stage { display: none; }
.stage.on { display: block; animation: up .22s ease; }
@keyframes up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-2);
  margin-bottom: 16px; overflow: hidden;
}
.card.pad { padding: 18px 20px; }
.card-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.card-hd.plain { border: 0; padding: 0 0 12px; }
.card-hd h3 { font-size: 15px; font-weight: 700; color: var(--nav); }
.card-hd .spacer { flex: 1; }
.card-bd { padding: 18px 20px; }

/* 双栏（对话页） */
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.split-3 { display: grid; grid-template-columns: 300px 1fr 300px; gap: 14px; align-items: start; }

/* 通用 */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-2); font-size: 13px; }
.sm { color: var(--text-3); font-size: 12px; }
.mono { font-family: Consolas, "SF Mono", monospace; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px;
  border-radius: 5px; border: 1px solid transparent; white-space: nowrap;
}
.t-blue  { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }
.t-green { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.t-amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.t-red   { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.t-gray  { background: #f1f5f9; color: var(--slate); border-color: var(--line); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 1px solid transparent; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .16s ease; white-space: nowrap;
}
.btn-p { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .28); }
.btn-p:hover { background: #1d4fd8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 99, 235, .34); }
.btn-p:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-o { background: #fff; color: var(--nav); border-color: var(--line-2); }
.btn-o:hover { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }
.btn-g { background: var(--green); color: #fff; }
.btn-g:hover { filter: brightness(1.06); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }

/* ============ 情景图（SVG 复刻：银行柜台） ============ */
.scene-box {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(170deg, #dce9f7 0%, #eef4fb 55%, #f4f8fd 100%);
  border: 1px solid var(--primary-line);
}
.scene-box svg { display: block; width: 100%; height: auto; }

/* 真实场景图 */
.scene-photo { position: relative; width: 100%; overflow: hidden; }
.scene-photo img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
}
.scene-img { aspect-ratio: 16 / 9; }
.scene-img.small { aspect-ratio: 16 / 9; }
/* A/B 角色角标（界面叠加，不在图内） */
.role-pin {
  position: absolute; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}
.scene-img .role-pin.a { left: 70%; top: 8%; background: #15803d; }
.scene-img .role-pin.b { right: 71%; top: 17%; background: #b45309; z-index: 5; }
.scene-img.small .role-pin { width: 22px; height: 22px; font-size: 11px; }
.scene-img.small .role-pin.a { left: 70%; top: 8%; }
.scene-img.small .role-pin.b { right: 71%; top: 17%; }
.scene-note {
  position: absolute; right: 8px; top: 8px;
  background: rgba(255, 255, 255, .9); color: var(--nav);
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--line-2);
}
/* 界面叠加的教学提示（证明图内无文字、提示由界面叠加） */
.overlay-hint-demo {
  position: absolute; left: 10px; top: 10px;
  background: rgba(22, 53, 92, .88); color: #fff;
  font-size: 12px; padding: 7px 12px; border-radius: 7px;
  max-width: 300px; line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, .18);
}

/* 版本管理时间线 */
.ver-timeline { position: relative; padding-left: 22px; }
.ver-timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.ver-item { position: relative; padding: 10px 0 12px; }
.ver-item::before {
  content: ''; position: absolute; left: -19px; top: 15px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line-2);
}
.ver-item.cur::before { background: var(--primary); border-color: var(--primary); }
.ver-item.cur::after {
  content: ''; position: absolute; left: -22px; top: 12px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--primary-soft); z-index: -1;
}
.ver-item .vh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ver-item .vn { font-weight: 700; font-size: 13.5px; color: var(--nav); }
.ver-item .vm { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.7; }
.ver-item .vm .op { color: var(--text-3); }

/* 口径桥接示意 */
.bridge-box {
  border: 1px solid var(--primary-line); background: var(--primary-soft);
  border-radius: var(--r); padding: 14px 16px;
}
.bridge-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bridge-seg {
  flex: 1; min-width: 150px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff;
}
.bridge-seg .lb { font-size: 11.5px; color: var(--text-2); }
.bridge-seg .vl { font-size: 18px; font-weight: 700; color: var(--nav); }
.bridge-arrow { color: var(--primary); font-size: 18px; font-weight: 700; }
.approval-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appr-node {
  padding: 7px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-2); background: #fff; color: var(--text-2);
}
.appr-node.done { background: var(--green-bg); border-color: var(--green-line); color: #15803d; }
.appr-node.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.appr-sep { color: var(--text-3); }

/* ============ 词汇卡（方案图8） ============ */
.vocab-list { max-height: 460px; overflow-y: auto; padding-right: 4px; }
.vocab-card {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
  transition: all .16s;
}
.vocab-card:hover { border-color: var(--primary-line); box-shadow: var(--sh-1); }
.vocab-card.learning { background: var(--primary-soft); border-color: var(--primary-line); }
.vocab-card .w { font-size: 16px; font-weight: 700; color: var(--nav); letter-spacing: -.2px; }
.vocab-card .ipa { font-size: 12px; color: var(--text-3); margin: 0 6px; }
.vocab-card .pos {
  display: inline-block; background: var(--primary); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; margin-left: 4px; vertical-align: 2px;
}
.vocab-card .cn { font-size: 13.5px; margin: 5px 0 7px; }
.vocab-card .ex {
  font-size: 12.5px; color: var(--text-2); font-style: italic;
  border-left: 2px solid var(--line-2); padding-left: 9px;
}
.vocab-foot {
  font-size: 11.5px; color: var(--text-3); text-align: center;
  padding-top: 10px; border-top: 1px dashed var(--line); margin-top: 4px;
}

/* 填空（输入框式，对齐方案图8） */
.fill-item {
  display: flex; gap: 12px; padding: 13px 15px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff;
  align-items: flex-start;
}
.fill-item.ok { background: var(--green-bg); border-color: var(--green-line); }
.fill-item.no { background: var(--red-bg); border-color: var(--red-line); }
.fill-item .no-badge {
  width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0;
  background: #f1f5f9; color: var(--text-3);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.fill-item.ok .no-badge { background: var(--green); color: #fff; }
.fill-item.no .no-badge { background: var(--red); color: #fff; }
.fill-item .body { flex: 1; }
.fill-item .ctx { font-size: 15px; line-height: 2; margin-bottom: 8px; }
.fill-in {
  border: none; border-bottom: 2px solid var(--primary-line);
  font-size: 15px; font-family: inherit; font-weight: 600;
  color: var(--primary); width: 130px; padding: 0 4px;
  outline: none; background: transparent;
}
.fill-in:focus { border-color: var(--primary); }
.fill-in.ok { color: var(--green); border-color: var(--green); }
.fill-in.no { color: var(--red); border-color: var(--red); text-decoration: line-through; }
.fill-fb { font-size: 12.5px; margin-top: 7px; line-height: 1.7; }
.fill-fb.ok { color: #15803d; }
.fill-fb.no { color: #b42318; }
.fill-fb .etype { font-weight: 700; }
.fill-item .row-act { margin-top: 9px; }

/* ============ 分幕图（方案图3 右侧情景图 + 图集） ============ */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.story-cell {
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; cursor: pointer; background: #fff;
  transition: all .18s;
}
.story-cell:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.story-cell.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.story-cell .pic { position: relative; }
.story-cell .pic .scene-photo { aspect-ratio: 16 / 9; }
.story-cell .cap { padding: 9px 12px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); }
.story-cell .cap b { color: var(--nav); }
.role-badge {
  position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 12px;
  border: 2px solid rgba(255, 255, 255, .85);
}
.role-badge.a { background: #15803d; }
.role-badge.b { background: #b45309; }

.script-line { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.script-line:last-child { border-bottom: 0; }
.script-line .sp {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 11.5px; color: #fff;
}
.script-line .sp.a { background: #15803d; }
.script-line .sp.b { background: #b45309; }

/* ============ 对话页（严格对齐方案图3） ============ */
.chat-panel { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }

.side-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-2); margin-bottom: 14px; overflow: hidden;
}
.side-card .hd {
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; font-weight: 700; color: var(--nav);
  display: flex; align-items: center; gap: 8px;
}
.side-card .bd { padding: 13px 14px; }

/* 目标词汇 chips（方案图3） */
.vchip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px; font-size: 12.5px;
  border: 1px solid var(--line-2); background: #f8fafc; color: var(--text-2);
}
.vchip.on { background: var(--green-bg); border-color: var(--green-line); color: #15803d; font-weight: 600; }
.vchip.on .w { font-weight: 700; }
.vchip .cn { font-size: 11px; opacity: .8; }

/* 当前角色（方案图3左下） */
.role-now {
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  border-radius: var(--r); padding: 12px 14px;
}
.role-now .lb { font-size: 11.5px; color: var(--text-2); }
.role-now .nm { font-size: 16px; font-weight: 700; color: var(--nav); margin: 3px 0 8px; }

/* 对话气泡 */
.chat-scroll {
  height: 460px; overflow-y: auto; padding: 18px 20px;
  background: #fafbfd; display: flex; flex-direction: column; gap: 14px;
}
.msg { display: flex; gap: 10px; max-width: 84%; }
.msg .av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px;
  background: #fff; border: 1px solid var(--line);
}
.msg.bot .av { background: #fff8ed; border-color: var(--amber-line); }
.msg .bub {
  background: #fff; border: 1px solid var(--line);
  border-radius: 4px 12px 12px 12px;
  padding: 11px 14px; font-size: 14px; line-height: 1.7;
  box-shadow: var(--sh-1);
}
.msg.me { flex-direction: row-reverse; margin-left: auto; }
.msg.me .av { background: var(--green-bg); border-color: var(--green-line); }
.msg.me .bub {
  background: #eaf4ff; border-color: #cfe4fb;
  border-radius: 12px 4px 12px 12px;
}
/* 示范读音按钮（方案图3） */
.tts-row { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tts-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--primary-line);
  color: var(--primary); font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.tts-btn:hover { background: var(--primary-soft); }
.tts-btn.spd { border-color: var(--line-2); color: var(--text-2); }

/* 即时反馈行（方案图3） */
.fb-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12px; color: var(--text-2);
}
.fb-line .sc { color: var(--nav); font-weight: 700; }
.fb-line .hit { color: var(--green); font-weight: 700; }
.sub-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 7px 11px;
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: 7px; font-size: 12px; color: var(--amber);
}
.sub-line b { font-weight: 700; }
.sub-line .back { color: var(--green); background: var(--green-bg); border: 1px solid var(--green-line);
  border-radius: 5px; padding: 1px 7px; font-size: 11px; font-weight: 600; }

/* 录音条（方案图3底部） */
.rec-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: #fff;
}
.mic {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 17px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .32); flex-shrink: 0;
  transition: all .18s;
}
.mic:hover { filter: brightness(1.08); }
.mic.on { background: var(--red); animation: pulse 1.3s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, .5); }
  50% { box-shadow: 0 0 0 14px rgba(217, 45, 32, 0); }
}
.wave { display: flex; align-items: center; gap: 2.5px; height: 22px; }
.wave i { width: 3px; border-radius: 2px; background: var(--primary); animation: wv .9s ease-in-out infinite; }
.wave i:nth-child(1){height:8px;animation-delay:0s}  .wave i:nth-child(2){height:15px;animation-delay:.1s}
.wave i:nth-child(3){height:20px;animation-delay:.2s} .wave i:nth-child(4){height:12px;animation-delay:.3s}
.wave i:nth-child(5){height:17px;animation-delay:.4s} .wave i:nth-child(6){height:7px;animation-delay:.5s}
.wave i:nth-child(7){height:13px;animation-delay:.6s}
@keyframes wv { 0%,100%{transform:scaleY(.55);opacity:.6} 50%{transform:scaleY(1);opacity:1} }
.rec-hint { font-size: 13px; color: var(--text-2); font-weight: 600; }
.rec-hint .sm { font-weight: 400; display: block; }

/* 引导用词提示（方案图3右下） */
.hint-box {
  background: #f8fafc; border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px; font-size: 12px; color: var(--text-2);
}
.hint-box b { color: var(--nav); display: block; margin-bottom: 3px; font-size: 11.5px; }

/* 轮次切换（方案图3右上「交换角色」） */
.round-chip {
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  color: var(--primary); font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}

/* 打字指示 */
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: bl 1.1s infinite; }
.typing i:nth-child(2){animation-delay:.18s} .typing i:nth-child(3){animation-delay:.36s}
@keyframes bl { 0%,60%,100%{opacity:.25} 30%{opacity:1} }

/* ============ 评价报告（方案图13） ============ */
.dual-ch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ch-card {
  border-radius: var(--r-lg); padding: 20px 22px;
  border: 1.5px solid var(--primary-line); background: var(--primary-soft);
}
.ch-card.free { border-color: var(--green-line); background: var(--green-bg); }
.ch-card .nm { font-size: 15px; font-weight: 700; color: var(--nav); }
.ch-card.free .nm { color: #15803d; }
.ch-card .big { font-size: 46px; font-weight: 700; line-height: 1.05; margin: 8px 0 2px; color: var(--primary); }
.ch-card.free .big { color: var(--green); }
.ch-card .big small { font-size: 15px; color: var(--text-3); font-weight: 500; }
.ch-card .ds { font-size: 12.5px; color: var(--text-2); }

.radar-box { display: grid; place-items: center; padding: 6px 0; }
.sent-item {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 9px; background: #fff;
}
.sent-item .tx { font-size: 13.5px; margin-bottom: 5px; }
.sent-item .tx b { color: var(--red); }
.sent-item .nt { font-size: 12px; color: var(--text-2); }
.sent-item .nt.ok { color: var(--green); }
.sent-item .nt.no { color: var(--red); }
.sent-item .sc {
  float: right; font-size: 17px; font-weight: 700; color: var(--nav);
}
.sent-item .sc.ok { color: var(--green); }
.sent-item .sc.no { color: var(--amber); }

.vocab-cov { display: flex; gap: 7px; flex-wrap: wrap; }
.cov {
  padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--green-line); background: var(--green-bg); color: #15803d;
}
.cov.miss { border-color: var(--line-2); background: #f8fafc; color: var(--text-3); font-weight: 500; }

/* ============ 教师看板（方案图1/2） ============ */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-2);
}
.kpi .lb { font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.kpi .n { font-size: 34px; font-weight: 700; color: var(--nav); line-height: 1.1; }
.kpi .n small { font-size: 14px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.kpi .dt { font-size: 12px; color: var(--green); margin-top: 4px; font-weight: 600; }
.kpi .dt .ar { font-size: 10px; }

.trend-chart { padding: 10px 4px; }
.trend-svg { width: 100%; height: auto; display: block; }
.trend-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); justify-content: flex-end; }
.trend-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

.mastery-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.mastery-row .w { width: 108px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.mastery-row .cn { font-size: 11px; color: var(--text-3); width: 34px; }
.mastery-row .bar { flex: 1; height: 9px; background: #eef2f7; border-radius: 5px; overflow: hidden; }
.mastery-row .bar i { display: block; height: 100%; border-radius: 5px; background: var(--primary); }
.mastery-row .pc { width: 40px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--nav); }
.mastery-row.low .bar i { background: var(--amber); }
.mastery-row.low .pc { color: var(--amber); }

.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.rank-item:last-child { border-bottom: 0; }
.rank-no {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.rank-item .nm { font-weight: 700; font-size: 13.5px; color: var(--nav); }
.rank-item .dt { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.rank-item .up { color: var(--green); font-weight: 700; }
.rank-item .warn-tx { color: var(--amber); font-weight: 700; }

/* ============ 内容生产工作台（方案图5 三栏） ============ */
.workbench { display: grid; grid-template-columns: 250px 1fr 300px; gap: 14px; align-items: start; }
.flow-step { display: flex; gap: 10px; padding: 10px 0; position: relative; }
.flow-step .dot {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--green); color: #fff; z-index: 1;
}
.flow-step.cur .dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.flow-step.wait .dot { background: #fff; color: var(--text-3); border: 1.5px solid var(--line-2); }
.flow-step .tx { font-size: 12.5px; }
.flow-step .tx b { display: block; font-size: 13px; color: var(--nav); }
.flow-step .tx span { color: var(--text-3); font-size: 11.5px; }
.flow-step::before {
  content: ''; position: absolute; left: 11.5px; top: 30px; bottom: -2px;
  width: 1.5px; background: var(--line-2);
}
.flow-step:last-child::before { display: none; }

.wb-hd { font-size: 13.5px; font-weight: 700; color: var(--nav); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.wb-hd::before { content: ''; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }

.wtag {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f8fafc; border: 1px solid var(--line-2);
  border-radius: 6px; padding: 4px 10px; font-size: 12.5px; color: var(--text);
}
.wtag b { color: var(--nav); font-weight: 700; }
.wtag .x { color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; }
.wtag .x:hover { color: var(--red); }

.node-item {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; cursor: grab;
  display: flex; gap: 10px; align-items: flex-start; background: #fff;
}
.node-item:hover { border-color: var(--primary-line); }
.node-item.branch { border-color: var(--amber-line); background: var(--amber-bg); }
.node-item .n {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: #f1f5f9; color: var(--text-2);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
}
.node-item.branch .n { background: var(--amber); color: #fff; }
.node-item .tx { flex: 1; }
.node-item .tx b { font-size: 13px; color: var(--nav); display: block; }
.node-item .tx span { font-size: 12px; color: var(--text-2); }

.check-item { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; font-size: 12.5px; line-height: 1.6; }
.check-item .ck {
  width: 17px; height: 17px; border-radius: 4px; flex-shrink: 0; margin-top: 2px;
  display: grid; place-items: center; font-size: 11px; color: #fff;
  background: var(--green);
}
.check-item.pending .ck { background: var(--amber); }
.check-item .tx { color: var(--text-2); }
.check-item.done .tx { color: var(--text-2); }

/* 投喂方式（方案图4） */
.feed-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.feed-tab {
  padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-family: inherit;
}
.feed-tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.feed-in {
  width: 100%; border: 1px solid var(--line-2); border-radius: 7px;
  padding: 9px 11px; font-size: 13px; font-family: inherit; outline: none;
}
.feed-in:focus { border-color: var(--primary); }

/* ============ 表格 ============ */
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  background: var(--nav); color: #fff; padding: 9px 12px;
  text-align: left; font-weight: 600; font-size: 12px; white-space: nowrap;
}
table.tb td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.tb tbody tr:hover { background: var(--primary-soft); }
table.tb tr.focus td { background: var(--red-bg); }

/* ============ Toast ============ */
#toast {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%) translateY(-14px);
  background: var(--nav); color: #fff; padding: 10px 22px;
  border-radius: 8px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--sh-3); opacity: 0; pointer-events: none;
  transition: all .24s; z-index: 999; max-width: 70vw; white-space: pre-line;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: var(--green); }
#toast.warn { background: var(--amber); }
#toast.err { background: var(--red); }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .split, .chat-panel, .workbench { grid-template-columns: 1fr; }
  .split-3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .story-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .wrap { --s-pad: 12px; padding: var(--s-pad); }
  .g2, .g3, .g4, .kpi-row, .dual-ch, .story-grid { grid-template-columns: 1fr; }
  .step span:not(.idx) { display: none; }
  .topbar .unit-chip .cn { display: none; }
}
/* 对方台词的中文场景说明 */
.cn-line {
  margin-top: 7px; font-size: 12px; color: var(--text-2);
  padding-left: 9px; border-left: 2px solid var(--primary-line);
  line-height: 1.6;
}

/* 对话完成提示（区别于剧情支线） */
.finish-line {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-bg); border: 1px solid var(--green-line);
  color: #15803d; font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 6px;
}

/* ---------- 班级横向对比 ---------- */
.cmp-tb th, .cmp-tb td { padding: 9px 12px; font-size: 13px; }
.cmp-tb td.best { color: var(--primary); font-weight: 700; }
.cmp-tb td.best::after { content: ' ▲'; font-size: 10px; }
.cmp-bar-row { margin-bottom: 14px; }
.cmp-bar-row:last-child { margin-bottom: 0; }
.cmp-bar-row .lb {
  font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 7px;
}
.cmp-bar-line { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cmp-bar-line .nm { width: 62px; font-size: 12.5px; color: var(--text-2); flex-shrink: 0; }
.cmp-bar-line .track {
  flex: 1; height: 16px; background: #eef2f7; border-radius: 8px; overflow: hidden;
}
.cmp-bar-line .track i {
  display: block; height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--nav), var(--primary));
}
.cmp-bar-line:nth-child(3) .track i {
  background: linear-gradient(90deg, #b45309, var(--amber));
}
/* 数值列：右侧留出 32px 安全距离，不贴卡片边缘 */
.cmp-bar-line .pc {
  width: 108px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--nav);
  font-family: ui-monospace, Menlo, Consolas, monospace; flex-shrink: 0;
  padding-right: 32px;
}
/* 对比区整体留白：左右各 32px，上下略增 */
#class-compare .bd { padding: 18px 32px 22px; }
.cmp-tb { width: 100%; border-collapse: collapse; }
.cmp-tb th, .cmp-tb td { padding: 11px 14px; }
.cmp-tb th:last-child, .cmp-tb td:last-child { padding-right: 34px; }
.cmp-tb th:first-child, .cmp-tb td:first-child { padding-left: 16px; }
.cmp-bar-row { padding: 0; }
.cmp-bar-line .pc { min-width: 108px; }
.cmp-bar-line .nm { width: 68px; padding-left: 4px; }

/* 对比区说明文字与条形图组：统一左右缩进，不贴卡片边 */
.cmp-note {
  margin: 13px 16px 0;
  line-height: 1.75;
}
.cmp-bars { margin: 15px 16px 0; }

/* ---------- 学情曲线：学生选择器 ---------- */
.pick-stu { display: inline-flex; align-items: center; gap: 7px; }
.pick-stu .lb { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.pick-stu .feed-in {
  width: auto; min-width: 130px; padding: 4px 10px; font-size: 12.5px;
  border: 1px solid var(--line-2); border-radius: 6px; background: #fff;
  color: var(--nav); font-family: inherit; cursor: pointer;
}
.pick-stu .feed-in:focus { outline: 2px solid var(--primary-line); outline-offset: 1px; }

/* ---------- Kappa 指标说明 ---------- */
.kappa-note {
  margin: 12px 16px 0;
  padding: 11px 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  border-left: 3px solid var(--primary);
  border-radius: var(--r);
  font-size: 12px; line-height: 1.85; color: var(--text-2);
}
.kappa-note b { color: var(--nav); }
.kappa-note .kg { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 9px; }
.kappa-note .kg span { white-space: nowrap; }
.kappa-note .kg i {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--green); margin-right: 5px; vertical-align: 1px;
}
.kappa-note .kg .w { background: var(--amber); }
.kappa-note .kg .d { background: var(--line-2); }

/* ---------- 样本复核表 ---------- */
#cal-tb th, #cal-tb td { padding: 9px 11px; font-size: 12.5px; white-space: nowrap; }
#cal-tb td.txt { white-space: normal; min-width: 260px; max-width: 340px; line-height: 1.65; }
#cal-tb td.num { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
#cal-tb td.num.diff-l { color: var(--green); }
#cal-tb td.num.diff-m { color: var(--amber); }
#cal-tb td.num.diff-h { color: var(--red, #dc2626); }
#cal-tb tr.row-pending { background: #fffdf7; }
#cal-tb tr.row-pending td.txt { color: var(--nav); font-weight: 600; }
.seg {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden;
}
.seg button {
  border: 0; background: #fff; padding: 5px 13px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; font-family: inherit;
}
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--nav); color: #fff; font-weight: 600; }
.seg button:hover:not(.on) { background: #f1f5fb; }

/* ---------- 复核评估弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 30, 55, .48);
  display: none; align-items: center; justify-content: center; z-index: 500;
  padding: 24px;
}
.modal-mask.on { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--r-lg); width: 100%;
  box-shadow: 0 20px 60px rgba(15, 30, 55, .3); overflow: hidden;
  display: flex; flex-direction: column; max-height: 88vh;
}
.modal-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; color: var(--nav);
}
.modal-x {
  border: 0; background: transparent; font-size: 22px; line-height: 1;
  color: var(--text-2); cursor: pointer; padding: 0 4px;
}
.modal-x:hover { color: var(--nav); }
.modal-bd { padding: 18px; overflow-y: auto; }
.modal-ft {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 18px; border-top: 1px solid var(--line); background: #fafbfd;
}
.rm-text {
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  border-radius: var(--r); padding: 13px 15px; font-size: 14.5px;
  line-height: 1.8; color: var(--nav); margin-bottom: 14px;
}
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rm-item { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.rm-item .lb { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.rm-item .vl { font-size: 24px; font-weight: 700; color: var(--nav); font-family: ui-monospace, Menlo, Consolas, monospace; }
.rm-item.sys .vl { color: var(--primary); }
.score-input {
  width: 100%; padding: 9px 12px; font-size: 20px; font-weight: 700;
  border: 1px solid var(--line-2); border-radius: var(--r);
  font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--nav);
}
.score-input:focus { outline: 2px solid var(--primary-line); outline-offset: 1px; }
.rm-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.rm-tags button {
  border: 1px solid var(--line-2); background: #fff; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-2); font-family: inherit;
}
.rm-tags button:hover { background: #f1f5fb; border-color: var(--primary-line); color: var(--primary); }

/* ---------- 分幕图上的漫画式对话气泡 ---------- */
.story-cell .pic { position: relative; overflow: hidden; }

/* 图层容器：铺满整格，气泡按漫画习惯分列两侧 */
.bub-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(12, 26, 46, .14) 0%, transparent 30%, transparent 100%);
}

/* 气泡本体：椭圆造型 + 实心描边，尾巴由 ::after 绘制 */
.bub {
  position: relative;
  max-width: 68%;
  min-width: 46px;
  padding: 4px 9px 5px;
  border: 1.6px solid var(--nav);
  border-radius: 13px;
  background: #fff;
  color: var(--nav);
  font-size: 9.5px; line-height: 1.45;
  box-shadow: 0 2px 5px rgba(8, 20, 40, .22);
  display: flex; align-items: baseline; gap: 5px;
  animation: bub-in .34s cubic-bezier(.34, 1.3, .64, 1) both;
}

/* 说话人标签：贴在气泡左上角外侧，像漫画里的署名 */
.bub .who {
  position: absolute; top: -7px;
  font-size: 8px; font-weight: 800; letter-spacing: .3px;
  padding: 0 5px; border-radius: 8px;
  background: var(--nav); color: #fff;
  border: 1.5px solid #fff;
  line-height: 1.5;
}
.bub .tx { flex: 1; }

/* ---------- 配色：由「角色分工」决定，与位置无关 ----------
 * q（第一开口 / 提问方）→ 橙色系
 * a（应答方）→ 蓝色系 */
.bub.q {
  border-radius: 14px 14px 4px 14px;
  background: #fff8ec;
  border-color: #d97706;
  color: #7a4406;
}
.bub.q .who { left: -7px; background: #d97706; }

/* 应答方 → 蓝色系 */
.bub.a {
  border-radius: 14px 14px 14px 4px;
  background: #f2f7fe;
  border-color: #2563eb;
  color: #14408c;
}
.bub.a .who { right: -7px; background: #2563eb; }

/* 尾巴：指向说话人所在的一侧 */
.bub::after {
  content: '';
  position: absolute;
  bottom: -8px;
  width: 0; height: 0;
  border: 7px solid transparent;
}
.bub.q::after {
  right: 14px;
  border-top-color: #d97706;
  border-bottom: 0;
}
.bub.a::after {
  left: 14px;
  border-top-color: #2563eb;
  border-bottom: 0;
}
/* 尾巴内的白色衬底，盖住描边与气泡的接缝 */
.bub::before {
  content: '';
  position: absolute;
  bottom: -9.5px;
  width: 0; height: 0;
  border: 6px solid transparent;
  z-index: -1;
}
.bub.q::before { right: 13.5px; border-top-color: #fff8ec; border-bottom: 0; }
.bub.a::before { left: 13.5px; border-top-color: #f2f7fe; border-bottom: 0; }

@keyframes bub-in {
  0%   { opacity: 0; transform: translateY(9px) scale(.9); }
  70%  { opacity: 1; transform: translateY(-1.5px) scale(1.03); }
  100% { opacity: 1; transform: none; }
}

/* 选中该幕：仅加粗描边与加重投影，配色保持不变（提问方橙 / 应答方蓝） */
.story-cell.on .bub { border-width: 2.4px; box-shadow: 0 3px 10px rgba(37, 99, 235, .34); }
.story-cell.on .bub.q { background: #fff3e0; }
.story-cell.on .bub.a { background: #e8f1fe; }

/* ---------- 两个气泡各自定位：都不遮脸 ----------
 * 位置由渲染时加的 pos-* 类决定，与配色 class 完全解耦 */
.bub-layer .bub { position: absolute; max-width: 70%; }
/* 第一句：靠右上 */
.bub-layer .bub.pos-tr { top: 9px; right: 9px; }
/* 第二句：左侧中下方，位于客人下巴以下 */
.bub-layer .bub.pos-lm { left: 9px; top: 46%; max-width: 64%; }

/* Production workflow and session states */
.prototype-notice{padding:10px 24px;background:#fff7e8;border-bottom:1px solid #f2d7a8;color:#835317;font-size:12px}.workflow-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:18px;padding:12px;background:white;border:1px solid var(--line);border-radius:10px}.step{font-family:inherit;border:1px solid transparent;cursor:pointer}.step:focus-visible{outline:2px solid var(--primary)}button:disabled{opacity:.55;cursor:not-allowed}textarea{width:100%;padding:12px;border:1px solid var(--line-2);border-radius:8px;font:inherit;resize:vertical;color:var(--text);background:white}textarea:focus{outline:2px solid #2563eb33;border-color:var(--primary)}#op-text{margin-bottom:16px}.session-expired,.draft-blocker{position:fixed;inset:0;background:#16355c88;z-index:1000;display:grid;place-items:center;padding:24px}.draft-blocker[hidden]{display:none}.session-expired .card,.draft-blocker .card{padding:28px;max-width:460px}.session-expired p,.draft-blocker p{margin:12px 0 22px}.learning-loading main{pointer-events:none;opacity:.5}#audio-dialog{border:1px solid var(--line);border-radius:14px;max-width:660px;width:90%;padding:28px;margin:auto;color:var(--text)}#audio-dialog::backdrop{background:#16355c88}#audio-text{margin:22px 0;line-height:1.9}.topbar .brand{white-space:nowrap}.topbar .me{white-space:nowrap}.topbar .auth-logout{white-space:nowrap}
