/* 首页 Leo 体验（10-30）：精简辅导台。板书本体沿用 style.css 里的 #board-panel 系列样式，这里只管版面和对话区 */
body.demo {
  --d-ink: #14382b; --d-ink2: #4d6b5d; --d-paper: #f6f1e4; --d-card: #fffdf7; --d-line: #e4dac3;
  --d-accent: #e0782a; --d-accent2: #f5a742; --d-leo: #2f6bff; --d-glow: 0 18px 50px rgba(20, 56, 43, .14);
  margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(1200px 600px at 85% -10%, #ffe8c7 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #dff0e6 0%, transparent 55%), var(--d-paper);
  color: var(--d-ink); font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dm-top { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid rgba(20,56,43,.08); background: rgba(255,253,247,.72); backdrop-filter: blur(14px); z-index: 3; }
.dm-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--d-ink); text-decoration: none; font-size: 17px; }
.dm-brand img { width: 28px; height: 28px; }
.dm-tag { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: #14382b0f; color: var(--d-ink2); }
.dm-spacer { flex: 1; }
body.demo .dm-link { border: 0; background: none; padding: 6px 8px; color: var(--d-ink2); font-size: 14px; box-shadow: none; cursor: pointer; }
body.demo .dm-link:hover { color: var(--d-ink); }
.dm-cta, .dm-sum-cta { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: linear-gradient(135deg, var(--d-accent), var(--d-accent2)); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; box-shadow: 0 8px 20px rgba(224,120,42,.28); }
.dm-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 27vw, 380px); gap: 14px; padding: 14px 16px 16px; }
.dm-stagecol { min-height: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.dm-problem { background: linear-gradient(120deg, #14382b, #1d5a44 60%, #2a5bd7); color: #fff; border-radius: 22px; padding: 16px 22px 16px; box-shadow: var(--d-glow); position: relative; overflow: hidden; }
.dm-problem::after { content: '?'; position: absolute; right: 18px; top: -26px; font: 700 150px/1 'Songti SC', serif; color: rgba(255,255,255,.07); pointer-events: none; }
.dm-kicker { font-size: 12.5px; letter-spacing: .08em; color: var(--d-accent); font-weight: 700; margin: 0; }
.dm-problem .dm-kicker { color: #ffc27a; }
.dm-problem h1 { margin: 2px 0 6px; font-size: clamp(22px, 2.4vw, 32px); font-family: 'Songti SC', 'STSong', serif; letter-spacing: .02em; }
.dm-problem-text { margin: 0; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.7; color: rgba(255,255,255,.92); max-width: 70em; }
.dm-stage { position: relative; flex: 1; min-height: 300px; border-radius: 24px; border: 1px solid var(--d-line); box-shadow: var(--d-glow); overflow: hidden;
  background: radial-gradient(800px 380px at 70% 0%, #fff6e6, transparent 70%), repeating-linear-gradient(0deg, transparent 0 39px, rgba(20,56,43,.045) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(20,56,43,.045) 39px 40px), #fffdf6; }
.dm-stage-fig { position: absolute; inset: 0 0 64px; display: flex; flex-direction: column; }
.dm-stage-badge { position: absolute; left: 16px; top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--d-accent); background: #fff3e3; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.dm-jxg { flex: 1; min-height: 0; width: 100%; }
.dm-jxg .JXGtext { white-space: nowrap; }
.dm-readout { position: absolute; left: 50%; bottom: -54px; transform: translateX(-50%); max-width: calc(100% - 24px); background: #14382b; color: #fff; border-radius: 16px; padding: 10px 18px; font-size: 16px; line-height: 1.5; box-shadow: 0 10px 26px rgba(20,56,43,.25); text-align: center; z-index: 2; }
.dm-readout em { font-style: normal; font-weight: 800; color: #ffc27a; font-size: 1.15em; font-variant-numeric: tabular-nums; }
.dm-readout small { display: inline-block; margin-left: 8px; opacity: .65; font-size: 12.5px; }
.dm-readout .dm-note { margin-top: 4px; color: #bcd7ff; font-size: 14px; } .dm-readout .dm-note.ok { color: #9ff0c4; }
.dm-solid { flex: 1; min-height: 0; } .dm-solid svg { width: 100%; height: 100%; }
.dm-slider { position: absolute; right: 16px; top: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--d-ink2); background: rgba(255,255,255,.85); padding: 8px 12px; border-radius: 14px; z-index: 2; }
.dm-slider input { width: 180px; accent-color: var(--d-accent); }
.dm-painted { flex: 1; min-height: 0; display: flex; justify-content: center; } .dm-painted svg { height: 100%; max-width: 100%; }
.dm-seg { position: absolute; right: 12px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 70%; z-index: 2; font-size: 13px; }
body.demo .dm-seg button { padding: 5px 10px; border-radius: 999px; font-size: 13px; background: #fff; border: 1px solid var(--d-line); box-shadow: none; }
body.demo .dm-seg button.on { background: var(--d-ink); color: #fff; border-color: var(--d-ink); }
.dm-seg label { display: flex; align-items: center; gap: 6px; color: var(--d-ink2); } .dm-seg input { width: 90px; accent-color: var(--d-accent); }
.dm-animals { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 16px 8px; }
.dm-pen { display: flex; gap: clamp(8px, 2vw, 22px); padding: 16px 20px 22px; border-radius: 22px; background: repeating-linear-gradient(90deg, #d8b27a 0 10px, #c89a5c 10px 14px) bottom/100% 18px no-repeat, #fff8ea; border: 2px solid #e6cfa5; }
body.demo .dm-ani { display: flex; flex-direction: column; align-items: center; gap: 2px; width: clamp(78px, 9vw, 120px); padding: 12px 6px; border-radius: 18px; background: #fff; border: 2px solid #f0dfbf; box-shadow: 0 6px 16px rgba(120,80,20,.12); transition: transform .2s; }
body.demo .dm-ani:hover { transform: translateY(-3px) rotate(-2deg); }
.dm-ani .e { font-size: clamp(40px, 5vw, 62px); line-height: 1.1; } .dm-ani .l { color: var(--d-accent); letter-spacing: 3px; font-weight: 800; } .dm-ani small { color: var(--d-ink2); font-size: 12px; }
body.demo .dm-ani.r { border-color: #f5a742; background: #fff4e3; }
.dm-ani.hop { animation: dm-hop .6s ease-out both; } .dm-ani.pop { animation: dm-hop .7s ease-out 2; }
@keyframes dm-hop { 30% { transform: translateY(-14px); } 60% { transform: translateY(0); } }
.dm-meter { width: min(520px, 92%); display: flex; flex-direction: column; gap: 8px; align-items: center; font-size: 17px; }
.dm-meter-bar { position: relative; width: 100%; height: 16px; border-radius: 999px; background: #efe6d2; } .dm-meter-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--d-accent), var(--d-accent2)); transition: width .5s; }
.dm-meter-bar b { position: absolute; top: -22px; transform: translateX(-50%); font-size: 12px; color: var(--d-ink2); }
.dm-meter em { font-style: normal; font-weight: 800; font-size: 1.4em; color: var(--d-accent); } .dm-meter .ok { color: var(--d-green, #1f9d63); margin-left: 6px; }
.dm-drawer { position: relative; flex: 0 0 auto; height: 44%; min-height: 220px; display: flex; flex-direction: column; border-radius: 20px; background: #fffdf7; border: 1px solid var(--d-line); box-shadow: var(--d-glow); z-index: 20; animation: dm-rise .45s cubic-bezier(.2,.9,.3,1.1) both; overflow: hidden; }
.dm-drawer[hidden] { display: none; }
@keyframes dm-rise { from { transform: translateY(40px); opacity: 0; } }
body.demo .dm-drawer-tab { display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--d-line); background: linear-gradient(90deg, #eef4ff, #fff); border-radius: 0; padding: 9px 14px; font-weight: 700; text-align: left; box-shadow: none; }
.dm-drawer-tab small { color: var(--d-ink2); font-weight: 400; flex: 1; } .dm-drawer-tab i { font-style: normal; transition: transform .2s; }
.dm-drawer.collapsed { height: 44px; min-height: 0; } .dm-drawer.collapsed .dm-drawer-tab i { transform: rotate(180deg); }
body.demo .dm-drawer #board-panel.dm-board { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 0; flex: 1; overflow: auto; background: transparent; }
body.demo #board-panel .board-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px dashed var(--d-line); flex-wrap: wrap; }
body.demo #board-panel .board-head button { padding: 5px 11px; font-size: 13px; border-radius: 10px; }
body.demo #board-state { font-size: 12.5px; color: var(--d-ink2); }
body.demo .dm-drawer #jxgbox { min-height: 0; flex: 0 1 auto; }
body.demo .dm-drawer #jxgbox:empty { display: none; }
.dm-filmbtn { margin-left: auto; }
body.demo .dm-filmbtn { padding: 7px 12px; border-radius: 999px; font-size: 13px; border: 0; color: #fff; background: linear-gradient(135deg, #14382b, #2f6bff); box-shadow: 0 6px 16px rgba(47,107,255,.25); white-space: nowrap; }
body.demo .dm-sum-film { width: 100%; margin-top: 14px; padding: 12px; border-radius: 999px; border: 1.5px solid #2f6bff55; background: #eef4ff; color: #1d3f9e; font-size: 15px; font-weight: 600; }
.dm-play-open { animation: dm-pulse 1.2s infinite; border-radius: 999px !important; background: #fff3e3 !important; color: var(--d-accent) !important; }
.dm-sum-fig img, .dm-sum-fig svg { max-width: 100%; max-height: 210px; display: block; margin: auto; } .dm-sum-fig .dm-animals { padding: 0; transform: scale(.7); }
.dm-talk { min-height: 0; display: flex; flex-direction: column; background: rgba(255,253,247,.86); border: 1px solid var(--d-line); border-radius: 22px; box-shadow: var(--d-glow); overflow: hidden; }
.dm-leo { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--d-line); background: linear-gradient(90deg, #eef4ff, transparent); }
.dm-leo img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #dfe8ff; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #2f6bff33; }
body.demo[data-busy] .dm-leo img { animation: dm-pulse 1.2s ease-in-out infinite; }
@keyframes dm-pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 9px #2f6bff22; } }
.dm-leo strong { display: block; font-size: 16px; } .dm-leo small { color: var(--d-ink2); font-size: 12.5px; }
.dm-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.dm-msg { display: flex; gap: 6px; align-items: flex-end; max-width: 92%; animation: dm-in .28s ease-out both; }
@keyframes dm-in { from { opacity: 0; transform: translateY(6px); } }
.dm-msg .dm-bubble { padding: 10px 14px; border-radius: 16px; line-height: 1.7; font-size: 15.5px; }
.dm-msg.bot .dm-bubble { background: #fff; border: 1px solid var(--d-line); border-bottom-left-radius: 5px; }
.dm-msg.user { align-self: flex-end; } .dm-msg.user .dm-bubble { background: var(--d-ink); color: #fff; border-bottom-right-radius: 5px; }
.dm-msg.sys { align-self: center; max-width: 100%; } .dm-msg.sys .dm-bubble { background: transparent; color: var(--d-ink2); font-size: 13px; padding: 2px 8px; text-align: center; }
.dm-msg.thinking { color: var(--d-ink2); font-size: 14px; align-items: center; gap: 10px; padding: 4px 6px; }
body.demo .dm-say { border: 0; background: none; padding: 2px; font-size: 15px; opacity: .55; box-shadow: none; } .dm-say:hover { opacity: 1; }
.dm-dots { display: inline-flex; gap: 4px; } .dm-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--d-leo); animation: dm-dot 1s infinite ease-in-out; } .dm-dots i:nth-child(2) { animation-delay: .15s; } .dm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dm-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.dm-chips { display: flex; gap: 8px; padding: 8px 12px 0; flex-wrap: wrap; }
body.demo .dm-chip { flex: 1 1 auto; padding: 9px 12px; border-radius: 999px; font-size: 14.5px; background: #fff; border: 1.5px solid #14382b22; color: var(--d-ink); box-shadow: 0 3px 10px rgba(20,56,43,.06); }
body.demo .dm-chip:hover { border-color: var(--d-accent); color: var(--d-accent); transform: translateY(-1px); }
body.demo[data-busy] .dm-chip, body.demo[data-busy] .dm-send { opacity: .5; pointer-events: none; }
.dm-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 6px; }
.dm-input textarea { flex: 1; resize: none; border: 1.5px solid var(--d-line); border-radius: 16px; padding: 10px 12px; font: inherit; font-size: 15.5px; line-height: 1.5; background: #fff; color: var(--d-ink); min-height: 44px; }
.dm-input textarea:focus { outline: none; border-color: var(--d-leo); box-shadow: 0 0 0 3px #2f6bff1f; }
body.demo .dm-mic, body.demo .dm-send { height: 44px; border-radius: 14px; padding: 0 14px; font-size: 15px; }
body.demo .dm-send { background: var(--d-ink); color: #fff; border-color: var(--d-ink); }
body.demo .dm-mic.on { background: #ffe7e3; border-color: #e74c3c; animation: dm-pulse 1s infinite; }
.dm-foot { margin: 0; padding: 0 14px 10px; font-size: 12px; color: #8a9a90; text-align: center; }
.dm-film { display: flex; align-items: center; gap: 6px; margin: 6px 12px 0; }
body.demo .dm-film-card { flex: 1; display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border-radius: 16px; background: linear-gradient(135deg, #14382b, #2f6bff); color: #fff; border: 0; box-shadow: 0 10px 24px rgba(47,107,255,.25); }
.dm-film-card small { display: block; opacity: .8; font-size: 12.5px; }
.dm-film-play { width: 34px; height: 34px; border-radius: 50%; background: #fff; position: relative; flex: none; } .dm-film-play::after { content: ''; position: absolute; left: 13px; top: 10px; border: 7px solid transparent; border-left: 11px solid #14382b; }
body.demo .dm-film-x { border: 0; background: none; font-size: 20px; padding: 4px 8px; box-shadow: none; }
.dm-sheet, .dm-picker { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(12, 30, 24, .45); backdrop-filter: blur(6px); }
.dm-sheet[hidden], .dm-picker[hidden], .dm-film[hidden] { display: none; }
.dm-sheet-card, .dm-picker-inner { position: relative; width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--d-card); border-radius: 26px; padding: 26px 26px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: dm-pop .35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes dm-pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.dm-sheet-card h2, .dm-picker-inner h2 { margin: 4px 0 16px; font-family: 'Songti SC', 'STSong', serif; font-size: 26px; }
body.demo .dm-sheet-x { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 24px; padding: 4px 10px; box-shadow: none; }
.dm-sum-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.dm-sum-board { border: 1px solid var(--d-line); border-radius: 16px; background: #fffdf6; min-height: 180px; max-height: 300px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--d-ink2); font-size: 13px; padding: 8px; }
.dm-sum-board img { max-width: 100%; max-height: 220px; }
.dm-sum-board .dm-sum-notes { zoom: .8; pointer-events: none; width: 100%; max-height: 280px; overflow: hidden; display: block !important; }
.dm-sum-said h3 { margin: 0 0 8px; font-size: 15px; } .dm-sum-said ul { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 14.5px; }
.dm-sum-said li::marker { color: var(--d-accent); }
.dm-sheet-card .dm-sum-cta { margin-top: 18px; width: 100%; justify-content: center; font-size: 16px; padding: 14px; }
.dm-sum-note { font-size: 13px; color: var(--d-ink2); text-align: center; margin: 10px 0 0; }
.dm-film-shell { padding: 12px; background: #000; } .dm-film-shell video { width: 100%; border-radius: 14px; display: block; } .dm-film-shell .dm-sheet-x { color: #fff; z-index: 2; }
.dm-picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.dm-pick { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; border: 1px solid var(--d-line); background: #fff; color: var(--d-ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.dm-pick:hover { transform: translateY(-2px); box-shadow: var(--d-glow); } .dm-pick strong { font-size: 16.5px; } .dm-pick small { color: var(--d-ink2); }
.dm-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--d-ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; transition: .25s; z-index: 30; pointer-events: none; }
.dm-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1100px) and (min-width: 861px) { .dm-main { grid-template-columns: minmax(0, 1fr) 320px; } .dm-chips { gap: 6px; } body.demo .dm-chip { font-size: 13.5px; padding: 8px 10px; } }
@media (max-width: 860px) {
  body.demo { height: auto; min-height: 100dvh; overflow: auto; }
  .dm-main { display: flex; flex-direction: column; padding: 10px; gap: 10px; }
  .dm-stage { flex: none; height: min(62vh, 560px); min-height: 380px; }
  .dm-talk { min-height: 520px; }
  .dm-problem { padding: 14px 16px; border-radius: 18px; } .dm-problem h1 { font-size: 22px; } .dm-problem-text { font-size: 14.5px; }
  .dm-top { padding: 8px 12px; position: sticky; top: 0; } .dm-tag { display: none; }
  .dm-sum-grid { grid-template-columns: 1fr; } .dm-picker-grid { grid-template-columns: 1fr 1fr; }
  .dm-readout { font-size: 14.5px; padding: 8px 12px; bottom: -56px; width: calc(100% - 20px); } .dm-readout small { display: block; margin: 2px 0 0; }
  .dm-stage-fig { inset: 0 0 74px; }
  .dm-seg { left: 10px; right: 10px; max-width: none; justify-content: center; top: 44px; } .dm-slider { top: 44px; right: 10px; } .dm-slider input { width: 130px; }
  .dm-drawer { height: auto; max-height: 70vh; }
  .dm-pen { padding: 10px 10px 18px; } body.demo .dm-ani { width: 72px; }
}
@media (max-width: 860px) {
  body.demo { height: auto; min-height: 100dvh; overflow: auto; }
  .dm-main { display: flex; flex-direction: column; padding: 12px; gap: 12px; }
  body.demo #board-panel .board-head > span[style] { display: none; }
}
@media (max-width: 420px) { .dm-picker-grid { grid-template-columns: 1fr; } body.demo .dm-chip { font-size: 13.5px; padding: 8px 10px; } }

/* ── 第二轮：就地注册窗（注册送 30 万 token；邀请码 + 如何获取邀请码） */
.rg-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(10, 26, 20, .55); backdrop-filter: blur(3px); animation: rg-in .2s ease-out; }
.rg { position: fixed; z-index: 91; left: 50%; bottom: 0; transform: translateX(-50%); width: min(460px, 100%); max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--d-card, #fffdf7); color: var(--d-ink, #14382b); border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -24px 60px -20px rgba(0,0,0,.45); font: 15px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; animation: rg-up .35s cubic-bezier(.2,.9,.25,1.05); }
@media (min-width: 720px) { .rg { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 24px; animation: none; } }
@keyframes rg-up { from { transform: translate(-50%, 40px); opacity: 0; } }
@keyframes rg-in { from { opacity: 0; } }
.rg * { box-sizing: border-box; }
body.demo .rg-x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #14382b0d; color: var(--d-ink2); font-size: 20px; box-shadow: none; padding: 0; }
.rg-kick { margin: 0 0 4px; color: var(--d-accent); font-weight: 800; font-size: 13px; letter-spacing: .06em; }
.rg h2 { margin: 0 40px 4px 0; font: 800 23px/1.3 -apple-system, "PingFang SC", sans-serif; }
.rg h2 em { font-style: normal; color: var(--d-accent); }
.rg-sub { margin: 0 0 14px; color: var(--d-ink2); font-size: 14px; }
.rg form label { display: block; font-size: 12.5px; color: var(--d-ink2); font-weight: 600; margin: 0 0 8px; }
.rg input { display: block; width: 100%; margin-top: 4px; height: 46px; border-radius: 12px; border: 1.5px solid var(--d-line); background: #fff; padding: 0 12px; font-size: 16px; color: var(--d-ink); font-family: inherit; }
.rg input:focus { outline: none; border-color: var(--d-leo); box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
.rg-sms { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
body.demo .rg-sms button { height: 46px; margin-bottom: 8px; border-radius: 12px; border: 1.5px solid var(--d-leo); background: #fff; color: var(--d-leo); font-weight: 700; padding: 0 12px; box-shadow: none; }
.rg-code { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rg-code label { margin: 0 !important; }
body.demo .rg-help { border: 0; background: none; box-shadow: none; padding: 4px 0; color: var(--d-leo); font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.rg #rgCode { margin: 4px 0 6px; text-transform: none; }
.rg-auto { margin: 0 0 4px; font-size: 12.5px; color: #1f9d63; }
.rg-err { min-height: 18px; margin: 4px 0 6px; color: #c2462d; font-size: 13px; }
body.demo .rg-go { display: block; width: 100%; height: 50px; border: 0; border-radius: 16px; background: linear-gradient(135deg, var(--d-accent), var(--d-accent2)); color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 10px 22px -10px rgba(224,120,42,.9); }
body.demo .rg-go:disabled { opacity: .7; }
body.demo .rg-ghost { display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 1.5px solid var(--d-line); border-radius: 14px; background: #fff; color: var(--d-ink); font-weight: 700; font-size: 14.5px; box-shadow: none; }
.rg-ask { text-align: center; padding: 6px 2px 2px; }
.rg-ask-ico { font-size: 40px; margin: 0; }
.rg-ask h3 { margin: 4px 0 6px; font-size: 19px; line-height: 1.4; }
.rg-ask p { margin: 0 0 14px; color: var(--d-ink2); font-size: 14px; }
.rg-helpbox iframe { display: block; width: 100%; height: min(68dvh, 640px); border: 1px solid var(--d-line); border-radius: 16px; margin-top: 8px; background: #fff; }
body.demo .rg-helpback { width: auto; margin: 0; padding: 0 14px; display: inline-block; }
body.demo .dm-foot-reg { padding: 0; color: var(--d-accent); font-weight: 700; font-size: inherit; text-decoration: underline; }
body[data-member="1"] .dm-foot-reg { display: none; }

/* ── 第三轮：预制讲解板书（分步展开，KaTeX，统一配色、大字号） */
.dm-drawer.prefab #board-panel { display: none !important; }
.dm-steps { display: none; }
.dm-drawer.prefab .dm-steps { display: block; flex: 1; min-height: 0; overflow: auto; padding: 10px 14px 16px; }
.bs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bs-step { border: 1px solid var(--d-line); border-radius: 16px; background: #fff; padding: 10px 14px 8px; transition: box-shadow .3s, border-color .3s, opacity .3s; opacity: .78; }
.bs-step.cur { opacity: 1; border-color: #f2b56b; box-shadow: 0 10px 26px rgba(224,120,42,.16); }
.bs-step.in { animation: bs-in .5s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes bs-in { from { transform: translateY(14px); opacity: 0; } }
.bs-head { display: flex; align-items: center; gap: 10px; }
.bs-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--d-ink); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.bs-step.cur .bs-n { background: var(--d-accent); }
.bs-head strong { flex: 1; font-size: 16.5px; }
body.demo .bs-say { border: 0; background: none; box-shadow: none; padding: 4px; font-size: 15px; opacity: .6; }
.bs-lines { padding: 2px 0 0 36px; }
.bs-line { color: var(--d-ink); font-size: 18px; overflow-x: auto; overflow-y: hidden; }
.bs-step.in .bs-line { animation: bs-line .6s ease-out both; }
@keyframes bs-line { from { opacity: 0; transform: translateX(-10px); clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.bs-line .katex-display { margin: .35em 0; text-align: left; }
.bs-line .katex { font-size: 1.12em; }
.bs-hint { margin: 8px 0 2px 36px; padding: 8px 12px; border-radius: 12px; background: #fff4e3; border: 1px dashed #f2b56b; color: #8a4a12; font-size: 15px; animation: bs-in .4s ease-out both; }
@media (min-width: 1101px) {
  body.demo[data-board="on"] .dm-stagecol:has(.dm-drawer.prefab) { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  body.demo .dm-stagecol:has(.dm-drawer.prefab) .dm-problem { grid-column: 1 / -1; }
  body.demo .dm-stagecol:has(.dm-drawer.prefab) .dm-drawer { height: auto; min-height: 0; }
}
/* 浮在图上的 Leo 字幕条：手机竖屏首屏就能看到开场白 */
.dm-cap { display: none; }
@media (max-width: 860px) {
  .dm-stage-badge { display: none; }
  .dm-cap ~ .dm-stage-fig .dm-seg, .dm-stage:has(.dm-cap:not(:empty)) .dm-seg, .dm-stage:has(.dm-cap:not(:empty)) .dm-slider { top: 112px; }
  .dm-cap.dim { max-height: 3.4em; opacity: .9; }
  .dm-cap { display: block; position: absolute; left: 10px; right: 10px; top: 10px; transition: max-height .4s; z-index: 4; padding: 10px 14px 10px 46px; border-radius: 16px; background: rgba(20,56,43,.92); color: #fff; font-size: 15px; line-height: 1.55; box-shadow: 0 10px 26px rgba(20,56,43,.28);
    background-image: url(../brand/leo-avatar.webp); background-repeat: no-repeat; background-size: 28px; background-position: 10px 10px; max-height: 6.4em; overflow: hidden; }
  .dm-cap:empty { display: none; }
  .dm-cap.in { animation: bs-in .4s ease-out both; }
  .dm-problem-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .dm-problem.open .dm-problem-text { display: block; }
}
