/* ===== 气象业务题库考试系统 · 管理后台样式 ===== */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5eaf2;
  --line-2: #eef2f8;
  --bg: #f4f7fb;
  --card: #ffffff;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eaf1ff;
  --cyan: #06b6d4;
  --green: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --sidebar-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
::selection { background: #bfdbfe; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .16s ease; white-space: nowrap;
}
.btn:hover { border-color: #c9d5e8; background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .25); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
.btn.danger:hover { background: #fee2e2; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef2f8; color: var(--ink); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { border-color: #93b4fb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.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='%2364748b' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
label.field { display: block; }
label.field > .label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.label .req { color: var(--rose); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: #071322; }
.login-hero {
  position: relative; overflow: hidden; padding: 64px 72px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(37, 99, 235, .55), transparent 60%),
    radial-gradient(700px 420px at -10% 95%, rgba(6, 182, 212, .34), transparent 60%),
    linear-gradient(160deg, #08182c 0%, #0b1e38 55%, #0a2540 100%);
}
.login-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 75%);
}
.hero-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.hero-logo {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, #3b82f6, #06b6d4); box-shadow: 0 10px 24px rgba(37, 99, 235, .45);
}
.hero-brand .name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.hero-brand .sub { font-size: 12px; color: #93b4d8; letter-spacing: 1.6px; }
.hero-main { position: relative; z-index: 1; max-width: 560px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 2px; color: #7dd3fc; text-transform: uppercase; margin-bottom: 20px; }
.hero-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 0 5px rgba(34, 211, 238, .18); }
.hero-main h1 { font-size: 42px; line-height: 1.25; margin: 0 0 18px; letter-spacing: 1px; font-weight: 700; }
.hero-main h1 em { font-style: normal; background: linear-gradient(90deg, #60a5fa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-main p { color: #a8bfd8; font-size: 15px; line-height: 1.9; margin: 0 0 30px; }
.hero-points { display: grid; gap: 14px; }
.hero-point { display: flex; gap: 12px; align-items: flex-start; color: #cfe0f2; font-size: 14px; }
.hero-point .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(37, 99, 235, .25); border: 1px solid rgba(96, 165, 250, .45); display: grid; place-items: center; color: #7dd3fc; }
.hero-foot { position: relative; z-index: 1; color: #6482a1; font-size: 12px; letter-spacing: .4px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #f5f8fc; }
.login-card { width: 100%; max-width: 396px; }
.login-card .badge-top { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #2563eb; background: #e8f0ff; border: 1px solid #d6e4ff; padding: 4px 10px; border-radius: 999px; margin-bottom: 16px; }
.login-card h2 { font-size: 26px; margin: 0 0 6px; letter-spacing: .5px; }
.login-card .desc { color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.login-card .field { margin-bottom: 16px; }
.login-card .input { height: 44px; background: #fff; }
.login-card .input-wrap { position: relative; }
.login-card .input-wrap .input { padding-left: 40px; }
.login-card .input-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.login-submit { width: 100%; height: 44px; font-size: 15px; margin-top: 8px; }
.login-error { display: none; background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.login-error.show { display: block; }
.login-tip { margin-top: 22px; padding: 12px 14px; border-radius: 10px; background: #eef4ff; border: 1px dashed #c7d9fb; color: #3b5b8c; font-size: 12px; line-height: 1.8; }
.login-tip b { color: #1d4ed8; }

/* ---------- 应用框架 ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0b1728 0%, #0d1f33 60%, #0b1a2c 100%);
  color: #94a8bf; border-right: 1px solid rgba(148, 163, 184, .12);
}
.side-brand { height: 68px; display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid rgba(148, 163, 184, .1); }
.side-brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #3b82f6, #06b6d4); display: grid; place-items: center; flex: none; }
.side-brand .txt { line-height: 1.25; }
.side-brand .txt b { display: block; color: #e8f0fa; font-size: 13.5px; letter-spacing: .4px; }
.side-brand .txt span { font-size: 10.5px; color: #5d7a99; letter-spacing: 1.2px; }
.side-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 10.5px; letter-spacing: 1.4px; color: #4c6480; padding: 10px 10px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #9db1c7; font-size: 13.5px; cursor: pointer; margin-bottom: 2px; transition: all .15s; border: 1px solid transparent;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(148, 163, 184, .09); color: #e2e8f0; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .08)); border-color: rgba(59, 130, 246, .28); color: #fff; }
.nav-item.active svg { color: #60a5fa; opacity: 1; }
.nav-item .tag { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 5px; background: rgba(148, 163, 184, .16); color: #8fa6bd; }
.side-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(148, 163, 184, .1); font-size: 11.5px; color: #526c88; line-height: 1.8; }
.side-foot .status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #34d399; margin-right: 6px; box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-size: 15px; font-weight: 600; }
.crumb .sep { color: #cbd5e1; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.top-user { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 10px; cursor: pointer; }
.top-user:hover { background: #f1f5f9; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg, #2563eb, #06b6d4); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.top-user .who { line-height: 1.25; }
.top-user .who b { display: block; font-size: 13px; }
.top-user .who span { font-size: 11px; color: var(--muted); }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: 44px; width: 168px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md); padding: 6px; display: none; z-index: 50;
}
.dropdown-menu.open { display: block; }
.dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left; }
.dropdown-menu button:hover { background: #f1f5f9; }
.dropdown-menu button.danger { color: #dc2626; }
.content { padding: 24px 26px 56px; max-width: 1480px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: .3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 10px; flex: 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; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.card-body { padding: 20px; }

/* ---------- 工作台 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { position: relative; overflow: hidden; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat-card .value { font-size: 30px; font-weight: 700; letter-spacing: .5px; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-card .foot { font-size: 12px; color: var(--muted); }
.stat-card .icon-chip { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.stat-card .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.chip-blue { background: #eaf1ff; color: #2563eb; }
.chip-violet { background: #f3efff; color: #7c3aed; }
.chip-teal { background: #e6fbfb; color: #0e9aa7; }
.chip-amber { background: #fff7e8; color: #d97706; }

.dash-grid { display: grid; grid-template-columns: 1.25fr .95fr; gap: 18px; }
.bar-list { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 76px 1fr 58px; align-items: center; gap: 12px; }
.bar-row .name { font-size: 13px; color: var(--ink-2); }
.bar-track { height: 9px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #06b6d4); transition: width .5s ease; }
.bar-row .num { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 132px; height: 132px; border-radius: 50%; flex: none; position: relative; }
.donut::after { content: ""; position: absolute; inset: 16px; background: #fff; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut-center b { font-size: 22px; display: block; line-height: 1.1; }
.donut-center span { font-size: 11px; color: var(--muted); }
.legend { display: grid; gap: 8px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend-item .sw { width: 9px; height: 9px; border-radius: 3px; }
.legend-item .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px;
  background: #f8fafc; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .col-actions { text-align: right; white-space: nowrap; }
table.data .link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 5px; }
table.data .link-btn:hover { background: var(--brand-soft); }
table.data .link-btn.danger { color: #dc2626; }
table.data .link-btn.danger:hover { background: #fee2e2; }
.stem-cell { max-width: 520px; }
.cat-table td:nth-child(2) { white-space: nowrap; }
.cat-table td:nth-child(3) { white-space: nowrap; }
.stem-cell .stem { color: var(--ink); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stem-cell .meta { margin-top: 5px; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.checkbox { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; line-height: 1.6; white-space: nowrap; }
.badge.single { background: #eaf1ff; color: #1d4ed8; }
.badge.multiple { background: #f3efff; color: #7c3aed; }
.badge.judge { background: #fff5e6; color: #b45309; }
.badge.blank { background: #e6fbfb; color: #0e7490; }
.badge.short { background: #ffeef2; color: #be123c; }
.badge.on { background: #e8f9f1; color: #047857; }
.badge.off { background: #f1f5f9; color: #64748b; }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.diff { display: inline-flex; gap: 3px; align-items: center; }
.diff i { width: 6px; height: 6px; border-radius: 50%; background: #e2e8f0; display: inline-block; }
.diff i.on { background: #f59e0b; }

.switch { position: relative; width: 38px; height: 21px; border-radius: 99px; background: #cbd5e1; border: 0; cursor: pointer; transition: background .18s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(17px); }

/* 筛选栏 */
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.filter-bar .search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.filter-bar .search input { padding-left: 36px; }
.filter-bar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.filter-bar .select { width: 136px; height: 36px; }
.filter-bar .spacer { flex: 1; }
.filter-bar .count { font-size: 12px; color: var(--muted); }

/* 批量操作条 */
.batch-bar { display: none; align-items: center; gap: 12px; padding: 10px 18px; background: #eff6ff; border-bottom: 1px solid #dbeafe; font-size: 13px; color: #1e40af; }
.batch-bar.show { display: flex; }
.batch-bar b { font-variant-numeric: tabular-nums; }
.batch-bar .spacer { flex: 1; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; align-items: center; gap: 5px; }
.pager button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.pager button:hover:not(:disabled) { border-color: #bfdbfe; color: var(--brand); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .size { display: flex; align-items: center; gap: 8px; }
.pager .select { width: 78px; height: 30px; }

/* ---------- 空状态 / 占位 ---------- */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .art { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 22px; background: #eef4ff; display: grid; place-items: center; color: #93b4fb; }
.empty h3 { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; }
.empty p { margin: 0; font-size: 13px; }
.soon { padding: 60px 24px; text-align: center; }
.soon .pill { display: inline-block; font-size: 11px; letter-spacing: 1.5px; color: #2563eb; background: #eaf1ff; border-radius: 999px; padding: 3px 10px; margin-bottom: 14px; }
.soon h3 { margin: 0 0 8px; font-size: 18px; }
.soon p { color: var(--muted); margin: 0 auto; max-width: 460px; font-size: 13px; line-height: 1.9; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); z-index: 200; display: grid; place-items: center; padding: 24px; animation: fadeIn .16s ease; }
.modal {
  width: 760px; max-width: 100%; max-height: 92vh; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: popIn .18s ease;
}
.modal.sm { width: 440px; }
.modal.md { width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); flex: none; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; border: 0; background: #f1f5f9; color: #64748b; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: #e2e8f0; color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); flex: none; background: #fbfcfe; border-radius: 0 0 16px 16px; }
.modal-error { display: none; margin: 0 0 14px; background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; padding: 9px 12px; border-radius: 9px; font-size: 13px; }
.modal-error.show { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* 题型选择 */
.type-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.type-opt { border: 1px solid var(--line); border-radius: 10px; padding: 9px 6px; text-align: center; cursor: pointer; font-size: 13px; color: var(--ink-2); background: #fff; transition: all .14s; }
.type-opt:hover { border-color: #bfdbfe; background: #f8fbff; }
.type-opt.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; box-shadow: 0 0 0 1px var(--brand) inset; }

/* 选项编辑 */
.option-list { display: grid; gap: 8px; }
.option-row { display: flex; align-items: center; gap: 9px; }
.option-row .key { width: 26px; height: 26px; border-radius: 7px; background: #f1f5f9; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); flex: none; }
.option-row .input { flex: 1; }
.option-row .mark { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; flex: none; }
.option-row .mark input { accent-color: var(--brand); }
.option-row .remove { width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: #94a3b8; cursor: pointer; flex: none; }
.option-row .remove:hover { background: #fee2e2; color: #dc2626; }
.add-option { align-self: flex-start; margin-top: 2px; }

.answer-box { border: 1px dashed #cbd5e1; border-radius: 10px; padding: 14px; background: #fbfcfe; }
.answer-box .inner-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.judge-picker { display: flex; gap: 10px; }
.judge-opt { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; background: #fff; font-size: 14px; transition: all .14s; }
.judge-opt.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.blank-list { display: grid; gap: 8px; }
.blank-row { display: flex; align-items: center; gap: 8px; }
.blank-row .no { width: 46px; font-size: 12px; color: var(--muted); flex: none; }
.keyword-list { display: grid; gap: 8px; }
.keyword-row { display: flex; gap: 8px; align-items: center; }
.keyword-row .input { flex: 1; }
.keyword-row .score { width: 84px; }
.keyword-row .remove { width: 30px; height: 30px; border: 0; background: #f1f5f9; border-radius: 7px; color: #94a3b8; cursor: pointer; flex: none; }
.keyword-row .remove:hover { background: #fee2e2; color: #dc2626; }

/* toast */
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 500; display: grid; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 260px; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--brand); border-radius: 10px; box-shadow: var(--shadow-md);
  padding: 11px 14px; font-size: 13px; color: var(--ink-2); animation: slideIn .2s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--rose); }
.toast .t-title { font-weight: 600; color: var(--ink); margin-bottom: 1px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* 详情描述列表 */
.detail-list { display: grid; gap: 12px; }
.detail-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; font-size: 13.5px; }
.detail-row .k { color: var(--muted); }
.detail-row .v { color: var(--ink-2); }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  table.data th, table.data td { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 1100px) {
  /* 窄屏隐藏难度与更新时间列，保证题干可读 */
  .q-table th:nth-child(4), .q-table td:nth-child(4),
  .q-table th:nth-child(7), .q-table td:nth-child(7) { display: none; }
}
@media (max-height: 760px) {
  .login-hero { padding: 34px 48px; gap: 18px; }
  .hero-main h1 { font-size: 32px; margin-bottom: 10px; }
  .hero-main p { font-size: 13.5px; line-height: 1.75; margin-bottom: 16px; }
  .hero-kicker { margin-bottom: 10px; }
  .hero-points { gap: 7px; }
  .hero-point { font-size: 13px; line-height: 1.5; }
  .hero-point .tick { width: 20px; height: 20px; }
  .hero-foot { font-size: 11px; }
}
/* ===== 阶段 ②：组卷 / 试卷详情 / 导入 ===== */
.modal.lg { width: 920px; }
.modal.xl { width: 1080px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; line-height: 1.7; white-space: nowrap;
  background: #f1f5f9; color: #475569;
}
.chip.ok { background: #e8f9f1; color: #047857; }
.chip.warn { background: #fff7e8; color: #b45309; }
.chip.draft { background: #eef2f8; color: #64748b; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.paper-title {
  font-weight: 600; color: var(--ink); line-height: 1.5; min-width: 230px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
tr.clickable { cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.foot-hint { font-size: 12px; color: var(--muted); margin-right: auto; }
.hint-box { background: #eef4ff; border: 1px dashed #c7d9fb; color: #3b5b8c; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.8; }

.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 5px; }
.link-btn:hover { background: var(--brand-soft); }
.link-btn.danger { color: #dc2626; }
.link-btn.danger:hover { background: #fee2e2; }
.link-btn:disabled { color: #cbd5e1; cursor: not-allowed; background: none; }
.icon-btn {
  width: 28px; height: 28px; flex: none; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: #64748b; cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-grid; place-items: center; transition: all .14s;
}
.icon-btn:hover:not(:disabled) { border-color: #bfdbfe; background: #f0f6ff; color: var(--brand); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* 抽题规则 */
.rule-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.rule-head b { font-size: 13.5px; }
.rule-head .hint { margin-left: 8px; display: inline; }
.rule-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rule-labels, .rule-row { display: grid; grid-template-columns: 1.15fr 1.3fr 82px 92px 96px 32px; gap: 10px; align-items: center; padding: 8px 12px; }
.rule-labels { background: #f8fafc; font-size: 12px; color: var(--muted); font-weight: 600; }
.rule-row { border-top: 1px solid var(--line-2); }
.rule-row .input, .rule-row .select { height: 34px; font-size: 13px; }
.rule-row .input[type="number"] { text-align: center; padding: 0 6px; }
.rule-avail { font-size: 12px; color: var(--muted); text-align: center; white-space: nowrap; }
.rule-avail.ok { color: #047857; }
.rule-avail.warn { color: #b45309; font-weight: 600; }
.rule-summary { display: flex; gap: 20px; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.rule-summary b { color: var(--brand); font-size: 15px; }

/* 试卷详情 */
.paper-head h1 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.back-link { display: inline-block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.back-link:hover { color: var(--brand); }
.meta-line { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.meta-line span { position: relative; }
.paper-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 560px; }
.pq-list { display: grid; }
.pq-item { display: grid; grid-template-columns: 38px 1fr 96px auto; gap: 12px; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--line-2); }
.pq-item:last-child { border-bottom: 0; }
.pq-item:hover { background: #fbfcfe; }
.pq-index { width: 30px; height: 30px; border-radius: 9px; background: #eef4ff; color: var(--brand); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.pq-stem { font-size: 13.5px; color: var(--ink); line-height: 1.6; word-break: break-word; }
.pq-score { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.pq-score .input { width: 60px; height: 32px; text-align: center; padding: 0 4px; }
.pq-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.card-head .count { font-size: 12px; color: var(--muted); }

/* 换题 */
.replace-source { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.replace-source .label { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.replace-stem { font-size: 13.5px; color: var(--ink); line-height: 1.65; word-break: break-word; }
.filter-bar.compact { border: 0; padding: 0 0 12px; }
.replace-list { max-height: 420px; overflow-y: auto; display: grid; gap: 8px; }
.replace-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: all .14s; }
.replace-row:hover { border-color: #bfdbfe; background: #f8fbff; }
.replace-row input[type="radio"] { margin-top: 4px; accent-color: var(--brand); }
.replace-row > div { flex: 1; min-width: 0; }

/* 试卷预览 */
.preview-paper { background: #fff; }
.preview-title { text-align: center; font-size: 19px; font-weight: 700; color: var(--ink); }
.preview-meta { text-align: center; font-size: 12.5px; color: var(--muted); margin: 6px 0 22px; }
.preview-q { padding: 12px 0; border-top: 1px dashed var(--line); }
.preview-stem { font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.preview-score { color: var(--muted); font-size: 12px; }
.preview-options { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin: 7px 0 0 18px; font-size: 13px; color: var(--ink-2); }
.preview-answer { margin: 6px 0 0 18px; font-size: 12.5px; color: #047857; }

/* 批量导入 */
.upload-zone { display: block; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 26px 18px; text-align: center; cursor: pointer; transition: all .15s; }
.upload-zone:hover { border-color: #93b4fb; background: #f8fbff; }
.upload-icon { width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 12px; background: #eef4ff; color: var(--brand); display: grid; place-items: center; }
.upload-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.upload-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.upload-file { font-size: 12.5px; color: var(--brand); margin-top: 8px; word-break: break-all; }
.check-line { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check-line input { accent-color: var(--brand); }
.import-rules { display: grid; gap: 7px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.import-rules p { margin: 0; }
.import-rules code { background: #f1f5f9; border-radius: 4px; padding: 1px 5px; font-size: 12px; color: #1d4ed8; }
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* 宽表：数字列不换行，窄屏隐藏次要列 */
.paper-table td:nth-child(2), .paper-table td:nth-child(3),
.paper-table td:nth-child(4), .paper-table td:nth-child(5),
.exam-table td:nth-child(2), .exam-table td:nth-child(3),
.exam-table td:nth-child(4), .exam-table td:nth-child(5),
.exam-table td:nth-child(6), .exam-table td:nth-child(7) { white-space: nowrap; }
@media (max-width: 1280px) {
  .paper-table th:nth-child(6), .paper-table td:nth-child(6),
  .paper-table th:nth-child(7), .paper-table td:nth-child(7),
  .exam-table th:nth-child(4), .exam-table td:nth-child(4),
  .exam-table th:nth-child(6), .exam-table td:nth-child(6) { display: none; }
}

@media (max-width: 1180px) {
  .grid-2-cards { grid-template-columns: 1fr; }
  .paper-actions { max-width: none; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .pq-item { grid-template-columns: 30px 1fr; }
  .pq-score, .pq-actions { grid-column: 2; justify-content: flex-start; }
  .rule-labels { display: none; }
  .rule-row { grid-template-columns: 1fr 1fr; }
  .preview-options { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 18px 14px 48px; }
  .topbar { padding: 0 16px; }
  .type-picker { grid-template-columns: repeat(3, 1fr); }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
}
