/* ============================================================
   刷题王 · 全局样式
   纯 CSS，无外部字体 / 图标 / 框架；配色统一由 CSS 变量定义
   桌面端（PC）专用：移动端请使用 /m/ 独立页面
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --bg-soft: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cfd8e3;
  --text: #1f2937;
  --text-2: #536171;
  --muted: #8a97a8;
  --primary: #3b6ef5;
  --primary-dark: #2f5bd8;
  --primary-soft: #e8f0ff;
  --success: #17a673;
  --success-soft: #e6f7f0;
  --danger: #e05353;
  --danger-soft: #fdecec;
  --warn: #d98b16;
  --warn-soft: #fff5e3;
  --info: #4a7bd6;
  --info-soft: #eaf1fc;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 38, 66, .04), 0 6px 20px rgba(20, 38, 66, .06);
  --shadow-lg: 0 12px 48px rgba(20, 38, 66, .18);
  --topbar-h: 56px;
  --maxw: 1280px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
          "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo,
          "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-width: 1000px;   /* 桌面版固定布局：窄窗口横向滚动，不为小屏重排（移动端请用 /m/） */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.35; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
[hidden] { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
  white-space: nowrap;
}
.topbar .brand:hover { color: var(--text); }
.brand__mark { width: 26px; height: 26px; flex: none; display: block; }
.topbar .nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar .nav::-webkit-scrollbar { display: none; }
.topbar .nav a {
  position: relative; flex: none;
  display: inline-flex; align-items: center;
  padding: 0 12px;
  color: var(--text-2); font-size: 13.5px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.topbar .nav a:hover { background: var(--bg-soft); color: var(--text); }
.topbar .nav a.is-active { color: var(--primary); font-weight: 600; }
.topbar .nav a.is-active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; border-radius: 2px 2px 0 0; background: var(--primary);
}
.topbar__right { flex: none; display: flex; align-items: center; gap: 10px; }
.topbar__link { flex: none; font-size: 13px; color: var(--text-2); padding: 5px 8px; border-radius: var(--radius-sm); }
.topbar__link:hover { background: var(--bg-soft); color: var(--primary); }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); flex: none;
}
/* 右上角账户菜单：设置与退出登录收进用户名下拉，顶栏不再放独立按钮 */
.user-menu { position: relative; }
.user-chip--btn {
  appearance: none; -webkit-appearance: none; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.user-chip--btn:hover, .user-chip--btn.is-active, .user-menu.is-open .user-chip--btn {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark);
}
.user-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.user-menu__caret {
  width: 0; height: 0; flex: none; margin: 2px 0 0 1px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted); transition: transform .15s;
}
.user-menu.is-open .user-menu__caret { transform: rotate(180deg); }
.user-menu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  display: none; min-width: 150px; max-width: calc(100vw - 24px); padding: 6px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); box-shadow: 0 10px 28px rgba(20, 38, 66, .14);
}
.user-menu.is-open .user-menu__panel { display: block; }
.user-menu__item {
  display: flex; align-items: center; box-sizing: border-box; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 7px; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--text-2);
  text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.user-menu__item:hover { background: var(--bg-soft); color: var(--text); }
.user-menu__item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.user-menu__item--danger { color: var(--danger); }
.user-menu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.user-menu__sep { height: 1px; margin: 4px 2px; background: var(--border); }

/* ---------------- 页面容器 ---------------- */
.view { min-height: calc(100vh - var(--topbar-h)); }
.view:focus { outline: none; }
.page { max-width: var(--maxw); margin: 0 auto; padding: 22px 24px 48px; }
.page--narrow { max-width: 620px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
/* 卡片标题栏：全站与首页「开始练习」卡统一为白底 + 20px 留白，只靠一条极淡分隔线分区。
   原来灰底标题栏叠在卡片外框里，和旁边白底的首页配置卡并排时显得条条框框。 */
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: transparent;
}
.card__head h2, .card__head h3 { font-size: 15px; }
.card__head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
/* 标题旁跟随一个问号提示：左对齐不占操作区 */
.card__head--with-hint { justify-content: flex-start; flex-wrap: wrap; gap: 4px 10px; }
/* 标题 + 问号成组，保证右侧 .head-actions 仍靠右（如「我的题库」的新建按钮） */
.card__title-row { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.help-tip { position: relative; display: inline-flex; align-items: center; }
.help-tip__btn {
  width: 16px; height: 16px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface); color: var(--muted);
  font-size: 11px; font-weight: 600; line-height: 1; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.help-tip__btn:hover, .help-tip:focus-within .help-tip__btn {
  color: var(--primary); border-color: var(--primary); background: var(--primary-soft);
}
.help-tip__btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.help-tip__bubble {
  position: absolute; top: 100%; left: 0; z-index: 20;
  width: max-content; max-width: min(260px, 76vw);
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow);
  font-size: 12px; font-weight: 400; line-height: 1.6; text-align: left;
  visibility: hidden; opacity: 0; transform: translateY(-3px); pointer-events: none;
  transition: opacity .12s, transform .12s;
}
/* 透明桥接区，避免鼠标从问号移到气泡时提示闪断 */
.help-tip__bubble::before {
  content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
.help-tip:hover .help-tip__bubble, .help-tip:focus-within .help-tip__bubble {
  visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto;
}
.head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: nowrap; }
/* 正文 / 页脚与标题栏左右对齐到 20px，页脚同样去掉灰底，卡片只留一个外框 */
.card__body { padding: 16px 18px; }
.card__body--tight { padding: 10px 18px; }
.card__foot { padding: 10px 18px; border-top: 1px solid var(--border); background: transparent; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13.5px; font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover { background: #dbe8ff; color: var(--primary-dark); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: #fbdcdc; color: #c33c3c; }
.btn--plain { background: transparent; color: var(--text-2); padding: 6px 10px; }
.btn--plain:hover { background: var(--bg-soft); color: var(--text); }
.btn--sm { padding: 5px 11px; font-size: 12.5px; }
.btn--lg { padding: 11px 22px; font-size: 15px; }
.btn--block { width: 100%; }
.icon-btn {
  border: none; background: transparent; color: var(--muted);
  font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
/* 表单标签后的轻量补充提示：比标签更小更淡，不抢主信息 */
.field__hint { margin-left: 4px; font-size: 11px; font-weight: 400; color: var(--muted); opacity: .78; }
input[type="text"], input[type="password"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 110, 245, .12);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
select { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* 开始练习：默认折叠的高级选项 */
.more-options {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); margin-top: 16px;
}
.more-options > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary::before {
  content: '▸'; color: var(--primary); font-size: 12px; line-height: 1;
  transition: transform .15s;
}
.more-options[open] > summary::before { transform: rotate(90deg); }
.more-options > summary:hover { color: var(--primary); }
.more-options__body { padding: 14px 14px 16px; border-top: 1px solid var(--border); }
/* 三个短筛选项固定一行三列，避免某项说明文字换行把其它项挤到下一行 */
.opt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* 题型 + 答案显示收进同一个浅色分组，层级更清楚 */
.opt-group {
  margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.opt-group__head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.opt-group .check-grid { gap: 8px 18px; }
.opt-group > .sep { margin: 12px 0; }

/* 题库页：顶部题库切换（含右侧重置）+ 紧凑筛选条 */
.bank-switcher {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.bank-switcher__tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.bank-switcher__reset { flex: 0 0 auto; margin-left: auto; }
.bank-switcher__label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.bank-tab {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; line-height: 1.4; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.bank-tab:hover { background: var(--bg-soft); color: var(--text); }
.bank-tab.is-active {
  background: var(--primary-soft); color: var(--primary); border-color: transparent; font-weight: 600;
}
.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-bar .field { flex: 0 0 auto; }
.filter-bar .field--type { width: 118px; }
.filter-bar .field--difficulty { width: 96px; }
.filter-bar .field--scope { width: 128px; }
.filter-bar .field--keyword { flex: 0 0 200px; width: 200px; }
.filter-bar .btn { flex: 0 0 auto; }
/* 筛选条三个下拉：自绘箭头，往左挪出一点右边距，避免贴着边框 */
.filter-bar select {
  appearance: none; -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%3E%3Cpath%20d='M2.5%204.5%206%208l3.5-3.5'%20fill='none'%20stroke='%23536171'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input, .inline-field select { flex: 1 1 auto; }

/* ---------------- 表格 ---------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.table th, table.table td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.table th {
  background: var(--surface-2); color: var(--text-2); font-weight: 600;
  white-space: nowrap; font-size: 12.5px;
}
table.table tbody tr:hover { background: var(--surface-2); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.table .truncate { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-empty { padding: 26px; text-align: center; color: var(--muted); }

/* 固定列：表格横向滚动时，选择列（左）与操作列（右）保持可见 */
table.table th.col-sticky, table.table td.col-sticky {
  position: sticky; z-index: 2;
  background: var(--surface);
}
table.table th.col-sticky { background: var(--surface-2); z-index: 3; }
table.table td.col-sticky-left, table.table th.col-sticky-left { left: 0; }
table.table td.col-sticky-right, table.table th.col-sticky-right { right: 0; }
table.table td.col-sticky-left { box-shadow: inset -1px 0 0 var(--border); }
table.table td.col-sticky-right { box-shadow: inset 1px 0 0 var(--border-strong); }
table.table th.col-sticky-left { box-shadow: inset -1px 0 0 var(--border); }
table.table th.col-sticky-right { box-shadow: inset 1px 0 0 var(--border-strong); }
table.table tbody tr:hover td.col-sticky { background: var(--surface-2); }
table.table tbody tr.is-selected td.col-sticky,
table.table tbody tr.is-selected:hover td.col-sticky { background: var(--primary-soft); }

/* 右侧固定的「操作」列：加一层很淡的蓝灰底色，横向滚动时与流动内容区分 */
table.table td.col-sticky-right { background: #f7fafd; }
table.table th.col-sticky-right { background: #f2f6fb; }
table.table tbody tr:hover td.col-sticky-right { background: #eff4fa; }
table.table tbody tr.is-selected td.col-sticky-right,
table.table tbody tr.is-selected:hover td.col-sticky-right { background: var(--primary-soft); }

/* 题库列表「操作」列：PC 端收窄 + 按钮靠右对齐（列宽紧贴按钮，仅留几像素余量） */
table.table--fluid-actions th.col-sticky-right,
table.table--fluid-actions td.col-sticky-right { text-align: right; padding-left: 5px; padding-right: 6px; width: 1%; white-space: nowrap; }
table.table--fluid-actions td.col-sticky-right .btn { margin-left: 5px; padding-left: 9px; padding-right: 9px; }
/* 分值列 / 序号列：数值左右居中（覆盖 .num 的靠右） */
table.table th.col-score, table.table td.col-score,
table.table th.col-no, table.table td.col-no { text-align: center; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; line-height: 1.6; white-space: nowrap;
  background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border);
}
.badge--primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge--warn    { background: var(--warn-soft);    color: var(--warn);    border-color: transparent; }
.badge--info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }
.tag {
  display: inline-block; padding: 1px 7px; margin: 1px 3px 1px 0;
  border-radius: 5px; background: var(--bg-soft); color: var(--text-2); font-size: 12px;
}

/* ---------------- 状态（加载 / 空 / 错误） ---------------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; color: var(--muted); }
.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state { padding: 42px 18px; text-align: center; color: var(--muted); }
.state--empty::before { content: ""; display: block; width: 42px; height: 42px; margin: 0 auto 12px; border: 2px dashed var(--border-strong); border-radius: 10px; }
.state--error { color: var(--danger); }
.state .btn { margin-top: 12px; }

/* ---------------- Toast ---------------- */
.toast-host {
  position: fixed; z-index: 100; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 460px);
}
.toast {
  max-width: 100%; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--text); color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: toast-in .2s ease-out;
}
.toast--success { background: #147d59; }
.toast--error { background: #c94646; }
.toast--warn { background: #b8760f; }
.toast.is-out { opacity: 0; transform: translateY(-8px); transition: all .22s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 弹窗 / 抽屉 ---------------- */
.modal-overlay, .drawer-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(24, 36, 56, .42);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fade-in .16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(100%, 520px); max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal--wide { width: min(100%, 760px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal__title { font-size: 16px; }
.modal__body { padding: 18px; overflow-y: auto; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
/* 确认框分层排版：主问题醒目，补充说明 / 后果提示弱化为小灰字 */
.confirm { display: flex; flex-direction: column; gap: 10px; }
.confirm__lead { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.confirm__note { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.confirm--rich .confirm__lead { font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--text); }
.confirm__num { color: var(--primary); font-weight: 700; font-size: 1.12em; font-variant-numeric: tabular-nums; }
.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer {
  width: min(100%, 560px); height: 100%; background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: drawer-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.drawer--wide { width: min(100%, 720px); }
.drawer__tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.drawer__tab {
  border: none; background: transparent; color: var(--text-2); cursor: pointer;
  padding: 11px 16px; font-size: 13.5px; border-bottom: 2px solid transparent;
}
.drawer__tab:hover { color: var(--text); }
.drawer__tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------------- 题库批量操作 / 题目编辑 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.toolbar__info { font-size: 12.5px; color: var(--text-2); }
.spacer { flex: 1 1 auto; }
.cell-check { width: 38px; text-align: center !important; }
table.table tbody tr.is-selected { background: var(--primary-soft); }
.opt-edit-row { display: flex; align-items: center; gap: 9px; }
.opt-edit-row__key {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 600;
}
.opt-edit-row > input[type="text"], .inline-field > input[type="text"] { flex: 1 1 auto; width: auto; }
.hint-box {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--info-soft); color: var(--text-2); font-size: 12.5px; line-height: 1.6;
}
.hint-box--quiet {
  padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; line-height: 1.55;
}

/* 题目编辑表单：紧凑分组 + 按钮化操作 + pill 化答案选择 */
.edit-form { gap: 14px; }
.edit-form .field { gap: 5px; }
.edit-form .field > label { font-size: 12.5px; }
.edit-form .form-grid { gap: 12px 14px; }
.edit-form .detail-section { margin-bottom: 0; }
.form-grid--meta { grid-template-columns: 120px minmax(0, 1fr); }

.edit-section { border-top: 1px solid var(--border); padding-top: 14px; }
.edit-section__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.edit-section__head h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: var(--text); font-weight: 600; }
.edit-section__head h4::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--primary); }
.edit-section .hint { display: block; margin: -2px 0 10px; font-size: 12px; color: var(--muted); }

.field--answer { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.answer-grid { gap: 8px; }
.answer-choice { position: relative; display: inline-flex; cursor: pointer; }
.answer-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.answer-choice > span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 30px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.answer-choice:hover > span { border-color: var(--primary); color: var(--primary); }
.answer-choice input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.answer-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(59, 110, 245, .2); }

/* ---------------- 登录 ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #f2f6fd 0%, #f7f9fc 60%, #eef2f7 100%); }
.login-card { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 28px; }
.login-card__logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 700; text-align: center; }
.login-card__mark { width: 44px; height: 44px; flex: none; }
.login-card__sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { margin-top: 8px; }
.form-error { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 13px; }
.login-card__foot { text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.login-card__foot a { color: var(--primary); font-weight: 500; }

/* ---------------- 通用小组件 ---------------- */
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sep { height: 1px; background: var(--border); margin: 16px 0; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 10px; }
.pill-tabs button { border: none; background: transparent; padding: 6px 16px; border-radius: 7px; font-size: 13.5px; color: var(--text-2); }
.pill-tabs button.is-active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
/* 错题本 / 题库页 / 共享题库 / 全部练习：切分类、切范围、刷新、翻页走后台取数，旧列表不消失；
   仅用表头下（共享题库页是卡片底边）一条细进度线反馈在途请求 */
.book-progress, .bank-progress, .community-progress, .sessions-progress { height: 2px; background: transparent; overflow: hidden; }
.book-progress.is-on, .bank-progress.is-on, .community-progress.is-on, .sessions-progress.is-on { background: var(--primary-soft); }
.book-progress.is-on::after, .bank-progress.is-on::after, .community-progress.is-on::after, .sessions-progress.is-on::after {
  content: ''; display: block; width: 32%; height: 100%; background: var(--primary);
  animation: book-progress 1s ease-in-out infinite;
}
@keyframes book-progress {
  from { transform: translateX(-100%); }
  to   { transform: translateX(320%); }
}
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; font-size: 13px; color: var(--text-2); }

/* ---------------- 导入 ---------------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 34px 18px; text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone__title { font-size: 15px; font-weight: 600; }
.dropzone__hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.dropzone .btn { margin-top: 14px; }
/* 解析预览汇总：四个指标 + 各工作表压成两行，不再用七张带描边的大数字卡 */
.preview-summary { display: grid; gap: 10px; }
.preview-summary__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-width: 0; }
.preview-summary__item { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.preview-summary__item > span { font-size: 12.5px; color: var(--muted); }
.preview-summary__item b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.preview-summary__item--error b { color: var(--danger); }
.preview-summary__item--warn b { color: var(--warn); }
.preview-summary__row--sheets { gap: 8px 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.preview-summary__label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-right: 2px; }
.preview-summary__chip {
  display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%;
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden;
}
.preview-summary__chip b { font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.preview-summary__chip small { font-size: 11.5px; color: var(--muted); }

/* 解析预览阶段：汇总 / 校验结果 / 题目预览 / 确认导入合并成一张卡，
   只靠细分隔线分区，不再四张白框各带 16px 灰色间隙 */
.card--import-preview > .card__body { padding: 0; }
.import-preview__body > .preview-summary { padding: 14px 20px; }
.import-section { padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.import-section__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.import-section__head h3 { font-size: 15px; font-weight: 600; }
.import-section__head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* 无错误 / 警告时该分区收成一条提示，去掉小标题与多余留白 */
.import-section--issues.card--issues-ok { padding: 0; }
.import-section--issues.card--issues-ok .import-section__head { display: none; }
.issues-ok { display: flex; align-items: center; gap: 8px; padding: 11px 20px; font-size: 13px; color: var(--text-2); }
.issues-ok__mark { flex: none; display: grid; place-items: center; width: 18px; height: 18px;
                   border-radius: 50%; background: var(--success-soft); color: var(--success);
                   font-size: 11px; font-weight: 700; }
.issues-ok__count { margin-left: auto; color: var(--muted); font-size: 12px; }
.result-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.result-bar__item { flex: 1 1 110px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; text-align: center; }
.result-bar__num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-bar__label { font-size: 12px; color: var(--muted); }

/* ---------------- 答题 ---------------- */
.practice { max-width: 860px; margin: 0 auto; padding: 22px 20px 60px; }
.practice--with-sheet { max-width: 1360px; }
.practice-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 210px; gap: 16px; align-items: start; }
.practice-main { min-width: 0; }

/* 右侧操作区：上一题 / 下一题 / 自动跳转 / 用时 + 交卷 */
.side-panel { padding: 14px; position: sticky; top: 74px; display: flex; flex-direction: column; gap: 13px; }
.side-panel__group { display: flex; flex-direction: column; gap: 8px; }
.side-panel__group + .side-panel__group { border-top: 1px dashed var(--border); padding-top: 12px; }
.side-panel__label { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.side-panel__timer { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .3px; line-height: 1.2; }
/* 下一题是主操作：占更宽的列、实心主色、字号与高度都放大，并带方向箭头；上一题保持弱化 */
.side-panel__nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; align-items: stretch; }
.btn--nav-next { padding: 10px 12px; font-size: 14px; font-weight: 600; }
.btn--nav-next span[aria-hidden] { font-size: 15px; line-height: 1; }
.side-panel .btn { width: 100%; justify-content: center; }

/* 收藏：圆润饱满的五角星图标，无边框无底色 */
.fav-star { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; background: none; border: none; box-shadow: none; padding: 3px 5px; margin: 0; color: var(--text-2); cursor: pointer; transition: color .15s, transform .12s; }
.fav-star__icon { width: 22px; height: 22px; display: block; pointer-events: none; }
.fav-star__shape { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fav-star:hover { color: var(--primary); transform: scale(1.08); }
.fav-star.is-fav { color: #f5a623; }
.fav-star.is-fav .fav-star__shape { fill: currentColor; }
.fav-star.is-fav:hover { color: #e8951a; }
/* 请求进行中：仅轻微置灰，不改文字、不移除图标 */
.fav-star:disabled,
.fav-star:disabled:hover { opacity: .55; cursor: default; transform: none; }

/* 题目底部工具组：收藏 + 笔记 */
.q-tools { display: flex; align-items: center; gap: 4px; }
.note-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px 4px 6px; border: none; border-radius: 999px;
  background: none; color: var(--text-2); font-size: 12.5px; line-height: 1.4;
  transition: color .15s, background .15s;
}
.note-btn:hover { color: var(--primary); background: var(--primary-soft); }
.note-btn__icon { width: 17px; height: 17px; display: block; pointer-events: none; }
.note-btn__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); display: none; }
.note-btn.has-note { color: var(--primary); background: var(--primary-soft); }
.note-btn.has-note .note-btn__dot { display: block; }
.note-btn:disabled { opacity: .55; cursor: default; }

/* 笔记弹窗 */
.note-editor textarea {
  display: block; width: 100%; min-height: 140px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13.5px; line-height: 1.7; resize: vertical;
}
.note-editor textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.note-editor__hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

/* 工具行：答对自动跳转开关（题号信息已在顶部进度条，不再重复显示） */
.side-panel__tools { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.side-panel__switch { display: inline-flex; align-items: center; gap: 6px; }

/* 顶部：本次用时（小字）+ 交卷 同一行；导航按钮移到最下方 */
.side-panel__submit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.side-panel__time { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.side-panel__submit .btn { width: auto; flex: 1 1 auto; }

/* 左侧竖向答题卡 */
.answer-panel { padding: 14px 14px 12px; position: sticky; top: 74px; }
.answer-panel__title { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 12px; padding-left: 8px; border-left: 3px solid var(--primary); }
.answer-panel__stats { margin-top: 12px; font-size: 12px; color: var(--text-2); text-align: center; }
.answer-panel__legend { display: flex; justify-content: center; gap: 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.answer-panel__legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.dot--answered { background: #bfe8d6; }
.dot--todo { background: var(--border-strong); }
.dot--wrong { background: #f3b9b9; }
.answer-sheet__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; max-height: 430px; overflow-y: auto; padding: 2px; }
.answer-sheet__cell {
  width: 100%; aspect-ratio: 1; max-width: 38px; justify-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface); color: var(--text-2); font-size: 12.5px;
  font-variant-numeric: tabular-nums; padding: 0;
}
.answer-sheet__cell:hover { border-color: var(--primary); color: var(--primary); }
.answer-sheet__cell.is-current { border-color: var(--primary); color: var(--primary); font-weight: 700; box-shadow: 0 0 0 2px var(--primary-soft); }
.answer-sheet__cell.is-answered { background: var(--success-soft); color: var(--success); border-color: #bfe8d6; }
.answer-sheet__cell.is-wrong { background: var(--danger-soft); color: var(--danger); border-color: #f3b9b9; }
.answer-sheet__cell.is-current.is-answered,
.answer-sheet__cell.is-current.is-wrong { box-shadow: 0 0 0 2px var(--primary-soft); border-color: var(--primary); font-weight: 700; }

/* 顶部进度条 + 题目信息：横跨答题卡 / 答题区 / 右侧操作栏三列，三栏从同一高度起排。
   刻意不加 .card 白框：否则会与下方三栏的白卡片叠成「框中框」，只需一行文字 + 一条细轨。 */
.practice-header { padding: 2px 2px 0; margin-bottom: 18px; }
.practice-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.practice-header__count { font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; }
.practice-header .progress { margin-bottom: 0; height: 6px; background: #dfe7f7; box-shadow: none; }
.practice-header .progress__bar { background: linear-gradient(90deg, var(--primary), #6b93ff); }
.practice__meta { font-size: 15px; font-weight: 600; min-width: 0; }
.practice__meta .muted { font-weight: 400; font-size: 13px; margin-left: 10px; }
.progress { height: 7px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress__bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .25s; }
.q-card { padding: 22px; }
.q-stem { font-size: 16px; line-height: 1.8; white-space: normal; word-break: break-word; margin-bottom: 18px; }
.q-stem__no { color: var(--primary); font-weight: 700; margin-right: 8px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.opt.is-checked { border-color: var(--primary); background: var(--primary-soft); }
/* 提交后的选项反馈：正确绿、错选红 */
.opt.is-correct { border-color: #8fd8bb; background: var(--success-soft); }
.opt.is-correct .opt__key, .opt.is-correct .opt__text { color: var(--success); }
.opt.is-wrong { border-color: #f3b9b9; background: var(--danger-soft); }
.opt.is-wrong .opt__key, .opt.is-wrong .opt__text { color: var(--danger); }
.opt input { margin-top: 3px; }
.opt__key { font-weight: 700; color: var(--primary); min-width: 18px; }
.opt__text { flex: 1; word-break: break-word; }
.blank-list { display: grid; gap: 12px; }
.blank-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.q-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.q-actions .hint { font-size: 12.5px; color: var(--muted); }
.q-score { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
/* 题目卡底部：收藏星（左）与“本题满分”（右）同一行 */
.q-score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.q-score-row .q-score { margin-top: 0; }
.q-score-row .fav-star { align-self: center; }
.auto-next { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }

/* ---------------- 内联解析块（选项下方小灰块，参考卷王样式） ---------------- */
.explain-box { margin-top: 14px; padding: 12px 15px; background: var(--bg-soft); border-radius: var(--radius-sm); font-size: 13.5px; }
.explain-box__head { display: flex; align-items: center; gap: 10px; }
.explain-box__verdict { font-weight: 700; font-size: 13.5px; }
.explain-box__verdict.is-correct { color: var(--success); }
.explain-box__verdict.is-wrong { color: var(--danger); }
.explain-box__verdict.is-pending { color: var(--text-2); }
.explain-box__score { font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
.explain-box__row { margin-top: 8px; line-height: 1.75; word-break: break-word; }
.explain-box__label { display: inline-block; color: var(--muted); font-size: 12.5px; margin-right: 9px; vertical-align: 1px; }
.explain-box__md { display: inline; }
.explain-box__md p { margin: 0 0 4px; }
.explain-box__md p:last-child { margin-bottom: 0; }
.explain-box__blanks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.blank-chip { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.blank-chip.is-ok { color: var(--success); border-color: #bfe8d6; }
.blank-chip.is-no { color: var(--danger); border-color: #f3b9b9; }
.explain-box__review { display: flex; align-items: center; gap: 8px; }
.explain-box__ai { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border-strong); display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.explain-box__ai a { color: var(--primary); font-size: 12.5px; text-decoration: none; cursor: pointer; }
.explain-box__ai a:hover { text-decoration: underline; }
.explain-box__ai a.is-busy { pointer-events: none; opacity: .6; }
.explain-box__ai #ai-status { margin-left: 4px; }
.explain-box__ai-content { margin-top: 6px; font-size: 13px; line-height: 1.75; word-break: break-word; }
.explain-box__ai-content p { margin: 0 0 4px; }

/* ---------------- AI 提问 / 多轮追问 ---------------- */
.ai-chat { margin-top: 10px; }
.ai-chat__list { display: flex; flex-direction: column; gap: 9px; }
.ai-chat__list:empty { display: none; }
.ai-chat__msg { display: flex; align-items: flex-start; gap: 8px; }
.ai-chat__msg--user { flex-direction: row-reverse; }
.ai-chat__who { flex: none; font-size: 11.5px; color: var(--muted); padding-top: 5px; }
.ai-chat__bubble { max-width: 88%; min-width: 40px; padding: 8px 11px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13px; line-height: 1.75; word-break: break-word; }
.ai-chat__msg--user .ai-chat__bubble { background: var(--primary-soft); border-color: #cfe0ff; }
.ai-chat__bubble.is-error { color: var(--danger); background: var(--danger-soft); border-color: #f3b9b9; }
.ai-chat__bubble p { margin: 0 0 4px; }
.ai-chat__bubble p:last-child { margin-bottom: 0; }
.ai-chat__form { margin-top: 9px; }
.ai-chat__form textarea { display: block; width: 100%; min-height: 54px; padding: 8px 10px; resize: vertical; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; line-height: 1.6; }
.ai-chat__form textarea:focus { outline: none; border-color: var(--primary); }
.ai-chat__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ai-chat__actions .btn { flex: none; }

/* ---------------- AI 解析面板（独立于结果卡） ---------------- */
/* 折叠条 + 两个入口按钮 + 展开面板合并成一张连续卡片：操作与反馈同处一卡，
   折叠时只有标题行，展开时标题行与内容之间补一条细线，不再出现分离的色块 */
.ai-section {
  margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); overflow: hidden;
}
.ai-head { display: flex; align-items: center; gap: 6px; padding-right: 8px; }
.ai-section.is-open .ai-head { border-bottom: 1px solid var(--border); }
.ai-fold { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
           padding: 9px 12px; text-align: left;
           border: 0; border-radius: 0; background: transparent;
           color: var(--text); font-size: 13px; transition: background .15s ease; }
.ai-fold:hover { background: var(--surface-2); }
/* 没有任何解析 / 追问时：标题条不暗示可点开，避免展开一块空面板 */
.ai-fold.is-static { cursor: default; }
.ai-fold.is-static:hover { background: transparent; }
.ai-fold.is-static .ai-fold__chevron { visibility: hidden; }
.ai-fold:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ai-fold strong { font-size: 13px; font-weight: 600; }
.ai-fold__chevron { flex: none; color: var(--muted); font-size: 12px; transition: transform .18s ease; }
.ai-fold.is-open .ai-fold__chevron { transform: rotate(180deg); }
.ai-fold__hint { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ai-fold__hint:empty { display: none; }
.ai-fold__toggle { flex: none; color: var(--primary); font-size: 12px; white-space: nowrap; }
.ai-fold__toggle[hidden] { display: none; }
.ai-panel { padding: 12px 15px 14px; font-size: 13.5px; }
.ai-panel .explain-box__ai { margin-top: 0; padding-top: 6px; border-top: 0; }
.q-score-row { flex-wrap: wrap; }
/* 生成 / 查看解析与向 AI 提问：与标题同一行，未解锁时随整卡一起隐藏 */
.ai-entry { flex: none; display: flex; align-items: center; gap: 6px; }
.ai-entry[hidden] { display: none; }
.ai-entry .btn { white-space: nowrap; }
.q-score-row .q-score { white-space: nowrap; }

/* 结果卡 */
.result-card { border-left: 4px solid var(--border-strong); }
.result-card.is-correct { border-left-color: var(--success); }
.result-card.is-wrong { border-left-color: var(--danger); }
.result-card.is-pending { border-left-color: var(--warn); }
.result-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.result-card__verdict { font-size: 16px; font-weight: 700; }
.result-card__verdict.is-correct { color: var(--success); }
.result-card__verdict.is-wrong { color: var(--danger); }
.result-card__verdict.is-pending { color: var(--warn); }
.result-block { margin-top: 14px; }
.result-block__title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.result-block__body { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; word-break: break-word; }
.blank-detail { width: 100%; border-collapse: collapse; font-size: 13px; }
.blank-detail th, .blank-detail td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.blank-detail th { color: var(--muted); font-weight: 500; }
.blank-detail tr:last-child td { border-bottom: none; }
.blank-detail .ok { color: var(--success); }
.blank-detail .no { color: var(--danger); }
.ai-box { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ai-box__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ai-box__head strong { font-size: 14px; }
.ai-box__status { color: var(--muted); font-size: 12.5px; flex: 1; }
.ai-box__content { padding: 14px 16px; min-height: 40px; font-size: 14px; }

/* ---------------- Markdown ---------------- */
.md { line-height: 1.8; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.1em 0 .5em; }
.md h1 { font-size: 20px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; }
.md h4, .md h5, .md h6 { font-size: 14px; }
.md p { margin: .6em 0; }
.md ul, .md ol { margin: .6em 0; padding-left: 1.6em; }
.md li { margin: .25em 0; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.md pre { background: #1f2733; color: #e6edf5; border-radius: var(--radius-sm); padding: 13px 15px; overflow-x: auto; margin: .8em 0; }
.md pre code { background: none; border: none; color: inherit; padding: 0; font-size: 12.5px; }
.md strong { font-weight: 700; }

/* Markdown 引用块（> / >> 嵌套）：左侧竖线 + 浅蓝底，块内首末元素不留多余外边距 */
.md .md-quote { margin: .8em 0; padding: 8px 14px; border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--primary-soft); color: var(--text-2); }
.md .md-quote > :first-child { margin-top: 0; }
.md .md-quote > :last-child { margin-bottom: 0; }
.md .md-quote .md-quote { margin: .5em 0; background: var(--surface-2); }

/* 代码块：语言标签 + 复制 + 语法高亮（暗色，接近 IDE 观感）
   PC / 移动版共用 shared/highlight.js 输出的 .tok--* 类名，配色各自定义。 */
.md .md-code {
  --code-bg: #1f2733; --code-bg-2: #27313f; --code-line: #34404f; --code-fg: #e6edf5;
  --tok-kw: #c792ea; --tok-ty: #ffcb6b; --tok-bi: #80cbc4; --tok-fn: #82aaff;
  --tok-st: #c3e88d; --tok-nm: #f78c6c; --tok-cm: #8b9ab0; --tok-op: #89ddff;
  --tok-mt: #f07178; --tok-tg: #f07178; --tok-lt: #f78c6c;
  margin: .8em 0; background: var(--code-bg); border: 1px solid var(--code-line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.md .md-code__head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 8px 5px 14px; background: var(--code-bg-2); border-bottom: 1px solid var(--code-line); }
.md .md-code__lang { color: #aebbd0; font-family: var(--mono); font-size: 11.5px;
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.md .md-code__copy { flex: none; padding: 3px 8px; border: 0; border-radius: 5px;
  background: transparent; color: #aebbd0; font: inherit; font-size: 11.5px; cursor: pointer; }
.md .md-code__copy:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.md .md-code__copy.is-done { color: var(--tok-st); }
.md .md-code__copy:focus-visible { outline: 2px solid #82aaff; outline-offset: -2px; }
.md .md-code pre { margin: 0; padding: 12px 15px; border: 0; border-radius: 0;
  background: transparent; color: var(--code-fg); font-size: 12.5px; line-height: 1.7;
  overflow-x: auto; tab-size: 4; }
.md .md-code pre code { background: none; border: 0; color: inherit; padding: 0; font-size: inherit; }
.md .md-code .tok--kw { color: var(--tok-kw); }
.md .md-code .tok--ty { color: var(--tok-ty); }
.md .md-code .tok--bi { color: var(--tok-bi); }
.md .md-code .tok--fn { color: var(--tok-fn); }
.md .md-code .tok--st { color: var(--tok-st); }
.md .md-code .tok--nm, .md .md-code .tok--lt { color: var(--tok-nm); }
.md .md-code .tok--cm { color: var(--tok-cm); font-style: italic; }
.md .md-code .tok--op { color: var(--tok-op); }
.md .md-code .tok--mt, .md .md-code .tok--tg { color: var(--tok-mt); }

/* Markdown 表格（GFM 管道表格） */
.md .md-table { margin: .8em 0; max-width: 100%; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.md .md-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md .md-table--wide table { min-width: 620px; }
.md .md-table th, .md .md-table td { padding: 7px 12px; text-align: left;
  vertical-align: top; word-break: break-word; overflow-wrap: anywhere;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.md .md-table th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.md .md-table tbody tr:last-child td { border-bottom: 0; }
.md .md-table th:last-child, .md .md-table td:last-child { border-right: 0; }

/* ---------------- 统计 ---------------- */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
/* 统计数字卡的标题也统一到卡片标题栏的 15px / 600 / 深色，大数值仍是主视觉 */
.stat-card__label { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.stat-card__value { font-size: 28px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
/* ---------------- 学习统计（重构） ----------------
   三张卡分区；趋势只画有练习的日期；明细用正确率条代替整行黄底高亮，
   长列表默认收起，避免 20 行表格 + 大片黄色色块把页面拉得又长又乱。 */
.stats-head-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.chart-legend--inline { margin-bottom: 0; }

/* 概览：四张等高小卡，正确率带进度条，其余用透明占位条保持行高一致 */
.stats-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats-kpi { display: flex; flex-direction: column; min-width: 0;
  padding: 12px 14px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.stats-kpi__label { font-size: 12.5px; color: var(--text-2); }
.stats-kpi__value { margin-top: 5px; font-size: 26px; line-height: 1.15;
  font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-kpi__sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.stats-kpi__bar { height: 4px; margin-top: 10px; border-radius: 999px;
  background: var(--bg-soft); overflow: hidden; }
.stats-kpi__bar.is-placeholder { visibility: hidden; }
.stats-kpi__bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

/* 趋势：SVG 自带网格与 Y 轴刻度，图下补 30 天尺度摘要 */
.stats-chart { padding-top: 6px; }
.stats-chart .chart { width: 100%; height: auto; display: block; }
.stats-chart .state--empty { padding: 20px 12px; }
.stats-chart .state--empty::before { width: 30px; height: 30px; margin-bottom: 8px; }
.stats-chart__foot { display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); }
.stats-chart__foot b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }

/* 明细：名称 / 正确率条 / 百分比 / 答对数，颜色只落在条与数字上 */
.stats-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; margin-bottom: 18px; }
.stats-panel { min-width: 0; }
.stats-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.stats-panel__head h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.stats-panel__head .sub { font-size: 12px; color: var(--muted); }
.stats-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 54px 74px;
  gap: 10px; align-items: center; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.stats-row__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-row__bar { height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.stats-row__bar i { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: var(--primary); }
.stats-row--high .stats-row__bar i { background: var(--success); }
.stats-row--low .stats-row__bar i { background: var(--warn); }
.stats-row__pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-row--high .stats-row__pct { color: var(--success); }
.stats-row--low .stats-row__pct { color: var(--warn); }
.stats-row__count { text-align: right; color: var(--muted); font-size: 12px;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-empty { padding: 12px 0; font-size: 12.5px; color: var(--muted); }
.stats-panel--tags { padding-top: 16px; border-top: 1px solid var(--border); }
.stats-tags:not(.is-expanded) .stats-row--extra { display: none; }
.stats-more { margin-top: 10px; padding: 4px 0; border: 0; background: none;
  color: var(--primary); font: inherit; font-size: 12.5px; cursor: pointer; }
.stats-more:hover { color: var(--primary-dark); }

/* ---------------- 详情 ---------------- */
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.detail-stem { font-size: 15px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.detail-options { display: flex; flex-direction: column; gap: 6px; }
.detail-option { padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; }
.detail-option.is-answer { border-color: var(--success); background: var(--success-soft); }

/* ============================================================
   题库 v2：列表 / 共享题库 / 多选器 / 快速加题
   ============================================================ */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
       background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; }
.seg__btn { border: 0; background: transparent; color: var(--text-2);
            padding: 6px 12px; border-radius: 7px; font-size: 13px; line-height: 1.4; }
.seg__btn:hover { color: var(--primary); }
.seg__btn.is-active { background: var(--surface); color: var(--primary);
                     font-weight: 600; box-shadow: 0 1px 3px rgba(20, 38, 66, .1); }

.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.bank-card { display: flex; flex-direction: column; min-height: 188px; }
.bank-card.is-deleted { opacity: .78; border-style: dashed; }
.bank-card__title { font-size: 15px; font-weight: 600; display: flex;
                   align-items: center; gap: 8px; flex-wrap: wrap; }
.bank-card__desc { color: var(--text-2); font-size: 13px; min-height: 38px;
                   margin: 8px 0 10px; display: -webkit-box; -webkit-line-clamp: 2;
                   -webkit-box-orient: vertical; overflow: hidden; }
.bank-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px;
                  color: var(--muted); font-size: 12px; }
.bank-card__stats { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
                    padding: 9px 0; margin-top: auto; border-top: 1px solid var(--border);
                    color: var(--text-2); font-size: 12px; }
.bank-card__stats b { color: var(--text); font-size: 14px; font-weight: 600; }
.bank-card__actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
/* 只显示「公开」标识；私有不显示徽标（无标识即私有） */
.badge--public { background: var(--success-soft); color: var(--success); }

/* 状态切换是就地更新的：固定收藏按钮宽度避免文案变长挤动同行按钮，颜色用过渡平滑切换 */
.react-btn { display: inline-flex; align-items: center; gap: 4px;
             transition: background .15s, border-color .15s, color .15s; }
.react-btn.is-fav { min-width: 80px; }
.react-btn.is-on { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.react-btn.is-on.is-fav { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
        border-radius: 999px; background: var(--primary-soft);
        color: var(--primary-dark); font-size: 12px; }
.chip__x { border: 0; background: transparent; color: inherit;
           padding: 0 2px; line-height: 1; font-size: 14px; }

.picker { border: 1px solid var(--border); border-radius: var(--radius-sm);
          background: var(--surface-2); padding: 10px; }
.picker__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.picker__list { max-height: 228px; overflow: auto; background: var(--surface);
                border: 1px solid var(--border); border-radius: var(--radius-sm); }
.picker__row { display: flex; align-items: center; gap: 9px; padding: 7px 10px;
               border-bottom: 1px solid var(--border); font-size: 13px; }
.picker__row:last-child { border-bottom: 0; }
.picker__row:hover { background: var(--surface-2); }
.picker__row label { display: flex; align-items: center; gap: 9px;
                     flex: 1; min-width: 0; cursor: pointer; }
.picker__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__count { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.picker__foot { display: flex; align-items: center; justify-content: space-between;
               gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); font-size: 12px; }

.quick-add { margin-top: 10px; }
.quick-add textarea { min-height: 92px; }

/* ============================================================
   首页（开始练习）与练习管理页
   ============================================================ */
/* 左列「开始练习」为主列，右列（快捷入口 + 最近练习）为辅列并稍窄；两列顶部对齐 */
.home-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.home-side { display: grid; gap: 14px; align-content: start; min-width: 0; }

/* 首页快捷入口：题库 / 错题本 / 学习统计 / 练习管理，替代顶部导航里的独立入口 */
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
/* 放进右列时收成 2×2，压在「最近练习」上方 */
.quick-links--side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 0; }
.quick-links--side .quick-link { padding: 12px 13px; gap: 10px; }
.quick-links--side .quick-link__icon { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.quick-links--side .quick-link__arrow { font-size: 13px; }
.quick-link {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.quick-link:hover { border-color: var(--primary); box-shadow: 0 6px 20px rgba(59, 110, 245, .12); transform: translateY(-1px); }
.quick-link__icon {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; font-size: 15px; font-weight: 700;
}
.quick-link__icon--bank { background: var(--warn-soft); color: var(--warn); }
.quick-link__icon--book { background: var(--danger-soft); color: var(--danger); }
.quick-link__icon--stats { background: var(--primary-soft); color: var(--primary); }
.quick-link__icon--sessions { background: var(--success-soft); color: var(--success); }
.quick-link__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick-link__body b { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.quick-link__body small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-link__arrow { margin-left: auto; color: var(--muted); font-size: 15px; }

/* 首页最近练习：整行可点的精简列表，只展示 5 条 */
.session-list { display: flex; flex-direction: column; }
.session-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 4px;
  border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: background .15s;
}
.session-row:last-child { border-bottom: 0; }
.session-row:hover { background: var(--surface-2); }
.session-row__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.session-row__title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-row__meta { font-size: 12px; color: var(--muted); }
.session-row__go { margin-left: auto; flex: none; color: var(--primary); font-size: 12.5px; white-space: nowrap; }
.card__foot--link { padding: 0; }
.more-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; color: var(--primary); font-size: 13px; text-decoration: none;
}
.more-link:hover { background: var(--primary-soft); }

/* 练习管理：操作列里的成绩 / 继续 + 删除 */
.row-actions { display: inline-flex; align-items: center; gap: 4px; }
.row-actions .btn--plain { color: var(--danger); }
/* 「题数」列：表头默认靠左、数值单元格 .num 靠右，数字被挤到列右侧离表头很远。
   统一居中让数字落在表头正下方（沿用 .col-score / .col-no 的居中约定）。 */
table.table--sessions th.col-count,
table.table--sessions td.num.col-count { text-align: center; }
/* 「操作」列：原先整列带淡蓝底 + 深色竖线，还自动分走约 1/3 表格宽度，按钮右侧空一大片。
   改为与数据行同色、列宽紧贴按钮并右对齐，剩余宽度交给「模式」列。 */
table.table--sessions th.col-sticky-right,
table.table--sessions td.col-sticky-right {
  width: 1%; white-space: nowrap; text-align: right;
  padding-left: 6px; padding-right: 12px; box-shadow: none;
}
table.table--sessions td.col-sticky-right { background: var(--surface); }
table.table--sessions th.col-sticky-right { background: var(--surface-2); }
table.table--sessions tbody tr:hover td.col-sticky-right { background: var(--surface-2); }
table.table--sessions tbody tr.is-selected td.col-sticky-right,
table.table--sessions tbody tr.is-selected:hover td.col-sticky-right { background: var(--primary-soft); }
table.table--sessions td { vertical-align: middle; }
table.table--sessions td.col-sticky-right .row-actions { justify-content: flex-end; gap: 6px; }
table.table--sessions .row-actions .btn--plain:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------------- 共享题库顶部：合并分层、去掉标签行与查询按钮 ----------------
   原来是「灰底标题栏 → 分段控件 → 分隔线 → 三行标签 + 描边输入框 + 实心按钮」四层，
   现在只保留卡片自身一个外框：标题与分段同一行，筛选压成一行，输入即筛无需按钮。 */
.card--community { position: relative; padding: 14px 18px 16px; }
.card--community .community-progress { position: absolute; left: 0; right: 0; bottom: 0; }
.card--community .community-bar__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap;
}
.card--community .community-bar__title { display: inline-flex; align-items: center; gap: 8px; }
.card--community .community-bar__title h2 { font-size: 15px; }

/* 分段控件不再是灰底描边胶囊：两个轻量文字标签即可 */
.card--community .seg { padding: 0; gap: 4px; border: 0; background: transparent; }
.card--community .seg__btn { padding: 6px 12px; border-radius: 8px; }
.card--community .seg__btn.is-active { background: var(--primary-soft); box-shadow: none; }

/* 筛选行：搜索 + 分类 + 排序共用浅底控件，无标签行、无描边、无提交按钮 */
.card--community .community-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card--community .community-field {
  display: flex; align-items: center; min-width: 0; height: 36px;
  border: 1px solid transparent; border-radius: 9px; background: var(--bg-soft);
}
.card--community .community-field:focus-within { background: var(--surface); border-color: var(--border-strong); }
.card--community .community-field--search { flex: 1 1 240px; }
.card--community .community-field--search:focus-within { border-color: var(--primary); }
.card--community .community-field--search input[type="text"] {
  width: 100%; height: 100%; padding: 0 10px 0 32px;
  border: 0; border-radius: 0; background-color: transparent; color: var(--text); font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a97a8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; box-shadow: none;
}
.card--community .community-field--select { flex: 0 1 156px; padding-left: 10px; }
.card--community .community-field__label { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.card--community .community-field select {
  flex: 1 1 auto; min-width: 0; width: auto;
  appearance: none; -webkit-appearance: none;
  border: 0; border-radius: 0; background-color: transparent; color: var(--text);
  font-size: 13px; padding: 6px 22px 6px 6px; cursor: pointer;
  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='%238a97a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; box-shadow: none;
}
.card--community .community-field input:focus,
.card--community .community-field select:focus { border: 0; box-shadow: none; }

/* 「我的题库」「错题本」复用同一套顶部风格：标题、范围标签、操作按钮共一行，操作按钮靠右。
   我的题库筛选行比共享题库多一个「公开」下拉；错题本多一个「状态」下拉与重置文字按钮。 */
.card--bank .community-bar__top, .card--book .community-bar__top { justify-content: flex-start; }
.card--bank .community-bar__title, .card--book .community-bar__title { flex: 0 0 auto; }
.card--bank #scope-seg, .card--book #tabs { flex: 0 0 auto; }
.card--bank .head-actions, .card--book .head-actions { margin-left: auto; }
/* 「我的题库」新增 AI 入口后按钮变多：窄屏允许换行，避免挤出卡片 */
.card--bank .head-actions { flex-wrap: wrap; justify-content: flex-end; }
.card--bank .community-field--select { flex: 0 1 148px; }
.card--book .community-field--select { flex: 0 1 132px; }
.card--book .bk-reset { flex: 0 0 auto; }

/* ---------------- 开始练习：去框，改用留白 / 浅底色 / 字重分层 ----------------
   原来卡片里套「picker 框 → 列表框 → 每行横线 → 更多选项框」，层层描边显得零碎。
   现在只保留卡片本身一个外框，内部靠一个浅色列表块和两条极淡的分隔线分区。 */
/* 开始练习的白底标题栏已提升为 .card__head 全局默认，这里只保留正文留白；
   题库选择器上方的「题库」标签已移除，搜索框自带 placeholder / aria-label */
.card--practice .card__body { padding: 18px 20px 20px; }

.card--practice .picker { border: 0; border-radius: 0; background: transparent; padding: 0; }

/* 搜索行：输入框浅底无描边（带放大镜），辅助操作改文字按钮，只留「搜索」一个淡蓝按钮 */
.card--practice .picker__head { gap: 6px; margin-bottom: 10px; }
.card--practice .picker__head input[type="text"] {
  padding-left: 32px; border-color: transparent; background-color: var(--bg-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a97a8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}
.card--practice .picker__head input[type="text"]:focus { background-color: var(--surface); border-color: var(--primary); }
.card--practice .picker__head .btn { padding: 6px 9px; border-color: transparent; background: transparent; color: var(--text-2); }
.card--practice .picker__head .btn--soft { background: var(--primary-soft); color: var(--primary); }
.card--practice .picker__head .btn:hover { background: var(--bg-soft); color: var(--text); }
.card--practice .picker__head .btn--soft:hover { background: #dbe8ff; color: var(--primary-dark); }

/* 列表：一个浅色圆角块，行之间不画横线，选中行整行淡蓝高亮。
   每页固定 8 条，高度随内容自然撑开，本页一次看全，不再出现内部滚动条 */
.card--practice .picker__list {
  padding: 4px; border: 0; border-radius: 10px; background: var(--surface-2);
  max-height: none; overflow: visible;
}
.card--practice .picker__row { border: 0; border-radius: 7px; padding: 8px 10px; transition: background .15s; }
.card--practice .picker__row:hover { background: rgba(59, 110, 245, .07); }
.card--practice .picker__row.is-selected { background: var(--primary-soft); }
.card--practice .picker__row.is-selected .picker__name { color: var(--primary-dark); font-weight: 600; }

/* 底部状态与分页：去掉两个描边按钮，只留轻量文字按钮 */
.card--practice .picker__foot { margin-top: 10px; color: var(--muted); }
.card--practice .picker__foot #bp-count { color: var(--text-2); }
.card--practice .picker__foot .pager { gap: 4px; padding-top: 0; font-size: 12px; }
.card--practice .picker__foot .pager .btn { padding: 4px 8px; border-color: transparent; background: transparent; color: var(--text-2); }
.card--practice .picker__foot .pager .btn:hover:not(:disabled) { background: var(--bg-soft); color: var(--text); }
.card--practice .picker__foot .pager .btn:disabled { opacity: .35; }

/* 「更多选项」不再是一个独立描边盒子，只留顶部一条分隔线 */
.card--practice .more-options { margin-top: 18px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.card--practice .more-options > summary { padding: 12px 2px; }
.card--practice .more-options__body { padding: 0 2px 6px; border-top: 0; }
.card--practice .opt-group { border: 0; border-radius: 10px; background: var(--surface-2); }


/* ============================================================
   桌面端优化：移动版已独立到 /m/，PC 不再迁就小屏
   —— 顶栏常驻全功能导航、列表化信息密度、键盘可达与快捷键
   ============================================================ */
/* 键盘焦点：鼠标点击不显示，Tab 导航时清晰可见 */
a:focus-visible, button:focus-visible, summary:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 题库 / 共享题库：移动端式的大卡片流改成桌面行式列表。
   一屏可看 8~10 个题库，名称、描述、统计与操作按钮落在同一行。 */
.bank-grid { display: flex; flex-direction: column; gap: 0; margin: -6px -18px -8px; }
.bank-grid .bank-card {
  display: flex; flex-direction: row; align-items: center;
  min-height: 0; margin: 0; padding: 0 18px;
  border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; box-shadow: none;
  transition: background .12s;
}
.bank-grid .bank-card:last-child { border-bottom: 0; }
.bank-grid .bank-card:hover { background: var(--surface-2); }
.bank-grid .bank-card.is-deleted { background: var(--surface-2); opacity: .78; }
.bank-grid .bank-card > .card__body { padding: 10px 0; }
.bank-grid .bank-card > .card__body:first-child {
  flex: 1 1 auto; min-width: 0;
  display: grid; grid-template-columns: minmax(0, .55fr) minmax(0, 1fr);
  align-items: center; gap: 2px 14px;
}
.bank-grid .bank-card__title {
  grid-column: 1 / -1; min-width: 0; flex-wrap: nowrap;
  white-space: nowrap; overflow: hidden; font-size: 14px;
}
.bank-grid .bank-card__title .badge { flex: none; }
.bank-grid .bank-card__desc {
  display: block; min-height: 0; margin: 0; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-line-clamp: unset;
}
.bank-grid .bank-card__meta {
  flex-wrap: nowrap; overflow: hidden; white-space: nowrap;
  gap: 10px; font-size: 11.5px;
}
.bank-grid .bank-card__meta > span { min-width: 0; }
.bank-grid .bank-card > .bank-card__side {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  padding: 10px 0 10px 16px; border-left: 1px solid var(--border);
}
.bank-grid .bank-card__stats {
  margin: 0; padding: 0; border: 0; gap: 12px;
  white-space: nowrap; font-size: 11.5px;
}
.bank-grid .bank-card__stats b { font-size: 13px; }
.bank-grid .bank-card__actions { padding: 0; flex-wrap: nowrap; gap: 6px; }

/* 答题页快捷键提示（PC 专属，键盘操作不必记忆） */
.shortcut-hint {
  margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 11.5px; line-height: 1.9; color: var(--muted);
}
.shortcut-hint kbd {
  display: inline-block; min-width: 17px; padding: 0 4px; margin: 0 1px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface-2); font: 11px/1.6 var(--mono);
  text-align: center; color: var(--text-2);
}

/* ============================================================
   题库详情 / 题目管理：桌面化重设计
   原来三张等宽卡片堆叠（标题卡 / 筛选卡 / 列表卡），留白多、层级弱。
   现在是一张信息头 + 一张列表卡：筛选与批量操作各占一行，宽度让给题干。
   ============================================================ */
.q-hero__top {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.q-hero__back {
  border: 0; background: transparent; color: var(--text-2);
  font-size: 12.5px; padding: 2px 0; cursor: pointer;
}
.q-hero__back:hover { color: var(--primary); }
.q-hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 12px; white-space: nowrap;
}
.q-hero__badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.q-hero__badge.is-public { background: var(--success-soft); color: var(--success); border-color: transparent; }
.q-hero__id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.q-hero__main {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 16px 18px 18px;
}
.q-hero__ident { min-width: 0; }
.q-hero__ident h1 { font-size: 21px; font-weight: 650; letter-spacing: -.2px; line-height: 1.35; }
.q-hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  margin-top: 6px; font-size: 12.5px; color: var(--text-2);
}
.q-hero__meta i { font-style: normal; color: var(--border-strong); }
.q-hero__meta b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.q-hero__desc { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); }
.q-hero__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; padding-top: 3px; }
.q-hero__actions .btn { white-space: nowrap; }

.q-quick {
  padding: 13px 18px 15px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.q-quick__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.q-quick__head strong { font-size: 13.5px; }
.q-quick__head span { font-size: 12.5px; color: var(--muted); }
.q-quick textarea { width: 100%; min-height: 82px; resize: vertical; }
.q-quick__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px;
}

.q-filters {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.q-field {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.q-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 110, 245, .12); }
.q-field__label { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.q-field select, .q-field input {
  height: 30px; padding: 0; border: 0; outline: none; box-shadow: none;
  background: transparent; color: var(--text); font-size: 13px;
}
.q-field select {
  min-width: 68px; padding-right: 16px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%3E%3Cpath%20d='M2.5%204.5%206%208l3.5-3.5'%20fill='none'%20stroke='%23536171'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center; background-size: 12px 12px;
}
.q-field--search { flex: 1 1 240px; max-width: 320px; }
.q-field--search input { flex: 1 1 auto; min-width: 0; }
.q-filters__hint { font-size: 12px; color: var(--muted); white-space: nowrap; }

.q-list__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 14px; transition: background .15s;
}
.q-list__head.has-selection { background: var(--primary-soft); }
.q-list__title { display: flex; align-items: center; gap: 10px; }
.q-list__title h2 { font-size: 15px; }
.q-count {
  padding: 2px 9px; border-radius: 999px; background: var(--bg-soft);
  color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.q-bulk { display: flex; align-items: center; gap: 12px; }
.q-bulk .check-row { font-size: 12.5px; }
.q-bulk__info { min-width: 78px; font-size: 12.5px; color: var(--text-2); }
.q-list .card__foot .pager { padding-top: 0; }

/* 题目表：固定列宽把空间让给题干；列宽已固定、不会横向滚动，
   因此不再用 sticky 固定列（也就没有原操作列那块突兀的独立底色与竖线）。 */
table.table.q-table { table-layout: fixed; }
table.table.q-table th, table.table.q-table td { padding: 9px 12px; vertical-align: middle; }
table.table.q-table tbody tr { cursor: pointer; }
table.table.q-table th.q-th-center, table.table.q-table td.q-num,
table.table.q-table td.q-score { text-align: center; }
table.table.q-table th.q-th-right { text-align: right; }
table.table.q-table td.q-num {
  color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
table.table.q-table td.q-score { color: var(--text-2); font-variant-numeric: tabular-nums; }
.q-type {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: var(--bg-soft); color: var(--text-2); font-size: 12px; white-space: nowrap;
}
.q-stem { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-origin {
  margin-top: 1px; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.q-diff { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.q-diff i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.q-diff.is-easy i { background: var(--success); }
.q-diff.is-mid i { background: var(--warn); }
.q-diff.is-hard i { background: var(--danger); }
table.table.q-table td.q-actions { text-align: right; white-space: nowrap; }
.q-act {
  padding: 4px 8px; border: 0; border-radius: 5px;
  background: transparent; color: var(--primary); font-size: 12.5px; cursor: pointer;
}
.q-act:hover { background: var(--primary-soft); }
.q-act--danger { color: var(--danger); }
.q-act--danger:hover { background: var(--danger-soft); }

/* ---------------- 错题本：与「共享题库 / 我的题库」同款双卡版式 ----------------
   顶部信息卡（标题 + 范围 + 操作 + 浅底筛选行）与下方列表卡（标题栏 / 行 / 页脚分页）
   共用 .card--community 视觉；行内左侧题干、右侧统计与操作，用一条竖线分区。
   不使用任何徽标 / 标签；笔记默认只显示一行摘要，点击后才展开输入框。 */
.bk-list-box { padding: 0; margin: -6px -18px -8px; }
.bk-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.bk-item:last-child { border-bottom: 0; }
.bk-item:hover { background: var(--surface-2); }
.bk-no {
  flex: 0 0 24px; align-self: flex-start; padding-top: 2px; text-align: right;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.bk-main { flex: 1 1 auto; min-width: 0; }
.bk-stem { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.5;
  color: var(--text); word-break: break-word; }
.bk-item.is-mastered .bk-stem { color: var(--text-2); }
.bk-meta { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-meta i { margin: 0 7px; font-style: normal; color: var(--border-strong); }

/* 右侧栏：统计与时间一行、操作按钮一行，和共享题库右侧对齐 */
.bk-side {
  flex: 0 0 348px; align-self: stretch; justify-content: center;
  display: flex; flex-direction: column; gap: 8px;
  padding-left: 16px; border-left: 1px solid var(--border);
}
.bk-side__info { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bk-stats { display: flex; align-items: baseline; gap: 10px;
  color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.bk-stats b { color: var(--text); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-time { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bk-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.bk-actions .bk-act { padding: 4px 9px; font-size: 12.5px; }
/* 当前状态靠按钮底色表达，不再用徽标 */
.bk-act.is-mastered { background: var(--success-soft); color: var(--success); }
.bk-act.is-mastered:hover { background: #d6f1e6; color: var(--success); }
.bk-act.is-fav { background: var(--warn-soft); color: var(--warn); }
.bk-act.is-fav:hover { background: #ffedcc; color: var(--warn); }
.bk-act--danger { color: var(--muted); }
.bk-act--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 笔记摘要：一条低调的可点文字，不是输入框 */
.bk-note { margin-top: 2px; }
.bk-note__peek {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  max-width: min(560px, 100%); padding: 3px 8px; margin-left: -8px;
  border: 0; border-radius: 5px; background: transparent;
  font-size: 12.5px; line-height: 1.6; text-align: left; cursor: pointer;
}
.bk-note__peek:hover { background: var(--bg-soft); }
.bk-note__k { flex: 0 0 auto; color: var(--muted); }
.bk-note__k--add { color: var(--text-2); }
.bk-note__peek:hover .bk-note__k { color: var(--primary); }
.bk-note__v { min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--text-2); }
.bk-note__peek:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 只有交互后才出现的输入区 */
.bk-item.is-note-open .bk-note__peek { display: none; }
.bk-note__editor { margin-top: 8px; }
.bk-note__editor[hidden] { display: none; }
.bk-note__editor textarea { min-height: 62px; font-size: 13px; }
.bk-note__editor-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.bk-note__hint { margin-right: auto; font-size: 11.5px; color: var(--muted); }

/* ---------------- PC 首页（公开落地页） ----------------
   不依赖任何需认证的接口；只有登录入口，登录后由 app.js 带进应用。 */
.lp { min-height: 100vh; background: linear-gradient(165deg, #f3f7ff 0%, #f8fafc 46%, #eef3fa 100%); }
.lp__bar, .lp__main { width: calc(100% - 48px); max-width: 1080px; margin: 0 auto; }
.lp__bar { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.lp__brand { display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 18px; font-weight: 700; text-decoration: none; }
.lp__mark { width: 36px; height: 36px; flex: none; }
.lp__bar-right { display: flex; align-items: center; gap: 20px; }
.lp__link { color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.lp__link:hover, .lp__ghost:hover, .lp__foot a:hover { color: var(--primary); }

.lp__main { padding: 32px 0 34px; }
.lp__hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 400px);
  gap: 56px; align-items: center; min-height: 380px; }
.lp__eyebrow { display: inline-flex; align-items: center; gap: 8px;
  color: var(--primary); font-size: 12.5px; font-weight: 600; letter-spacing: .5px; }
.lp__eyebrow::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: var(--primary); }
.lp__title { margin: 16px 0 18px; font-size: 46px; line-height: 1.24;
  font-weight: 700; letter-spacing: -1px; color: var(--text); }
.lp__lead { max-width: 470px; margin: 0; font-size: 15.5px; line-height: 1.9; color: var(--text-2); }
.lp__cta { display: flex; align-items: center; gap: 20px; margin-top: 28px; }
.lp__cta .btn { text-decoration: none; }
.lp__ghost { color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.lp__note { margin-top: 24px; font-size: 12.5px; color: var(--muted); }

/* 右侧练习卡示意：纯 CSS，无图片 / 无外部资源 */
.lp__preview { position: relative; padding-bottom: 38px; }
.lp__card { padding: 18px 20px 16px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.lp__card-top { display: flex; align-items: center; justify-content: space-between; }
.lp__card-tag { padding: 2px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; }
.lp__card-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.lp__bar-track { height: 4px; margin-top: 14px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.lp__bar-track i { display: block; width: 30%; height: 100%; border-radius: 4px; background: var(--primary); }
.lp__card-type { margin-top: 18px; color: var(--muted); font-size: 12px; }
.lp__card-q { margin: 6px 0 14px; font-size: 14.5px; font-weight: 600; line-height: 1.6; color: var(--text); }
.lp__card-opt { display: flex; align-items: center; gap: 10px; padding: 8px 11px;
  margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; color: var(--text-2); }
.lp__card-opt b { flex: none; color: var(--muted); font-size: 12px; }
.lp__card-opt span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp__card-opt em { flex: none; font-style: normal; }
.lp__card-opt.is-picked { border-color: #bcd0ff; background: var(--primary-soft); color: var(--primary); }
.lp__card-opt.is-picked b, .lp__card-opt.is-picked em { color: var(--primary); }
.lp__card-foot { display: flex; justify-content: space-between; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.lp__card-foot span:last-child { color: var(--primary); }
.lp__float { position: absolute; right: -6px; bottom: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-size: 12px; color: var(--text-2); }
.lp__float::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.lp__features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-top: 54px; }
.lp__feature { padding: 20px 22px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); }
.lp__feature-no { color: var(--primary); font: 600 12px var(--mono); }
.lp__feature h2 { margin: 10px 0 8px; font-size: 15px; font-weight: 600; }
.lp__feature p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.lp__foot { display: flex; align-items: center; justify-content: space-between;
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); }
.lp__foot a { color: var(--primary); text-decoration: none; }
.lp a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* AI 生成题库弹窗：文件读取状态与错误提示 */
.ai-gen .inline-field > .small { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-gen .hint-box.is-error { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
