/* 题目提取工具。「审稿台」：纸白底、墨黑字；颜色只表达审核含义——绿=通过、红=退回或停下、琥珀=AI 拿不准；操作用深青。小圆角、少阴影。 */
:root {
  --bg: #f3f3f0; --card: #ffffff; --paper2: #f7f7f4; --ink: #1b1f23; --ink2: #5a6169; --ink3: #979da3; --line: #dcddd7; --line2: #ecece8;
  --accent: #0f5e5a; --accent-2: #0a4643; --accent-wash: #e2eeec; --accent-line: #a9cdc9;
  --ok: #2f7d4f; --ok-2: #25663f; --ok-wash: #e5f1e9; --warn: #8f5f00; --warn-wash: #faf2da; --warn-line: #ead9a3; --warn-dot: #d6971a;
  --bad: #b8352a; --bad-wash: #fae9e6; --desk: #d2d3ce;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(27, 31, 35, .05), 0 4px 14px -8px rgba(27, 31, 35, .14);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.grow { flex: 1 1 0; min-width: 0; }
.muted { color: var(--ink2); }
.error { color: var(--bad); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { display: inline-flex; }

/* 按钮：主（实心）＞次（描边）＞弱（无边）＞图标 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled):not(.disabled) { border-color: #c3c5be; background: var(--paper2); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled):not(.disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover:not(:disabled) { background: var(--ok-2); border-color: var(--ok-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink2); padding: 0 10px; }
.btn.ghost:hover:not(:disabled) { background: var(--line2); border-color: transparent; color: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 4px; }
.btn kbd { font: 11px var(--sans); opacity: .6; margin-left: 2px; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 5px; background: none; color: var(--ink2); cursor: pointer; text-decoration: none; flex: none; }
.iconbtn:hover:not(:disabled) { background: var(--line2); color: var(--ink); }
.iconbtn:disabled { opacity: .35; cursor: not-allowed; }
.iconbtn.sm { width: 26px; height: 26px; border-radius: 4px; }
.iconbtn.del:hover { color: var(--bad); background: var(--bad-wash); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--card); }
textarea, input[type=text], select { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; background: var(--card); line-height: 1.6; }
textarea { resize: none; min-height: 38px; display: block; }
textarea:focus, input[type=text]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--accent-wash); color: var(--accent); }
.pill.grey { background: var(--line2); color: var(--ink2); }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.state { height: 24px; padding: 0 10px; border-radius: 4px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; background: var(--line2); color: var(--ink2); white-space: nowrap; flex: none; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state.running, .state.queued { background: var(--accent-wash); color: var(--accent); }
.state.running::before { animation: pulse 1.2s ease-in-out infinite; }
.state.need_human { background: var(--warn-wash); color: var(--warn); }
.state.stopped { background: var(--bad-wash); color: var(--bad); }
.state.ready { background: var(--ok-wash); color: var(--ok); }
@keyframes pulse { 50% { opacity: .25; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; z-index: 60; }

/* ---------- 首页 ---------- */
.home { max-width: 720px; margin: 0 auto; padding: 9vh 24px 80px; }
.home h1 { font-size: 28px; line-height: 1.25; margin: 0 0 20px; font-weight: 700; }
.home .who { margin: -12px 0 16px; font-size: 13px; color: var(--ink2); }
.home .who a { color: var(--accent); }
.composer { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
body.dragging-file .composer { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash), var(--shadow); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 24px 28px; cursor: pointer; color: var(--ink2); border: 0; background: none; width: 100%; }
.drop:hover { color: var(--accent); }
.drop .mark { width: 48px; height: 48px; border-radius: 6px; background: var(--accent-wash); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.drop .big { font-size: 15px; font-weight: 700; color: var(--ink); }
.drop .fmt { font-size: 12px; }
.composer.has .drop { flex-direction: row; justify-content: flex-start; padding: 12px 16px; gap: 10px; border-bottom: 1px solid var(--line2); }
.composer.has .drop .mark { width: 30px; height: 30px; border-radius: 5px; }
.composer.has .drop .big { font-size: 13px; }
.composer.has .drop .fmt { display: none; }
.filelist { list-style: none; margin: 0; padding: 8px 12px 4px; max-height: 232px; overflow: auto; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 5px; }
.filelist li:hover { background: var(--line2); }
.filelist .ext { flex: none; width: 34px; height: 22px; border-radius: 3px; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; background: var(--bad-wash); color: var(--bad); }
.filelist .ext.doc { background: var(--accent-wash); color: var(--accent); }
.filelist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .sz { flex: none; color: var(--ink3); font-size: 12px; font-variant-numeric: tabular-nums; }
.modebar { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; }
.composer textarea { border: 0; border-top: 1px solid var(--line2); border-radius: 0; padding: 14px 18px; box-shadow: none !important; }
.composer .foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px 18px; }
.composer .foot .btn { height: 38px; padding: 0 22px; font-size: 14px; }
.recent { margin-top: 40px; }
.recent h2 { font-size: 13px; font-weight: 700; color: var(--ink3); margin: 0 0 8px 4px; }
.recent ul { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.recent li { border-top: 1px solid var(--line2); }
.recent li:first-child { border-top: 0; }
.recent a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.recent a:hover { background: var(--paper2); }
.recent .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.recent .cnt { color: var(--ink2); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.recent .tm { color: var(--ink3); font-size: 12px; flex: none; width: 7.5em; text-align: right; }

/* ---------- 任务页骨架 ---------- */
.app { height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; background: var(--card); border-bottom: 1px solid var(--line); min-width: 0; }
.bar h1 { font-size: 15px; font-weight: 700; margin: 0; min-width: 0; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { width: 72px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex: none; margin-left: 6px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .2s; }
.prog { color: var(--ink2); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vsep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; flex: none; }

.wait { min-height: 0; display: flex; justify-content: center; }
.wait .chat { width: 100%; max-width: 780px; }

.bench { display: grid; min-height: 0; grid-template-columns: var(--rail-w, 248px) 5px minmax(0, 1fr) 5px var(--sheet-w, 46%); }
.bench > * { min-height: 0; min-width: 0; }
.split { cursor: col-resize; background: transparent; position: relative; z-index: 3; touch-action: none; }
.split::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: var(--line); }
.split:hover::after, body.resizing .split.on::after { left: 1px; width: 3px; background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing #pdf, body.resizing .sheet { pointer-events: none; }

/* 目录 */
.rail { background: var(--card); display: flex; flex-direction: column; overflow: hidden; }
.railhead { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 16px; flex: none; }
.railtitle { font-size: 12px; font-weight: 700; color: var(--ink3); }
.raillist { flex: 1; overflow: auto; padding: 0 8px 24px; }
.grp { display: flex; align-items: center; gap: 4px; width: 100%; border: 0; background: none; padding: 10px 8px 4px; font-size: 12px; font-weight: 700; color: var(--ink3); cursor: pointer; text-align: left; }
.grp .ico { transition: transform .12s; transform: rotate(90deg); }
.grp[aria-expanded=false] .ico { transform: none; }
.grp.hot { color: var(--warn); }
.grp .c { font-weight: 600; margin-left: 2px; }
.rail .q { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 5px; cursor: pointer; color: var(--ink); }
.rail .q:hover { background: var(--line2); }
.rail .q.cur { background: var(--accent-wash); color: var(--accent); font-weight: 700; }
.rail .q .n { flex: none; width: 22px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink3); font-size: 12px; }
.rail .q.cur .n { color: var(--accent); }
.rail .q .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .q .m { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.rail .q .m.done { background: var(--ok); } .rail .q .m.doubt { background: var(--warn-dot); } .rail .q .m.returned { background: var(--accent); } .rail .q .m.rejected { background: var(--bad); }
.rail .q .m.todo { box-shadow: inset 0 0 0 1.5px var(--ink3); }
.rail .q .x { flex: none; }
.rail .warn { margin: 8px; padding: 8px 10px; background: var(--warn-wash); color: var(--warn); border-radius: 5px; font-size: 12px; }
.rail .info { margin: 8px; padding: 8px 10px; background: var(--accent-wash); color: var(--accent); border-radius: 5px; font-size: 12px; line-height: 1.6; }
.rail.mini .railhead { justify-content: center; padding: 8px 0 4px; }
.rail.mini .railtitle, .rail.mini .grp, .rail.mini .q .t, .rail.mini .warn, .rail.mini .loose { display: none; }
.rail.mini .raillist { padding: 0 6px 24px; }
.rail.mini .q { justify-content: center; gap: 4px; padding: 7px 0; }
.rail.mini .q .n { width: auto; }

/* 原文 */
.source { display: grid; grid-template-rows: auto 1fr; background: var(--desk); position: relative; overflow: hidden; }
.source .tools { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--card); border-bottom: 1px solid var(--line); min-width: 0; }
.source .tools > * { flex: none; }
.source .tools .grow { flex: 1 1 0; }
.seg { display: inline-flex; background: var(--line2); border-radius: 5px; padding: 3px; }
.seg button { border: 0; background: none; height: 26px; padding: 0 14px; border-radius: 4px; font-weight: 600; font-size: 13px; color: var(--ink2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 2px rgba(27, 31, 35, .12); }
.source .tools select { flex: 0 1 16em; min-width: 4em; height: 32px; padding: 0 8px; text-overflow: ellipsis; border-color: transparent; background: none; font-size: 13px; color: var(--ink2); }
.source .tools select:hover { background: var(--line2); }
#pdf { overflow: auto; position: relative; padding: 14px 14px 64px; min-height: 0; }
.pdfpages { margin: 0 auto; }
.pdfpage { position: relative; background: #fff; margin: 0 auto 14px; box-shadow: 0 1px 4px rgba(27, 31, 35, .18); }
.pdfpage canvas { display: block; width: 100%; height: 100%; }
.pdfpage.target { outline: 3px solid rgba(15, 94, 90, .45); }
.pdfpage.target.boxed { outline: none; }
.pdfpage .hl { position: absolute; border: 2px solid var(--warn-dot); background: rgba(250, 204, 21, .14); border-radius: 3px; pointer-events: none; }
.pdfmsg { text-align: center; color: var(--ink2); padding: 60px 0; }
#pdf .docx-wrapper { background: none; padding: 0; }
#pdf .docx-wrapper > section.docx { box-shadow: 0 1px 4px rgba(27, 31, 35, .18); margin-bottom: 14px; max-width: 100%; }
.pdfctl { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; background: rgba(27, 31, 35, .88); color: #fff; border-radius: 999px; font-size: 12px; font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); z-index: 4; white-space: nowrap; }
.pdfctl button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pdfctl button:hover { background: rgba(255, 255, 255, .16); }
.pdfctl span { padding: 0 6px; min-width: 3.2em; text-align: center; }
.pdfctl i { width: 1px; height: 14px; background: rgba(255, 255, 255, .28); margin: 0 4px; }
.miss { position: absolute; top: 50px; right: 10px; z-index: 5; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px; box-shadow: var(--shadow); }
.miss .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* 题目卡片 */
.sheet { overflow: auto; padding: 14px 14px 0; }
.card { background: var(--card); border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: 0; display: flex; flex-direction: column; min-height: 100%; }
.card > header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line2); }
.card .no { font-size: 17px; font-weight: 800; }
.card .who { color: var(--ink3); font-size: 12px; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.note { border-radius: 6px; padding: 10px 14px; font-size: 13px; }
.note b { font-weight: 700; }
.note.doubt { background: var(--warn-wash); color: var(--warn); }
.note.re { background: var(--accent-wash); color: var(--ink); }
.note.rej { background: var(--bad-wash); color: var(--bad); display: flex; gap: 10px; align-items: flex-start; }
.note.rej .t { flex: 1; white-space: pre-wrap; }
.note .quote { margin: 4px 0 0; padding-left: 10px; border-left: 2px solid currentColor; opacity: .85; white-space: pre-wrap; }
.note .acts2 { display: flex; gap: 8px; margin-top: 10px; }
.change { margin-top: 8px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.change .k { color: var(--accent); font-weight: 700; margin-right: 8px; }
.change del { background: var(--bad-wash); color: var(--bad); padding: 0 2px; border-radius: 3px; }
.change ins { background: var(--ok-wash); color: var(--ok); text-decoration: none; padding: 0 2px; border-radius: 3px; }
.material { background: var(--paper2); border: 1px solid var(--line2); border-radius: 6px; padding: 12px 16px; }
.rich { overflow-wrap: anywhere; line-height: 1.85; }
.rich p { margin: 0 0 .55em; } .rich p:last-child { margin-bottom: 0; }
.rich table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.rich th, .rich td { border: 1px solid var(--line); padding: 4px 12px; }
.rich th { background: var(--paper2); }
.rich ul, .rich ol { margin: .3em 0; padding-left: 1.4em; }
.rich code { background: var(--line2); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.stem { font-size: 15px; font-weight: 600; }
.material .stem { font-weight: 400; font-size: 14px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.opts.long { grid-template-columns: 1fr; }
.opts .o { display: flex; gap: 8px; }
.opts .o b { color: var(--accent); flex: none; }
.kv { display: flex; gap: 12px; font-size: 13px; }
.kv .k { flex: none; color: var(--ink3); font-weight: 700; width: 2.5em; }
.kv .v { flex: 1; min-width: 0; }
.kv .v.ans { color: var(--accent); font-weight: 700; }
.kv .v.none { color: var(--ink3); font-weight: 400; }
.imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.imgs figure { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 5px; padding: 6px; background: #fff; max-width: 100%; min-width: 48px; min-height: 48px; }
.imgs img { max-width: 100%; max-height: 240px; display: block; }
.imgs figcaption { font-size: 12px; color: var(--bad); }
.imgs .iconbtn { position: absolute; top: 6px; right: 6px; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1px var(--line); }
.sub { border-top: 1px solid var(--line2); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.sub .subno { color: var(--accent); font-weight: 800; margin-right: 6px; }
.acts { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 20px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 16px -12px rgba(27, 31, 35, .18); }
.acts .err { color: var(--bad); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acts.rejecting { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 14px; padding-bottom: 12px; }
.acts.rejecting textarea { min-height: 104px; max-height: 260px; line-height: 1.7; padding: 10px 12px; }
.acts.rejecting .row { display: flex; align-items: center; gap: 8px; }
.acts.rejecting .tip { font-size: 12px; color: var(--ink3); }

/* 编辑 */
.editor .body { gap: 18px; }
.fld > label, .fld > .lab { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink2); margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor select { height: 38px; padding: 0 10px; }
.optrow { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.optrow .letter { flex: none; width: 24px; line-height: 38px; font-weight: 800; color: var(--accent); }
.optrow textarea { flex: 1; }
.optrow .iconbtn { margin-top: 2px; }
.add { border: 1px dashed var(--accent-line); background: none; color: var(--accent); border-radius: 4px; height: 26px; width: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.add:hover { background: var(--accent-wash); }
.preview { margin-top: 6px; padding: 8px 12px; border-radius: 5px; background: var(--paper2); border: 1px solid var(--line2); font-size: 13px; }
.tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tabs .tab { width: 30px; height: 30px; border-radius: 4px; border: 0; background: var(--line2); color: var(--ink2); font-weight: 700; cursor: pointer; }
.tabs .tab.on { background: var(--accent); color: #fff; }
.childbox { border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 16px; }

/* 对话 */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer-w, 440px), 100vw); background: var(--card); border-left: 1px solid var(--line); z-index: 30; display: flex; box-shadow: -24px 0 48px -24px rgba(27, 31, 35, .3); }
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%; }
.chat > header { display: flex; align-items: center; gap: 8px; height: 51px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; flex: none; }   /* 与页面顶栏同高、同一条分隔线 */
.wait .chat > header { display: none; }
.chat .log { flex: 1; overflow: auto; padding: 22px 18px 8px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.msg.user { align-self: flex-end; align-items: flex-end; max-width: 86%; }
.msg.user .bubble { background: var(--accent-wash); color: var(--ink); border-radius: 8px 8px 4px 8px; padding: 9px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user .tag { font-size: 11px; color: var(--ink3); }
.msg .files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 5px; background: var(--card); border: 1px solid var(--line); font-size: 12px; }
.chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22em; }
.chip button { border: 0; background: none; color: var(--ink3); cursor: pointer; padding: 0; display: inline-flex; }
.msg.ai { align-self: stretch; padding-left: 38px; position: relative; }
.msg.ai::before { content: "AI"; position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 5px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.msg.ai .rich { padding-top: 2px; }
.msg.ai .rich.bad { color: var(--bad); }
.steps { font-size: 12px; color: var(--ink2); }
.steps summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 4px; user-select: none; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary:hover { background: var(--line2); }
.steps[open] summary .ico { transform: rotate(90deg); }
.steps ol { margin: 6px 0 0; padding: 8px 12px 8px 30px; border-left: 2px solid var(--line); max-height: 260px; overflow: auto; }
.steps li { margin: 2px 0; overflow-wrap: anywhere; }
.typing { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 13px; min-height: 28px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); animation: blink 1.2s infinite both; }
.typing .dots i:nth-child(2) { animation-delay: .2s; } .typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.typing .now { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys { align-self: center; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink2); background: var(--line2); border-radius: 4px; padding: 4px 6px 4px 14px; max-width: 100%; }
.sys.plain { padding: 4px 14px; }
.sys.bad { background: var(--bad-wash); color: var(--bad); }
.sys span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inputbox { flex: none; margin: 8px 14px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); padding: 8px 8px 8px 12px; }
.inputbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.inputbox .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 6px; }
.inputbox .chips:empty { display: none; }
.inputbox .line { display: flex; align-items: flex-end; gap: 6px; }
.inputbox textarea { border: 0; padding: 6px 2px; box-shadow: none !important; max-height: 180px; background: none; }
.inputbox .sendbtn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.inputbox .sendbtn:disabled { background: var(--line); color: var(--ink3); cursor: default; }
.inputbox .hint { display: block; font-size: 12px; color: var(--bad); padding: 4px 2px 0; }
.inputbox .hint:empty { display: none; }
.chat .whoin { width: 9em; height: 28px; font-size: 12px; padding: 0 8px; font-weight: 400; }

/* 总览 */
.admin { max-width: 980px; margin: 0 auto; padding: 32px 24px; }
.admin h1 { font-size: 20px; font-weight: 800; }
.admin table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 6px; overflow: hidden; }
.admin th, .admin td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin th { font-size: 12px; color: var(--ink2); font-weight: 700; }

@media (max-width: 1000px) {
  .app { height: auto; min-height: 100vh; }
  .bar { flex-wrap: wrap; }
  .bench { display: block; }
  .split { display: none; }
  .rail { max-height: 30vh; border-bottom: 1px solid var(--line); }
  .source { height: 60vh; }
  .sheet { overflow: visible; }
  .opts { grid-template-columns: 1fr; }
  .wait { height: calc(100vh - 52px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 宽屏上对话停靠在右侧，不盖住题目 */
@media (min-width: 1280px) {
  body.chat-open .app { margin-right: var(--drawer-w, 440px); }
  .drawer { box-shadow: none; }
}

/* 上传页：按「套」分组 */
.setbar { display: flex; align-items: center; gap: 4px; padding: 8px 10px 0 18px; }
.setbar .cnt { font-size: 12px; color: var(--ink2); font-weight: 600; }
.sets { max-height: 300px; overflow: auto; padding: 4px 12px 8px; }
.sets:empty { display: none; }
.setblock + .setblock { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.setname { font-size: 11px; font-weight: 700; color: var(--accent); padding: 4px 6px 0; }
.sets .filelist { padding: 0; max-height: none; overflow: visible; }
.filelist select { flex: none; width: auto; height: 26px; padding: 0 6px; font-size: 12px; border-radius: 4px; color: var(--ink2); }
.composer.has .drop { border-bottom: 1px solid var(--line2); }
.recent .rhead { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px 4px; }
.recent .rhead h2 { margin: 0; }
.recent .rhead input { width: 200px; height: 30px; padding: 0 10px; font-size: 12px; }
.recent li { display: flex; align-items: center; }
.recent li a { flex: 1; min-width: 0; padding-right: 8px; }
.recent li .rm { margin-right: 10px; opacity: 0; }
.recent li:hover .rm, .recent li .rm:focus-visible { opacity: 1; }
.recent li.none { padding: 14px 16px; color: var(--ink3); font-size: 13px; }
.recent #recentMore { margin: 8px auto 0; display: flex; }
.recent #recentMore.hidden { display: none; }

/* ===== 第三轮：平铺右栏、三栏顶部对齐、滚动条、编辑器 ===== */
:root { --head-h: 46px; }
* { scrollbar-width: thin; scrollbar-color: rgba(110, 112, 105, .38) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(110, 112, 105, .32); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(80, 82, 76, .6); border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

.railhead, .source .tools, .card > header { height: var(--head-h); box-sizing: border-box; border-bottom: 1px solid var(--line); flex: none; }
.railhead { padding: 0 8px 0 16px; }
.raillist { padding-top: 4px; }
.source .tools { padding: 0 10px; }
.sheet { padding: 0; background: var(--card); }
.card { border: 0; border-radius: 0; min-height: 100%; margin: 0; }
.card > header { padding: 0 10px 0 20px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.card .no { font-size: 15px; }
.card .body { padding: 18px 20px 24px; }
.acts { padding: 10px 20px; }
.miss .ttl { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.pill.warn { background: var(--warn-wash); color: var(--warn); }

/* 编辑器 */
.editor .body { gap: 20px; }
.fld .lab { display: flex; align-items: center; justify-content: space-between; min-height: 26px; font-size: 12px; font-weight: 700; color: var(--ink2); margin-bottom: 6px; }
.fld .req { color: var(--bad); font-style: normal; margin-left: 2px; }
.fld .tipr { font-weight: 400; color: var(--ink3); font-size: 11px; }
.fld textarea { line-height: 1.7; padding: 9px 12px; }
.fld textarea.bad { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash); }
.ferr { margin: 6px 0 0; color: var(--bad); font-size: 12px; }
.seg.mini { padding: 2px; border-radius: 4px; }
.seg.mini button { height: 22px; padding: 0 10px; font-size: 11px; border-radius: 3px; }
.fld .preview { margin: 0; min-height: 60px; padding: 10px 12px; }
.optrow { align-items: flex-start; gap: 8px; margin-bottom: 8px; border-radius: 5px; }
.optrow .grip { flex: none; width: 14px; line-height: 38px; text-align: center; color: var(--ink3); cursor: grab; letter-spacing: -3px; font-size: 12px; user-select: none; }
.optrow .grip:hover { color: var(--ink2); }
.optrow .letter { width: 20px; line-height: 38px; }
.optrow .blankno { flex: none; min-width: 34px; line-height: 38px; font-size: 12px; font-weight: 700; color: var(--ink3); }
.optrow .iconbtn { margin-top: 2px; }
.optrow.dragging { opacity: .45; }
.optrow.over { box-shadow: 0 -2px 0 var(--accent); }
.letters { display: flex; flex-wrap: wrap; gap: 8px; }
.letters .letter { width: 36px; height: 36px; border-radius: 5px; border: 1px solid var(--line); background: var(--card); font-weight: 700; color: var(--ink2); cursor: pointer; }
.letters .letter:hover { border-color: var(--accent-line); color: var(--accent); }
.letters .letter.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.imgrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.imgrow figure { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 5px; padding: 6px; background: #fff; }
.imgrow img { max-height: 120px; max-width: 220px; display: block; }
.imgrow figure .iconbtn { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1px var(--line); }
.addimg { width: 72px; min-height: 72px; border: 1px dashed var(--accent-line); border-radius: 5px; background: none; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.addimg:hover { background: var(--accent-wash); }
.childbox { border: 1px solid var(--line); border-radius: 6px; padding: 0; gap: 0; overflow: hidden; }
.childbox > header { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--paper2); border-bottom: 1px solid var(--line2); }
.childbox .ttl { font-size: 12px; font-weight: 700; color: var(--ink2); }
.childbox .inner { padding: 16px 14px; display: flex; flex-direction: column; gap: 18px; }
.tabs .tab { position: relative; width: 28px; height: 28px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.tabs .tab.on { box-shadow: none; }
.tabs .tab.err::after { content: ""; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.btn.danger-text:hover:not(:disabled) { color: var(--bad); background: var(--bad-wash); }
.imgrow figure { min-width: 72px; min-height: 72px; display: flex; align-items: center; justify-content: center; }
/* 上传规则提示 */
.composer .rule { margin: 0; padding: 11px 18px; background: var(--warn-wash); color: var(--warn); font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--warn-line); }
.filelist { padding: 4px 12px 8px; }

/* 文中的图、编辑器的插入工具与公式对话框 */
.rich .inimg { max-width: 100%; max-height: 260px; vertical-align: middle; border: 1px solid var(--line); border-radius: 4px; padding: 4px; background: #fff; }
.instools { display: flex; gap: 2px; }
.minibox { flex: 1; min-width: 0; }
.minibox .preview { margin-top: 6px; min-height: 0; }
.fld .preview { margin-top: 6px; min-height: 0; }
.modal { position: fixed; inset: 0; background: rgba(27, 31, 35, .32); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; }
.dlg { width: min(520px, 100%); background: var(--card); border-radius: 8px; box-shadow: 0 24px 64px -24px rgba(27, 31, 35, .5); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.dlg > header { font-weight: 800; font-size: 15px; }
.dlg textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.dlg .preview { min-height: 64px; display: flex; align-items: center; justify-content: center; overflow: auto; margin: 0; padding: 10px; border-radius: 5px; background: var(--paper2); border: 1px solid var(--line2); }
.dlg > footer { display: flex; align-items: center; gap: 8px; }
.dlg .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); }
.fxchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fxchips button { height: 28px; min-width: 32px; padding: 0 9px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; color: var(--ink); }
.fxchips button:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-wash); }

/* 对话抽屉左边缘：可拖动调宽 */
.drawergrip { position: absolute; top: 0; bottom: 0; left: -3px; width: 7px; cursor: col-resize; z-index: 2; touch-action: none; }
.drawergrip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 3px; background: transparent; }
.drawergrip:hover::after, .drawergrip.on::after { background: var(--accent); }
body.resizing .drawer { pointer-events: none; }
body.resizing .drawergrip { pointer-events: auto; }

/* 使用指引：遮罩 + 局部高亮 */
.tour { position: fixed; inset: 0; z-index: 90; }
.tourhole { position: fixed; border-radius: 6px; box-shadow: 0 0 0 200vmax rgba(27, 31, 35, .58), 0 0 0 2px var(--warn-dot); transition: left .18s, top .18s, width .18s, height .18s; pointer-events: none; }
.tourcard { position: fixed; width: min(340px, calc(100vw - 24px)); background: var(--card); border-radius: 8px; padding: 16px 18px 14px; box-shadow: 0 12px 40px -12px rgba(27, 31, 35, .5); display: flex; flex-direction: column; gap: 6px; }
.tourcard .tourno { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.tourcard h2 { margin: 0; font-size: 16px; font-weight: 700; }
.tourcard p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink2); }
.tourcard footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
/* 审核指南 */
.dlg.guide { width: min(600px, 100%); max-height: calc(100vh - 48px); overflow: auto; gap: 10px; padding: 18px 22px; }
.dlg.guide > header { display: flex; align-items: center; font-size: 17px; }
.dlg.guide .lead { margin: 0; color: var(--ink2); }
.dlg.guide dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.dlg.guide dt { font-weight: 700; white-space: nowrap; }
.dlg.guide dd { margin: 0; color: var(--ink2); }
.dlg.guide h3 { margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--line2); font-size: 13px; font-weight: 700; color: var(--ok); }
.dlg.guide .tip { margin: 6px 0 0; padding: 8px 12px; border-radius: 5px; background: var(--warn-wash); color: var(--warn); font-size: 13px; }
@media (max-width: 560px) { .dlg.guide dl { grid-template-columns: 1fr; gap: 2px 0; } .dlg.guide dd { margin-bottom: 8px; } }
