/* ============================================================
 * 刷题助手 · 全局样式
 * 纯手写 CSS：变量主题、桌面侧边栏、移动端自适应、卡片 / 过渡 / 图表
 * 无任何外部字体、图片或 CDN 资源。
 * ============================================================ */

/* ---------------- 变量 ---------------- */
:root {
  --bg: #f4f6fb;
  --bg-soft: #eef2f9;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #172033;
  --text-2: #46536b;
  --muted: #8a94a6;
  --border: #e5eaf2;
  --border-strong: #d3dbe8;

  --primary: #2563eb;
  --primary-2: #3b82f6;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf1ff;
  --primary-soft-2: #dbe7ff;

  --green: #16a34a;
  --green-soft: #e9f9ef;
  --red: #dc2626;
  --red-soft: #fdeeee;
  --amber: #d97706;
  --amber-soft: #fff6e4;
  --violet: #7c3aed;
  --teal: #0d9488;
  --yellow: #ca8a04;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --shadow-sm: 0 1px 2px rgba(18, 32, 66, 0.05);
  --shadow: 0 10px 30px -16px rgba(18, 32, 66, 0.22), 0 2px 6px rgba(18, 32, 66, 0.04);
  --shadow-lg: 0 30px 70px -28px rgba(15, 30, 70, 0.42);

  --transition: 180ms cubic-bezier(0.2, 0.7, 0.3, 1);
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

/* ---------------- Reset / 基础 ---------------- */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

::selection { background: var(--primary-soft-2); color: var(--primary-hover); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.muted { color: var(--muted); }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.kbd {
  display: inline-block;
  min-width: 20px;
  padding: 0 5px;
  margin-left: 6px;
  font-family: inherit;
  font-size: 11px;
  line-height: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  text-align: center;
}

.noscript {
  padding: 18px;
  background: var(--amber-soft);
  color: #92400e;
  text-align: center;
  border-bottom: 1px solid #fde68a;
}

/* ---------------- 布局骨架 ---------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: 100vh;
  padding: 22px 16px 18px;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 20px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f8cff 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.75);
}
.brand-logo-sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.brand-text small { font-size: 11.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-item:active { transform: scale(0.985); }
.nav-item.is-active {
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 600;
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-ico { display: inline-flex; width: 20px; height: 20px; color: inherit; }
.nav-ico svg { width: 20px; height: 20px; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 10px;
  font-size: 12px;
  color: var(--muted);
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.conn-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
  transition: background var(--transition), box-shadow var(--transition);
}
.conn-dot.is-online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); }
.conn-dot.is-offline { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }

.conn-mini { display: inline-flex; align-items: center; }
.conn-mini .conn-dot { width: 9px; height: 9px; flex-basis: 9px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.mobile-topbar { display: none; }

.offline-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 24px 0;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  color: #9a3412;
  box-shadow: var(--shadow-sm);
}
.offline-ico { display: inline-flex; width: 22px; height: 22px; flex: 0 0 22px; color: #ea580c; }
.offline-body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.offline-body strong { font-size: 14px; }
.offline-body code {
  padding: 1px 5px;
  background: #ffedd5;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}
.offline-banner .btn { margin-left: auto; flex: 0 0 auto; }

.view {
  flex: 1;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 30px 34px 70px;
  outline: none;
}

/* ---------------- 页面头 ---------------- */
.page { animation: page-in 220ms ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head-text { min-width: 0; }
.page-title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.page-desc { margin-top: 6px; color: var(--muted); font-size: 13.5px; max-width: 720px; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #fff;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition), opacity var(--transition);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .icon { flex: 0 0 auto; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.65);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f8cff, var(--primary-hover));
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.75);
}

.btn-ghost {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); border-color: #b9c5d8; color: var(--text); }

.btn-ghost-danger { background: transparent; border-color: transparent; color: #b91c1c; }
.btn-ghost-danger:hover:not(:disabled) { background: var(--red-soft); border-color: #fecaca; color: var(--red); }

.btn-danger { background: linear-gradient(135deg, #ef4444, var(--red)); color: #fff; }
.btn-danger:hover:not(:disabled) { background: linear-gradient(135deg, #f87171, #b91c1c); }
.btn-danger-ghost { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-soft); }
.btn-success { background: linear-gradient(135deg, #22c55e, var(--green)); color: #fff; }
.btn-success:hover:not(:disabled) { background: linear-gradient(135deg, #4ade80, #15803d); }

.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 5px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn.is-loading { pointer-events: none; opacity: 0.72; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; }

.star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #c3ccdb;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.star-btn:hover { background: #fff8e6; color: var(--yellow); transform: scale(1.06); }
.star-btn.is-on { color: #f59e0b; }
.star-btn.is-on:hover { color: #d97706; }

.flag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #c3ccdb;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.flag-btn:hover { background: var(--red-soft); color: #ef4444; transform: scale(1.06); }
.flag-btn.is-on { color: #dc2626; }
.flag-btn.is-on:hover { color: #b91c1c; }

/* ---------------- 卡片 / 区块标题 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}
.card-title .icon { color: var(--primary); }
.card-meta { font-size: 12px; color: var(--muted); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 2px 12px;
  flex-wrap: wrap;
}
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}
.section-title .icon { color: var(--primary); }
.section-meta { font-size: 12.5px; color: var(--muted); }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--bg-soft);
  color: var(--text-2);
}
.tag-single { background: #eaf1ff; color: #1d4ed8; }
.tag-multiple { background: #f1ebff; color: #6d28d9; }
.tag-judge { background: #e7f8f5; color: #0f766e; }
.tag-fill { background: #fff3dd; color: #b45309; }
.tag-default { background: var(--bg-soft); color: var(--text-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-ok { background: var(--green-soft); color: #15803d; }
.badge-warn { background: var(--amber-soft); color: #b45309; }
.badge-danger { background: var(--red-soft); color: #b91c1c; }

.answer-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--green-soft);
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.answer-chip b { font-weight: 800; }
.answer-chip-empty { background: var(--bg-soft); color: var(--muted); }

.meta-wrong {
  font-size: 12px;
  color: #b91c1c;
  background: var(--red-soft);
  padding: 3px 9px;
  border-radius: 7px;
  white-space: nowrap;
}

/* ---------------- 来源（PDF 文件名 + 页码，全局醒目） ---------------- */
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: #1e40af;
  font-size: 12px;
  line-height: 1.5;
  vertical-align: middle;
}
.source-pill .icon { flex: 0 0 auto; opacity: 0.85; }
.source-name {
  font-weight: 600;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-dot { opacity: 0.5; }
.source-page { font-weight: 800; white-space: nowrap; }
.source-strong {
  background: #e3edff;
  border: 1px solid #c7dbff;
  color: #1e3a8a;
  font-size: 12.5px;
  padding: 5px 11px;
}
.source-strong .source-name { max-width: 340px; }

/* ---------------- Tabs ---------------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: #e9eef7;
  border-radius: 12px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: #fff;
  color: var(--primary-hover);
  box-shadow: var(--shadow-sm);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.14);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
}
.tab.is-active .tab-count { background: var(--primary-soft); }

/* ---------------- Toast ---------------- */
.toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.toast.is-show { opacity: 1; transform: none; }
.toast-success { border-left-color: #22c55e; }
.toast-success .toast-ico { color: #16a34a; }
.toast-error { border-left-color: #ef4444; }
.toast-error .toast-ico { color: var(--red); }
.toast-warn { border-left-color: #f59e0b; }
.toast-warn .toast-ico { color: var(--amber); }
.toast-info { border-left-color: var(--primary); }
.toast-info .toast-ico { color: var(--primary); }
.toast-ico { display: inline-flex; margin-top: 1px; flex: 0 0 auto; }
.toast-msg { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
}
.toast-close:hover { background: var(--bg-soft); color: var(--text); }

/* ---------------- 弹窗 ---------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* 独立确认层：叠在已有弹窗之上，不销毁底层弹窗 */
.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 190ms ease;
}
.modal.is-open { opacity: 1; }
.modal-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(88vh, 900px);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.985);
  transition: transform 210ms cubic-bezier(0.2, 0.8, 0.3, 1);
  outline: none;
  overflow: hidden;
}
.modal.is-open .modal-panel { transform: none; }
.modal-sm { max-width: 430px; }
.modal-md { max-width: 680px; }
.modal-lg { max-width: 940px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-titles { min-width: 0; }
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); word-break: break-word; }
.modal-close { flex: 0 0 auto; margin: -4px -6px 0 0; }
.modal-body { padding: 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--card-soft);
}
.confirm-msg { font-size: 14px; color: var(--text-2); white-space: pre-line; line-height: 1.7; }

body.modal-open { overflow: hidden; }

/* ---------------- 加载 / 骨架 / 空状态 / 错误 ---------------- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2.5px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 30px; height: 30px; border-width: 3px; }
.btn-primary .spinner,
.btn-danger .spinner,
.btn-success .spinner {
  border-color: rgba(255, 255, 255, 0.42);
  border-top-color: #ffffff;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 42px 20px;
  color: var(--muted);
  font-size: 13.5px;
}
.loading-state .icon { color: var(--primary); }

.stage-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 72px 24px;
  text-align: center;
}
.stage-loading h2 { font-size: 17px; font-weight: 700; }
.stage-loading p { color: var(--muted); font-size: 13px; }

.skeleton-list { display: flex; flex-direction: column; gap: 12px; }
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.skeleton-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sk {
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.sk-dot { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; }
.sk-line { height: 11px; margin-bottom: 9px; }
.sk-line:last-child { margin-bottom: 0; }
.sk-block { height: 42px; margin-top: 14px; border-radius: 9px; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-90 { width: 90%; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 54px 28px;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
}
.empty-title { font-size: 17px; font-weight: 700; }
.empty-desc { margin-top: 7px; max-width: 460px; color: var(--muted); font-size: 13.5px; }
.empty-action { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 44px 24px;
  text-align: center;
  color: var(--text-2);
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
}
.error-state .icon { color: var(--red); }
.error-state p { max-width: 560px; color: var(--text-2); font-size: 13.5px; word-break: break-word; }
.error-state-lg { padding: 64px 24px; }

.fatal-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 24px;
  text-align: center;
}
.fatal-state .icon { color: var(--amber); }
.fatal-state h2 { font-size: 20px; }
.fatal-state p { color: var(--muted); max-width: 560px; }

/* ---------------- 分页 ---------------- */
.pager-wrap { margin-top: 18px; }
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-info b { color: var(--text); }
.pager-simple { justify-content: flex-end; }
.pager .icon { opacity: 0.8; }

/* ---------------- 题库：上传 ---------------- */
.upload-card {
  position: relative;
  padding: 26px 24px;
  background: linear-gradient(135deg, #f8fbff, #ffffff 55%);
  border: 2px dashed #c3d5f2;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.upload-card:hover {
  border-color: var(--primary-2);
  background: linear-gradient(135deg, #f2f7ff, #ffffff 60%);
  box-shadow: 0 12px 30px -22px rgba(37, 99, 235, 0.6);
}
.upload-card.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1);
  transform: scale(1.005);
}
.upload-card.is-busy { cursor: default; border-style: solid; border-color: var(--border-strong); background: #fff; }
.upload-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.upload-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e8f0ff, #dbe7ff);
  color: var(--primary);
}
.upload-copy { flex: 1 1 260px; min-width: 0; }
.upload-copy h3 { font-size: 16.5px; font-weight: 700; }
.upload-copy p { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.upload-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.upload-busy { display: flex; align-items: center; gap: 16px; }
.upload-busy-main { flex: 1; min-width: 0; }
.upload-file-name {
  font-size: 14.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-status { margin: 4px 0 9px; font-size: 12.5px; color: var(--primary-hover); }

.progress {
  height: 8px;
  background: #e8eef9;
  border-radius: 999px;
  overflow: hidden;
}
.progress-thin { height: 6px; }
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, var(--primary));
  border-radius: 999px;
  transition: width 260ms ease;
}

/* ---------------- 题库：PDF 卡片 ---------------- */
.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.pdf-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.pdf-card:hover {
  box-shadow: var(--shadow);
  border-color: #d5e1f5;
  transform: translateY(-2px);
}
.pdf-card-head { display: flex; gap: 12px; align-items: flex-start; }
.pdf-file-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: var(--red-soft);
  color: #dc2626;
}
.pdf-card-titles { min-width: 0; flex: 1; }
.pdf-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-card-badges { margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }

.pdf-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 12px;
  background: var(--card-soft);
  border-radius: var(--radius);
}
.pdf-meta > div { min-width: 0; }
.pdf-meta dt { font-size: 11px; color: var(--muted); }
.pdf-meta dd {
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-meta-strong { color: var(--primary-hover) !important; }

.pdf-warnings {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #92400e;
  font-size: 12px;
  line-height: 1.55;
}
.pdf-warnings > .icon { flex: 0 0 auto; margin-top: 1px; color: var(--amber); }
.pdf-warnings-list p + p { margin-top: 3px; }
.pdf-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: #b91c1c;
  font-size: 12px;
  word-break: break-word;
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 2px;
}
.pdf-actions .btn { flex: 0 0 auto; white-space: nowrap; }

/* ---------------- 工具栏 / 筛选 ---------------- */
.toolbar { padding: 12px 14px; margin-bottom: 16px; }
.toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1 1 auto; }
.toolbar-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-2);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.select-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.select-wrap > .icon { flex: 0 0 auto; color: var(--muted); pointer-events: none; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 4px 0 0;
  min-width: 120px;
  max-width: 260px;
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.select-block { display: flex; width: 100%; }
.select-block select { flex: 1; min-width: 0; max-width: none; width: 100%; }

.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 380px;
  min-height: 38px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.search-wrap > .icon { color: var(--muted); flex: 0 0 auto; }
.search-wrap input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
}
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
}
.search-wrap.has-value .search-clear { display: inline-flex; }
.search-clear:hover { color: var(--text); background: #e3e9f4; }

.chip-toggle { display: inline-flex; align-items: center; cursor: pointer; user-select: none; }
.chip-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.chip-toggle:hover .chip { background: var(--bg-soft); }
.chip-toggle input:focus-visible + .chip { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip-toggle input:checked + .chip {
  background: var(--primary-soft);
  border-color: #bcd3ff;
  color: var(--primary-hover);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.06);
}
.chip-toggle input:checked + .chip .icon { color: var(--primary); }

/* ---------------- 题库：题目列表 ---------------- */
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.q-row:hover {
  border-color: #d5e1f5;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.q-row-body { flex: 1; min-width: 0; }
.q-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-seq {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.q-row-top .star-btn { margin-left: auto; }
.q-row-top .flag-btn { margin-left: -2px; }
.meta-toggles { display: inline-flex; align-items: center; gap: 1px; flex: 0 0 auto; }
.meta-toggle { color: var(--muted); }
.meta-toggle.is-on-fav { color: #f59e0b; background: #fff8e6; }
.meta-toggle.is-on-flag { color: #dc2626; background: var(--red-soft); }
.meta-toggle:hover { background: var(--bg-soft); }
.q-stem {
  font-size: 14.5px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}
.q-stem-btn {
  display: block;
  width: 100%;
  margin: 7px 0 9px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition);
}
.q-stem-btn:hover { color: var(--primary-hover); }
.q-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-row-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.q-row-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.pdf-name,
.q-stem-btn { word-break: break-word; }

/* ---------------- 题目详情 / 原题 / 编辑表单 ---------------- */
.q-detail { display: flex; flex-direction: column; gap: 14px; }
.q-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-detail-seq { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.q-detail-stem {
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 500;
  padding: 14px 16px;
  background: var(--card-soft);
  border-left: 3px solid var(--primary-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.detail-options { display: flex; flex-direction: column; gap: 7px; }
.detail-options li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 12px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.6;
}
.detail-options-sm li { padding: 6px 10px; font-size: 12.5px; }
.detail-opt-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 800;
}
.detail-opt-text { flex: 1; min-width: 0; word-break: break-word; }
.detail-label {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  margin-right: 8px;
  white-space: nowrap;
}
.answer-value {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 7px;
  background: var(--green-soft);
  color: #15803d;
  font-size: 14px;
  font-weight: 800;
}
.q-detail-answer,
.wrong-answer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.q-detail-explain,
.wrong-explain {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}
.q-detail-explain .pre-wrap,
.wrong-explain .pre-wrap { margin-top: 4px; flex: 1; min-width: 0; }
.q-detail-extra {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}
.raw-details {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.raw-details summary { cursor: pointer; user-select: none; }
.raw-text {
  margin: 10px 0 0;
  padding: 12px;
  max-height: 260px;
  overflow: auto;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
}

.original-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.original-tip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.original-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 12px;
  background: #f1f5fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
.original-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px -14px rgba(15, 30, 70, 0.35);
  background: #fff;
}
.img-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.img-error .icon { color: var(--muted); }

.edit-form { display: flex; flex-direction: column; gap: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}
.field-hint { font-size: 11.5px; color: var(--muted); }
.field-hint-inline { font-weight: 500; color: var(--muted); }
.field input[type="text"],
.field textarea,
.edit-form input[type="text"],
.edit-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input[type="text"]:focus,
.field textarea:focus,
.edit-form input[type="text"]:focus,
.edit-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.opt-edit-list { display: flex; flex-direction: column; gap: 8px; }
.opt-edit-row { display: flex; align-items: center; gap: 8px; }
.opt-key-input {
  width: 42px !important;
  flex: 0 0 42px;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  padding: 9px 4px !important;
}
.opt-text-input { flex: 1; min-width: 0; }
.opt-edit-actions { margin-top: 8px; }
.quick-answers { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-answer { min-width: 72px; }
.form-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--muted);
}
.form-note .icon { color: var(--muted); }

/* ---------------- 刷题：设置 ---------------- */
.practice-stage { display: block; }
.setup-overview {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 11px 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  color: var(--text-2);
}
.setup-overview .icon { color: var(--primary); }
.setup-overview b { color: var(--text); font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.setup-overview-loading { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}
.setup-card { padding: 20px 22px 22px; }
.mode-grid { display: flex; flex-direction: column; gap: 8px; }
.mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.mode-card:hover { border-color: #c9d8f2; background: #fbfcff; }
.mode-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.mode-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.mode-card.is-active .mode-ico { background: #fff; color: var(--primary); }
.mode-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mode-text b { font-size: 13.5px; font-weight: 700; color: var(--text); }
.mode-text small { font-size: 11.5px; color: var(--muted); }
.mode-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  color: transparent;
  transition: all var(--transition);
}
.mode-card.is-active .mode-check { background: var(--primary); border-color: var(--primary); color: #fff; }

.setup-pdf-field { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.setup-chapter-field { margin-top: 14px; }
.setup-card .field + .switch-row { margin-top: 16px; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.chip-btn:hover { background: var(--bg-soft); }
.chip-btn.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
  font-weight: 700;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--border);
}
.switch-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.switch-label { font-size: 13px; font-weight: 700; }
.switch-desc { font-size: 11.5px; color: var(--muted); }
.switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: #d5dce8;
  transition: background var(--transition);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 30, 70, 0.25);
  transition: transform var(--transition);
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

.setup-avail {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.setup-avail.is-ok { background: var(--green-soft); border-color: #c9f0d6; color: #15803d; }
.setup-avail.is-empty { background: var(--amber-soft); border-color: #fde3ae; color: #92400e; }
.setup-avail a { font-weight: 700; }
.setup-avail b { font-size: 14px; }
.setup-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------------- 刷题：作答 ---------------- */
.session-page { display: flex; flex-direction: column; gap: 14px; }
.session-bar { padding: 14px 18px; }
.session-bar-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.session-count { font-size: 14px; font-weight: 700; }
.session-count b { color: var(--primary-hover); font-size: 16px; }
.session-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}
.session-stat .icon { color: var(--muted); }
.session-stat b { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.session-mode {
  padding: 3px 10px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 11.5px;
  font-weight: 700;
}

.session-nav-btn { padding: 0 10px; }
.nav-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.nav-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.nav-dot { display: inline-block; width: 14px; height: 14px; border-radius: 5px; border: 1px solid var(--border-strong); background: #fff; }
.nav-dot.is-current { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22); }
.nav-dot.is-correct { background: var(--green-soft); border-color: #86efac; }
.nav-dot.is-wrong { background: var(--red-soft); border-color: #fca5a5; }
.nav-dot.is-pending { background: #eef2fb; border-color: #c7d7f2; }
.nav-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.nav-cell {
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-cell:hover { border-color: var(--primary); color: var(--primary-hover); background: #f6faff; }
.nav-cell.is-correct { background: var(--green-soft); border-color: #86efac; color: #15803d; }
.nav-cell.is-wrong { background: var(--red-soft); border-color: #fca5a5; color: #b91c1c; }
.nav-cell.is-pending { background: #eef2fb; border-color: #c7d7f2; color: #35507a; }
.nav-cell.is-current { box-shadow: 0 0 0 2px var(--primary); border-color: var(--primary); color: var(--primary-hover); }
.nav-jump { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.nav-jump-label { font-size: 12.5px; color: var(--text-2); }
.nav-input {
  width: 84px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.question-card { padding: 24px 26px 22px; }
.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.q-meta-hint { font-size: 11.5px; color: var(--muted); }
.question-source { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.question-source .source-name { max-width: 200px; }
.q-stem-lg {
  font-size: 17.5px;
  line-height: 1.75;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 20px;
}
.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.options-multiple .option-key { border-radius: 6px; }
.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.option-card:hover { border-color: #b9cdf3; background: #fbfdff; }
.option-card:active { transform: scale(0.995); }
.option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 800;
  transition: all var(--transition);
}
.option-text { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.option-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  color: transparent;
  transition: all var(--transition);
}
.option-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.option-card.is-selected .option-key { background: var(--primary); border-color: var(--primary); color: #fff; }
.option-card.is-selected .option-check { border-color: var(--primary); background: var(--primary); color: #fff; }
.options.is-locked .option-card { cursor: default; }
.options.is-locked .option-card:hover { transform: none; }
.option-card.is-correct {
  border-color: #22c55e !important;
  background: var(--green-soft) !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}
.option-card.is-correct .option-key { background: #22c55e; border-color: #22c55e; color: #fff; }
.option-card.is-correct .option-check { border-color: #16a34a; background: #16a34a; color: #fff; }
.option-card.is-wrong {
  border-color: #ef4444 !important;
  background: var(--red-soft) !important;
}
.option-card.is-wrong .option-key { background: #ef4444; border-color: #ef4444; color: #fff; }
.option-card.is-wrong .option-check { border-color: #dc2626; background: #dc2626; color: #fff; }

.options-judge { flex-direction: row; gap: 12px; }
.options-judge .option-card { flex: 1 1 0; justify-content: center; padding: 18px 16px; }
.options-judge .option-text { flex: 0 0 auto; font-size: 16px; font-weight: 700; }
.judge-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 34px;
}
.judge-true { background: var(--green-soft); color: #16a34a; }
.judge-false { background: var(--red-soft); color: var(--red); }
.options-judge .option-card.is-selected .judge-ico { background: rgba(255, 255, 255, 0.85); }

.fill-wrap { margin-bottom: 18px; }
.fill-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 13px;
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.fill-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.fill-input:disabled { background: var(--card-soft); color: var(--muted); }

.options-empty {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid #fde3ae;
  color: #92400e;
  font-size: 13px;
}
.options-empty .icon { flex: 0 0 auto; margin-top: 1px; }

.feedback-wrap { display: none; margin-bottom: 18px; }
.feedback-wrap.is-visible { display: block; animation: feedback-in 240ms ease both; }
@keyframes feedback-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.feedback {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feedback-correct { background: linear-gradient(135deg, #f2fdf6, #eafaf0); border-color: #b9edc9; }
.feedback-wrong { background: linear-gradient(135deg, #fff6f6, #fdeeee); border-color: #fbcfcf; }
.feedback-self { background: linear-gradient(135deg, #fffbeb, #fff6e4); border-color: #fde3ae; }
.feedback-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--text);
}
.feedback-correct .feedback-head { color: #15803d; }
.feedback-wrong .feedback-head { color: #b91c1c; }
.feedback-self .feedback-head { color: #92400e; }
.feedback-head strong { font-weight: 800; }
.feedback-answer { font-size: 13.5px; color: var(--text-2); }
.feedback-answer b { color: var(--text); font-weight: 800; }
.feedback-explain { font-size: 13px; line-height: 1.7; color: var(--text-2); }
.feedback-explain .detail-label { display: block; margin-bottom: 3px; }
.feedback-desc { font-size: 13px; line-height: 1.7; color: var(--text-2); }
.feedback-desc.muted { color: var(--muted); }
.feedback-source {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.feedback-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #b45309;
}
.self-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.question-progress-hint { font-size: 12.5px; color: var(--muted); }
.question-progress-hint b { color: var(--text); }
.action-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--amber);
}
.session-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------------- 刷题：成绩单 ---------------- */
.report-page { display: flex; flex-direction: column; gap: 18px; }
.report-hero {
  padding: 24px 26px;
  background: linear-gradient(135deg, #ffffff, #f3f7ff 55%, #eef4ff);
  border-color: #dbe7ff;
}
.report-hero-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.report-trophy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7e0, #ffe9b5);
  color: #b45309;
  box-shadow: 0 10px 24px -14px rgba(180, 83, 9, 0.6);
}
.report-hero-text { flex: 1; min-width: 0; }
.report-hero-text h2 { font-size: 20px; font-weight: 700; }
.report-hero-text p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.report-acc {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  margin-left: auto;
}
.report-acc b { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary-hover); font-variant-numeric: tabular-nums; }
.report-acc span { font-size: 12px; color: var(--muted); }
.report-overall {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed #cdddf7;
  font-size: 12.5px;
  color: var(--text-2);
}
.report-overall .icon { color: var(--primary); }
.report-overall b { color: var(--primary-hover); font-weight: 800; font-variant-numeric: tabular-nums; }
.accuracy-track {
  height: 10px;
  margin: 18px 0 16px;
  background: #e3ecfc;
  border-radius: 999px;
  overflow: hidden;
}
.accuracy-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.accuracy-fill.is-great { background: linear-gradient(90deg, #34d399, #16a34a); }
.accuracy-fill.is-ok { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.accuracy-fill.is-low { background: linear-gradient(90deg, #fbbf24, #f97316); }
.report-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.report-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e1eafb;
  border-radius: 12px;
}
.report-num b { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.report-num span { font-size: 11.5px; color: var(--muted); }
.report-num.is-green b { color: #15803d; }
.report-num.is-red b { color: #b91c1c; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.review-section { display: flex; flex-direction: column; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.review-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-stem { font-size: 15px; font-weight: 600; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.review-answer { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13.5px; }
.review-answer b { color: #15803d; font-weight: 800; padding: 1px 8px; background: var(--green-soft); border-radius: 6px; }
.review-explain { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.review-explain .detail-label { display: block; margin-bottom: 3px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }

/* ---------------- 错题本 ---------------- */
.wrong-list { display: flex; flex-direction: column; gap: 12px; }
.wrong-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-left: 3px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.wrong-card:hover { box-shadow: var(--shadow); }
.wrong-card.is-mastered { opacity: 0.72; border-left-color: #22c55e; }
.wrong-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wrong-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--red-soft);
  color: #b91c1c;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.mastered-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--green-soft);
  color: #15803d;
  font-size: 11.5px;
  font-weight: 700;
}
.wrong-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f7faff;
  border: 1px solid #e3edff;
  border-radius: 11px;
}
.wrong-source-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-hover);
  letter-spacing: 0.02em;
}
.wrong-stem { font-size: 15.5px; font-weight: 600; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.wrong-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; border-top: 1px dashed var(--border); padding-top: 12px; }
.mastered-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #15803d; }

/* ---------------- 统计 ---------------- */
.stats-body { display: flex; flex-direction: column; gap: 18px; }
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}
@media (min-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card.is-clickable { cursor: pointer; }
.stat-card.is-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d5e1f5; }
.stat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}
.stat-violet .stat-ico { background: #f1ebff; color: var(--violet); }
.stat-teal .stat-ico { background: #e7f8f5; color: var(--teal); }
.stat-amber .stat-ico { background: var(--amber-soft); color: var(--amber); }
.stat-green .stat-ico { background: var(--green-soft); color: var(--green); }
.stat-red .stat-ico { background: var(--red-soft); color: var(--red); }
.stat-yellow .stat-ico { background: #fdf6e3; color: var(--yellow); }
.stat-text { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.stat-arrow { margin-left: auto; color: var(--muted); opacity: 0.6; }
.stat-card-skeleton { display: block; padding: 16px; }
.stat-card-skeleton .sk-line { margin-bottom: 10px; }

.stats-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 18px; }
.chart-card { padding: 20px 22px; }
.bar-chart { display: flex; flex-direction: column; gap: 15px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bar-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bar-acc { font-size: 13px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { height: 9px; background: #edf1f8; border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  transition: width 700ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.bar-fill.is-good { background: linear-gradient(90deg, #4ade80, #16a34a); }
.bar-fill.is-mid { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.bar-fill.is-low { background: linear-gradient(90deg, #fbbf24, #f97316); }
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.chart-empty .icon { color: #c3ccdb; }
.chart-empty-sm { padding: 22px 16px; }

.day-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 2px 0;
  height: 196px;
}
.day-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.day-bar-space {
  position: relative;
  width: 100%;
  height: 148px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.day-bar {
  position: relative;
  width: min(34px, 72%);
  min-height: 2px;
  border-radius: 7px 7px 3px 3px;
  background: #dbeafe;
  overflow: hidden;
  transition: height 600ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.day-bar.is-empty { background: #e9eef6; }
.day-bar-correct {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-radius: 7px 7px 0 0;
  transition: height 600ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
.day-count {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.day-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.legend-correct { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.legend-attempt { background: #dbeafe; }

.session-list { display: flex; flex-direction: column; }
.session-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1.2fr) minmax(0, 0.8fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.session-row:last-child { border-bottom: none; }
.session-mode {
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.session-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.session-nums { color: var(--text-2); font-weight: 600; }
.session-duration { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
.accuracy-badge {
  justify-self: end;
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.accuracy-badge.is-good { background: var(--green-soft); color: #15803d; }
.accuracy-badge.is-mid { background: var(--primary-soft); color: var(--primary-hover); }
.accuracy-badge.is-low { background: var(--amber-soft); color: #b45309; }
.sessions-card { padding-bottom: 14px; }

/* ---------------- 滚动条 ---------------- */
* { scrollbar-width: thin; scrollbar-color: #c7d2e4 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c7d2e4; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #aab8d0; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .view { padding: 26px 26px 70px; }
  .setup-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  /* iPad / iPhone：输入框字号不小于 16px，避免 Safari 聚焦时自动放大页面 */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 -8px 24px -18px rgba(18, 32, 66, 0.3);
    z-index: 60;
  }
  .sidebar .brand,
  .sidebar .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 2px; margin: 0; }
  .nav-item {
    flex: 1 1 0;
    flex-direction: column;
    gap: 2px;
    padding: 7px 4px;
    font-size: 11px;
    border-radius: 10px;
    text-align: center;
  }
  .nav-item.is-active::before { display: none; }
  .nav-ico svg { width: 21px; height: 21px; }
  .nav-label { font-size: 10.5px; }

  .main { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .brand-mini {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
  }
  .brand-mini:hover { text-decoration: none; }
  .brand-mini strong { font-size: 15px; }

  .offline-banner { margin: 12px 14px 0; align-items: flex-start; flex-wrap: wrap; }
  .offline-banner .btn { margin-left: 34px; }

  .view { padding: 18px 14px 40px; }
  .page-title { font-size: 23px; }
  .page-desc { font-size: 12.5px; }
  .page-head { gap: 12px; margin-bottom: 18px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 0 0 auto; }

  .toasts { top: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); right: 14px; left: 14px; width: auto; }
  .modal-root { padding: 12px; align-items: flex-end; }
  .modal-panel { max-height: 92vh; border-radius: 18px; }
  .modal-sm, .modal-md, .modal-lg { max-width: 100%; }
  .modal-foot { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 16px 16px 12px; }

  .q-row { flex-direction: column; gap: 10px; }
  .q-row-actions { width: 100%; justify-content: flex-end; border-top: 1px dashed var(--border); padding-top: 9px; }
  .q-row-top .star-btn { margin-left: 0; }
  .pdf-grid { grid-template-columns: minmax(0, 1fr); }
  /* 窄屏下长 PDF 文件名必须允许换行，否则 nowrap 的 min-content 会把卡片撑出屏幕 */
  .pdf-name {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .skeleton-grid { grid-template-columns: 1fr; }
  .toolbar-row { gap: 8px; }
  .search-wrap { max-width: none; flex: 1 1 100%; order: 3; }
  .toolbar-questions .search-wrap { order: 3; }
  .toolbar .toolbar-spacer { display: none; }
  .toolbar-count { margin-left: auto; }

  .upload-card { padding: 20px 16px; }
  .upload-inner { gap: 13px; }
  .upload-ico { width: 48px; height: 48px; flex-basis: 48px; border-radius: 13px; }
  .upload-copy h3 { font-size: 15px; }
  .upload-cta { width: 100%; justify-content: center; }

  .question-card { padding: 18px 16px; }
  .q-stem-lg { font-size: 16px; }
  .option-card { padding: 12px 13px; }
  .option-text { font-size: 14px; }
  .options-judge { flex-direction: column; }
  .session-bar { position: sticky; top: 57px; z-index: 20; }

  .report-hero { padding: 20px 18px; }
  .report-acc b { font-size: 32px; }
  .report-hero-top { gap: 12px; }
  .report-trophy { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; }
  .report-actions .btn { flex: 1 1 auto; }
  .report-num b { font-size: 17px; }

  .setup-card { padding: 16px 16px 18px; }
  .session-row { grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row; gap: 4px 10px; }
  .session-mode { justify-self: start; }
  .session-date { grid-column: 1 / 2; grid-row: 2; }
  .session-nums { grid-column: 2 / 3; grid-row: 1; justify-self: end; }
  .session-duration { grid-column: 2 / 3; grid-row: 2; justify-self: end; }
  .accuracy-badge { grid-column: 1 / 3; grid-row: 3; justify-self: start; }

  .day-chart { height: 172px; gap: 5px; }
  .day-bar-space { height: 128px; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 18px; }
  .stat-ico { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
}

@media (max-width: 520px) {
  .page-head-actions .btn { width: 100%; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .toolbar { padding: 10px; }
  .select-wrap { flex: 1 1 100%; }
  .select-wrap select { width: 100%; max-width: none; }
  .chip-toggle { width: 100%; }
  .chip { width: 100%; justify-content: center; }
  .stat-cards { grid-template-columns: 1fr; }
  .stat-card { padding: 13px 14px; }
  .stat-value { font-size: 19px; }
  .source-name { max-width: 150px; }
  .source-strong .source-name { max-width: 190px; }
  .q-detail-stem { font-size: 15px; padding: 12px; }
  .report-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-acc { width: 100%; align-items: flex-start; margin-left: 0; }
  .nav-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .nav-cell { min-height: 38px; }
  .setup-overview { font-size: 12.5px; }
  .report-acc b { font-size: 30px; }
  .question-actions .btn { width: 100%; }
  .question-actions { justify-content: stretch; }
  .question-progress-hint { width: 100%; }
  .action-hint { width: 100%; }
  .session-bar { padding: 12px 14px; top: 57px; }
  .session-bar-top { gap: 9px; }
  .session-bar-top .btn { margin-left: auto; }
  .modal-root { padding: 0; }
  .modal-panel { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-lg .modal-body { padding: 14px; }
}

/* ---------------- 动效降级 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- 意见反馈 ---------------- */
.feedback-entry { flex: 0 0 auto; }

.feedback-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.feedback-tip:hover {
  border-color: #b9cdf5;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.feedback-tip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.feedback-tip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.feedback-tip-text { min-width: 0; }
.feedback-tip-link {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}

.modal-feedback { max-width: 600px; }

.feedback-form { display: flex; flex-direction: column; gap: 8px; }
.fb-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}
.fb-label:first-child { margin-top: 0; }
.fb-count {
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.fb-cat {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
}
.fb-cat:hover { border-color: #b9cdf5; color: var(--primary); }
.fb-cat.is-active {
  background: var(--primary-soft);
  border-color: #b9cdf5;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}
.fb-textarea,
.fb-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 11px 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.fb-textarea { min-height: 104px; resize: vertical; line-height: 1.65; }
.fb-textarea::placeholder,
.fb-input::placeholder { color: #a6b0c0; }
.fb-textarea:focus,
.fb-input:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.fb-error { margin: 0; color: var(--red); font-size: 12.5px; }

.fb-history {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.fb-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.fb-history-title { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text); }
.fb-pending { font-size: 12px; font-weight: 600; color: var(--amber); }
.fb-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}
.fb-history-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 2px;
  color: var(--muted);
  font-size: 12.5px;
}
.fb-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.fb-history-empty .icon { color: #b7c2d6; }
.fb-history-empty.is-error {
  color: var(--red);
  border-color: #fecaca;
  background: var(--red-soft);
}
.fb-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-soft);
  padding: 10px 12px;
}
.fb-item-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.fb-cat-tag {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--primary-soft);
  color: var(--primary);
}
.fb-cat-tag.fb-cat-extraction { background: var(--amber-soft); color: var(--amber); }
.fb-cat-tag.fb-cat-ui { background: #f1ebff; color: var(--violet); }
.fb-cat-tag.fb-cat-other { background: var(--bg-soft); color: var(--text-2); }
.fb-status {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}
.fb-status.is-pending { background: var(--amber-soft); color: var(--amber); }
.fb-status.is-resolved { background: var(--green-soft); color: var(--green); }
.fb-time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fb-item-content {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.fb-item-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 6px 0 0;
  color: var(--green);
  font-size: 12px;
  line-height: 1.55;
}
.fb-item-note .icon { flex: 0 0 auto; margin-top: 2px; }
.fb-item-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.fb-delete { color: var(--red); padding: 4px 8px; }
.fb-delete:hover { color: #b91c1c; background: var(--red-soft); border-color: #fecaca; }

@media (max-width: 560px) {
  .feedback-tip { padding: 11px 12px; gap: 8px; }
  .feedback-tip-text { font-size: 12.5px; }
  .modal-feedback { max-width: 100%; }
  .fb-history-list { max-height: 200px; }
  .fb-cats { gap: 6px; }
  .fb-cat { padding: 6px 11px; }
  .fb-textarea { min-height: 96px; }
}

@media (max-width: 900px) {
  .confirm-layer { padding: 12px; align-items: flex-end; }
}
@media (max-width: 520px) {
  .confirm-layer { padding: 0; }
}

/* ---------------- AI 设置 / 讲解 ---------------- */
.mobile-ai-btn { display: none; position: relative; }
.mobile-ai-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #fff;
}
.mobile-ai-dot[hidden] { display: none; }

.nav-item-ai {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.nav-item-ai .nav-ico { color: var(--violet, #7c3aed); }
.nav-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: #b91c1c;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-badge[hidden] { display: none; }

.ai-entry-btn .icon { color: var(--violet, #7c3aed); }

/* AI 设置弹窗 */
.modal-ai-settings { max-width: 600px; }
.ai-settings { display: flex; flex-direction: column; gap: 14px; }
.ai-settings-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  color: var(--muted);
  font-size: 13px;
}
.ai-settings-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.ai-presets { display: flex; flex-direction: column; gap: 9px; }
.ai-presets-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.ai-preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-preset { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.ai-preset-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.ai-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ai-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ai-field .input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ai-field .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.ai-key-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.ai-key-row .input { flex: 1 1 auto; min-width: 0; }
.ai-key-row .btn { flex: 0 0 auto; }
.ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12.5px;
}
.ai-status.is-ok { background: #ecfdf5; color: #15803d; }
.ai-status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #cbd5e1; }
.ai-status.is-ok .ai-status-dot { background: #22c55e; }
.ai-test-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-soft);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.ai-test-result[hidden] { display: none; }
.ai-test-result.is-error { border-color: #fecaca; background: var(--red-soft); color: #b91c1c; }
.ai-test-result .pre-wrap { margin: 0; }
.ai-test-meta { color: var(--muted); font-size: 11.5px; }
.ai-safety {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.ai-safety .icon { flex: 0 0 auto; margin-top: 1px; }

/* AI 讲解弹窗 */
.modal-ai { max-width: 780px; }
.ai-modal { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ai-modebar { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.ai-mode:hover { background: var(--bg-soft); }
.ai-mode.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}
.ai-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(52vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 2px 2px;
  min-height: 120px;
}
.ai-msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; min-width: 0; }
.ai-msg-user { align-self: flex-end; align-items: flex-end; }
.ai-msg-assistant { align-self: flex-start; align-items: flex-start; }
.ai-msg-who { padding: 0 4px; font-size: 11px; color: var(--muted); }
.ai-msg-text {
  padding: 10px 13px;
  border-radius: 13px;
  background: #f3f5f9;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}
.ai-msg-user .ai-msg-text { background: var(--primary-soft); color: var(--text); }
.ai-msg-user .ai-msg-text { border-bottom-right-radius: 5px; }
.ai-msg-assistant .ai-msg-text { border-bottom-left-radius: 5px; }
.ai-loading .ai-msg-text { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ai-msg-error .ai-msg-text {
  border: 1px solid #fecaca;
  background: var(--red-soft);
  color: #b91c1c;
}
.ai-msg-error p { margin: 0; }
.ai-error-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ai-composer { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.ai-followup {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ai-followup:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ai-send { flex: 0 0 auto; min-width: 84px; justify-content: center; }

@media (max-width: 900px) {
  .nav .nav-item-ai { display: none; }
  .mobile-ai-btn { display: inline-flex; }
}
@media (max-width: 560px) {
  .modal-ai, .modal-ai-settings { max-width: 100%; }
  .ai-thread { max-height: 44vh; gap: 10px; }
  .ai-msg { max-width: 96%; }
  .ai-msg-text { font-size: 13px; padding: 9px 11px; }
  .ai-send { min-width: 0; padding: 0 12px; }
  .ai-preset { min-height: 30px; padding: 0 10px; font-size: 12px; }
  .ai-settings { gap: 12px; }
  .ai-key-row .btn { padding: 0 9px; }
}

/* ============================================================
 * 访问密码登录层
 * ============================================================ */
.nav-item[hidden],
.mobile-ai-btn[hidden],
.nav-badge[hidden] { display: none !important; }

.login-screen[hidden] { display: none; }
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(20px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(20px + env(safe-area-inset-left, 0px));
  background:
    radial-gradient(1100px 520px at 18% -10%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(900px 480px at 108% 108%, rgba(124, 58, 237, 0.14), transparent 62%),
    var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-locked { overflow: hidden; }
body.is-locked .app-shell { display: none; }

.login-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 34px 30px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 70px -32px rgba(18, 32, 66, 0.35), 0 2px 8px rgba(18, 32, 66, 0.04);
}
.login-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 17px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.8);
}
.login-logo svg { width: 27px; height: 27px; }
.login-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text);
}
.login-sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.login-input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.login-error {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12.5px;
  line-height: 1.5;
}
.login-error[hidden] { display: none; }
.login-submit {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  justify-content: center;
  font-size: 15px;
  border-radius: 11px;
}
.login-submit[disabled] { opacity: 0.72; cursor: default; }

.sidebar-logout {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.sidebar-logout:hover {
  color: var(--red, #dc2626);
  border-color: #fecaca;
  background: #fef2f2;
}

@media (max-width: 560px) {
  .login-screen { align-items: center; padding-left: 16px; padding-right: 16px; }
  .login-card { padding: 28px 22px 24px; border-radius: 18px; }
  .login-title { font-size: 22px; }
  .login-input, .login-submit { font-size: 16px; }
}
