/* 解题导师 Demo —— 2009 全国卷Ⅱ真题 */
:root {
  --ink: #183145;
  --muted: #637483;
  --surface: #ffffff;
  --canvas: #f3f7f8;
  --brand: #147b8f;
  --brand-dark: #0d5f71;
  --line: #dce6e8;
  --accent: #d97706;
}
* { box-sizing: border-box; }
body { background: var(--canvas); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; margin: 0; padding-top: 58px; }
.demo-shell { width: min(1000px, calc(100% - 24px)); margin: 0 auto; padding: 26px 0 60px; }

/* 顶栏 */
.demo-top { align-items: center; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.demo-top .back { color: var(--brand-dark); text-decoration: none; font-size: 14px; }
.demo-top h1 { font-size: 22px; margin: 0; }
.demo-badge { background: var(--accent); border-radius: 4px; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1px; padding: 3px 8px; }
.demo-sub { color: var(--muted); font-size: 13px; margin-left: auto; }

/* 标签页 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 14px; padding: 7px 16px; }
.tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 题卡列表 */
.q-list { display: flex; flex-direction: column; gap: 12px; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: flex; gap: 14px; padding: 14px 16px; transition: box-shadow .18s ease, transform .18s ease; }
.q-card:hover { box-shadow: 0 8px 20px rgba(20, 67, 84, .12); transform: translateY(-2px); }
.q-no { align-items: center; background: #e8f2f3; border-radius: 8px; color: var(--brand-dark); display: flex; flex: 0 0 auto; flex-direction: column; font-weight: 700; height: 52px; justify-content: center; line-height: 1.2; width: 52px; }
.q-no small { font-size: 11px; font-weight: 400; opacity: .8; }
.q-main { flex: 1; min-width: 0; }
.q-stem { color: var(--ink); display: -webkit-box; font-size: 15px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.q-meta { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #f0f5f6; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; padding: 2px 10px; }
.chip.know { color: var(--brand-dark); }
.chip.script { background: #fef3e2; border-color: #f3d9ac; color: #a16207; }
.q-go { align-items: center; color: var(--muted); display: flex; font-size: 20px; }

/* 弹窗 */
.overlay { align-items: center; background: rgba(16, 40, 52, .55); display: none; inset: 0; justify-content: center; padding: 18px; position: fixed; z-index: 50; }
.overlay.open { display: flex; }
.dialog { background: var(--surface); border-radius: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-width: 760px; overflow: hidden; width: 100%; }
.dialog-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 10px; padding: 14px 18px; }
.dialog-head h2 { font-size: 17px; margin: 0; }
.dialog-head .spacer { flex: 1; }
.dlg-btn { background: none; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); cursor: pointer; font-size: 13px; padding: 5px 11px; }
.dlg-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.dlg-btn.video-btn { border-color: var(--accent); color: var(--accent); }
.dlg-btn.video-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.dlg-close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 6px; }
.dialog-body { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; }
.q-body { border-bottom: 1px solid var(--line); padding: 16px 18px; }
.q-body .stem { font-size: 15.5px; line-height: 1.85; }
.q-body .stem p { margin: 0 0 10px; }
.q-body .stem p:last-child { margin-bottom: 0; }
.q-options { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.q-option { align-items: flex-start; display: flex; gap: 10px; line-height: 1.7; }
.q-option .opt-key { background: #e8f2f3; border-radius: 50%; color: var(--brand-dark); flex: 0 0 auto; font-size: 13px; font-weight: 700; height: 24px; line-height: 24px; text-align: center; width: 24px; }
.q-figure { margin-top: 12px; text-align: center; }
.q-figure img, .q-figure svg { background: #fbfdfd; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.q-figure .fig-desc { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* 参考答案折叠 */
.answer-box { border-top: 1px solid var(--line); padding: 0 18px 16px; }
.answer-box details > summary { color: var(--brand-dark); cursor: pointer; font-size: 14px; list-style: none; padding: 12px 0 6px; }
.answer-box details > summary::before { content: "▸ "; }
.answer-box details[open] > summary::before { content: "▾ "; }
.answer-box .ans-content { background: #f7fafb; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; line-height: 1.85; padding: 12px 14px; }
.answer-box .ans-content p { margin: 0 0 8px; }
.answer-box .ans-content p:last-child { margin: 0; }

/* 对话剧本（极简 AI / 学生 文本） */
.transcript { border-top: 1px solid var(--line); padding: 14px 18px 6px; }
.trans-title { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.trans-list { display: flex; flex-direction: column; gap: 8px; }
.trans-line { border-radius: 8px; font-size: 14.5px; line-height: 1.8; padding: 8px 12px; transition: opacity .45s ease; }
.trans-line.ai { background: #eef6f7; border: 1px solid #d8eaec; }
.trans-line.st { background: #fffdf6; border: 1px dashed var(--line); margin-left: 26px; }
.trans-who { font-weight: 700; margin-right: 6px; }
.trans-line.ai .trans-who { color: var(--brand-dark); }
.trans-line.st .trans-who { color: var(--accent); }

/* 视频 demo 弹窗 */
.video-overlay { align-items: center; background: rgba(10, 22, 28, .88); display: flex; inset: 0; justify-content: center; position: fixed; z-index: 70; }
.video-stage { align-items: center; display: flex; flex-direction: column; gap: 12px; max-width: 96vw; }
.video-stage video, .video-stage img { background: #000; border-radius: 6px; max-height: 84vh; max-width: 94vw; }

/* 原卷灯箱 */
.paper-overlay { align-items: center; background: rgba(10, 22, 28, .88); display: none; inset: 0; justify-content: center; position: fixed; z-index: 60; }
.paper-overlay.open { display: flex; }
.paper-stage { align-items: center; display: flex; flex-direction: column; gap: 12px; max-height: 100vh; padding: 20px; }
.paper-stage img { border-radius: 4px; max-height: calc(100vh - 130px); max-width: 96vw; }
.paper-nav { align-items: center; display: flex; gap: 18px; }
.paper-nav button { background: #fff; border: 0; border-radius: 5px; cursor: pointer; font-size: 14px; padding: 7px 16px; }
.paper-nav .paper-count { color: #cfe3e8; font-size: 14px; }

@media (max-width: 600px) {
  .msg { max-width: 92%; }
  .q-stem { white-space: normal; }
  .dialog { max-height: calc(100vh - 16px); }
}
