@import url('./answer-switch.css');
/* 答题系统现站接线样式（as- 前缀，避免与现站类名冲突）
   调性对齐现站 style-orb154.css：白容器、1px 细边框、14px 圆角、克制的字级与留白、英文眉题。
   颜色一律 var(--brand-*)（theme-orb154.js 内联注入，四主题含巴蜀紫自动跟随）；
   对错/警告/信息为独立语义色，不随主题染色。 */

#answerCenter, .as-ws {--as-ok:#1f7a4d;--as-okBg:#e9f4ee;--as-part:#94732f;--as-partBg:#fbf3e2;--as-bad:#a04c35;--as-badBg:#fbebe6;--as-info:#41597e;--as-infoBg:#eef2f8;--as-review:#6d4a8c;--as-reviewBg:#f3ecf7;}
.as-muted{color:var(--brand-muted)}.as-small{font-size:11px}.as-grow{flex:1;min-width:0}
.as-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.as-between{justify-content:space-between}
.as-mt8{margin-top:8px}.as-mt16{margin-top:16px}.as-mt24{margin-top:24px}.as-mb8{margin-bottom:8px}.as-mb16{margin-bottom:16px}
.as-eyebrow{font-size:10px;letter-spacing:2px;color:var(--brand-muted);font-weight:700;text-transform:uppercase}
.as-sec-title{display:flex;align-items:center;gap:10px;font-size:17px;font-weight:650;margin:0 0 14px;color:var(--brand-ink)}
.as-sec-title::before{content:'';width:3px;height:17px;border-radius:2px;background:var(--brand-primary);flex:none}

.as-card{background:var(--brand-surface,#fff);border:1px solid var(--brand-line);border-radius:14px;padding:22px 24px}
.as-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 0 12px;margin-bottom:14px;border-bottom:1px solid var(--brand-line)}
.as-card-head h3{margin:0;font-size:15px;color:var(--brand-ink)}

.as-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:3px 10px;border-radius:999px;line-height:1.8;background:var(--brand-tint);color:var(--brand-muted);white-space:nowrap}
.as-badge i{width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.as-badge.as-ok{background:var(--as-okBg);color:var(--as-ok)}
.as-badge.as-part{background:var(--as-partBg);color:var(--as-part)}
.as-badge.as-bad{background:var(--as-badBg);color:var(--as-bad)}
.as-badge.as-wait{background:var(--as-partBg);color:var(--as-part)}
.as-badge.as-info{background:var(--as-infoBg);color:var(--as-info)}
.as-badge.as-review{background:var(--as-reviewBg);color:var(--as-review)}
.as-tag{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:2px 9px;border-radius:6px;background:var(--brand-tint);color:var(--brand-muted);white-space:nowrap}
.as-tag.as-mode{color:var(--brand-primary);font-weight:600}

.as-primary,.as-secondary,.as-ghost,.as-danger{font:inherit;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:9px 16px;border-radius:8px;font-size:12.5px;font-weight:600;border:1px solid transparent;cursor:pointer;transition:background .15s,border-color .15s}
.as-primary{background:var(--brand-primary);color:#fff;border:0}
.as-primary:hover:not(:disabled){background:var(--brand-hover)}
.as-secondary{background:var(--brand-surface,#fff);color:var(--brand-muted);border-color:var(--brand-line)}
.as-secondary:hover:not(:disabled){border-color:var(--brand-primary);color:var(--brand-primary)}
.as-ghost{background:transparent;color:var(--brand-muted);min-height:32px;padding:4px 9px;font-weight:500}
.as-ghost:hover:not(:disabled){background:var(--brand-tint);color:var(--brand-ink)}
.as-danger{background:var(--as-badBg);color:var(--as-bad)}
.as-danger:hover:not(:disabled){background:#f6dcd4}
.as-primary:disabled,.as-secondary:disabled,.as-ghost:disabled,.as-danger:disabled{opacity:.45;cursor:not-allowed}
.as-sm{min-height:32px;padding:5px 11px;font-size:11.5px}
.as-primary:focus-visible,.as-secondary:focus-visible,.as-ghost:focus-visible,.as-danger:focus-visible,.as-seg button:focus-visible,.as-task-card:focus-visible{outline:2px solid var(--brand-primary);outline-offset:3px}

.as-note{display:flex;gap:10px;align-items:flex-start;padding:12px 15px;border-radius:10px;font-size:12.5px;line-height:1.7;border:1px solid transparent;margin:12px 0}
.as-note-info{background:var(--as-infoBg);color:var(--as-info);border-color:#dde5f0}
.as-note-warn{background:var(--as-partBg);color:var(--as-part);border-color:#f0dfc0}
.as-note-err{background:var(--as-badBg);color:var(--as-bad);border-color:#f0d5cc}
.as-note-neutral{background:var(--brand-tint);color:var(--brand-muted);border-color:var(--brand-line)}
.as-err{color:var(--as-bad)}.as-warn{color:var(--as-part)}.as-ok{color:var(--as-ok)}

.as-seg{display:inline-flex;background:var(--brand-tint);border-radius:8px;padding:3px;gap:2px}
.as-seg button{border:0;background:transparent;padding:6px 12px;border-radius:6px;font:inherit;font-size:11.5px;font-weight:600;color:var(--brand-muted);cursor:pointer;min-height:30px}
.as-seg button.on{background:var(--brand-surface,#fff);color:var(--brand-primary);box-shadow:0 1px 3px #0001}

.as-table{width:100%;border-collapse:collapse;font-size:12.5px}
.as-table th{text-align:left;font-size:11px;color:var(--brand-muted);font-weight:500;padding:9px 12px;border-bottom:1px solid var(--brand-line);white-space:nowrap}
.as-table td{padding:11px 12px;border-bottom:1px solid var(--brand-tint);vertical-align:middle}
.as-table tr:last-child td{border-bottom:0}
.as-table tr.as-click{cursor:pointer}
.as-table tr.as-click:hover{background:var(--brand-bg)}

.as-empty{text-align:center;padding:30px 16px;color:var(--brand-muted);font-size:12.5px}
.as-empty strong{display:block;color:var(--brand-ink);font-size:13.5px;margin-bottom:5px}

.as-task-card{display:block;width:100%;text-align:left;font:inherit;background:var(--brand-surface,#fff);border:1px solid var(--brand-line);border-radius:12px;padding:15px 17px;cursor:pointer;color:var(--brand-ink);transition:border-color .15s,box-shadow .15s;margin-bottom:10px}
.as-task-card:hover{border-color:var(--brand-primary);box-shadow:0 3px 12px color-mix(in srgb,var(--brand-primary) 9%,transparent)}
.as-task-card h3{margin:0 0 6px;font-size:14px}
.as-task-meta{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:8px}

/* ---------- 作答工作台 ---------- */
.as-ws-grid{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:20px;align-items:start}
.as-ws-mobile-tabs,.as-gc-mobile-tabs{display:none}
.as-q-meta{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;align-items:center}
.as-q-body{font-size:15.5px;line-height:2;color:var(--brand-ink)}
.as-q-body p{margin:0 0 10px}
.as-q-formula{text-align:center;font-size:19px;background:var(--brand-bg);border-radius:10px;padding:14px;margin:12px 0;overflow-x:auto}

.as-doc-block{border:1px solid var(--brand-line);border-radius:10px;background:var(--brand-surface,#fff);margin-bottom:12px}
.as-doc-block:focus-within{border-color:var(--brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-primary) 10%,transparent)}
.as-blk-tag{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px;border-bottom:1px dashed var(--brand-line);font-size:10.5px;color:var(--brand-muted)}
.as-blk-body{padding:12px 14px}
.as-doc-text{width:100%;border:0;resize:vertical;min-height:70px;font:inherit;font-size:14.5px;line-height:1.9;padding:0;background:transparent;color:var(--brand-ink);box-shadow:none}
.as-doc-text:focus{outline:0}
.as-doc-preview{border-top:1px dashed var(--brand-line);padding:8px 14px 10px;font-size:14.5px;line-height:2}
.as-doc-preview-label{font-size:10px;color:var(--brand-muted);margin-bottom:2px}
.as-footbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--brand-line)}
.as-save-state{font-size:11px;color:var(--brand-muted);display:inline-flex;align-items:center;gap:6px}
.as-save-state.as-ok{color:var(--as-ok)}.as-save-state.as-warn{color:var(--as-part)}.as-save-state.as-err{color:var(--as-bad)}

/* ---------- 公式编辑器 ---------- */
.as-fe{border:1px solid var(--brand-line);border-radius:10px;background:var(--brand-surface,#fff);overflow:visible;position:relative}
.as-fe-compact{font-size:13px}
.as-fe-head{display:flex;align-items:center;gap:6px;padding:7px 10px;border-bottom:1px solid var(--brand-line);background:var(--brand-bg);flex-wrap:wrap;border-radius:10px 10px 0 0}
.as-fe-live{padding:10px 12px 4px}
.as-mathfield{display:block;min-height:56px;max-width:100%;font-size:1.25rem;border:1px solid var(--brand-line);border-radius:9px;background:var(--brand-surface,#fff);color:var(--brand-ink);padding:8px 10px;--caret-color:var(--brand-primary);--selection-background-color:var(--brand-tint);--hue:260}
.as-mathfield:focus-within,.as-mathfield:focus{outline:2px solid var(--brand-primary);outline-offset:1px}
.as-fe-code{width:100%;font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace;font-size:13px;line-height:1.7;border:0;background:transparent;resize:vertical;min-height:60px;padding:12px 14px;color:var(--brand-ink);box-shadow:none}
.as-fe-code:focus{outline:0}
.as-fe-preview{min-height:46px;display:flex;align-items:center;overflow-x:auto;padding:12px 14px}
.as-fe-symbols{display:flex;gap:4px;flex-wrap:wrap;padding:6px 12px 8px}
.as-fe-symbols button{min-width:34px;height:34px;border-radius:8px;border:1px solid var(--brand-line);background:var(--brand-surface,#fff);font-size:14px;color:var(--brand-ink);cursor:pointer;padding:0 8px}
.as-fe-symbols button:hover{border-color:var(--brand-primary);color:var(--brand-primary)}
.as-fe-boundary{font-size:10.5px;color:var(--brand-muted);margin:0;padding:0 14px 8px}
.as-fe-hints{border-top:1px solid var(--brand-line);padding:10px 14px;font-size:11.5px;background:var(--brand-bg);border-radius:0 0 10px 10px}
.as-fe-hints table{width:100%;border-collapse:collapse}
.as-fe-hints td{padding:3px 6px;border-bottom:1px dashed var(--brand-line);vertical-align:top}
.as-fe-hints td code{font-family:ui-monospace,Menlo,monospace;background:var(--brand-surface,#fff);border:1px solid var(--brand-line);border-radius:5px;padding:0 5px;font-size:10.5px}
.as-fe-status{display:flex;gap:10px;align-items:center;padding:7px 14px;font-size:11px;border-top:1px dashed var(--brand-line);flex-wrap:wrap}
.as-fe-src{color:var(--brand-muted);margin-left:auto;font-family:ui-monospace,Menlo,monospace;font-size:10px}
.as-fe-amb{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 12px 10px;padding:9px 12px;border-radius:8px;background:var(--as-partBg);color:var(--as-part);font-size:12px}
.as-fe-amb[hidden]{display:none}
.as-fe-amb button{font:inherit;font-size:11.5px;font-weight:600;border:1px solid #e3cfa8;background:#fff;color:#7a5f24;border-radius:7px;padding:4px 9px;cursor:pointer}
.as-vkbd{position:fixed;left:0;right:0;bottom:0;z-index:70;background:var(--brand-surface,#fff);border-top:1px solid var(--brand-line);box-shadow:0 -10px 34px #0002;padding:8px max(10px,env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom))}
.as-vkbd[hidden]{display:none}
.as-vkbd-head{display:flex;justify-content:space-between;align-items:center;padding:0 4px 8px;font-size:11.5px;color:var(--brand-muted);max-width:720px;margin:0 auto}
.as-vkbd-row{display:flex;gap:6px;justify-content:center;max-width:720px;margin:0 auto 6px}
.as-vkbd-row button{flex:1;max-width:76px;min-height:42px;border-radius:8px;border:1px solid var(--brand-line);background:var(--brand-bg);font-size:15px;color:var(--brand-ink);cursor:pointer}
.as-vkbd-row button:active{background:var(--brand-tint)}
.as-vkbd-row button.as-wide{max-width:150px;font-size:12px;font-weight:600;color:var(--brand-muted)}
body.as-kbd-open .as-scroll-pad{padding-bottom:300px}

/* ---------- 手写画布 ---------- */
.as-ink{border:1px solid var(--brand-line);border-radius:10px;overflow:hidden;background:var(--brand-surface,#fff)}
.as-ink-pages{display:flex;gap:6px;padding:8px 10px;border-bottom:1px solid var(--brand-line);overflow-x:auto;background:var(--brand-bg)}
.as-ink-pages button{min-width:44px;height:34px;border-radius:7px;border:1px solid var(--brand-line);background:var(--brand-surface,#fff);font:inherit;font-size:11.5px;font-weight:600;color:var(--brand-muted);cursor:pointer}
.as-ink-pages button.on{border-color:var(--brand-primary);color:var(--brand-primary);background:var(--brand-tint)}
.as-ink-toolbar{display:flex;gap:6px;align-items:center;padding:8px 10px;border-bottom:1px solid var(--brand-line);flex-wrap:wrap}
.as-ink-toolbar button{font:inherit;font-size:11.5px;font-weight:600;min-height:32px;padding:4px 10px;border-radius:7px;border:1px solid var(--brand-line);background:var(--brand-surface,#fff);color:var(--brand-muted);cursor:pointer}
.as-ink-toolbar button.on{border-color:var(--brand-primary);color:var(--brand-primary);background:var(--brand-tint)}
.as-ink-colors{display:inline-flex;gap:4px}
.as-ink-colors button{padding:4px 8px;font-size:13px}
.as-ink-stage{position:relative;height:360px;overflow:hidden;touch-action:none;background:linear-gradient(var(--brand-bg) 1px,transparent 1px) 0 0/100% 34px,var(--brand-surface,#fff)}
.as-ink-stage canvas{position:absolute;inset:0;width:100%;height:100%}
.as-ink-foot{display:flex;gap:10px;align-items:center;padding:7px 12px;border-top:1px solid var(--brand-line);font-size:10.5px;color:var(--brand-muted);flex-wrap:wrap}
.as-ink-zoom{font-size:10.5px;color:var(--brand-muted);min-width:36px;text-align:center}
.as-ink-penonly{font-size:11px;color:var(--brand-muted);display:inline-flex;gap:6px;align-items:center;margin:0}
.as-ink-penonly input{width:auto;min-height:0}

/* ---------- 附件 ---------- */
.as-att-drop{border:1.5px dashed var(--brand-line);border-radius:10px;padding:16px;text-align:center;color:var(--brand-muted);font-size:12.5px;background:var(--brand-bg);cursor:pointer}
.as-att-drop:hover,.as-att-drop.hover{border-color:var(--brand-primary);background:var(--brand-tint);color:var(--brand-primary)}
.as-att-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px;margin-top:12px}
.as-att-card{position:relative;border:1px solid var(--brand-line);border-radius:9px;background:var(--brand-surface,#fff);overflow:hidden}
.as-att-card img,.as-att-card .as-att-thumb{width:100%;aspect-ratio:3/4;object-fit:cover;display:block;background:var(--brand-bg)}
.as-att-thumb{display:flex;align-items:center;justify-content:center;font-size:24px;color:var(--brand-muted)}
.as-att-meta{padding:6px 8px;font-size:10px;color:var(--brand-muted)}
.as-att-ops{display:flex;gap:4px;padding:0 7px 8px}
.as-att-ops button{flex:1;border:0;background:var(--brand-tint);border-radius:6px;font:inherit;font-size:10.5px;padding:4px 0;color:var(--brand-muted);cursor:pointer;min-height:26px}
.as-att-ops button:hover{color:var(--brand-primary)}
.as-att-prog{position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--brand-tint)}
.as-att-prog i{display:block;height:100%;background:var(--brand-primary);transition:width .2s}

/* ---------- PDF 阅读器 ---------- */
.as-pdf-bar{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0;align-items:center}
.as-pdf-bar button,.as-pdf-bar a{font:inherit;font-size:11.5px;border:1px solid var(--brand-line);background:var(--brand-surface,#fff);color:var(--brand-muted);border-radius:7px;padding:6px 11px;cursor:pointer;text-decoration:none}
.as-pdf-bar button:hover,.as-pdf-bar a:hover{border-color:var(--brand-primary);color:var(--brand-primary)}
.as-pdf-bar label{font-size:11.5px;color:var(--brand-muted);display:inline-flex;gap:6px;align-items:center;margin:0}
.as-pdf-bar select{width:auto;min-height:32px;padding:4px 8px}
.as-pdf-status{font-size:11.5px;color:var(--brand-muted)}
.as-pdf-status:empty{display:none}
.as-pdf-frame{max-width:100%;overflow:auto;border:1px solid var(--brand-line);border-radius:8px;background:var(--brand-bg)}
.as-pdf-page{position:relative;width:max-content;margin:0 auto}
.as-pdf-page canvas{display:block}
.as-pdf-hl{position:absolute;border:2px solid var(--brand-primary);background:color-mix(in srgb,var(--brand-primary) 12%,transparent);border-radius:4px;pointer-events:none}
.as-pdf-hl.as-teacher{border-color:#b05540;background:rgba(176,85,64,.12)}

/* ---------- 反馈 ---------- */
.as-fb-hero{border-radius:12px;padding:18px 20px;color:#fff;position:relative}
.as-fb-hero h3{margin:0 0 6px;font-size:17px}
.as-fb-hero p{margin:0;font-size:12.5px;opacity:.93;line-height:1.7}
.as-fb-src{position:absolute;top:12px;right:14px;font-size:10px;background:rgba(255,255,255,.2);padding:3px 10px;border-radius:999px;white-space:nowrap}
.as-fb-ok{background:linear-gradient(120deg,#1d6d46,#258753)}
.as-fb-part{background:linear-gradient(120deg,#8a6415,#a87d22)}
.as-fb-bad{background:linear-gradient(120deg,#96422e,#b05540)}
.as-fb-unknown{background:linear-gradient(120deg,#4a5d7c,#66799c)}
.as-fb-review{background:linear-gradient(120deg,#5f4080,#7c58a3)}
.as-fb-step{display:flex;gap:12px;padding:12px 14px;border:1px solid var(--brand-line);border-radius:10px;background:var(--brand-surface,#fff);margin-bottom:10px;font-size:12.5px}
.as-fb-step h4{margin:0 0 3px;font-size:12.5px;color:var(--brand-ink)}
.as-fb-step p{margin:0;color:var(--brand-muted);line-height:1.7}
.as-fb-ic{flex:none;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700}
.as-fb-ic.as-ok{background:var(--as-okBg);color:var(--as-ok)}
.as-fb-ic.as-part{background:var(--as-partBg);color:var(--as-part)}
.as-fb-ic.as-bad{background:var(--as-badBg);color:var(--as-bad)}
.as-fb-ic.as-unknown{background:var(--as-infoBg);color:var(--as-info)}

/* ---------- 批改台 ---------- */
.as-gc-grid{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:20px;align-items:start}
.as-manuscript{background:var(--brand-bg);border:1px solid var(--brand-line);border-radius:12px;overflow:hidden}
.as-layerbar{display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid var(--brand-line);background:var(--brand-surface,#fff);flex-wrap:wrap;align-items:center}
.as-layerbar .as-ly{display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:11px;color:var(--brand-muted);background:var(--brand-bg);border:1px solid transparent;border-radius:999px;padding:5px 11px;cursor:pointer;min-height:30px}
.as-layerbar .as-ly i{width:8px;height:8px;border-radius:3px;flex:none}
.as-layerbar .as-ly.on{border-color:var(--brand-primary);color:var(--brand-primary);background:var(--brand-tint)}
.as-ms-stage{position:relative;padding:16px;display:flex;justify-content:center;overflow:auto;max-height:72vh}
.as-ms-page{position:relative;background:#fff;box-shadow:0 4px 18px #0002;border-radius:4px;overflow:hidden}
.as-ms-page img{display:block;max-width:min(100%,620px)}
.as-anno-mark{position:absolute;border:2px solid #b05540;background:rgba(176,85,64,.1);border-radius:4px;cursor:pointer}
.as-anno-note{position:absolute;transform:translateY(-100%);background:#b05540;color:#fff;font-size:10px;padding:2px 7px;border-radius:6px 6px 6px 0;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis}
.as-anno-private .as-anno-note{background:#6d4a8c}
.as-anno-private.as-anno-mark{border-color:#6d4a8c;background:rgba(109,74,140,.1)}
.as-rubric-row{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px dashed var(--brand-line)}
.as-seg4{display:inline-flex;background:var(--brand-tint);border-radius:7px;padding:2px;gap:2px}
.as-seg4 button{border:0;background:transparent;font:inherit;font-size:10.5px;font-weight:600;padding:4px 8px;border-radius:6px;color:var(--brand-muted);cursor:pointer;min-height:26px}
.as-seg4 button.as-on-ok{background:var(--as-okBg);color:var(--as-ok)}
.as-seg4 button.as-on-part{background:var(--as-partBg);color:var(--as-part)}
.as-seg4 button.as-on-bad{background:var(--as-badBg);color:var(--as-bad)}
.as-seg4 button.as-on-unknown{background:var(--as-infoBg);color:var(--as-info)}
.as-gc-actions{display:flex;gap:9px;flex-wrap:wrap;padding-top:14px;margin-top:16px;border-top:1px solid var(--brand-line)}
.as-gc-auto{font-size:10.5px;color:var(--brand-muted)}

/* ---------- 弹层与 Toast ---------- */
.as-modal-mask{position:fixed;inset:0;z-index:80;background:#15202a66;display:flex;align-items:center;justify-content:center;padding:18px}
.as-modal{background:var(--brand-surface,#fff);color:var(--brand-ink);border:1px solid var(--brand-line);border-radius:16px;box-shadow:0 20px 70px #0003;width:100%;max-width:520px;max-height:88vh;display:flex;flex-direction:column}
.as-modal-wide{max-width:880px}
.as-modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid var(--brand-line)}
.as-modal-head h3{margin:0;font-size:15px}
.as-x{border:0;background:transparent;font-size:22px;line-height:1;color:var(--brand-muted);cursor:pointer;padding:4px 8px}
.as-modal-body{padding:16px 20px;overflow-y:auto;font-size:13.5px;line-height:1.8}
.as-modal-foot{padding:12px 20px;border-top:1px solid var(--brand-line);display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
#asToasts{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:90;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;width:min(92vw,460px)}
.as-toast{background:#15202a;color:#e8eef4;padding:10px 18px;border-radius:10px;font-size:12.5px;box-shadow:0 8px 30px #0003;max-width:100%}
.as-toast.as-ok{background:#1d5c3a}.as-toast.as-err{background:#7c3427}.as-toast.as-warn{background:#6b4d12}

.as-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.as-field>label{font-size:12px;font-weight:600;color:var(--brand-ink);margin:0}
.as-field .as-hint{font-size:10.5px;color:var(--brand-muted);font-weight:400}
.as-field input,.as-field select,.as-field textarea{font:inherit;font-size:12.5px;color:var(--brand-ink);background:var(--brand-surface,#fff);border:1px solid var(--brand-line);border-radius:8px;padding:9px 12px;min-height:38px;width:100%}
.as-field textarea{min-height:84px;resize:vertical;line-height:1.75}
.as-field input:focus,.as-field select:focus,.as-field textarea:focus{outline:0;border-color:var(--brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-primary) 12%,transparent)}

.as-practice-link{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 18px;padding:12px 16px;border:1px solid var(--brand-line);border-radius:11px;background:var(--brand-tint);color:var(--brand-ink);font-size:12.5px}

/* ---------- 响应式（390px 主操作可达） ---------- */
@media (max-width:900px){
  .as-ws-grid,.as-gc-grid{grid-template-columns:1fr}
  .as-ws-grid.as-hide-q .as-q-col{display:none}
  .as-ws-grid.as-hide-a .as-a-col{display:none}
  .as-gc-grid.as-hide-ms .as-ms-col{display:none}
  .as-gc-grid.as-hide-panel .as-panel-col{display:none}
  .as-ws-mobile-tabs,.as-gc-mobile-tabs{display:flex;gap:0;border-bottom:1px solid var(--brand-line);margin-bottom:14px}
  .as-ws-mobile-tabs button,.as-gc-mobile-tabs button{flex:1;border:0;background:none;font:inherit;padding:11px;font-size:13px;font-weight:600;color:var(--brand-muted);border-bottom:2.5px solid transparent;cursor:pointer;min-height:44px}
  .as-ws-mobile-tabs button.on,.as-gc-mobile-tabs button.on{color:var(--brand-primary);border-bottom-color:var(--brand-primary)}
  .as-ms-stage{max-height:56vh;padding:10px}
  .as-ink-stage{height:300px}
}
@media (prefers-reduced-motion:reduce){
  .as-task-card,.as-primary,.as-secondary,.as-ghost{transition:none}
}

/* In-place self-practice editor; keep the existing math-site layout. */
.as-practice-editor { display:grid; gap:16px; min-width:0; }
.as-practice-editor [hidden] { display:none !important; }
.as-practice-editor .as-seg { flex-wrap:wrap; }
.as-practice-editor .as-practice-block { margin:12px 0; padding:12px; border:1px solid var(--brand-line,#dce3ec); border-radius:12px; }
.as-practice-editor textarea { width:100%; box-sizing:border-box; }
.as-practice-editor .handwriting-panel { margin:0; }
.as-practice-editor [data-error] { color:#a22; }

/* ---------- 个人作答历史（history-ui 追加；as- 前缀，不覆盖现站主题变量） ---------- */
.as-personal-history{display:flex;flex-direction:column;gap:10px;min-width:0;color:var(--brand-ink,#15202a)}
.as-personal-history h3{margin:0;font-size:17px;font-weight:650;color:var(--brand-ink,#15202a)}
.as-history-status{font-size:12.5px;line-height:1.7;color:var(--brand-muted,#5b6b7f);margin:0}
.as-history-status .as-secondary{margin-left:8px}
.as-history-count{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:12px}
.as-history-total{font-weight:600;color:var(--brand-ink,#15202a)}
.as-history-count-chip{display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;background:var(--brand-tint,#eef2f8);color:var(--brand-muted,#5b6b7f);font-size:11px;white-space:nowrap}
.as-history-count-chip[data-count-state=completed]{background:var(--as-okBg,#e9f4ee);color:var(--as-ok,#1f7a4d)}
.as-history-count-chip[data-count-state=processing]{background:var(--as-infoBg,#eef2f8);color:var(--as-info,#41597e)}
.as-history-count-chip[data-count-state=submitted]{background:var(--as-partBg,#fbf3e2);color:var(--as-part,#94732f)}
.as-history-count-chip[data-count-state=unavailable]{background:var(--as-badBg,#fbebe6);color:var(--as-bad,#a04c35)}
.as-history-count-chip[data-count-state=draft]{background:var(--brand-tint,#eef2f8);color:var(--brand-muted,#5b6b7f)}
.as-history-filters{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 4px}
.as-history-filters button{font:inherit;font-size:11.5px;font-weight:600;min-height:30px;padding:5px 12px;border-radius:999px;border:1px solid var(--brand-line,#dce3ec);background:var(--brand-surface,#fff);color:var(--brand-muted,#5b6b7f);cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,color .15s}
.as-history-filters button:hover{border-color:var(--brand-primary,#4759a8);color:var(--brand-primary,#4759a8)}
.as-history-filters button[aria-pressed=true]{background:var(--brand-primary,#4759a8);border-color:var(--brand-primary,#4759a8);color:#fff}
.as-history-list{display:flex;flex-direction:column;gap:10px;min-width:0}
.as-history-more-wrap{display:flex;justify-content:center}
.as-filter-empty{text-align:center;padding:22px 14px;color:var(--brand-muted,#5b6b7f);font-size:12.5px;border:1px dashed var(--brand-line,#dce3ec);border-radius:12px;margin:0}
.as-filter-empty p{margin:0 0 10px}
.as-history-empty{padding:32px 16px}
.as-record{border:1px solid var(--brand-line,#dce3ec);border-radius:12px;background:var(--brand-surface,#fff);overflow:hidden;min-width:0}
.as-record[hidden]{display:none}
.as-record-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 15px;cursor:pointer;list-style:none;color:var(--brand-ink,#15202a);font-size:13px}
.as-record-summary::-webkit-details-marker{display:none}
.as-record-summary::marker{content:''}
.as-record-summary:hover{background:var(--brand-bg,#f7f9fc)}
.as-record-summary::after{content:'展开';margin-left:auto;flex:none;font-size:11px;color:var(--brand-muted,#5b6b7f)}
.as-record[open]>.as-record-summary::after{content:'收起'}
.as-record-chip{flex:none;display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap;background:var(--brand-tint,#eef2f8);color:var(--brand-muted,#5b6b7f)}
.as-record[data-state=completed]>.as-record-summary .as-record-chip{background:var(--as-okBg,#e9f4ee);color:var(--as-ok,#1f7a4d)}
.as-record[data-state=processing]>.as-record-summary .as-record-chip{background:var(--as-infoBg,#eef2f8);color:var(--as-info,#41597e)}
.as-record[data-state=submitted]>.as-record-summary .as-record-chip{background:var(--as-partBg,#fbf3e2);color:var(--as-part,#94732f)}
.as-record[data-state=unavailable]>.as-record-summary .as-record-chip{background:var(--as-badBg,#fbebe6);color:var(--as-bad,#a04c35)}
.as-record[data-state=needs_confirmation]>.as-record-summary .as-record-chip{background:var(--as-reviewBg,#f3ecf7);color:var(--as-review,#6d4a8c)}
.as-record[data-state=draft]>.as-record-summary .as-record-chip{background:var(--brand-tint,#eef2f8);color:var(--brand-muted,#5b6b7f)}
.as-record-title{flex:1 1 220px;min-width:0;font-weight:600;font-size:13.5px;line-height:1.5;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.as-record-ordinal,.as-record-time{flex:none;font-size:11.5px;color:var(--brand-muted,#5b6b7f);white-space:nowrap}
.as-record-score{flex:none;font-size:11.5px;font-weight:600;color:var(--brand-primary,#4759a8);white-space:nowrap}
.as-record-body{padding:2px 15px 16px;border-top:1px solid var(--brand-line,#dce3ec);min-width:0}
.as-record-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px 14px;margin:12px 0;padding:10px 12px;border-radius:10px;background:var(--brand-bg,#f7f9fc)}
.as-record-meta>div{min-width:0}
.as-record-label{display:block;font-size:10px;letter-spacing:.4px;color:var(--brand-muted,#5b6b7f);font-weight:600;margin-bottom:2px}
.as-record-value{display:block;color:var(--brand-ink,#15202a);font-size:11.5px;line-height:1.6;overflow-wrap:anywhere}
.as-record-question{margin:12px 0;min-width:0}
.as-q-body{font-size:14.5px;line-height:1.95;color:var(--brand-ink,#15202a);margin:0;overflow-wrap:anywhere}
.as-record-original{margin:12px 0;min-width:0}
.as-record-original h4{margin:0 0 8px;font-size:13.5px;color:var(--brand-ink,#15202a)}
.as-record-block{margin:0 0 8px;font-size:14px;line-height:1.95;color:var(--brand-ink,#15202a);overflow-wrap:anywhere;white-space:pre-wrap}
.as-record-attachments{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.as-record-att{margin:0;display:flex;flex-direction:column;gap:6px;max-width:100%;min-width:0}
.as-record-att img{display:block;max-width:100%;width:auto;max-height:220px;object-fit:contain;border:1px solid var(--brand-line,#dce3ec);border-radius:10px;background:var(--brand-bg,#f7f9fc)}
.as-record-att-link{font-size:11.5px;font-weight:600;color:var(--brand-primary,#4759a8);text-decoration:none;align-self:flex-start;overflow-wrap:anywhere}
.as-record-att-link:hover{color:var(--brand-hover,#3a4a8f)}
.as-record-choice{margin-top:14px;min-width:0}
.as-record-error{margin:12px 0 8px;font-size:12.5px;color:var(--as-bad,#a04c35)}
.as-evidence-hit{outline:2px solid var(--brand-primary,#4759a8);outline-offset:3px;border-radius:6px;background:var(--brand-tint,#eef2f8);transition:background .2s,outline-color .2s}

/* 全站链接禁止下划线：本轮新增区域内的链接/链接式按钮一律无下划线（含 hover/focus/active）。 */
.as-personal-history a,.as-personal-history a:link,.as-personal-history a:visited,.as-personal-history a:hover,.as-personal-history a:focus,.as-personal-history a:active{text-decoration:none}
.as-personal-history button,.as-personal-history summary{text-decoration:none}
.as-personal-history :focus-visible,.as-record-summary:focus-visible{outline:2px solid var(--brand-primary,#4759a8);outline-offset:3px}

/* 移动端：600px 起改为双列 meta，390px 单列且 chip/时间可换行，主操作可达。 */
@media (max-width:600px){
  .as-record-summary{gap:6px 8px;padding:11px 12px}
  .as-record-chip{order:1}
  .as-record-title{order:2;flex-basis:100%;font-size:13px}
  .as-record-ordinal,.as-record-time{order:3}
  .as-record-score{order:4;margin-left:auto}
  .as-record-body{padding:2px 12px 14px}
  .as-record-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .as-history-filters button{min-height:34px}
}
@media (max-width:390px){
  .as-personal-history h3{font-size:16px}
  .as-history-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .as-history-filters button{padding:5px 6px;min-height:36px;text-align:center}
  .as-record-summary{padding:10px}
  .as-record-title{font-size:13px}
  .as-record-time{white-space:normal;overflow-wrap:anywhere}
  .as-record-meta{grid-template-columns:minmax(0,1fr)}
  .as-record-att img{max-height:180px}
}

/* Match the course/domain panels; retain the question’s responsive inner padding. */
body[data-session="active"] #practice #questionPicker,
body[data-session="active"] #practice > .question {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}
