/* ============================================================
   数智题库 · AI 智能组卷系统
   ============================================================ */
:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e7e9f2;
  --line-2: #eff1f7;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-700: #3730a3;
  --primary-soft: #eef2ff;
  --primary-soft-2: #e0e7ff;
  --ok: #079455;
  --ok-soft: #ecfdf3;
  --warn: #dc6803;
  --warn-soft: #fffaeb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 28px -14px rgba(16, 24, 40, .14);
  --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, .25);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
svg.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); font-size: 12.5px; }
.link { color: var(--primary); font-size: 12.5px; font-weight: 600; }
.link:hover { color: var(--primary-700); }
.hidden { display: none !important; }

/* ============================ 登录页 ============================ */
.auth-page { min-height: 100vh; position: relative; overflow: hidden; background: #070b18; }
.auth-bg { position: absolute; inset: 0; }
.auth-grid {
  position: absolute; inset: -10%;
  background-image: linear-gradient(rgba(99, 102, 241, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 102, 241, .09) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.orb-1 { width: 620px; height: 620px; left: -140px; top: -160px; background: #4338ca; }
.orb-2 { width: 520px; height: 520px; right: -120px; bottom: -180px; background: #7c3aed; }

.auth-layout {
  position: relative; z-index: 2; min-height: 100vh;
  display: grid; grid-template-columns: 1.05fr .95fr;
  max-width: 1180px; margin: 0 auto; padding: 56px 40px; gap: 40px;
  align-items: center;
}
.auth-brand { color: #e6e8ff; padding-right: 20px; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.auth-logo svg { width: 34px; height: 34px; color: #a5b4fc; stroke: currentColor; }
.auth-logo span { font-size: 12px; letter-spacing: .26em; font-weight: 700; color: #c7d2fe; }
.auth-brand h1 { font-size: 44px; line-height: 1.22; margin: 0 0 20px; letter-spacing: -.02em; font-weight: 800; color: #fff; }
.auth-brand h1 span {
  background: linear-gradient(100deg, #a5b4fc, #c4b5fd 40%, #7dd3fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-lead { color: #98a2c9; font-size: 15px; line-height: 1.85; margin: 0 0 30px; }
.auth-features { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 13px; }
.auth-features li { display: flex; gap: 12px; align-items: flex-start; color: #b6bee0; font-size: 13.5px; }
.auth-features .dot { width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: #818cf8; box-shadow: 0 0 0 4px rgba(129, 140, 248, .16); flex: none; }
.auth-formula {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 16px 22px; border-radius: 16px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(165, 180, 252, .18);
  backdrop-filter: blur(6px);
}
.auth-formula .fx { font-size: 34px; color: #a5b4fc; font-family: Georgia, serif; line-height: 1; }
.auth-formula .fx-line { color: #dbe2ff; font-size: 14px; }
.auth-formula .fx-sub { color: #7f89b3; font-size: 11.5px; margin-top: 4px; letter-spacing: .04em; }

.auth-card-wrap { display: flex; justify-content: flex-end; }
.auth-card {
  width: 100%; max-width: 410px; background: #fff; border-radius: 22px;
  padding: 38px 36px 30px; box-shadow: 0 40px 80px -30px rgba(3, 7, 18, .7), 0 0 0 1px rgba(255, 255, 255, .08);
}
.auth-card-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; }
.auth-card-head p { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 13px; color: var(--muted-2); width: 17px; height: 17px; }
.input-wrap input {
  width: 100%; height: 46px; border-radius: 11px; border: 1px solid var(--line);
  padding: 0 44px 0 40px; font-size: 14px; color: var(--ink); background: #fbfcfe;
  transition: border .16s, box-shadow .16s, background .16s;
}
.input-wrap input:focus { outline: none; border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 4px rgba(79, 70, 229, .1); }
.pwd-toggle { position: absolute; right: 8px; background: none; border: 0; padding: 6px; color: var(--muted-2); cursor: pointer; display: flex; }
.pwd-toggle:hover { color: var(--primary); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.auth-hint { font-size: 11.5px; color: var(--muted-2); font-family: var(--mono); }
.auth-error {
  background: var(--danger-soft); color: #b42318; border: 1px solid #fecdca;
  padding: 9px 12px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px;
}
.auth-foot { text-align: center; color: var(--muted-2); font-size: 11.5px; margin: 18px 0 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all .16s ease;
}
.btn:hover { border-color: #d0d5e2; background: #fbfcfe; }
.btn:active { transform: translateY(.5px); }
.btn svg.icon { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, #5b52ee, var(--primary)); color: #fff;
  border-color: transparent; box-shadow: 0 1px 2px rgba(79, 70, 229, .3), 0 8px 18px -8px rgba(79, 70, 229, .55);
}
.btn-primary:hover { background: linear-gradient(180deg, #5148e8, var(--primary-600)); border-color: transparent; }
.btn-ghost { background: #fff; color: var(--ink-2); }
.btn-light { background: #fff; color: #312e81; border-color: #fff; }
.btn-light:hover { background: #f5f3ff; border-color: #f5f3ff; }
.btn-outline-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.btn-danger-ghost { color: var(--danger); border-color: #fecdca; background: #fff; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg.icon { width: 14px; height: 14px; }
.btn-lg { height: 44px; font-size: 14px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn.loading .btn-text::after { content: "…"; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn svg.icon { width: 16px; height: 16px; }

/* ============================ 表单 ============================ */
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); font-size: 13px; padding: 0 11px; height: 38px; transition: border .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #a5b4fc; box-shadow: 0 0 0 3.5px rgba(79, 70, 229, .1); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.select-sm { height: 32px; font-size: 12.5px; border-radius: 8px; }
.field-sm { display: block; margin-bottom: 13px; flex: 1; min-width: 0; }
.field-sm > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-sm em.hint { display: block; font-size: 11.5px; color: var(--muted-2); font-style: normal; margin-top: 5px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field-sm { margin-bottom: 13px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }
.input-with-btn .select { flex: 1; }
.model-apply { display: flex; gap: 8px; margin-top: 6px; }
.model-apply .btn { font-size: 11px; padding: 4px 10px; }

/* ============================ 应用框架 ============================ */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(900px 500px at 10% 0%, #1d2740 0%, #0b1220 55%);
  color: #aab4cc; padding: 20px 14px 14px; z-index: 40;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 0 6px; margin-bottom: 26px; }
.sb-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, #6366f1, #8b5cf6);
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .9); color: #fff; flex: none;
}
.sb-logo svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.sb-brand-text strong { color: #fff; font-size: 15px; letter-spacing: .02em; }
.sb-brand-text span { font-size: 10.5px; color: #7f8bab; letter-spacing: .13em; text-transform: uppercase; }
.sb-close { display: none; }
.sb-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.sb-group { font-size: 10.5px; letter-spacing: .16em; color: #5d6883; padding: 16px 12px 7px; font-weight: 600; }
.sb-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #a6b0c8; font-size: 13.5px; font-weight: 500; position: relative; transition: all .16s;
}
.sb-item svg.icon { width: 18px; height: 18px; opacity: .85; }
.sb-item:hover { background: rgba(255, 255, 255, .055); color: #e8ecf8; }
.sb-item.active { background: linear-gradient(90deg, rgba(99, 102, 241, .28), rgba(99, 102, 241, .06)); color: #fff; }
.sb-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: #818cf8; box-shadow: 0 0 12px #818cf8;
}
.sb-count { margin-left: auto; font-size: 10.5px; font-style: normal; background: rgba(255, 255, 255, .09); color: #c7d2fe; padding: 1px 7px; border-radius: 20px; }
.sb-tag { margin-left: auto; font-size: 9.5px; font-style: normal; font-weight: 700; letter-spacing: .04em; color: #0b1220; background: linear-gradient(120deg, #a5b4fc, #7dd3fc); padding: 1px 6px; border-radius: 5px; }
.sb-foot { padding-top: 12px; }
.sb-tip {
  display: flex; gap: 10px; align-items: center; padding: 11px; border-radius: 12px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .06); margin-bottom: 12px;
}
.sb-tip-icon { width: 30px; height: 30px; border-radius: 8px; background: rgba(129, 140, 248, .16); color: #a5b4fc; display: grid; place-items: center; flex: none; }
.sb-tip-icon svg { width: 16px; height: 16px; }
.sb-tip strong { display: block; color: #dfe4f3; font-size: 12px; font-weight: 600; }
.sb-tip span { font-size: 10.5px; color: #7d88a5; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-top: 1px solid rgba(255, 255, 255, .07); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg, #6366f1, #a855f7); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.sb-user-info { flex: 1; min-width: 0; line-height: 1.25; }
.sb-user-info strong { display: block; color: #e6eaf5; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-info span { font-size: 10.5px; color: #78839f; }
.sb-user .icon-btn { color: #8894b0; }
.sb-user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sb-mask { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 26px; height: 72px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.menu-btn { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 19px; margin: 0; letter-spacing: -.01em; font-weight: 700; }
.topbar-title p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.ai-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
  border-radius: 20px; background: #f8f9fc; border: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); font-weight: 600;
}
.ai-pill i { width: 7px; height: 7px; border-radius: 50%; background: #d0d5dd; }
.ai-pill.on { background: var(--ok-soft); border-color: #abefc6; color: #067647; }
.ai-pill.on i { background: #17b26a; box-shadow: 0 0 0 3px rgba(23, 178, 106, .16); }

.view-wrap { padding: 24px 26px 60px; flex: 1; }
.view { display: none; animation: fadeUp .26s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================ 卡片与网格 ============================ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px 13px; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.head-actions { display: flex; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.paper-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }

/* ============================ 工作台 ============================ */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 32px 34px;
  background: linear-gradient(120deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
  color: #fff; display: flex; justify-content: space-between; gap: 30px; align-items: center;
  box-shadow: 0 24px 48px -24px rgba(67, 56, 202, .7);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .16), transparent 42%), linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px; mask-image: linear-gradient(90deg, transparent 30%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.hero-text { position: relative; z-index: 1; max-width: 560px; }
.hero-chip { display: inline-block; font-size: 10px; letter-spacing: .18em; color: #c7d2fe; background: rgba(255, 255, 255, .1); padding: 4px 10px; border-radius: 20px; margin-bottom: 14px; }
.hero h2 { font-size: 27px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -.02em; font-weight: 800; }
.hero p { margin: 0 0 20px; color: #d7dbfd; font-size: 13.5px; max-width: 460px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-card {
  position: relative; z-index: 1; min-width: 210px; padding: 20px 22px; border-radius: 18px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(10px);
}
.hero-card-title { font-size: 11px; letter-spacing: .12em; color: #c7d2fe; text-transform: uppercase; }
.hero-big { font-size: 46px; font-weight: 800; line-height: 1.05; margin-top: 6px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 12px; color: #c7d2fe; }
.hero-mini { display: flex; gap: 26px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .18); }
.hero-mini strong { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-mini span { font-size: 10.5px; color: #c7d2fe; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; gap: 13px; align-items: flex-start; box-shadow: var(--shadow-sm); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.i1 { background: #eef2ff; color: #4f46e5; }
.stat-icon.i2 { background: #ecfdf3; color: #079455; }
.stat-icon.i3 { background: #fff7ed; color: #dc6803; }
.stat-icon.i4 { background: #f0f9ff; color: #0891b2; }
.stat-body { min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 25px; font-weight: 750; line-height: 1.25; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 11px; color: var(--muted-2); }

.bars { padding: 4px 20px 20px; display: grid; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 46px; gap: 12px; align-items: center; font-size: 12.5px; }
.bar-track { height: 9px; background: #f1f3f9; border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

.type-split { padding: 6px 20px 20px; display: flex; gap: 24px; align-items: center; }
.donut { width: 132px; height: 132px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 26px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; }
.donut-center strong { font-size: 22px; font-weight: 750; line-height: 1; }
.donut-center span { font-size: 10.5px; color: var(--muted); }
.legend { display: grid; gap: 9px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-item b { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }

.recent-list { padding: 4px 12px 14px; display: grid; gap: 2px; }
.recent-item { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 9px; cursor: pointer; transition: background .15s; }
.recent-item:hover { background: #f8f9fd; }
.recent-idx { width: 28px; height: 28px; border-radius: 8px; background: #f2f4fa; color: var(--muted); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.recent-main { flex: 1; min-width: 0; }
.recent-stem { font-size: 12.8px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { font-size: 10.8px; color: var(--muted-2); margin-top: 1px; }
.recent-score { font-size: 11.5px; color: var(--muted); flex: none; }
.empty-mini { color: var(--muted-2); font-size: 12.5px; padding: 28px; text-align: center; }

/* ============================ 题库 ============================ */
.toolbar-card { padding: 16px 18px 12px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; flex: 1 1 190px; min-width: 165px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 16px; height: 16px; }
.search-box input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 0 35px; font-size: 13px; background: #fbfcfe; }
.search-box input:focus { outline: none; border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3.5px rgba(79, 70, 229, .1); }
.toolbar .select { width: auto; min-width: 82px; max-width: 112px; font-size: 12.5px; }
.toolbar-sub { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.result-count { font-size: 12.5px; color: var(--muted); }
.toolbar-sub-right { display: flex; gap: 8px; }
.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: #fafbfe; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .13s; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); }
.cell-id { color: var(--muted-2); font-family: var(--mono); font-size: 11.5px; }
.stem-cell { min-width: 0; }
.stem-main { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.65; color: var(--ink); }
.stem-main .katex { font-size: 1.02em; }
.stem-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; padding: 1px 7px; border-radius: 5px; background: #f2f4fa; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tag.ai { background: #f5f3ff; color: #6d28d9; }
.tag.img { background: #ecfeff; color: #0e7490; }
.tag.ok { background: var(--ok-soft); color: #067647; }
.type-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.type-single { background: #eef2ff; color: #4338ca; }
.type-multiple { background: #f5f3ff; color: #6d28d9; }
.type-fill { background: #ecfdf3; color: #047857; }
.type-judge { background: #fff7ed; color: #b45309; }
.type-solve { background: #f0f9ff; color: #0369a1; }
.stars { color: #f59e0b; font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #e4e7ec; }
.kp-cell { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.kp-cell small { display: block; color: var(--muted-2); font-size: 10.5px; }
.row-actions { display: flex; gap: 2px; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.empty-cell { text-align: center; color: var(--muted-2); padding: 46px 0 !important; font-size: 13px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 13px 18px; border-top: 1px solid var(--line-2); }
.pager button { min-width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: #c7d2fe; color: var(--primary); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .pg-info { font-size: 12px; color: var(--muted); margin-right: 6px; }

/* ============================ 抽屉 ============================ */
.drawer-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 80; backdrop-filter: blur(2px); }
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: #fff;
  display: flex; flex-direction: column; transform: translateX(104%); transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  z-index: 81; box-shadow: var(--shadow-lg);
}
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 14px; border-bottom: 1px solid var(--line-2); }
.drawer-head h3 { margin: 0; font-size: 17px; }
.drawer-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.drawer-body { padding: 18px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: #fcfcfe; }
.live-preview { border: 1px dashed #d7dbeb; background: #fbfcfe; border-radius: 10px; padding: 10px 12px; font-size: 13px; min-height: 42px; margin: -4px 0 14px; line-height: 1.7; color: var(--ink-2); }

/* ============================ 切题 ============================ */
.cut-layout { min-height: calc(100vh - 130px); display: flex; flex-direction: column; }
.cut-empty { padding: 26px; flex: 1; display: flex; align-items: center; }
.cut-empty > .cut-empty-inner { width: 100%; }
.cut-empty-inner { display: grid; grid-template-columns: 1fr 320px; gap: 26px; max-width: 1180px; margin: 0 auto; }
.cut-drop {
  border: 2px dashed #d5d9e8; border-radius: 18px; background: linear-gradient(180deg, #fbfcff, #f7f8fe);
  padding: 52px 30px; text-align: center; transition: all .18s;
}
.cut-drop.drag { border-color: var(--primary); background: var(--primary-soft); }
.cut-drop-icon { width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 18px; background: #eef2ff; color: var(--primary); display: grid; place-items: center; }
.cut-drop-icon svg { width: 28px; height: 28px; }
.cut-drop h3 { margin: 0 0 8px; font-size: 19px; }
.cut-drop p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.cut-drop-note { display: flex; gap: 18px; justify-content: center; margin-top: 22px; color: var(--muted-2); font-size: 11.5px; flex-wrap: wrap; }
.cut-drop-note span::before { content: "· "; }
.cut-side h4 { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.cut-recent { display: grid; gap: 8px; }
.cut-recent-item { display: flex; gap: 10px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: all .15s; }
.cut-recent-item:hover { border-color: #c7d2fe; background: #fbfbff; }
.cut-recent-thumb { width: 44px; height: 34px; border-radius: 6px; object-fit: cover; background: #f2f4fa; flex: none; }
.cut-recent-main { min-width: 0; flex: 1; }
.cut-recent-main strong { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cut-recent-main span { font-size: 10.5px; color: var(--muted-2); }

.cut-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.cut-canvas-col { display: flex; flex-direction: column; overflow: hidden; }
.cut-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.cut-toolbar-left, .cut-toolbar-right { display: flex; align-items: center; gap: 7px; }
.cut-file { font-size: 12.5px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoom-group { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; height: 32px; padding: 0 4px; }
.zoom-group span { font-size: 11.5px; color: var(--muted); min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.zoom-group .icon-btn { width: 24px; height: 24px; font-size: 15px; }
.cut-stage {
  background-color: #eef1f7;
  background-image: radial-gradient(#d3d8e4 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 26px; overflow: auto; max-height: calc(100vh - 300px); min-height: 420px;
}
.cut-paper { position: relative; background: #fff; box-shadow: 0 2px 6px rgba(16, 24, 40, .1), 0 18px 40px -18px rgba(16, 24, 40, .3); margin: 0 auto; transform-origin: top center; }
.cut-paper img { display: block; width: 100%; height: auto; user-select: none; pointer-events: none; }
.cut-layer { position: absolute; inset: 0; }
.cut-box {
  position: absolute; border: 2px solid rgba(79, 70, 229, .6); background: rgba(79, 70, 229, .06);
  border-radius: 4px; cursor: move; transition: border-color .12s, background .12s;
}
.cut-box:hover { border-color: rgba(79, 70, 229, .9); background: rgba(79, 70, 229, .1); }
.cut-box.selected { border-color: #4f46e5; background: rgba(79, 70, 229, .14); box-shadow: 0 0 0 3px rgba(79, 70, 229, .18); z-index: 5; }
.cut-box.done { border-color: rgba(7, 148, 85, .7); background: rgba(7, 148, 85, .07); }
.cut-box.skip { border-color: rgba(152, 162, 179, .8); background: rgba(152, 162, 179, .1); }
.cut-box-label {
  position: absolute; top: -11px; left: -2px; background: #4f46e5; color: #fff; font-size: 10px;
  padding: 0 6px; height: 18px; line-height: 18px; border-radius: 4px; font-weight: 700; white-space: nowrap;
}
.cut-box.done .cut-box-label { background: #079455; }
.cut-box.skip .cut-box-label { background: #98a2b3; }
.cut-handle { position: absolute; width: 10px; height: 10px; background: #fff; border: 2px solid #4f46e5; border-radius: 3px; }
.cut-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.cut-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.cut-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.cut-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.cut-statusbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); }
.cut-legend { display: flex; align-items: center; gap: 6px; }
.cut-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.lg-pending { background: #4f46e5; }
.lg-ok { background: #079455; }
.lg-skip { background: #98a2b3; }

.cut-list-col { display: flex; flex-direction: column; max-height: calc(100vh - 130px); overflow: hidden; }
.cut-list-head { display: flex; justify-content: space-between; gap: 10px; padding: 15px 16px 10px; }
.cut-list-head h3 { margin: 0; font-size: 14.5px; }
.cut-list-head h3 span { color: var(--primary); }
.cut-list-head p { margin: 2px 0 0; font-size: 11px; color: var(--muted-2); }
.cut-meta { padding: 0 16px 12px; border-bottom: 1px solid var(--line-2); }
.cut-meta .field-sm { margin-bottom: 9px; }
.cut-meta .field-sm > span { font-size: 11px; margin-bottom: 4px; }
.check-sm { font-size: 11.5px; }
.cut-cards { overflow-y: auto; padding: 12px 12px 16px; display: grid; gap: 9px; flex: 1; }
.cut-card { border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; cursor: pointer; transition: all .15s; background: #fff; }
.cut-card:hover { border-color: #c7d2fe; }
.cut-card.selected { border-color: #a5b4fc; background: #fbfbff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.cut-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cut-no { width: 22px; height: 22px; border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.cut-card.selected .cut-no { background: var(--primary); color: #fff; }
.cut-card-stem { font-size: 12.3px; color: var(--ink-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cut-card-thumb { display: block; width: 100%; max-height: 96px; object-fit: cover; object-position: top left; border: 1px solid var(--line); border-radius: 8px; margin: 2px 0 6px; background: #fff; }
.cut-card.selected .cut-card-thumb { max-height: 200px; object-fit: contain; }
.q-image-box { margin: 8px 0 2px; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: #fafbff; }
.q-image-box img { display: block; max-width: 100%; max-height: 220px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.q-image-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--ink-2); opacity: .75; }
.q-image-meta .btn { font-size: 11px; padding: 3px 9px; }
.cut-img-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 2px 2px; }
.cut-img-actions .hint { font-size: 11px; line-height: 1.5; color: var(--ink-2); opacity: .7; }
.cut-img-btns { display: flex; gap: 6px; flex-shrink: 0; }
.cut-img-btns .btn { font-size: 11px; padding: 3px 9px; }
.cut-img-toggle { margin-top: 7px; font-size: 11.5px; }
.cut-img-toggle .check, .cut-img-toggle input { margin-top: 1px; }
.fig-badge { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 5px; background: #eef2ff; color: var(--primary); }
/* ---------- 附件管理 ---------- */
.file-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; }
.file-crumbs a { color: var(--primary); text-decoration: none; padding: 3px 6px; border-radius: 6px; }
.file-crumbs a:hover { background: var(--primary-soft); }
.file-crumbs .crumb-cur { font-weight: 600; color: var(--ink); padding: 3px 6px; }
.file-crumbs .crumb-sep { color: #c3c8d8; }
.file-cell { white-space: nowrap; }
.file-cell a { color: var(--ink); text-decoration: none; font-size: 12.6px; }
.file-cell a:hover { color: var(--primary); text-decoration: underline; }
.file-cell small { color: var(--ink-2); opacity: .6; font-size: 11px; margin-left: 6px; }
.file-cell .tag { margin-left: 6px; }
.file-ico { width: 15px; height: 15px; stroke: var(--primary); fill: none; vertical-align: -3px; margin-right: 6px; }
.data-table tr.is-used .file-cell a { color: #94a3b8; }
.data-table tr.is-used .tag { background: #fef3c7; color: #92400e; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.cut-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cut-card-foot .select { width: auto; height: 26px; font-size: 11px; padding: 0 22px 0 7px; background-position: right 6px center; }
.cut-card-actions { margin-left: auto; display: flex; gap: 2px; }
.cut-card-actions .icon-btn { width: 24px; height: 24px; }
.cut-card.muted { opacity: .55; }

/* ============================ 组卷 ============================ */
.paper-config { position: sticky; top: 88px; max-height: calc(100vh - 112px); display: flex; flex-direction: column; overflow: hidden; }
.config-head { padding: 16px 18px 11px; border-bottom: 1px solid var(--line-2); }
.config-head h3 { margin: 0; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.config-head h3 svg { color: var(--primary); width: 17px; height: 17px; }
.config-head .muted { font-size: 11.5px; }
.config-body { padding: 15px 18px 18px; overflow-y: auto; flex: 1; }
.config-foot { padding: 12px 18px 14px; border-top: 1px solid var(--line-2); background: #fff; }
.config-foot .config-note { margin: 8px 0 0; text-align: center; }
.config-section { margin: 4px 0 14px; }
.config-section-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.config-section-head em { font-style: normal; font-size: 10.5px; color: var(--muted-2); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll-y { max-height: 96px; overflow-y: auto; padding: 2px; }
.chips.tall { max-height: 130px; }
.chip {
  font-size: 11.5px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; user-select: none; transition: all .13s;
}
.chip:hover { border-color: #c7d2fe; color: var(--primary); }
.chip.on { background: var(--primary-soft); border-color: #c7d2fe; color: var(--primary-700); font-weight: 600; }
.chip.empty { color: var(--muted-2); border-style: dashed; cursor: default; }
.type-rows { display: grid; gap: 7px; }
.type-row { display: flex; align-items: center; gap: 9px; }
.type-row-label { flex: 1; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.tavail { margin-left: auto; font-style: normal; font-size: 10px; color: var(--muted-2); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 30px; }
.stepper button { width: 26px; height: 100%; border: 0; background: #fbfcfe; color: var(--muted); cursor: pointer; font-size: 14px; }
.stepper button:hover { background: #f2f4fa; color: var(--primary); }
.stepper input { width: 38px; text-align: center; border: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); background: #fff; -moz-appearance: textfield; height: 100%; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.diff-sliders { display: grid; gap: 8px; }
.diff-slider { display: grid; grid-template-columns: 62px 1fr 24px; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); }
.diff-slider input[type=range] { width: 100%; accent-color: var(--primary); height: 4px; }
.diff-slider b { font-size: 11px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.config-note { font-size: 11px; color: var(--muted-2); line-height: 1.6; margin: 10px 0 0; }
#paperGenerate { box-shadow: 0 10px 24px -10px rgba(79,70,229,.55); }
.paper-result { min-width: 0; }
.paper-empty { padding: 80px 30px; text-align: center; }
.paper-empty-icon { font-size: 52px; color: #c7d2fe; font-family: Georgia, serif; line-height: 1; margin-bottom: 18px; }
.paper-empty h3 { margin: 0 0 8px; font-size: 17px; }
.paper-empty p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.paper-empty-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.paper-empty-chips span { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: #f4f6fc; color: var(--muted); }
.paper-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; position: sticky; top: 84px; z-index: 20; }
.pp-info { min-width: 0; }
.pp-info strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-chips { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.pp-chips span { font-size: 10.5px; color: var(--muted); background: #f4f6fc; padding: 1px 7px; border-radius: 5px; }
.pp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: flex; background: #f2f4fa; border-radius: 9px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 600; }
.segmented button.active { background: #fff; color: var(--primary-700); box-shadow: var(--shadow-sm); }
.paper-scroll { background: #e9ecf4; border-radius: 14px; padding: 22px; max-height: calc(100vh - 210px); overflow: auto; }

/* A4 试卷 */
.paper-sheet {
  width: 794px; margin: 0 auto; background: #fff; padding: 42px 52px 52px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .12), 0 24px 50px -24px rgba(16, 24, 40, .35);
  color: #111827; font-size: 14px; line-height: 1.9; min-height: 1123px;
}
.ps-head { text-align: center; padding-bottom: 14px; border-bottom: 2px solid #111827; }
.ps-school { font-size: 13px; letter-spacing: .18em; color: #374151; margin-bottom: 6px; }
.ps-title { font-size: 21px; font-weight: 800; letter-spacing: .04em; margin: 0 0 6px; }
.ps-subtitle { font-size: 12px; color: #4b5563; }
.ps-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #374151; padding: 10px 0 4px; flex-wrap: wrap; }
.ps-meta span { border-bottom: 1px solid #9ca3af; min-width: 120px; display: inline-block; padding: 0 4px 1px; }
.ps-notice { font-size: 11.5px; color: #6b7280; margin: 6px 0 16px; line-height: 1.7; }
.ps-section { margin: 22px 0 8px; font-size: 15px; font-weight: 800; }
.ps-q { margin: 0 0 17px; page-break-inside: avoid; }
.ps-stem { font-size: 13.6px; line-height: 1.95; text-align: justify; }
.ps-stem .qno { font-weight: 700; margin-right: 4px; }
.ps-stem .score { font-weight: 400; color: #6b7280; font-size: 12px; margin-left: 3px; }
.ps-options { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 18px; margin: 5px 0 0 20px; font-size: 13.2px; }
.ps-options.single-col { grid-template-columns: 1fr; }
.ps-answer-space { height: 46px; border-bottom: 1px dashed #d1d5db; margin: 8px 0 0; }
.ps-answer-space.tall { height: 120px; }
.ps-img { max-width: 100%; margin: 8px 0; border-radius: 4px; }
.ps-foot { margin-top: 30px; padding-top: 10px; border-top: 1px solid #d1d5db; text-align: center; font-size: 11px; color: #9ca3af; }
.ps-answer-item { font-size: 13px; margin-bottom: 12px; line-height: 1.85; }
.ps-answer-item .ano { display: inline-block; min-width: 26px; font-weight: 700; }
.ps-answer-item .ans { color: #b91c1c; font-weight: 600; }
.ps-analysis { color: #4b5563; font-size: 12.6px; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.ps-table th, .ps-table td { border: 1px solid #d1d5db; padding: 6px 8px; text-align: center; }
.ps-table th { background: #f3f4f6; font-weight: 700; }
.ps-table td.left { text-align: left; }
.paper-sheet .katex { font-size: 1.03em; }
.ps-break { page-break-before: always; }

/* ============================ 试卷库 ============================ */
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 4px 18px 20px; }
.paper-card { border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px; transition: all .16s; background: #fff; }
.paper-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow); transform: translateY(-1px); }
.paper-card-top { display: flex; align-items: flex-start; gap: 10px; }
.paper-card-icon { width: 36px; height: 36px; border-radius: 10px; background: #eef2ff; color: var(--primary); display: grid; place-items: center; flex: none; }
.paper-card h4 { margin: 0; font-size: 13.5px; line-height: 1.45; flex: 1; }
.paper-card-sub { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.paper-card-meta { display: flex; gap: 12px; margin: 12px 0 12px; font-size: 11.5px; color: var(--muted); }
.paper-card-meta b { color: var(--ink-2); font-weight: 650; }
.paper-card-actions { display: flex; gap: 6px; }
.paper-card-actions .btn { flex: 1; }
.paper-card-actions .btn:last-child { flex: 0 0 46px; }

/* ============================ 分类体系 ============================ */
.tax-layout { display: grid; grid-template-columns: 230px 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.tax-col { min-height: calc(100vh - 140px); display: flex; flex-direction: column; overflow: hidden; }
.tax-subjects { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }
.tax-subjects .chip { font-size: 12px; }
.tax-grades { padding: 4px 10px 14px; overflow-y: auto; display: grid; gap: 3px; }
.tax-grade { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.tax-grade:hover { background: #f7f8fd; }
.tax-grade.on { background: var(--primary-soft); color: var(--primary-700); font-weight: 650; }
.tax-grade small { color: var(--muted-2); font-size: 10.5px; }
.tax-list { overflow-y: auto; padding: 0 10px 16px; display: grid; gap: 3px; }
.tax-unit { padding: 9px 11px; border-radius: 9px; font-size: 12.8px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.tax-unit:hover { background: #f7f8fd; }
.tax-unit.on { background: var(--primary-soft); color: var(--primary-700); font-weight: 650; }
.tax-unit span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tax-unit em { font-style: normal; font-size: 10px; color: var(--muted-2); }
.tax-tree { padding: 0 16px 18px; overflow-y: auto; flex: 1; }
.lesson-block { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; overflow: hidden; }
.lesson-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: #fafbfe; }
.lesson-head strong { font-size: 12.8px; }
.lesson-head .lesson-actions { margin-left: auto; display: flex; gap: 2px; }
.kp-list { padding: 4px 10px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.kp-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; background: #f4f6fc; border-radius: 7px; padding: 4px 8px; color: var(--ink-2); }
.kp-item button { border: 0; background: none; color: var(--muted-2); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.kp-item button:hover { color: var(--danger); }
.tax-add-kp { border: 1px dashed #c7d2fe; color: var(--primary); background: #fff; font-size: 11px; padding: 4px 9px; border-radius: 7px; cursor: pointer; }

/* ---------------------- 分类批量导入 / 删除 ---------------------- */
.tax-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding: 9px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.tax-toolbar-info { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.tax-toolbar-info .icon { width: 15px; height: 15px; color: var(--primary); flex: none; }
.tax-toolbar-info strong { color: var(--ink-2); font-weight: 650; }
.tax-toolbar-actions { display: flex; gap: 8px; flex: none; }

.tax-imp-bar { display: flex; align-items: center; gap: 9px; margin: -4px 0 10px; flex-wrap: wrap; }
.tax-imp-bar .muted { font-size: 11.5px; margin-left: auto; }
.tax-imp-hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.75; margin: 0; }
.tax-imp-hint b { color: var(--ink-2); }
.tax-imp-hint code { background: #f4f6fc; border-radius: 4px; padding: 1px 5px; font-size: 11px; color: var(--primary-700); }

.tax-result { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.tax-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.tax-stat {
  display: inline-flex; align-items: baseline; gap: 5px; font-size: 11.5px; color: var(--muted);
  background: #f7f8fd; border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px;
}
.tax-stat em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--primary-700); }
.tax-err { margin-top: 10px; background: var(--danger-soft); border: 1px solid #fecdca; border-radius: 9px; padding: 9px 12px; font-size: 11.5px; color: #912018; line-height: 1.8; }
.tax-err strong { display: block; margin-bottom: 3px; }
.tax-err code { background: rgba(0, 0, 0, .05); border-radius: 4px; padding: 0 4px; }

.tax-pick-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tax-pick-col { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; display: flex; flex-direction: column; }
.tax-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; background: #fafbfe; border-bottom: 1px solid var(--line-2); }
.tax-pick-head em { font-style: normal; font-size: 11px; color: var(--muted-2); }
.tax-pick-body { max-height: 320px; overflow-y: auto; padding: 6px; }
.tax-pick-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  font-size: 12.3px; color: var(--ink-2); cursor: pointer;
}
.tax-pick-row:hover { background: #f7f8fd; }
.tax-pick-row input { width: 14px; height: 14px; accent-color: var(--primary); flex: none; }
.tax-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tax-pick-row em { font-style: normal; font-size: 10px; color: var(--muted-2); flex: none; }

/* ============================ 设置 ============================ */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-body { padding: 4px 20px 20px; }
.settings-stack { display: grid; gap: 16px; }
.provider-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.provider-grid button { height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: 12px; color: var(--ink-2); cursor: pointer; font-weight: 600; }
.provider-grid button:hover { border-color: #c7d2fe; }
.provider-grid button.on { border-color: #a5b4fc; background: var(--primary-soft); color: var(--primary-700); }
.ai-test-result { margin-top: 12px; font-size: 12px; }
.ai-test-result.ok { color: #067647; background: var(--ok-soft); border: 1px solid #abefc6; padding: 9px 12px; border-radius: 9px; }
.ai-test-result.err { color: #b42318; background: var(--danger-soft); border: 1px solid #fecdca; padding: 9px 12px; border-radius: 9px; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; color: var(--ink-2); }

/* ============================ 模态 / Toast ============================ */
.modal-mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); display: none; align-items: center; justify-content: center; z-index: 90; padding: 20px; backdrop-filter: blur(3px); }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); max-height: 88vh; display: flex; flex-direction: column; animation: pop .2s ease; }
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px; overflow-y: auto; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; background: #fcfcfe; border-radius: 0 0 16px 16px; }
.toast-wrap { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 120; }
.toast { background: #101828; color: #fff; padding: 11px 15px; border-radius: 10px; font-size: 12.8px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; animation: slideIn .22s ease; max-width: 420px; }
.toast.ok { background: #054f31; }
.toast.err { background: #7a271a; }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cut-workspace { grid-template-columns: 1fr; }
  .cut-list-col { max-height: none; }
  .paper-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .tax-layout { grid-template-columns: 200px 260px minmax(0, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-102%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .sb-close { display: inline-flex; margin-left: auto; color: #8b96b3; }
  .sb-mask.show { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 39; }
  .menu-btn { display: inline-flex; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-card { width: 100%; min-width: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .paper-layout { grid-template-columns: 1fr; }
  .paper-config { position: static; max-height: none; }
  .tax-layout { grid-template-columns: 1fr; }
  .tax-col { min-height: 0; }
  .cut-empty-inner { grid-template-columns: 1fr; }
  .paper-sheet { width: 100%; padding: 28px 24px; min-height: 0; }
  .paper-scroll { padding: 12px; }
  .topbar-actions .btn-ghost { display: none; }
}
@media (max-width: 640px) {
  .view-wrap { padding: 16px 14px 50px; }
  .topbar { padding: 0 14px; height: 64px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .ai-pill { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 21px; }
  .hero { padding: 22px; }
  .hero h2 { font-size: 21px; }
  .toolbar .select { max-width: none; flex: 1; }
  .search-box { min-width: 100%; }
  .data-table th:nth-child(2), .data-table td:nth-child(2),
  .data-table th:nth-child(5), .data-table td:nth-child(5),
  .data-table th:nth-child(6), .data-table td:nth-child(6),
  .data-table th:nth-child(7), .data-table td:nth-child(7) { display: none; }
  .data-table th:nth-child(3) { width: auto; }
  .data-table th:nth-child(8), .data-table td:nth-child(8) { width: 76px; }
  .data-table td, .data-table th { padding: 11px 9px; }
  .hero-card { display: flex; align-items: center; gap: 18px; justify-content: space-between; padding: 14px 18px; }
  .hero-card-title { display: none; }
  .hero-big { font-size: 34px; margin: 0; }
  .hero-sub { margin-top: 2px; }
  .hero-mini { margin: 0; padding: 0; border: 0; gap: 18px; }
  .hero-mini strong { font-size: 16px; }
  .paper-scroll { max-height: none; }
  .paper-preview-bar { position: static; }
  .auth-layout { grid-template-columns: 1fr; padding: 30px 20px; }
  .auth-brand { display: none; }
}

/* ============================ 打印 ============================ */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .sidebar, .topbar, .paper-config, .paper-preview-bar, .toast-wrap, .drawer, .drawer-mask,
  .modal-mask, .view:not(#view-paper), .sb-mask { display: none !important; }
  .app { display: block; }
  .view-wrap { padding: 0; }
  .paper-layout { display: block; }
  .paper-scroll { background: #fff; padding: 0; max-height: none; overflow: visible; }
  .paper-sheet { width: 100%; box-shadow: none; padding: 0; min-height: 0; }
  .paper-sheet .ps-q { page-break-inside: avoid; }
  .ps-break { page-break-before: always; }
}
