/* 同芯题库 · 做题页（沿用 /questions/styles.css 里的设计令牌与导航样式） */
body.is-problem{background:#eef2f7;display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden}
body.is-problem .nav,
body.is-problem .mobile-quick{display:none !important}
body.is-problem .devbar{display:none}

/* ── 顶部题目工具条 ── */
.pbar{flex:0 0 auto;display:flex;align-items:center;gap:14px;padding:calc(8px + env(safe-area-inset-top)) 16px 8px;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 1px 0 rgba(15,36,56,.04)}
.pbar[hidden]{display:none}
.pbar-back{display:inline-flex;align-items:center;gap:4px;padding:6px 12px 6px 8px;border-radius:11px;font-size:13.5px;font-weight:700;color:var(--navy);transition:.15s}
.pbar-back:hover{background:#eef3f9}
.pbar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.pbar-nav{display:flex;align-items:center;gap:4px;margin:0 auto}
.pbar-step{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:10px;background:none;color:#52667d;cursor:pointer;transition:.15s}
.pbar-step:hover{background:#eef3f9;color:var(--navy)}
.pbar-step[aria-disabled="true"]{opacity:.3;pointer-events:none}
.pbar-count{min-width:62px;text-align:center;font-family:'JetBrains Mono',monospace;font-size:12.5px;font-weight:600;color:var(--muted)}
.pbar-right{display:flex;align-items:center;gap:8px}
.pbar .fav{opacity:1}
.pbar-status{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:99px;font-size:12.5px;font-weight:700;background:#eef3f9;color:#4b6480}
.pbar-status.done{background:#e3f6ef;color:#0b8a69}
.pbar-status svg{width:15px;height:15px;stroke-width:2.2}

/* ── 左右分栏 ── */
.pw{flex:1 1 auto;min-height:0;display:flex;padding:12px;gap:0;--left:33.333%}
.pw[hidden]{display:none}
.pw-left{flex:0 0 var(--left);min-width:0;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-card);overflow:hidden}
.pw-right{flex:1 1 0;min-width:0;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-card);overflow:hidden;container:work / inline-size}
.pw-divider{flex:0 0 12px;position:relative;cursor:col-resize;touch-action:none}
.pw-divider::after{content:"";position:absolute;left:50%;top:50%;width:4px;height:44px;margin:-22px 0 0 -2px;border-radius:99px;background:#c9d5e3;transition:.15s}
.pw-divider:hover::after,.pw-divider.drag::after,.pw-divider:focus-visible::after{background:var(--navy);height:64px;margin-top:-32px}
body.dragging{user-select:none;cursor:col-resize}
.pane-scroll{flex:1;min-height:0;overflow-y:auto;padding:22px 24px 40px;scrollbar-width:thin}

/* ── 左：题目描述 ── */
.p-title{font-family:'Noto Serif SC',serif;font-size:21px;font-weight:700;line-height:1.45;color:var(--navy-2);overflow-wrap:anywhere;word-break:break-word}
.p-title .no{color:var(--muted-2);font-weight:600;margin-right:6px;font-variant-numeric:tabular-nums}
.p-tags{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 18px}
.tag{display:inline-flex;align-items:center;padding:3px 11px;border-radius:99px;font-size:12px;font-weight:700;background:#eef3f9;color:#4b6480}
.tag.easy{background:#e3f6ef;color:var(--easy)} .tag.medium{background:#fdf0d6;color:var(--medium)} .tag.hard{background:#fde6e4;color:var(--hard)}
.tag.kind{background:var(--gold-soft);color:var(--gold-dark)}
.tag.mono{font-family:'JetBrains Mono',monospace;font-weight:600}

.rich{font-size:14.5px;line-height:1.8;color:#23384f;overflow-wrap:anywhere;word-break:break-word}
.rich p{margin:0 0 12px}
.rich ul,.rich ol{margin:0 0 12px;padding-left:22px}
.rich li{margin:4px 0}
.rich code{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.88em;padding:1px 6px;border-radius:6px;background:#eef3f9;color:#0f2942;white-space:pre-wrap;overflow-wrap:anywhere}
.rich b{color:var(--navy-2)}
.rich pre{margin:0 0 14px;padding:14px 16px;border-radius:12px;background:#0f2438;color:#dbe6f2;overflow-x:auto;-webkit-overflow-scrolling:touch;font-size:13px;line-height:1.65;max-width:100%}
.rich pre code{display:block;padding:0;padding-right:56px;background:none;color:inherit;font-size:inherit;white-space:pre;overflow-wrap:normal;word-break:normal;min-width:min-content}
.rich table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:0 0 14px;font-size:13.5px;line-height:1.6}
.rich th,.rich td{padding:6px 12px;border:1px solid var(--line);text-align:left;vertical-align:top;white-space:nowrap}
.rich th{background:#f3f6fa;color:var(--navy-2);font-weight:600}
/* Follow-up appended to an existing question: boxed, numbered asks, short answer sections */
.rich .fu{margin:22px 0 14px;padding:14px 16px 4px;border:1px solid #efe2bb;border-left:4px solid var(--gold);border-radius:12px;background:#fffcf2}
.rich .fu-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:0 0 10px}
.rich .fu-badge{display:inline-flex;align-items:center;padding:2px 10px;border-radius:99px;background:var(--gold-soft);border:1px solid #efe2bb;color:var(--gold-dark);font-size:12px;font-weight:700;line-height:1.6;white-space:nowrap}
.rich .fu-title{font-size:15px;font-weight:700;color:var(--navy-2);line-height:1.5}
.rich .fu-asks{padding-left:22px}
.rich .fu-asks li{margin:6px 0;padding-left:2px}
.rich .fu h4{margin:18px 0 6px;padding-top:12px;border-top:1px dashed #eadfbf;font-size:14.5px;font-weight:700;color:var(--navy-2)}
.rich .fu h4:first-of-type{margin-top:6px;padding-top:0;border-top:0}
.rich .fu ul{margin-bottom:10px}
.rich .fu pre{margin-top:4px}
.rich .fu-note{margin-top:14px;padding:8px 12px;border-radius:8px;background:#eef7f2;color:#24584a;font-size:13.5px}

.p-sec{margin-top:22px;border-top:1px solid var(--line-2);padding-top:6px}
.p-sec summary{display:flex;align-items:center;gap:8px;padding:10px 0;cursor:pointer;list-style:none;font-size:14px;font-weight:700;color:var(--navy);user-select:none}
.p-sec summary::-webkit-details-marker{display:none}
.p-sec summary::before{content:"";width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);transition:.15s;margin-right:2px}
.p-sec[open] summary::before{transform:rotate(45deg)}
.hint-item{display:flex;gap:10px;margin:8px 0;padding:10px 14px;border-radius:12px;background:#f6f9fc;font-size:13.5px;line-height:1.7;color:#35506b}
.hint-item i{flex:0 0 auto;font-style:normal;font-weight:700;color:var(--gold-dark);font-family:'JetBrains Mono',monospace}
.p-placeholder{margin-top:16px;padding:14px 16px;border-radius:12px;background:var(--gold-soft);border:1px dashed #e4cd84;color:var(--gold-dark);font-size:13px;line-height:1.7}

/* ── 右：作答区 ── */
.rw-head{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line-2);background:#fafcfe}
.rw-head h2{font-family:'Noto Sans SC',sans-serif;font-size:13.5px;font-weight:700;color:var(--navy);display:flex;align-items:center;gap:8px}
.rw-head h2 svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;color:var(--muted)}
.lang{padding:2px 9px;border-radius:7px;background:var(--navy);color:#f8e7aa;font-size:11.5px;font-weight:700;font-family:'JetBrains Mono',monospace}
.lang-pick-wrap{margin-left:8px}
.lang-pick{height:28px;padding:0 22px 0 10px;border:0;border-radius:8px;background-color:var(--navy);color:#f8e7aa;font-size:12px;font-weight:700;font-family:'JetBrains Mono',monospace;cursor:pointer;-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23f8e7aa' d='M1 1l4 4 4-4'/></svg>");background-repeat:no-repeat;background-position:right 8px center}
.lang-pick:hover,.lang-pick:focus{outline:2px solid #f8e7aa;outline-offset:1px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.rw-meta{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.ghost{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:0;border-radius:9px;background:none;font-size:12.5px;font-weight:600;color:#52667d;transition:.15s}
.ghost:hover{background:#e9eff6;color:var(--navy)}
.ghost svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.saved{font-size:11.5px;color:var(--muted-2)}

.pw-right{--ans:58%}
.rw-body{flex:1 1 0;min-height:72px;display:flex;flex-direction:column}
/* 编码题：带行号的代码编辑器 */
.ed{flex:1;min-height:0;display:flex;background:#fbfcfe;font-family:'JetBrains Mono',ui-monospace,monospace;font-size:13.5px;line-height:1.7}
.ed-gutter{flex:0 0 auto;min-width:46px;padding:14px 10px 14px 0;text-align:right;color:#a7b6c8;background:#f3f6fa;border-right:1px solid var(--line-2);overflow:hidden;user-select:none;white-space:pre}
.ed-main{flex:1;min-width:0;position:relative;overflow:hidden}
.ed-hl,.ed-main textarea{box-sizing:border-box;margin:0;padding:14px 16px;font:inherit;line-height:inherit;white-space:pre;tab-size:2;overflow:auto;word-wrap:normal;overflow-wrap:normal}
.ed-hl{position:absolute;inset:0;pointer-events:none;color:#0f2942;background:#fbfcfe;overflow:hidden}
.ed-main textarea{position:relative;z-index:1;display:block;width:100%;height:100%;border:0;outline:0;resize:none;background:transparent;color:transparent;-webkit-text-fill-color:transparent;caret-color:var(--navy)}
.ed-main textarea::selection{background:rgba(16,42,69,.18);color:transparent}
/* 非编码题：文字回答 */
.ans-ta{flex:1;min-height:0;font-family:inherit;border:0;outline:0;resize:none;padding:20px 24px;font-size:15px;line-height:1.85;color:#1f3550;background:#fff}
.ans-ta::placeholder{color:#a3b2c4}

/* 参考答案抽屉：高度可拖，默认约六成，避免答案被写死在一小条里 */
.ans-drag{flex:0 0 14px;position:relative;z-index:2;cursor:row-resize;touch-action:none;background:transparent}
.ans-drag::after{content:"";position:absolute;left:50%;top:5px;width:48px;height:4px;margin-left:-24px;border-radius:99px;background:#e4cd84;transition:.15s}
.ans-drag:hover::after,.ans-drag.drag::after,.ans-drag:focus-visible::after{background:var(--gold);width:72px;margin-left:-36px}
.ans-drag[hidden]{display:none}
body.dragging-y{user-select:none;cursor:row-resize}
.rw-answer{flex:0 0 var(--ans);min-height:120px;display:flex;flex-direction:column;border-top:2px solid var(--gold);background:#fbfcfe;animation:drawerIn .25s ease}
.rw-answer[hidden]{display:none}
@keyframes drawerIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.ans-head{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:9px 14px;background:var(--gold-soft);border-bottom:1px solid #f1e3b0}
.ans-head strong{font-size:13.5px;color:var(--gold-dark)}
.ans-head .ghost{margin-left:auto;color:var(--gold-dark)}
.ans-head .ghost:hover{background:rgba(139,106,24,.12)}
.ans-body{flex:1;min-height:0;overflow-y:auto;padding:16px 22px 26px;scrollbar-width:thin}
.ans-body .rich pre{position:relative}
.copy-code{position:absolute;top:8px;right:8px;height:26px;padding:0 10px;border:0;border-radius:8px;background:rgba(255,255,255,.12);color:#c6d4e3;font-size:12px;font-weight:600;cursor:pointer}
.copy-code:hover{background:rgba(255,255,255,.22);color:#fff}
.ans-sub{margin:4px 0 8px;font-size:12.5px;font-weight:700;letter-spacing:.04em;color:var(--muted)}
.ans-sub:not(:first-child){margin-top:18px}

/* 要点自评清单（非编码题） */
.pts{list-style:none;margin:0 0 6px;padding:0;display:flex;flex-direction:column;gap:8px}
.pts label{display:flex;gap:11px;align-items:flex-start;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;font-size:14px;line-height:1.7;color:#23384f;transition:.15s}
.pts label:hover{border-color:#c3cfdd}
.pts input{position:absolute;opacity:0;pointer-events:none}
.pts .box{flex:0 0 auto;width:18px;height:18px;margin-top:3px;border:1.5px solid #c3cfdd;border-radius:6px;background:#fff;display:grid;place-items:center;transition:.15s}
.pts input:checked + .box{background:var(--ok);border-color:var(--ok)}
.pts input:checked + .box::after{content:"";width:8px;height:4px;border:solid #fff;border-width:0 0 2px 2px;transform:rotate(-45deg) translate(1px,-1px)}
.pts label:has(input:checked){border-color:#a9e0cd;background:#f2fbf7}
.pts code{font-family:'JetBrains Mono',monospace;font-size:.88em;padding:1px 6px;border-radius:6px;background:#eef3f9}
.score{display:inline-flex;align-items:center;gap:8px;margin:2px 0 10px;padding:4px 12px;border-radius:99px;background:#eef3f9;font-size:12.5px;font-weight:700;color:#4b6480}
.score b{color:var(--ok);font-family:'JetBrains Mono',monospace}
.no-answer{padding:22px;border-radius:12px;background:#f6f9fc;color:var(--muted);font-size:13.5px;text-align:center}

/* 底部操作栏：提示太长时会被右侧按钮挤成竖排，单行省略；栏窄则直接藏掉 */
.rw-foot{flex:0 0 auto;display:flex;align-items:center;flex-wrap:nowrap;gap:10px;padding:10px 14px;border-top:1px solid var(--line-2);background:#fff}
.rw-tip{flex:1 1 auto;min-width:0;font-size:12.5px;color:var(--muted);line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rw-foot .confirm{flex:0 0 auto;flex-wrap:nowrap}
.rw-foot .btn{padding:9px 16px;font-size:13.5px;border-radius:11px;white-space:nowrap}
@container work (max-width: 780px){.rw-tip{display:none}}
.btn-gold{background:var(--gold);color:var(--navy-2);box-shadow:0 8px 20px rgba(196,152,63,.25)}
.btn-gold:hover{transform:translateY(-1px)}
.btn-done{background:linear-gradient(180deg,#19b48a,#0f9a74);color:#fff;box-shadow:0 8px 20px rgba(15,154,116,.25)}
.btn-done:hover{transform:translateY(-1px)}
.btn-done.is-done{background:#e3f6ef;color:#0b8a69;box-shadow:none}
.confirm{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.confirm span{font-size:12.5px;color:var(--gold-dark);font-weight:600}

/* ── 语音输入 ── */
.mic{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 11px;border:1px solid #cfdae7;border-radius:99px;background:#fff;font-size:12.5px;font-weight:700;color:var(--navy);cursor:pointer;transition:.15s}
.mic svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.mic:hover{border-color:var(--navy);background:#f3f7fb}
.mic[hidden]{display:none}
.mic.rec{background:#fff1f0;border-color:#efb3ae;color:#c8443d}
.mic.rec svg{animation:micPulse 1.1s ease-in-out infinite}
@keyframes micPulse{50%{transform:scale(1.25)}}
.voice-bar{flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:10px 16px;border-top:1px solid #f3cbc7;background:#fff7f6}
.voice-bar[hidden]{display:none}
.rec-dot{flex:0 0 auto;width:10px;height:10px;border-radius:50%;background:#e5534b;box-shadow:0 0 0 0 rgba(229,83,75,.5);animation:recRing 1.4s ease-out infinite}
@keyframes recRing{to{box-shadow:0 0 0 10px rgba(229,83,75,0)}}
.voice-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:13px;line-height:1.55}
.voice-txt b{color:#b3453f;font-size:12.5px}
.voice-txt span{color:#6b7f95;font-style:italic;overflow-wrap:anywhere}
.voice-bar .btn{padding:7px 16px;font-size:13px;border-radius:10px}

/* ── AI 评价 ── */
.btn-ai{display:inline-flex;align-items:center;gap:6px;background:linear-gradient(180deg,#17406a,#0e2c4a);color:#f6d56d;box-shadow:0 8px 20px rgba(16,42,69,.25)}
.btn-ai svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linejoin:round;stroke-linecap:round}
.btn-ai:hover{transform:translateY(-1px)}
.btn-ai:disabled{opacity:.7;cursor:progress;transform:none}
/* AI 评价权限弹窗：卡片结构沿用题库访问弹窗，图标配色换成 AI 评价的藏青 + 金 */
.qb-ai-gate{position:fixed;inset:0;z-index:260;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(16,42,69,.4);backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px);animation:qb-ai-gate-fade .2s ease-out}
.qb-ai-gate-card{position:relative;box-sizing:border-box;width:min(420px,100%);padding:36px 32px 28px;border:1px solid rgba(255,255,255,.95);border-radius:26px;background:linear-gradient(150deg,#fff,#f6f9fd);box-shadow:0 26px 70px rgba(16,42,69,.22),0 4px 16px rgba(16,42,69,.08),inset 0 1px 0 #fff;text-align:center;animation:qb-ai-gate-in .32s ease-out}
.qb-ai-gate-icon{display:grid;place-items:center;width:60px;height:60px;margin:0 auto 18px;border-radius:20px;background:linear-gradient(160deg,#17406a,#0e2c4a);box-shadow:0 10px 24px rgba(16,42,69,.3),inset 0 1px 0 rgba(255,255,255,.14)}
.qb-ai-gate-icon svg{width:26px;height:26px;fill:#f6d56d}
.qb-ai-gate-eyebrow{display:block;font-size:10px;letter-spacing:.18em;font-weight:700;color:var(--gold-dark);margin-bottom:10px;text-transform:uppercase}
.qb-ai-gate-card h2{font-family:'Noto Serif SC',serif;font-size:21px;font-weight:700;letter-spacing:-.01em;line-height:1.5;color:var(--navy-2);margin:0 0 12px}
.qb-ai-gate-card p{margin:0 auto 24px;font-size:13.5px;line-height:1.75;color:var(--muted);max-width:302px}
.qb-ai-gate-actions{display:flex;flex-direction:column;gap:8px}
.qb-ai-gate-actions a,.qb-ai-gate-actions button{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:10px 16px;border:0;border-radius:13px;font-family:inherit;font-size:13.5px;font-weight:600;line-height:1.5;text-decoration:none;cursor:pointer;transition:background .2s,transform .2s}
.qb-ai-gate-primary{background:linear-gradient(135deg,#17406a,#0e2c4a);color:#f6d56d;box-shadow:0 8px 20px rgba(16,42,69,.25)}
.qb-ai-gate-primary:hover{transform:translateY(-1px)}
.qb-ai-gate-actions button{background:transparent;color:var(--muted)}
.qb-ai-gate-actions button:hover{background:#eef3f9;color:var(--navy)}
.qb-ai-gate-actions :focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@keyframes qb-ai-gate-in{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes qb-ai-gate-fade{from{opacity:0}to{opacity:1}}
@media(max-width:560px){.qb-ai-gate{padding:18px}.qb-ai-gate-card{padding:30px 24px 22px;border-radius:22px}.qb-ai-gate-card h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){.qb-ai-gate,.qb-ai-gate-card{animation:none}}

.rw-review{border-top-color:var(--navy);background:#fbfcfe}
.rw-review .ans-head{background:#eaf1f9;border-bottom-color:#d3e0ee}
.rw-review .ans-head strong{display:inline-flex;align-items:center;gap:6px;color:var(--navy)}
.rw-review .ans-head strong svg{width:16px;height:16px;fill:none;stroke:#c4983f;stroke-width:1.9;stroke-linejoin:round;stroke-linecap:round}
.rw-review .ans-head .ghost{color:var(--navy)}
.rw-review .ans-head .ghost:hover{background:rgba(16,42,69,.08)}
.rv-loading,.rv-error{display:flex;flex-direction:column;align-items:center;gap:10px;padding:46px 20px;text-align:center;color:var(--muted)}
.rv-loading b{font-size:14.5px;color:var(--navy)}
.rv-loading small{font-size:12.5px}
.rv-error b{font-size:14px;color:#b3453f;line-height:1.6}
.rv-error .btn{margin-top:4px;padding:9px 18px;font-size:13.5px;border-radius:11px}
.rv-spin{width:34px;height:34px;border-radius:50%;border:3px solid #dbe5f0;border-top-color:var(--gold);animation:rvspin .8s linear infinite}
@keyframes rvspin{to{transform:rotate(360deg)}}
.rv-top{display:flex;align-items:center;gap:18px;margin-bottom:6px}
.rv-ring{position:relative;flex:0 0 auto;width:92px;height:92px}
.rv-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.rv-ring circle{fill:none;stroke-width:7;stroke-linecap:round}
.rv-ring .bg{stroke:#e6edf5}
.rv-ring .fg{stroke:var(--c)}
.rv-ring div{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.rv-ring b{font-family:'JetBrains Mono',monospace;font-size:26px;color:var(--navy-2)}
.rv-ring small{margin-top:4px;font-size:11px;color:var(--muted)}
.rv-sum{min-width:0}
.rv-level{display:inline-block;padding:2px 11px;border-radius:99px;font-size:12.5px;font-weight:800;color:var(--c);background:color-mix(in srgb,var(--c) 13%,#fff)}
.rich .rv-sum p{margin:8px 0 0;font-size:14.5px;line-height:1.75;color:#23384f}
.rv-dims{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.rv-dim{padding:11px 14px;border:1px solid var(--line);border-radius:12px;background:#fff}
.rv-dim-h{display:flex;justify-content:space-between;align-items:baseline;font-size:13px;font-weight:700;color:var(--navy-2)}
.rv-dim-h b{font-family:'JetBrains Mono',monospace;font-size:14px}
.rv-dim-h i{font-style:normal;font-size:11px;font-weight:500;color:var(--muted)}
.rv-bar{height:6px;margin:7px 0;border-radius:99px;background:#e9eff6;overflow:hidden}
.rv-bar i{display:block;height:100%;border-radius:99px}
.rich .rv-dim p{margin:0;font-size:12.5px;line-height:1.65;color:#52667d}
.rich .rv-list{list-style:none;margin:0 0 4px;padding:0;display:flex;flex-direction:column;gap:7px}
.rich .rv-list li{margin:0;position:relative;padding:9px 14px 9px 38px;border-radius:12px;font-size:14px;line-height:1.7;color:#23384f}
.rv-list li::before{content:"";position:absolute;left:14px;top:14px;width:12px;height:12px;border-radius:50%}
.rv-list.good li{background:#f2fbf7}.rv-list.good li::before{background:var(--ok)}
.rv-list.gap li{background:#fff8e8}.rv-list.gap li::before{background:#e5a93a}
.rv-list.bad li{background:#fff1f0}.rv-list.bad li::before{background:#d9534f}
.rv-list.tip li{background:#eff5fc}.rv-list.tip li::before{background:#3f8fd8}
.rv-list code,.rv-dim code,.rv-sum code{font-family:'JetBrains Mono',monospace;font-size:.88em;padding:1px 6px;border-radius:6px;background:rgba(16,42,69,.07)}
.rv-quote{margin:0;padding:12px 16px;border-left:3px solid var(--gold);border-radius:0 12px 12px 0;background:#fffaf0;font-size:14px;line-height:1.8;color:#3a4a5e}
.rv-foot{display:flex;align-items:center;gap:10px;margin-top:20px;padding-top:12px;border-top:1px dashed var(--line);font-size:12px;color:var(--muted)}
.rv-foot .ghost{margin-left:auto;flex:0 0 auto;color:var(--navy)}
.rich.rv code,.rv-list code{font-variant-ligatures:none}
@media(max-width:1200px){.rw-tip{display:none}}
@media(max-width:560px){
  .rv-dims{grid-template-columns:1fr}
  .rv-top{flex-direction:column;align-items:flex-start;gap:12px}
  .rv-ring{width:84px;height:84px}
  .rich .rv-sum p,.rich .rv-list li{font-size:14.5px;line-height:1.75}
  .rv-quote{padding:12px 14px;font-size:14.5px;line-height:1.8}
}

/* 代码里不要用连字（|-> 会被画成一个箭头符号） */
.rich code,.rich pre,.ed,.ed textarea,.ed-hl,.pts code,.lang,.lang-pick{font-variant-ligatures:none;font-feature-settings:'liga' 0,'calt' 0}

/* 语法高亮 */
.tk-c{color:#7e92a8;font-style:italic} .tk-s{color:#8fd3a4} .tk-n{color:#f0a98a} .tk-k{color:#f2c25b;font-weight:600} .tk-m{color:#7cc4f2}
.ed-hl .tk-c{color:#64748b} .ed-hl .tk-s{color:#047857} .ed-hl .tk-n{color:#c2410c} .ed-hl .tk-k{color:#6d28d9;font-weight:700} .ed-hl .tk-m{color:#0369a1}

.pmissing{display:flex;flex-direction:column;align-items:center;gap:8px;margin:80px auto;padding:0 20px;text-align:center;color:var(--muted)}
.pmissing[hidden]{display:none}
.pmissing strong{font-size:18px;color:var(--navy-2)}
.pmissing .btn{margin-top:12px}
.ptabs{display:none}

/* ── 手机 / 窄屏：上下堆叠，用标签切换「题目 / 作答 / 答案」 ── */
@media(max-width:980px){
  body.is-problem{height:auto;min-height:100vh;min-height:100dvh;overflow:visible;background:#e8eef5}
  .pbar{padding:calc(6px + env(safe-area-inset-top)) 10px 6px;gap:6px;position:sticky;top:0;z-index:40}
  .pbar-back span{display:none}
  .pbar-nav{margin:0 auto 0 0}
  .ptabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:8px 12px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:calc(44px + env(safe-area-inset-top));z-index:39}
  .ptabs.has-ans{grid-template-columns:1fr 1fr 1fr}
  .ptabs[hidden]{display:none}
  .ptabs button{height:38px;border:0;border-radius:11px;background:#eef3f9;font-size:13.5px;font-weight:700;color:#52667d}
  .ptabs button.on{background:var(--navy);color:#fff}
  .pw{display:block;padding:10px 10px calc(18px + env(safe-area-inset-bottom))}
  .pw-divider{display:none}
  .pw-left,.pw-right{flex:none;width:100%;border-radius:12px}
  .pw[data-tab="desc"] .pw-right{display:none}
  .pw[data-tab="work"] .pw-left{display:none}
  .pw[data-tab="ans"] .pw-left{display:none}
  .pw[data-tab="ans"] .pw-right{display:flex;min-height:calc(100dvh - 168px)}
  .pw[data-tab="ans"] .rw-head,
  .pw[data-tab="ans"] .rw-body,
  .pw[data-tab="ans"] .voice-bar,
  .pw[data-tab="ans"] .ans-drag{display:none !important}
  .pw[data-tab="ans"] .rw-answer{display:flex !important;flex:1 1 auto;min-height:0;border-top:0;border-radius:12px;overflow:hidden}
  .pw[data-tab="ans"] .ans-body{overflow-y:auto;-webkit-overflow-scrolling:touch;flex:1}
  .pw[data-tab="ans"] .rw-foot{position:sticky;bottom:0}
  .pane-scroll{overflow:visible;padding:16px 14px 28px}
  .p-title{font-size:18.5px;line-height:1.5}
  .p-tags{gap:6px;margin:10px 0 14px}
  .tag{font-size:11.5px;padding:3px 9px}
  .rich{font-size:15px;line-height:1.85}
  .rich p{margin:0 0 14px}
  .rich ul,.rich ol{padding-left:1.15em}
  .rich .fu{margin:18px 0 12px;padding:12px 12px 2px}
  .rich .fu-asks{padding-left:1.15em}
  .rich li{margin:6px 0;line-height:1.8}
  .rich pre{margin:0 0 16px;padding:12px 12px 12px 14px;border-radius:10px;font-size:12px;line-height:1.7}
  .rich pre code{padding-right:48px}
  .hint-item{padding:12px 12px;font-size:14px;line-height:1.75}
  .pw-right{min-height:calc(100dvh - 200px);display:flex;flex-direction:column}
  .rw-head{padding:10px 12px;flex-wrap:wrap;gap:8px}
  .rw-meta{margin-left:0;width:100%;justify-content:flex-end}
  .rw-body{min-height:280px;flex:1 1 auto}
  .pw-right:has(.rw-answer:not([hidden])) .rw-body{min-height:180px;max-height:34vh}
  .ed{font-size:12.5px;line-height:1.65;min-height:180px}
  .ed-gutter{min-width:34px;padding:12px 6px 12px 0;font-size:11.5px}
  .ed-hl,.ed-main textarea{padding:12px 12px}
  .ans-ta{padding:16px 14px;font-size:15.5px;line-height:1.85;min-height:220px}
  .ans-drag{display:none}
  .rw-answer{flex:1 1 auto;min-height:42vh;max-height:none;border-radius:0 0 12px 12px}
  .ans-head{padding:11px 14px;position:sticky;top:0;z-index:2}
  .ans-head strong{font-size:14.5px}
  .ans-body{overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px 14px 32px}
  .ans-body .rich{font-size:15px;line-height:1.85}
  .ans-body .rich pre{font-size:12px;line-height:1.7}
  .ans-sub{margin:6px 0 10px;font-size:13px;letter-spacing:.02em}
  .pts label{padding:12px 12px;font-size:14.5px;line-height:1.75}
  .copy-code{top:6px;right:6px;height:28px;padding:0 11px;font-size:12px;background:rgba(255,255,255,.18)}
  .rw-foot{position:sticky;bottom:env(safe-area-inset-bottom);z-index:30;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));box-shadow:0 -6px 20px rgba(7,29,51,.08)}
  body.is-problem .toast{bottom:20px}
  .rw-tip{display:none}
  .rw-foot .btn{flex:1;min-height:42px;padding:10px 12px;font-size:14px;border-radius:12px}
  .mic span{display:none}
  .mic{padding:0 10px}
  .rich figure.qfig{padding:10px;margin:6px 0 14px;border-radius:10px}
  .rich figure.qfig figcaption{font-size:12px;text-align:left;line-height:1.55}
}

/* ── 管理员：编辑按钮 + 编辑弹窗 ── */
.pbar-edit{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 12px;border:1px solid #ecd69a;border-radius:99px;background:var(--gold-soft);color:var(--gold-dark);font-size:12.5px;font-weight:700;cursor:pointer;transition:.15s}
.pbar-edit[hidden]{display:none}
.pbar-edit:hover{background:#fbe9ae}
.pbar-edit.edited::after{content:"已修改";margin-left:2px;padding:0 6px;border-radius:99px;background:var(--gold);color:var(--navy-2);font-size:10.5px;line-height:17px}
.qe-mask{position:fixed;inset:0;z-index:200;display:flex;align-items:stretch;justify-content:center;padding:18px;background:rgba(7,29,51,.55);backdrop-filter:blur(3px)}
.qe{display:flex;flex-direction:column;width:min(1180px,100%);background:#f6f9fc;border-radius:16px;box-shadow:0 30px 80px rgba(7,29,51,.4);overflow:hidden}
.qe-head{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:12px 18px;background:#fff;border-bottom:1px solid var(--line)}
.qe-head b{font-size:15px;color:var(--navy-2)}
.qe-badge{padding:2px 9px;border-radius:99px;background:var(--gold-soft);color:var(--gold-dark);font-size:11.5px;font-weight:700}
.qe-msg{flex:1;min-width:0;font-size:12.5px;color:var(--muted);text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.qe-msg.bad{color:#c8443d;font-weight:600}
.qe-btn{height:34px;padding:0 16px;border:0;border-radius:10px;background:#eef3f9;color:var(--navy);font-size:13.5px;font-weight:700;cursor:pointer;transition:.15s}
.qe-btn:hover{background:#e3ebf5}
.qe-btn.primary{background:var(--navy);color:#fff}
.qe-btn.primary:hover{background:#0d2a47}
.qe-btn.danger{background:#fff1f0;color:#c8443d}
.qe-btn:disabled{opacity:.55;cursor:progress}
.qe-body{flex:1;min-height:0;overflow-y:auto;padding:18px 22px 40px;display:flex;flex-direction:column;gap:18px}
.qe-sec{padding:18px 20px;border:1px solid var(--line);border-radius:14px;background:#fff;display:flex;flex-direction:column;gap:14px}
.qe-sec h3{margin:0;font-size:14.5px;color:var(--navy-2)}
.qe-sec h3 small,.qe-field label small{font-size:11.5px;font-weight:500;color:var(--muted);margin-left:6px}
.qe-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.qe-field[hidden]{display:none}
.qe-field>label{font-size:12.5px;font-weight:700;color:#4b6480}
.qe-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.qe-months{display:flex;flex-wrap:wrap;gap:8px}
.qe-month{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border:1px solid #cfdae7;border-radius:10px;background:#fff;font-size:13.5px;color:var(--navy-2);cursor:pointer}
.qe-month:has(input:checked){border-color:var(--gold);background:#fff7e4}
.qe-month input{margin:0}
.qe-in{height:38px;padding:0 12px;border:1px solid #cfdae7;border-radius:10px;background:#fff;font:inherit;font-size:14px;color:var(--navy-2)}
.qe-in.short{max-width:220px}
.qe-in:focus,.qe-ta:focus{outline:2px solid rgba(237,192,74,.6);outline-offset:0;border-color:var(--gold)}
.qe-ta{width:100%;min-height:90px;padding:10px 12px;border:1px solid #cfdae7;border-radius:10px;background:#fff;font:inherit;font-size:13.5px;line-height:1.65;color:var(--navy-2);resize:vertical}
.qe-ta.mono{font-family:'JetBrains Mono',monospace;font-size:12.5px;font-variant-ligatures:none;white-space:pre;overflow:auto}
.qe-split{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:stretch}
.qe-split .qe-ta{min-height:220px}
.qe-preview{min-height:220px;max-height:420px;overflow:auto;padding:12px 16px;border:1px dashed #cfdae7;border-radius:10px;background:#fbfcfe;font-size:14px}
.qe-empty{color:var(--muted-2)}
.qe-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.qe-tools button{height:26px;padding:0 10px;border:1px solid #d6e0ea;border-radius:8px;background:#fff;font-size:12px;font-weight:600;color:#4b6480;cursor:pointer}
.qe-tools button:hover{background:#eef3f9;color:var(--navy)}
.qe-tools span{font-size:11.5px;color:var(--muted-2)}
@media(max-width:980px){
  .qe-mask{padding:0}
  .qe{border-radius:0}
  .qe-grid{grid-template-columns:1fr 1fr}
  .qe-split{grid-template-columns:1fr}
  .qe-head{flex-wrap:wrap}
  .qe-msg{order:9;flex-basis:100%;text-align:left}
}
.qe-split .qe-ta{white-space:pre-wrap;overflow-wrap:anywhere}

/* ── 题目反馈 ── */
.rw-foot .fb-btn{flex:0 0 auto;margin-left:2px;padding:9px 10px;background:none;box-shadow:none;color:var(--muted);gap:5px}
.rw-foot .fb-btn:hover{background:#eef3f9;color:var(--navy)}
.fb-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:980px){.rw-foot .fb-btn{flex:0 0 auto}.rw-foot .fb-btn span{display:none}}

.pbar-edit,.pbar-status{white-space:nowrap;flex:0 0 auto}
@media(max-width:980px){
  .pbar-edit span,.pbar-edit.edited::after{display:none}
  .pbar-edit{width:30px;padding:0;justify-content:center}
  .pbar-edit.edited{background:#fbe9ae}
  #footBtns:has(#fbBtn){flex-wrap:nowrap;gap:6px;width:100%}
  .rw-foot #footBtns:has(#fbBtn) .btn{padding:9px 6px;font-size:13px;white-space:nowrap}
  .rw-foot #footBtns:has(#fbBtn) .fb-btn{padding:9px 8px}
}

/* 题目/解析里的配图（时序图、框图、电路图等）：白底卡片，宽图可横向滚动 */
.rich figure.qfig{margin:4px 0 16px;padding:12px 14px 10px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow-x:auto}
.rich figure.qfig img{display:block;max-width:100%;height:auto;margin:0 auto}
.rich figure.qfig figcaption{margin-top:8px;font-size:12.5px;line-height:1.6;color:var(--muted);text-align:center}
.rich figure.qfig img{cursor:zoom-in}
.rich figure.qfig figcaption::after{content:"（点击图片放大）";color:var(--muted-2);margin-left:4px}
.qfig-zoom{position:fixed;inset:0;z-index:9999;background:rgba(10,22,38,.62);display:flex;align-items:center;justify-content:center;padding:4vh 3vw;backdrop-filter:blur(2px)}
.qfig-zoom-in{max-width:94vw;max-height:92vh;overflow:auto;background:#fff;border-radius:14px;padding:18px 20px 14px;box-shadow:0 24px 70px rgba(0,0,0,.35)}
.qfig-zoom-in img{display:block;width:min(1180px,88vw);min-width:min(720px,88vw);height:auto;margin:0 auto}
.qfig-zoom-cap{margin-top:10px;font-size:13px;line-height:1.6;color:var(--muted);text-align:center}
.qfig-zoom-x{position:absolute;top:18px;right:22px;width:38px;height:38px;border:0;border-radius:50%;background:#fff;color:#1b2a3d;font-size:24px;line-height:1;cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.25)}

/* Keep the question counter central; random is a secondary toolbar action. */
@media(min-width:981px){
  .pbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
  .pbar-back{justify-self:start}
  .pbar-nav{margin:0;justify-content:center;gap:10px}
  .pbar-right{justify-self:end;justify-content:flex-end}
  .pbar-count{color:var(--navy);min-width:90px}
  #randomLink{margin-right:8px;color:#7b8b9c}
}

/* Reserve the action footer when a resized desktop viewport compresses the answer drawer. */
@media(min-width:981px){
  .pw-left,.pw-right{min-height:0}
  .pw-right .rw-head,.pw-right .rw-foot,.pw-right .ans-drag{flex-shrink:0}
  .pw-right .rw-body{min-height:0;overflow:auto}
  .pw-right .rw-answer{flex:0 1 var(--ans);min-height:0;max-height:calc(100% - 140px);overflow:hidden}
  .pw-right .rw-foot{position:relative;z-index:3;flex-wrap:wrap}
  .pw-right .rw-foot .confirm{flex-wrap:wrap;row-gap:6px}
}

/* Study organization shares the toolbar's quiet navy palette. */
.study-actions{display:flex;align-items:center;gap:8px}
.study-picker{position:relative;color:#52667d;font-size:13px}
.study-picker summary{display:flex;align-items:center;gap:8px;min-height:36px;padding:0 11px;border:1px solid var(--line);border-radius:10px;background:#f8fafc;cursor:pointer;list-style:none;font-weight:650;white-space:nowrap}
.study-picker summary::-webkit-details-marker{display:none}
.study-picker summary>svg{width:14px;height:14px;transition:transform .15s}
.study-picker[open] summary>svg{transform:rotate(180deg)}
.study-picker summary:hover,.study-fav:hover{border-color:#b9c8d8;background:#eef3f9}
.study-picker summary:focus-visible,.study-menu button:focus-visible,.study-fav:focus-visible{outline:2px solid #517aa6;outline-offset:3px}
.study-dot{display:inline-block;flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:#9aabbc}
.study-dot.struggling,.study-picker[data-state="1"] summary .study-dot{background:#c77769}
.study-dot.review,.study-picker[data-state="2"] summary .study-dot{background:#ca9b43}
.study-dot.mastered,.study-picker[data-state="3"] summary .study-dot{background:#299579}
.study-picker[data-state="1"] summary{background:#fcf2ef;color:#995447;border-color:#efd8d0}
.study-picker[data-state="2"] summary{background:#fcf7e9;color:#926e28;border-color:#ecdfb9}
.study-picker[data-state="3"] summary{background:#edf8f3;color:#227c63;border-color:#cbe7db}
.study-menu{position:absolute;right:0;top:calc(100% + 10px);z-index:200;width:184px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 40px rgba(15,36,56,.16)}
.study-menu-title{padding:7px 10px 9px;font-size:12px;font-weight:700;color:var(--navy);border-bottom:1px solid #edf1f5;margin-bottom:5px}
.study-menu-title span{display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:4px}
.study-menu button{display:flex;align-items:center;gap:9px;text-align:left;width:100%;border:0;background:transparent;border-radius:9px;padding:10px;color:var(--navy);font:inherit;cursor:pointer}
.study-menu button:hover,.study-menu button[aria-pressed="true"]{background:#f0f5fa}
.study-menu small{display:block;color:var(--muted);font-size:11px;margin-top:4px;font-weight:400}
.study-check{margin-left:auto;visibility:hidden;color:#437c70}
.study-menu button[aria-pressed="true"] .study-check{visibility:visible}
.study-menu .study-clear{margin-top:5px;border-top:1px solid #edf1f5;border-radius:0 0 8px 8px;justify-content:center;font-size:12px;color:var(--muted)}
.pbar .study-fav{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;height:36px;padding:0 11px;border:1px solid var(--line);border-radius:10px;font-size:12px;font-weight:650;white-space:nowrap;background:#fff;color:#52667d}
.pbar .study-fav.on{background:#fcf7e9;border-color:#ecdfb9;color:#a77c25}
@media(max-width:600px){
  .pbar{flex-wrap:wrap;gap:8px;padding-left:10px;padding-right:10px}
  .pbar-back{padding-left:4px;padding-right:6px}
  .pbar-nav{margin-left:auto;margin-right:0}
  .pbar-right{width:100%;justify-content:flex-end;border-top:1px solid #edf1f5;padding-top:8px}
  #randomLink{margin-right:auto}
  .study-picker summary{min-height:40px}
  .pbar .study-fav{height:40px}
  .study-menu{right:0;width:184px}
  .study-menu button{min-height:44px}
}
.study-menu{max-height:min(65dvh,480px);overflow-y:auto;overscroll-behavior:contain}
.study-menu button>span:nth-child(2){min-width:0;overflow-wrap:anywhere}
.study-menu .study-create{font-size:12px;color:#6c8095;border-top:1px solid #edf1f5;border-radius:0;margin-top:4px}
#studyLabel{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:600px){#studyLabel{max-width:96px}}

/* Desktop: keep the centered menu only slightly wider than its trigger. */
@media(min-width:981px){
 .study-picker summary{gap:6px;padding:0 9px}
 .study-menu{right:-6px;width:calc(100% + 12px);padding:4px;top:calc(100% + 6px);border-radius:10px;box-shadow:0 8px 24px #102a451a}
 .study-menu-title{text-align:center;padding:6px 2px 8px;font-size:13px;margin-bottom:3px}
 .study-menu button{display:grid;grid-template-columns:8px minmax(0,1fr) 8px;gap:4px;padding:9px 6px;text-align:center;border-radius:7px;font-size:12px}
 .study-menu button>span:nth-child(2){text-align:center}
 .study-check{margin-left:0;font-size:10px}
 .study-menu .study-create,.study-menu .study-clear{display:flex;justify-content:center;padding:9px 2px;font-size:11px}
}
