/* ============================================================
 * parent.css —— 家长端专属样式（Prompt 11）
 * ------------------------------------------------------------
 * 设计基调：蓝灰专业感（与孩子端的温暖橙区分）
 *   - 桌面优先：1440px 为主设计，1024 / 768 / 375 逐级降级
 *   - 卡片：白底 + 轻阴影 + 16px 圆角
 *   - 导航：≥768px 顶部横向 60px；<768px 底部固定 56px（CSS media query 切换）
 *   - 交互元素触摸区 ≥ 44px
 * 依赖：theme.css（复用变量 / .card / .btn / .badge / .empty-state 等基础组件）
 * 用法：家长端页面给 <body> 加 class="parent"
 * ============================================================ */

/* ------------------------------------------------------------
 * 1. 家长端设计变量（覆盖 theme.css 的暖色基调）
 * ------------------------------------------------------------ */
body.parent {
  --p-primary: var(--brand-500);
  --p-primary-dark: var(--brand-600);
  --p-primary-50: var(--brand-50);
  --p-primary-100: var(--brand-100);
  --p-primary-200: var(--brand-200);
  --p-accent: var(--accent-500);

  --p-bg: var(--page-bg);
  --p-surface: var(--surface);
  --p-surface-soft: var(--surface-soft);
  --p-line: var(--line);
  --p-line-strong: var(--line-strong);

  --p-ink: var(--ink-900);
  --p-ink-soft: var(--ink-700);
  --p-ink-muted: var(--ink-500);

  --p-red: var(--danger-600);
  --p-orange: var(--warn-600);
  --p-green: var(--success-600);
  --p-danger: var(--danger-600);
  --p-gray: var(--ink-500);
  --p-muted: var(--ink-500);
  --p-primary-300: var(--brand-300);
  --p-primary-500: var(--brand-500);
  --p-primary-600: var(--brand-600);

  --p-shadow: 0 1px 2px rgba(31, 42, 60, 0.05), 0 6px 20px rgba(31, 42, 60, 0.06);
  --p-shadow-hover: 0 2px 4px rgba(31, 42, 60, 0.06), 0 10px 28px rgba(31, 42, 60, 0.1);
  --p-radius: 16px;

  --p-nav-h: 60px;
  --p-bottom-nav-h: 56px;

  background: var(--p-bg);
  background-image: none;
  color: var(--p-ink);
  font-size: 15px;
  line-height: 1.6;
  padding-bottom: 40px;
}

/* 家长端所有小号按钮也保证 ≥44px 触摸区（覆盖 theme 的 40px） */
body.parent .btn-sm {
  min-height: 44px;
}

body.parent .btn-primary {
  background: linear-gradient(135deg, var(--p-primary) 0%, var(--p-primary-dark) 100%);
  box-shadow: 0 6px 16px rgba(74, 111, 165, 0.26);
}

body.parent .btn-primary:hover {
  background: linear-gradient(135deg, var(--p-primary-dark) 0%, #2f4b73 100%);
}

body.parent .btn-secondary:hover {
  border-color: var(--p-primary-200);
  color: var(--p-primary-dark);
  background: var(--p-primary-50);
}

body.parent .badge-brand {
  background: var(--p-primary-100);
  color: var(--p-primary-dark);
}

/* ------------------------------------------------------------
 * 2. 顶部导航（桌面）/ 底部导航（手机）
 * ------------------------------------------------------------ */
.pnav {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--p-nav-h);
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-line);
}

.pnav-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.pnav-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
  color: var(--p-primary-dark);
  text-decoration: none;
  white-space: nowrap;
}

.pnav-brand span {
  font-weight: 500;
  color: var(--p-ink-muted);
}

.pnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pnav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--p-ink-soft);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

/* 有待处理事项时的角标（浏览器不支持通知权限请求时的降级提示） */
.pnav-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-red);
  box-shadow: 0 0 0 2px var(--p-surface);
}

.pnav-link:hover {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

.pnav-link.is-active {
  background: var(--p-primary-100);
  color: var(--p-primary-dark);
}

/* 底部导航：桌面隐藏，手机显示 */
.pbottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* 手机端：隐藏顶部横向导航，改为底部固定导航（规则 5） */
  .pnav {
    display: none;
  }

  .pnav-inner {
    padding: 0 16px;
  }

  .pbottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    height: calc(var(--p-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--p-surface);
    border-top: 1px solid var(--p-line);
  }

  .pbottom-link {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    text-decoration: none;
    color: var(--p-ink-muted);
    font-size: 12px;
  }

  .pbottom-dot {
    position: absolute;
    top: 7px;
    left: 50%;
    margin-left: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p-red);
  }

  .pbottom-icon {
    font-size: 20px;
    line-height: 1;
  }

  .pbottom-link.is-active {
    color: var(--p-primary);
    font-weight: 700;
  }

  body.parent {
    padding-bottom: calc(var(--p-bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  }
}

/* ------------------------------------------------------------
 * 3. 页面容器与栅格
 * ------------------------------------------------------------ */
.pwrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* 左栏 320px + 主区自适应 */
.pgrid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* 左右等分（周报中栏） */
.pgrid-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* 三栏：左 320 + 主区 + 右 320 */
.pgrid-3 {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.pstack > * + * {
  margin-top: 24px;
}

/* 1024px 以下统一降级为单栏（768px 起完全单栏，无溢出） */
@media (max-width: 1024px) {
  .pgrid,
  .pgrid-wide,
  .pgrid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .pwrap {
    padding: 16px;
  }

  .pstack > * + * {
    margin-top: 16px;
  }
}

/* ------------------------------------------------------------
 * 4. 卡片与页头
 * ------------------------------------------------------------ */
.pcard {
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 20px 24px;
}

.pcard + .pcard {
  margin-top: 0;
}

.pcard-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--p-ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.pcard-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pcard-title-row .pcard-title {
  margin-bottom: 0;
}

/* 页头：欢迎区 */
.phead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.phead-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--p-ink);
}

.phead-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--p-ink-muted);
}

.phead-sub strong {
  color: var(--p-primary-dark);
  font-weight: 600;
}

/* ------------------------------------------------------------
 * 5. 统计卡片（本周概览 / 周报概览）
 * ------------------------------------------------------------ */
.pstat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.pstat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pstat-icon {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 4px;
}

.pstat-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--p-primary);
  font-variant-numeric: tabular-nums;
}

.pstat-value small {
  font-size: 16px;
  font-weight: 600;
  margin-left: 2px;
  color: var(--p-ink-muted);
}

.pstat-label {
  font-size: 14px;
  color: var(--p-ink-muted);
}

@media (max-width: 560px) {
  .pstat-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .pstat {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }

  .pstat-icon {
    margin-bottom: 0;
  }
}

/* ------------------------------------------------------------
 * 6. 通知权限提示条
 * ------------------------------------------------------------ */
.pnb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: var(--p-primary-50);
  border: 1px solid var(--p-primary-200);
  font-size: 14px;
  color: var(--p-primary-dark);
}

.pnb-icon {
  font-size: 18px;
  line-height: 1;
}

.pnb-text {
  flex: 1;
}

.pnb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pnb-close {
  border: none;
  background: transparent;
  color: var(--p-ink-muted);
  font-size: 18px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  border-radius: 8px;
}

.pnb-close:hover {
  background: rgba(74, 111, 165, 0.12);
  color: var(--p-primary-dark);
}

/* ------------------------------------------------------------
 * 7. 待处理事项列表
 * ------------------------------------------------------------ */
.ptodo-list > * + * {
  margin-top: 4px;
}

.ptodo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--p-line);
  color: inherit;
  text-decoration: none;
}

.ptodo-item:last-child {
  border-bottom: none;
}

.ptodo-item[href]:hover {
  background: var(--p-surface-soft);
}

.ptodo-icon {
  font-size: 18px;
  line-height: 1;
  flex: none;
}

.ptodo-text {
  flex: 1;
  font-size: 15px;
  color: var(--p-ink);
}

/* Prompt 44：「变式生成失败」卡片里的题干（完整文本 + .latex-clamp-2 两行截断）。
   作为 flex 子项要允许收缩到 min-content 以下，否则长公式会把卡片撑宽。 */
.ptodo-fail-text {
  min-width: 0;
}

.ptodo-count {
  flex: none;
  font-weight: 700;
  color: var(--p-primary);
  font-variant-numeric: tabular-nums;
}

/* Prompt 25：「判定待确认」入口的红点角标（有待裁决时才上色） */
.ptodo-count.is-alert {
  color: #fff;
  background: var(--p-red);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  line-height: 18px;
  box-shadow: 0 1px 4px rgba(214, 69, 69, 0.32);
}

.ptodo-arrow {
  flex: none;
  color: var(--p-ink-muted);
  font-size: 14px;
}

.ptodo-empty {
  padding: 20px 4px;
  text-align: center;
  color: var(--p-green);
  font-weight: 600;
}

/* ------------------------------------------------------------
 * 8. 提醒卡片流（首页底部 / 提醒页）
 * ------------------------------------------------------------ */
.pnotice-flow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.palert {
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--p-line);
  background: var(--p-surface-soft);
  font-size: 14px;
  line-height: 1.6;
}

.palert-warn {
  background: #fdf6ec;
  border-color: #f2ddbc;
  color: #8a5a12;
}

.palert-info {
  background: var(--p-primary-50);
  border-color: var(--p-primary-200);
  color: var(--p-primary-dark);
}

.palert-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
}

.palert-msg {
  color: inherit;
}

.palert a {
  color: inherit;
  font-weight: 600;
}

/* ------------------------------------------------------------
 * 9. 变式题确认页
 * ------------------------------------------------------------ */
.pv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pv-toolbar-info {
  font-size: 14px;
  color: var(--p-ink-muted);
}

.pv-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .pv-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pv-card {
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.pv-card.is-leaving {
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
}

.pv-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--p-ink-muted);
  letter-spacing: 0.04em;
}

.pv-origin {
  font-size: 15px;
  color: var(--p-ink);
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--p-surface-soft);
  border: 1px solid var(--p-line);
}

.pv-variants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-item {
  border: 1px solid var(--p-line);
  border-radius: 12px;
  overflow: hidden;
}

.pv-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 14px;
  color: var(--p-ink);
  cursor: pointer;
}

.pv-item-head:hover {
  background: var(--p-primary-50);
}

.pv-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--p-primary-100);
  color: var(--p-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

/* Prompt 49：变式题「针对薄弱点」标签（折叠态小徽标 + 展开态整行） */
.pv-target-tag {
  flex: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid var(--p-line);
  border-radius: 999px;
  background: var(--p-surface);
  color: var(--p-ink-muted);
  font-size: 12px;
  font-weight: 600;
}

.pv-target {
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px dashed var(--p-line);
  border-radius: 8px;
  background: var(--p-surface);
  font-size: 13px;
  line-height: 1.6;
  color: var(--p-ink-muted);
}

.pv-item-snippet {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-caret {
  flex: none;
  color: var(--p-ink-muted);
  font-size: 12px;
}

.pv-item-body {
  padding: 4px 14px 14px;
  border-top: 1px dashed var(--p-line);
  font-size: 14px;
  line-height: 1.7;
  color: var(--p-ink-soft);
  background: var(--p-surface-soft);
}

.pv-item-body p + p {
  margin-top: 8px;
}

.pv-item-body strong {
  color: var(--p-ink);
}

.pv-latex {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef2f8;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #46586f;
  word-break: break-all;
  white-space: pre-wrap;
}

.pv-card-actions {
  display: flex;
  gap: 12px;
  padding-top: 4px;
}

.pv-card-actions .btn {
  flex: 1;
}

/* ------------------------------------------------------------
 * 10. 周报页
 * ------------------------------------------------------------ */
.pr-weekbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pr-range {
  font-size: 16px;
  font-weight: 700;
  color: var(--p-primary-dark);
  min-width: 168px;
  text-align: center;
}

.pr-oneline {
  font-size: 22px;
  font-weight: 700;
  color: var(--p-primary);
  line-height: 1.5;
}

.pr-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--p-ink-soft);
  margin-bottom: 12px;
}

/* 薄弱知识点 */
.pr-weak-item {
  border-bottom: 1px solid var(--p-line);
}

.pr-weak-item:last-child {
  border-bottom: none;
}

.pr-weak-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 4px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.pr-weak-head:hover {
  background: var(--p-surface-soft);
}

.pr-weak-main {
  flex: 1;
  min-width: 0;
}

.pr-weak-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--p-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pr-weak-subject {
  font-size: 12px;
  font-weight: 600;
  color: var(--p-primary-dark);
  background: var(--p-primary-100);
  border-radius: 999px;
  padding: 1px 8px;
}

.pr-weak-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pr-weak-rate {
  flex: none;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pr-bar {
  height: 8px;
  border-radius: 999px;
  background: #edf1f7;
  overflow: hidden;
  margin-top: 8px;
}

.pr-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.pr-rate-red {
  color: var(--p-red);
}
.pr-rate-orange {
  color: var(--p-orange);
}
.pr-rate-green {
  color: var(--p-green);
}

.pr-fill-red {
  background: var(--p-red);
}
.pr-fill-orange {
  background: var(--p-orange);
}
.pr-fill-green {
  background: var(--p-green);
}

.pr-weak-detail {
  padding: 0 4px 12px;
}

.pr-mistake-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--p-line);
  font-size: 13px;
  color: var(--p-ink-soft);
}

.pr-mistake-snippet {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-mistake-no {
  flex: none;
  font-weight: 700;
  color: var(--p-ink-muted);
  font-variant-numeric: tabular-nums;
}

/* 错因分布（横条图） */
.pr-reason-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pr-reason-row:last-child {
  margin-bottom: 0;
}

.pr-reason-name {
  font-size: 14px;
  color: var(--p-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-reason-track {
  height: 14px;
  border-radius: 6px;
  background: #edf1f7;
  overflow: hidden;
}

.pr-reason-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--p-accent), var(--p-primary));
  transition: width 0.4s ease;
}

.pr-reason-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 学习时长趋势（纯 CSS 柱状图） */
.pr-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 150px;
  padding: 8px 4px 0;
}

.pr-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
  position: relative;
}

.pr-col-minutes {
  font-size: 12px;
  font-weight: 700;
  color: var(--p-primary-dark);
  font-variant-numeric: tabular-nums;
  min-height: 16px;
}

.pr-col-bar {
  width: 60%;
  max-width: 52px;
  max-height: 100px;
  border-radius: 8px 8px 3px 3px;
  background: #cdd9e9;
  transition: height 0.35s ease, background 0.2s ease;
}

.pr-col.is-today .pr-col-bar {
  background: linear-gradient(180deg, var(--p-accent), var(--p-primary));
}

.pr-col-day {
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

.pr-col.is-today .pr-col-day {
  color: var(--p-primary-dark);
  font-weight: 700;
}

/* 悬停显示具体数值（桌面） */
.pr-col[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(31, 42, 60, 0.92);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

/* ------------------------------------------------------------
 * 11. 提醒详情页（桌面 table / 手机卡片）
 * ------------------------------------------------------------ */
.pn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pn-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--p-ink-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--p-line);
  white-space: nowrap;
}

.pn-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--p-line);
  color: var(--p-ink-soft);
  vertical-align: middle;
}

.pn-table tr:last-child td {
  border-bottom: none;
}

.pn-time {
  white-space: nowrap;
  color: var(--p-ink-muted);
  font-variant-numeric: tabular-nums;
}

.pn-msg {
  color: var(--p-ink);
}

.pn-op {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .pn-table,
  .pn-table thead,
  .pn-table tbody,
  .pn-table tr,
  .pn-table th,
  .pn-table td {
    display: block;
  }

  .pn-table thead {
    display: none;
  }

  .pn-table tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--p-line);
  }

  .pn-table tr:last-child {
    border-bottom: none;
  }

  .pn-table td {
    padding: 4px 0;
    border-bottom: none;
    display: flex;
    gap: 12px;
  }

  .pn-table td::before {
    content: attr(data-label);
    flex: none;
    width: 64px;
    color: var(--p-ink-muted);
    font-size: 13px;
  }
}

/* ------------------------------------------------------------
 * 12. 通用小工具
 * ------------------------------------------------------------ */
/* F5：历史私有空态/加载类名在 CSS 层对齐 theme 标准视觉
   （.empty-state 用 --ink-700；.loading-sub 用 --ink-500），HTML class 保留不强行改名。 */
.p-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-700);
  font-size: 15px;
}

.p-loading {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-500);
  font-size: 14px;
}

.pfade-in {
  animation: p-fade-in 0.24s ease both;
}

@keyframes p-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 桌面端不出现横向滚动条（1440px 全宽） */
@media (min-width: 1024px) {
  body.parent {
    overflow-x: hidden;
  }
}

/* ------------------------------------------------------------
 * 9. 打印导出（Prompt 11.3a）：export.html / print-preview / print-answers
 *    屏幕预览样式；打印态规则全部在 print.css（media="print"）
 * ------------------------------------------------------------ */

/* 导出管理页：勾选列表 */
.pex-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pex-row:hover {
  background: var(--p-primary-50);
}

.pex-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--p-primary);
}

.pex-qno {
  flex: none;
  min-width: 44px;
  font-weight: 700;
  color: var(--p-primary-dark);
  font-variant-numeric: tabular-nums;
}

.pex-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--p-ink);
}

.pex-meta {
  flex: none;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--p-ink-muted);
  font-size: 13px;
}

.pex-check-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pex-count {
  font-size: 14px;
  color: var(--p-ink-soft);
}

.pex-count strong {
  color: var(--p-primary-dark);
}

.pex-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 批次历史表 */
.ptable-wrap {
  overflow-x: auto;
}

.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ptable th,
.ptable td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--p-line);
  white-space: nowrap;
}

.ptable th {
  color: var(--p-ink-muted);
  font-weight: 600;
  font-size: 13px;
}

.ptable td.pcol-actions {
  white-space: normal;
}

.ptable .plink {
  color: var(--p-primary);
  background: none;
  border: 0;
  padding: 6px 8px;
  min-height: 32px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 8px;
}

.ptable .plink:hover {
  background: var(--p-primary-50);
}

.ptable .plink[disabled] {
  color: var(--p-ink-muted);
  cursor: not-allowed;
  background: none;
}

/* 状态徽标：已导出（蓝）/ 已回传（橙）/ 已完成（绿） */
.pbadge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.pbadge-exported {
  color: #2c5aa0;
  background: #e6eef8;
}

.pbadge-returned {
  color: #9a6212;
  background: #faeeda;
}

.pbadge-completed {
  color: #2e7d4f;
  background: #e3f2e8;
}

/* 打印预览页：A4 纸样式的屏幕预览 */
.pex-paper {
  max-width: 800px;
  margin: 0 auto 80px;
  background: #ffffff;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  box-shadow: var(--p-shadow);
  padding: 40px 48px;
}

.pex-sheet-head {
  text-align: center;
  border-bottom: 2px solid var(--p-ink);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

.pex-sheet-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--p-ink);
}

.pex-sheet-title .pex-warn {
  color: var(--p-red);
}

.pex-sheet-meta {
  margin-top: 10px;
  font-size: 14px;
  color: var(--p-ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pex-q {
  padding: 18px 0;
  border-bottom: 1px dashed var(--p-line-strong);
}

.pex-q:last-of-type {
  border-bottom: 0;
}

.pex-q-head {
  font-weight: 700;
  color: var(--p-ink);
  margin-bottom: 8px;
}

.pex-q-head .pex-subject {
  font-weight: 400;
  color: var(--p-ink-muted);
  font-size: 13px;
}

.pex-qtext {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  color: var(--p-ink);
  font-size: 15px;
}

/* Prompt 38 Bug 2 遗留 2：共享材料去重（打印卷 / 答案卷共用）
   组内第一题：材料单独成块 + 范围标注；后续题：只印「共享材料见 Qx」提示 */
.pex-shared {
  border-left: 3px solid var(--p-line-strong, #d8dee9);
  padding-left: 10px;
}

.pex-shared-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--p-ink-muted);
  margin-bottom: 4px;
}

.pex-shared-ref {
  font-size: 13px;
  color: var(--p-ink-muted);
  margin-bottom: 4px;
}

/* 材料块内的题干不再给上下额外间距（避免与 .pex-shared 的 padding 叠加） */
.pex-shared .pex-qtext {
  margin: 0;
}

.pex-latex {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--p-surface-soft);
  border-radius: 8px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
  color: var(--p-ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.pex-options {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 24px;
  color: var(--p-ink);
}

.pex-figure {
  margin-top: 10px;
}

.pex-figure img {
  width: 60%;
  max-width: 100%;
  border: 1px solid var(--p-line);
  border-radius: 6px;
  display: block;
}

.pex-figure-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--p-ink-muted);
}

/* Prompt 33：图形裁剪图 —— 居中显示、按原比例缩放（不拉伸出框） */
.pex-figure.is-cropped {
  text-align: center;
}

.pex-figure.is-cropped img {
  width: auto;
  max-width: 60%;
  max-height: 90mm;
  margin: 0 auto;
  border: none;      /* 裁剪图本身就是纯图形，不需要整页图的外框 */
  border-radius: 0;
  object-fit: contain;
}

/* Prompt 33：图形裁剪 UI（题库上传确认页 + 编辑页共用）
   缩略图 / 操作按钮 / 状态提示三件套 */
.pb-figbox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.pb-figactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pb-figstatus {
  font-size: 12px;
  color: var(--p-ink-muted);
  line-height: 1.5;
}

.pb-figstatus.is-cropped {
  color: var(--brand-600, #ea580c);
  font-weight: 600;
}

/* 裁剪图缩略图：居左、按比例、限高 */
.pb-figbox .pb-qfig-img {
  max-width: 320px;
  max-height: 240px;
  object-fit: contain;
}

/* Prompt 38 Bug 3-A：手动「包含图形」勾选（题库上传确认页 / 题目编辑页）
   触控友好：整行可点，最小高度 44px */
.pb-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}

.pb-toggle-input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand-500, #f97316);
  cursor: pointer;
  flex: none;
}

.pb-toggle-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink);
}

.pb-toggle-hint {
  font-size: 12px;
  color: var(--p-ink-muted);
  line-height: 1.5;
}

.pb-toggle-hint.is-cropped {
  color: var(--brand-600, #ea580c);
  font-weight: 600;
}

.pb-toggle-hint.is-whole {
  color: #b45309;
  font-weight: 600;
}

/* 图形区（勾选后才显示）：内嵌裁剪块与图形说明 */
.pb-figbody {
  margin-top: 6px;
}

/* 答案卷字段 */
.pex-ans-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}

.pex-ans-grid dt {
  color: var(--p-ink-muted);
}

.pex-ans-grid dd {
  margin: 0;
  color: var(--p-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.pex-ans-grid dd.pex-strong {
  font-weight: 700;
}

/* 屏幕预览工具区（打印时由 print.css 隐藏） */
.pprint-bar {
  max-width: 800px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pprint-config {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--p-ink-soft);
  flex-wrap: wrap;
}

.pprint-config input[type='number'] {
  width: 64px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--p-line-strong);
  border-radius: 8px;
  font-size: 14px;
}

.pprint-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--p-primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--p-shadow-hover);
  cursor: pointer;
}

.pprint-fab:hover {
  background: var(--p-primary-dark);
}

.pfoot-tip {
  text-align: center;
  color: var(--p-ink-muted);
  font-size: 13px;
  padding: 24px 0 8px;
  border-top: 2px solid var(--p-ink);
  margin-top: 12px;
}

@media (max-width: 768px) {
  .pex-paper {
    padding: 24px 18px;
  }

  .pex-options {
    grid-template-columns: 1fr;
  }

  .pprint-fab {
    right: 16px;
    bottom: 72px;
  }
}

/* ------------------------------------------------------------
 * 10. 回传批改（Prompt 11.3b）：return.html / grade-result.html
 * ------------------------------------------------------------ */

/* 上传拖拽区 */
.pdrop {
  border: 2px dashed var(--p-line-strong);
  border-radius: var(--p-radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--p-ink-soft);
  background: var(--p-surface-soft);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.pdrop:hover,
.pdrop.is-over {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
}

.pdrop-icon {
  font-size: 28px;
}

.pdrop-main {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--p-ink);
}

.pdrop-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pdrop input[type='file'] {
  display: none;
}

/* 上传进度 / 状态 */
.pupload-status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--p-primary-dark);
  min-height: 20px;
}

.pprogress {
  height: 6px;
  border-radius: 999px;
  background: var(--p-primary-100);
  overflow: hidden;
  margin-top: 8px;
}

.pprogress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--p-primary);
  transition: width 0.2s ease;
}

/* 已上传照片列表 */
.pret-list > * + * {
  margin-top: 10px;
}

.pret-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  min-height: 44px;
}

.pret-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--p-line);
  background: var(--p-surface-soft);
}

.pret-info {
  flex: 1;
  min-width: 0;
}

.pret-name {
  font-size: 14px;
  color: var(--p-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pret-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--p-ink-muted);
}

/* AI 批次号识别提示条 */
.pwarnbar {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #faeeda;
  color: #9a6212;
  font-size: 14px;
}

/* 批改结果条目 */
.pgrade-list > * + * {
  margin-top: 16px;
}

.pgrade {
  border: 1px solid var(--p-line);
  border-radius: 12px;
  padding: 16px;
}

.pgrade.is-confirmed {
  border-color: var(--p-line-strong);
  background: var(--p-surface-soft);
}

.pgrade-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pgrade-qno {
  font-weight: 700;
  color: var(--p-primary-dark);
  font-size: 16px;
}

.pgrade-subject {
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pgrade-field {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 14px;
}

.pgrade-field dt {
  color: var(--p-ink-muted);
}

.pgrade-field dd {
  margin: 0;
  color: var(--p-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.pgrade-verdict {
  font-weight: 700;
}

.pgrade-verdict.j-correct {
  color: var(--p-green);
}

.pgrade-verdict.j-wrong {
  color: var(--p-red);
}

.pgrade-verdict.j-unknown {
  color: var(--p-orange);
}

/* 家长确认单选 */
.pgrade-confirm {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pradio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--p-line-strong);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.pradio input {
  accent-color: var(--p-primary);
}

.pradio.is-on {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
}

.pgrade-answer-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--p-line-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

/* 完成横幅 */
.pdone-banner {
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #e3f2e8;
  color: #2e7d4f;
  font-size: 15px;
  font-weight: 600;
}

.pcount-line {
  font-size: 14px;
  color: var(--p-ink-soft);
}

.pcount-line strong {
  color: var(--p-primary-dark);
}

/* ------------------------------------------------------------
 * 11. 知识图谱（parent/graph.html，Prompt 11.5）
 *     桌面两栏：旭日图（自适应，最大 700px）+ 右侧详情 340px
 * ------------------------------------------------------------ */
.pg-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 家长端分段控件改蓝灰（覆盖 theme.css 的橙色高亮） */
body.parent .segmented {
  border-color: var(--p-line-strong);
}

body.parent .segmented button.is-active {
  background: linear-gradient(135deg, var(--p-primary) 0%, var(--p-primary-dark) 100%);
  box-shadow: 0 4px 12px rgba(74, 111, 165, 0.24);
}

.pg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.pg-chart-card {
  padding: 16px;
}

.pg-chart {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.pg-side {
  display: flex;
  flex-direction: column;
}

.pg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}

.pg-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pg-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--p-primary-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pg-stat-label {
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pg-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--p-line);
  padding-top: 12px;
}

.pg-side-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink-soft);
}

.pg-side-head .plink {
  border: 0;
  background: none;
  color: var(--p-primary);
  font: inherit;
  font-size: 14px;
  padding: 6px 10px;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.pg-side-head .plink:hover {
  background: var(--p-primary-50);
}

.pg-side-head .plink[disabled] {
  color: var(--p-ink-muted);
  cursor: not-allowed;
  background: none;
}

.pg-side-list {
  margin-top: 10px;
  max-height: 430px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pg-mrow {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--p-surface);
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pg-mrow:hover {
  border-color: var(--p-primary-200);
  background: var(--p-primary-50);
}

.pg-mrow-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pg-mrow-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--p-primary-dark);
  font-variant-numeric: tabular-nums;
}

.pg-mrow-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--p-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pg-mrow-meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

.pg-side-more {
  text-align: center;
  font-size: 13px;
  color: var(--p-ink-muted);
  padding: 6px 0;
}

/* 错题详情弹层 */
.pg-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 42, 60, 0.42);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.pg-modal-mask.is-visible {
  opacity: 1;
}

.pg-modal {
  width: min(640px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-hover);
  overflow: hidden;
}

.pg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--p-line);
}

.pg-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--p-ink);
}

.pg-modal-close {
  border: 0;
  background: none;
  color: var(--p-ink-muted);
  font-size: 18px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  cursor: pointer;
}

.pg-modal-close:hover {
  background: var(--p-surface-soft);
}

.pg-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
}

.pg-modal-item {
  border: 1px solid var(--p-line);
  border-radius: 12px;
  padding: 12px 14px;
}

.pg-modal-item + .pg-modal-item {
  margin-top: 10px;
}

.pg-modal-item:hover {
  border-color: var(--p-primary-200);
}

.pg-modal-qtext {
  font-size: 15px;
  line-height: 1.75;
  color: var(--p-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.pg-modal-dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}

.pg-modal-dl dt {
  color: var(--p-ink-muted);
}

.pg-modal-dl dd {
  margin: 0;
  color: var(--p-ink);
}

/* 平板：单列（旭日图缩小到容器宽） */
@media (max-width: 1024px) {
  .pg-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pg-chart {
    max-width: 640px;
  }
}

@media (max-width: 768px) {
  .pg-toolbar {
    width: 100%;
  }

  .pg-chart {
    max-width: 100%;
  }

  .pg-side-list {
    max-height: none;
  }

  .pg-modal-mask {
    padding: 12px;
    align-items: flex-end;
  }

  .pg-modal {
    max-height: 88vh;
  }
}

/* ============================================================
 * 批改结果：题型标签行（Prompt 11.6b）
 * ============================================================ */
.pgrade-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--ink-200);
}

/* ============================================================
 * 知识图谱：难度过滤条（Prompt 11.6b 第 10 条 / 第 18 条）
 * ------------------------------------------------------------
 * 勾选 L1-L5 后只统计这些难度的错题，默认全选
 * ============================================================ */
.pg-level-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.pg-level-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-700);
}

.pg-level-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-pill);
  background: #fff;
  font-size: 13px;
  color: var(--ink-500);
  cursor: pointer;
  user-select: none;
}

.pg-level-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.pg-level-check.is-on {
  border-color: #fbbf24;
  background: #fffdf5;
  color: var(--ink-900);
  font-weight: 700;
}

.pg-level-actions {
  display: inline-flex;
  gap: 8px;
  margin-left: auto;
}

.pg-level-reset {
  border: none;
  background: none;
  padding: 4px 6px;
  font-size: 13px;
  color: var(--info-600, #2563eb);
  cursor: pointer;
  text-decoration: underline;
}

/* 图谱错题条目上的难度徽标 */
.pg-mrow-level {
  margin-left: 6px;
}

/* ============================================================
 * 题库（Prompt 11.7a）
 * ------------------------------------------------------------
 * 用于 parent/bank.html、bank-upload.html、bank-detail.html、bank-question.html
 * 类名统一 pb- 前缀；仅补充题库专有布局，基础组件复用 theme.css / parent.css
 * ============================================================ */

/* ---------- 1. 首页：筛选 + 批次卡片 ---------- */
.pb-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pb-filter-label {
  font-size: 13px;
  color: var(--p-ink-muted);
  font-weight: 600;
}

.pb-chip {
  min-height: 40px;
  padding: 6px 16px;
  border: 1px solid var(--p-line-strong);
  border-radius: 999px;
  background: var(--p-surface);
  color: var(--p-ink-soft);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pb-chip:hover {
  border-color: var(--p-primary-200);
  background: var(--p-primary-50);
}

.pb-chip.is-active {
  border-color: var(--p-primary);
  background: var(--p-primary);
  color: #fff;
  font-weight: 600;
}

.pb-batches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.pb-batch {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.pb-batch:hover {
  box-shadow: var(--p-shadow-hover);
  transform: translateY(-1px);
}

.pb-batch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pb-batch-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--p-primary);
  letter-spacing: 0.4px;
}

.pb-batch-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--p-ink);
  line-height: 1.45;
  word-break: break-word;
}

.pb-batch-meta {
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pb-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.pb-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: var(--p-ink-muted);
  background: var(--p-surface);
  border: 1px dashed var(--p-line-strong);
  border-radius: var(--p-radius);
  line-height: 1.8;
}

.pb-empty-emoji {
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
}

/* ---------- 2. 上传页：步骤条 ---------- */
.pb-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pb-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--p-line);
  border-radius: 999px;
  background: var(--p-surface);
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pb-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--p-line);
  color: var(--p-ink-soft);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.pb-step.is-active {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
  font-weight: 700;
}

.pb-step.is-active .pb-step-no {
  background: var(--p-primary);
  color: #fff;
}

.pb-step.is-done {
  border-color: var(--p-line-strong);
  color: var(--p-ink-soft);
}

.pb-step.is-done .pb-step-no {
  background: var(--p-green);
  color: #fff;
}

.pb-panel {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 20px 22px;
}

.pb-panel + .pb-panel {
  margin-top: 16px;
}

.pb-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--p-ink);
  margin-bottom: 4px;
}

.pb-panel-sub {
  font-size: 13px;
  color: var(--p-ink-muted);
  margin-bottom: 16px;
}

/* ---------- 3. 表单 ---------- */
.pb-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px 18px;
}

.pb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pb-field.is-wide {
  grid-column: 1 / -1;
}

.pb-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-ink-soft);
}

.pb-req {
  color: var(--p-red);
  margin-left: 2px;
}

.pb-input,
.pb-select,
.pb-textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--p-line-strong);
  border-radius: 12px;
  background: var(--p-surface-soft);
  color: var(--p-ink);
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}

.pb-textarea {
  min-height: 96px;
  line-height: 1.6;
  resize: vertical;
}

.pb-input:focus,
.pb-select:focus,
.pb-textarea:focus {
  outline: none;
  border-color: var(--p-primary);
  background: #fff;
}

.pb-hint {
  font-size: 12px;
  color: var(--p-ink-muted);
  line-height: 1.6;
}
.pb-hint-warn {
  font-size: 12px;
  line-height: 1.6;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 4px 8px;
}

.pb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- 4. 图片缩略图 ---------- */
.pb-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.pb-thumb {
  position: relative;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--p-surface-soft);
}

.pb-thumb-img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  background: #fff;
}

.pb-thumb-name {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--p-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-thumb-order {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 42, 60, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.pb-thumb-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(214, 69, 69, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 5. 解析进度 ---------- */
.pb-imglist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pb-imgrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface-soft);
}

.pb-imgrow.is-fail {
  border-color: var(--danger-200);
  background: var(--danger-50);
}

.pb-imgrow-preview {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}

.pb-imgrow-main {
  flex: 1;
  min-width: 0;
}

.pb-imgrow-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink);
}

.pb-imgrow-status {
  font-size: 13px;
  color: var(--p-ink-muted);
  margin-top: 2px;
}

.pb-bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--p-line);
  overflow: hidden;
}

.pb-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--p-primary) 0%, var(--p-accent) 100%);
  transition: width 0.3s ease;
}

.pb-bar-fill.is-fail {
  background: var(--p-red);
}

.pb-bar-fill.is-done {
  background: var(--p-green);
}

/* ---------- 6. 逐题确认卡片 ---------- */
.pb-qlist {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pb-qcard {
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  box-shadow: var(--p-shadow);
  overflow: hidden;
}

.pb-qcard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--p-line);
  background: var(--p-surface-soft);
}

.pb-qno {
  min-height: 40px;
  width: 96px;
  padding: 6px 10px;
  border: 1px solid var(--p-line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink);
  text-align: center;
  box-sizing: border-box;
}

.pb-qcard-head-spacer {
  flex: 1;
}

.pb-qcard-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.pb-qrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pb-qrow.is-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pb-optlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pb-optrow {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pb-optrow .pb-input {
  flex: 1;
}

.pb-opt-del {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--p-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--p-ink-muted);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}

.pb-opt-del:hover {
  border-color: var(--danger-200);
  color: var(--p-red);
  background: var(--danger-50);
}

.pb-qtags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pb-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid var(--p-primary-200);
  border-radius: 999px;
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
  font-size: 13px;
  font-weight: 600;
}

.pb-tag-del {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--p-ink-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.pb-tag-del:hover {
  color: var(--p-red);
}

.pb-tag-none {
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pb-qfig-img {
  max-width: 260px;
  max-height: 200px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: #fff;
}

.pb-latex {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-all;
  white-space: pre-wrap;
}

.pb-collapse-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--p-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- 7. 底部固定操作条 ---------- */
.pb-footbar {
  position: sticky;
  bottom: 0;
  z-index: 60;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  box-shadow: 0 -2px 14px rgba(31, 42, 60, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pb-footbar-info {
  flex: 1;
  min-width: 160px;
  font-size: 14px;
  color: var(--p-ink-soft);
}

.pb-footbar-info strong {
  color: var(--p-ink);
}

/* ---------- 8. 完成页 ---------- */
.pb-done {
  padding: 36px 20px;
  text-align: center;
  background: var(--p-surface);
  border: 1px solid var(--line);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
}

.pb-done-emoji {
  display: block;
  font-size: 40px;
  margin-bottom: 10px;
}

.pb-done-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--p-ink);
  margin-bottom: 6px;
}

.pb-done-sub {
  font-size: 14px;
  color: var(--p-ink-muted);
  margin-bottom: 20px;
}

.pb-done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- 9. 批次详情 / 单题编辑 ---------- */
.pb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pb-table th,
.pb-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--p-line);
  vertical-align: top;
}

.pb-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-ink-muted);
  white-space: nowrap;
}

.pb-table td.pb-col-num {
  white-space: nowrap;
  font-weight: 700;
  color: var(--p-ink-soft);
  width: 68px;
}

.pb-table td.pb-col-actions {
  white-space: nowrap;
  width: 1%;
}

.pb-qtext-cell {
  cursor: pointer;
  color: var(--p-ink);
  line-height: 1.6;
  word-break: break-word;
}

.pb-qtext-cell:hover {
  color: var(--p-primary);
}

.pb-expand {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--p-surface-soft);
  border: 1px solid var(--p-line);
  font-size: 14px;
  line-height: 1.7;
}

.pb-expand dl {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 6px 12px;
  margin: 10px 0 0;
}

.pb-expand dt {
  color: var(--p-ink-muted);
  font-size: 13px;
}

.pb-expand dd {
  margin: 0;
  color: var(--p-ink);
  word-break: break-word;
}

.pb-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
  color: var(--p-ink-soft);
}

.pb-meta-strip strong {
  color: var(--p-ink);
}

@media (max-width: 768px) {
  .pb-steps {
    gap: 6px;
  }

  .pb-step {
    padding: 6px 10px;
    font-size: 12px;
  }

  .pb-batches {
    grid-template-columns: 1fr;
  }

  .pb-panel {
    padding: 16px 14px;
  }
}

/* ------------------------------------------------------------
 * 11. 题库检索 + 组卷（Prompt 11.7b）：bank-search / bank-compose / bank-papers
 * ------------------------------------------------------------ */

/* 检索页：左筛选 280px + 右结果 */
.bs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.bs-side {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  padding: 18px 16px;
  box-shadow: var(--p-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--p-nav-h) + 16px);
  max-height: calc(100vh - var(--p-nav-h) - 32px);
  overflow-y: auto;
}

.bs-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--p-ink-soft);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}

.bs-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bs-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--p-line-strong);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--p-ink-soft);
  background: var(--p-surface-soft);
  cursor: pointer;
  user-select: none;
  min-height: 32px;
}

.bs-check input {
  accent-color: var(--p-primary);
  margin: 0;
}

.bs-check.is-on {
  background: var(--p-primary-50);
  border-color: var(--p-primary-200);
  color: var(--p-primary-dark);
  font-weight: 600;
}

.bs-typeset {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bs-side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--p-line);
  padding-top: 12px;
}

.bs-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* 顶部：已选统计 + 快捷模板 */
.bs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  padding: 12px 16px;
  box-shadow: var(--p-shadow);
}

.bs-count strong {
  color: var(--p-primary-dark);
  font-size: 17px;
}

.bs-templates {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 结果卡片 */
.bs-qcard {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--p-shadow);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bs-qcard:hover {
  border-color: var(--p-primary-200);
  box-shadow: var(--p-shadow-hover);
}

.bs-qcard.is-picked {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
}

.bs-qcheck {
  padding-top: 2px;
}

.bs-qcheck input {
  width: 18px;
  height: 18px;
  accent-color: var(--p-primary);
  cursor: pointer;
}

.bs-qbody {
  flex: 1;
  min-width: 0;
}

.bs-qmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.bs-qno {
  font-weight: 700;
  color: var(--p-ink);
  font-size: 14px;
}

.bs-qtext {
  color: var(--p-ink-soft);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bs-qtypes {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bs-tag {
  font-size: 12px;
  color: var(--p-primary-dark);
  background: var(--p-primary-50);
  border: 1px solid var(--p-primary-100);
  border-radius: 999px;
  padding: 2px 10px;
}

.bs-usage {
  font-size: 12px;
  color: var(--p-ink-muted);
  background: var(--p-surface-soft);
  border-radius: 999px;
  padding: 2px 10px;
}

.bs-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 2px;
}

.bs-pager-info {
  color: var(--p-ink-muted);
  font-size: 13px;
}

/* 组卷页 */
.bc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--p-shadow);
}

.bc-item.is-removed {
  opacity: 0.45;
}

.bc-ops {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bc-op {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--p-line-strong);
  background: var(--p-surface-soft);
  color: var(--p-ink-soft);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
}

.bc-op:hover:not(:disabled) {
  border-color: var(--p-primary-200);
  color: var(--p-primary-dark);
}

.bc-op:disabled {
  opacity: 0.35;
  cursor: default;
}

.bc-order {
  font-size: 13px;
  font-weight: 700;
  color: var(--p-primary-dark);
  background: var(--p-primary-50);
  border-radius: 8px;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bc-footbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  box-shadow: 0 -4px 20px rgba(31, 42, 60, 0.08);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.bc-foot-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.bc-foot-fields label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--p-ink-soft);
}

.bc-foot-fields input[type="date"],
.bc-foot-fields input[type="text"] {
  border: 1px solid var(--p-line-strong);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--p-ink);
  background: var(--p-surface-soft);
}

/* Prompt 42：组卷标题同名未完成批次警告条（淡橙底 + 橙边 + 图标） */
.bc-dup-hint {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--warn-600);
  border-radius: 10px;
  background: var(--warn-50);
  color: var(--warn-800);
  font-size: 13px;
  line-height: 1.55;
}

.bc-dup-hint.is-allowed {
  border-style: dashed;
}

.bc-dup-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-weight: 600;
}

.bc-dup-icon {
  flex: 0 0 auto;
  line-height: 1.5;
}

.bc-dup-title {
  word-break: break-word;
}

.bc-dup-meta {
  margin-top: 2px;
  color: var(--warn-700);
  font-size: 12.5px;
}

.bc-dup-note {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--warn-700);
}

.bc-dup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* 组卷批次列表页 */
.bp-batch.is-open {
  border-color: var(--p-primary-200);
  background: var(--p-primary-50);
}

.bp-detail {
  margin-top: 10px;
  border-top: 1px dashed var(--p-line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 小屏降级：筛选栏收为横向滚动 */
@media (max-width: 900px) {
  .bs-layout {
    grid-template-columns: 1fr;
  }

  .bs-side {
    position: static;
    max-height: none;
  }
}

/* ============================================================
 * 14. 设置页（Prompt 12 三、14）
 * ------------------------------------------------------------ */
.psetting-result {
  margin-top: 12px;
  font-size: 14px;
}

.psetting-result a {
  color: var(--brand-600);
  text-decoration: underline;
  word-break: break-all;
}

/* 首页待处理事项：失败变式题条目 */
.ptodo-fail-head {
  color: #b54708;
  font-weight: 600;
}

.ptodo-fail {
  gap: 8px;
}

.ptodo-fail .ptodo-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
 * 15. 上传中心（Prompt 13b）
 * ------------------------------------------------------------ */
.upcard {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.uphint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--p-ink-muted);
}

/* Tab 切换区 */
.uptabs {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: 14px;
  padding: 6px;
}

.uptab {
  flex: 1;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--p-ink-soft);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.uptab:hover {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

.uptab.is-active {
  background: var(--p-primary-100);
  color: var(--p-primary-dark);
}

/* 拖拽上传区 */
.updrop {
  border: 2px dashed var(--p-line-strong, #c3cfdc);
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.updrop:hover {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
}

/* 拖入高亮（八、1：蓝色边框 + 淡蓝背景） */
.updrop.is-dragover {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
}

.updrop-icon {
  font-size: 34px;
  line-height: 1;
}

.updrop-text {
  margin: 10px 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--p-ink);
}

/* 识别进度（模拟进度） */
.upprogress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upprogress .progress-fill {
  transition: width 0.3s ease;
}

/* 题型标签 */
.uptags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.uptag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
  font-size: 14px;
  font-weight: 500;
}

.uptag-empty {
  background: #f1f4f8;
  color: var(--p-ink-muted);
}

/* 确认页头部与操作区 */
.upconfirm-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.upactions {
  margin-top: 4px;
}

/* 375px：tab 收紧、按钮不挤 */
@media (max-width: 480px) {
  .uptab {
    font-size: 14px;
    min-height: 44px;
    padding: 0 4px;
  }

  .updrop {
    padding: 24px 12px;
  }

  .upactions .btn {
    flex: 1;
  }
}

/* ============================================================
 * 16. 题库上传 · AI 难度提示（Prompt 14c）
 * ------------------------------------------------------------ */
.pb-diff-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-diff-hint {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 240px;
}

.pb-diff-hint .is-ai {
  color: var(--p-primary, #4a6fa5);
  font-weight: 600;
}

.pb-diff-hint .is-base,
.pb-diff-hint .is-modified {
  color: var(--p-ink-muted, #8a97a8);
}

.pb-diff-hint .pb-diff-reason {
  color: var(--p-ink-muted, #8a97a8);
}

/* ============================================================
 * 17. 题库多格式上传（Prompt 14a）
 * ------------------------------------------------------------ */
/* 三入口按钮行 */
.pb-entry-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pb-entry-btn {
  flex: 1;
  min-width: 120px;
  min-height: 44px;
}

/* 已选文件列表 */
.pb-filerow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface);
  margin-bottom: 8px;
}

.pb-filerow-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--p-line);
}

.pb-filerow-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--p-primary-50, #eef3fa);
  border-radius: 8px;
}

.pb-filerow-main {
  flex: 1;
  min-width: 0;
}

.pb-filerow-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-filerow-size {
  font-size: 12px;
  color: var(--p-ink-muted);
  margin-top: 2px;
}

/* 解析进度：总体进度条 */
.pb-totalprogress {
  margin: 14px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pb-totalprogress-text {
  font-size: 13px;
  color: var(--p-ink-muted);
}

/* 解析进度：文件列表 */
.pb-fileprogress .pb-imgrow {
  align-items: center;
}

.pb-fileprogress .pb-imgrow.is-fail {
  border-color: var(--p-danger, #d9534f);
  background: #fdf3f2;
}

.pb-imgrow-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--p-primary-50, #eef3fa);
  border-radius: 8px;
  flex: none;
}

/* 确认页来源标识 */
.pb-sourcerow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.pb-sourcerow-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--p-line);
  border-radius: 6px;
}

.pb-sourcerow-text {
  font-size: 12px;
  color: var(--p-ink-muted);
}

@media (max-width: 480px) {
  .pb-entry-btn {
    min-width: 100px;
  }
}

/* ============================================================
 * 18. 笔记文档上传（Prompt 14b-1 修正版）
 * ------------------------------------------------------------
 * 组件结构样式在 theme.css 第 27 节（两端口共用），
 * 这里只做家长端的配色微调。
 * ------------------------------------------------------------ */
.nd-content {
  border-color: var(--p-line, #e3e8ef);
  color: var(--p-ink, #1f2933);
}

.nd-content:focus {
  border-color: var(--p-primary-300, #a9c4e8);
}

.nd-tag {
  background: var(--p-primary-50, #eef3fa);
  color: var(--p-primary-600, #3b5c8c);
}

.nd-source-link {
  color: var(--p-primary-500, #4a6fa5);
}

.nd-type-hint.is-ai {
  color: #3b6ea5;
}

.nd-type-hint.is-modified {
  color: #8a6d1f;
}
/* ============================================================
 * 19. 错题/重点题文档上传（Prompt 14b-2）
 * ------------------------------------------------------------
 * 由 question-doc-upload.js 渲染，仅在家长端 upload.html 使用。
 * 复用 theme.css 的 progress-bar / badge / btn 体系。
 * ------------------------------------------------------------ */

/* ---- 步骤 1：选择文档（拖拽区） ---- */
.qd-drop {
  border: 2px dashed var(--p-primary-300, #a9c4e8);
  border-radius: 14px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--p-primary-50, #eef3fa);
  transition: border-color 0.15s, background 0.15s;
}

.qd-drop:hover,
.qd-drop:focus-visible,
.qd-drop.is-dragover {
  border-color: var(--p-primary-500, #4a6fa5);
  background: #e2ecf8;
}

.qd-drop-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
}

.qd-drop-text {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--p-ink, #1f2933);
}

.qd-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--p-muted, #6b7280);
}

.qd-picked {
  margin-top: 12px;
}

.qd-file-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--p-ink, #1f2933);
  word-break: break-all;
}

.qd-file-meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--p-muted, #6b7280);
}

.qd-btnrow {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ---- 步骤 2：解析中 ---- */
.qd-parsing .progress-bar {
  margin-top: 6px;
}

/* ---- 步骤 3：逐题确认 ---- */
.qd-quality-hint {
  margin: 10px 0 0;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
}

.qd-quality-hint.is-info {
  background: var(--p-primary-50, #eef3fa);
  color: var(--p-primary-600, #3b5c8c);
}

.qd-quality-hint.is-warn {
  background: #fdf3e0;
  color: #8a6d1f;
}

.qd-toolrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--p-line, #e3e8ef);
}

.qd-master-check,
.qd-check {
  width: 17px;
  height: 17px;
  accent-color: var(--p-primary-500, #4a6fa5);
  flex: none;
  cursor: pointer;
}

.qd-master-label {
  font-size: 13.5px;
  color: var(--p-ink, #1f2933);
  cursor: pointer;
}

.qd-selected-info {
  font-size: 12.5px;
  color: var(--p-muted, #6b7280);
  flex: 1;
}

/* ---- 题卡 ---- */
.qd-list {
  margin-top: 4px;
}

.qd-card {
  border: 1px solid var(--p-line, #e3e8ef);
  border-radius: 12px;
  margin-top: 10px;
  background: #fff;
  overflow: hidden;
}

.qd-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
}

.qd-no {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--p-primary-600, #3b5c8c);
  background: var(--p-primary-50, #eef3fa);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

.qd-preview {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--p-ink, #1f2933);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Prompt 44：题干预览不再用 JS slice(0, 40)（会切断 $…$），改为完整文本 + 两行 CSS 截断。
   需要把基类的 nowrap 放开，否则 -webkit-line-clamp 只能截出一行。 */
.qd-preview.latex-clamp-2 {
  white-space: normal;
}

.qd-flags {
  flex: none;
  display: flex;
  gap: 4px;
}

.qd-flag {
  font-size: 11px;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.qd-flag.is-ok {
  background: #e5f6ec;
  color: #1f7a43;
}

.qd-flag.is-bad {
  background: #fdeaea;
  color: #b23b3b;
}

.qd-flag.is-figure {
  background: #efe9fb;
  color: #6b4bb8;
}

.qd-card-del {
  flex: none;
  border: none;
  background: none;
  font-size: 12.5px;
  color: #b23b3b;
  cursor: pointer;
  padding: 2px 4px;
}

.qd-arrow {
  flex: none;
  color: var(--p-muted, #6b7280);
  font-size: 12px;
}

.qd-card-body {
  padding: 12px;
  border-top: 1px solid var(--p-line, #e3e8ef);
}

.qd-row {
  display: flex;
  gap: 10px;
}

.qd-row .qd-field {
  flex: 1;
  min-width: 0;
}

.qd-field-num {
  flex: none !important;
  width: 110px;
}

.qd-field-src {
  max-width: 180px;
}

.qd-field {
  margin-bottom: 10px;
}

.qd-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--p-muted, #6b7280);
  margin-bottom: 4px;
}

.qd-field-error {
  display: none;
  margin: 4px 0 0;
  font-size: 12px;
  color: #b23b3b;
}

.qd-card .input,
.qd-card .textarea,
.qd-card .select {
  width: 100%;
  font-size: 14px;
}

.qd-textarea {
  resize: vertical;
}

/* ---- 选项（只读展示） ---- */
.qd-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qd-option-item {
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  color: var(--p-ink, #1f2933);
}

.qd-option-letter {
  flex: none;
  font-weight: 700;
  color: var(--p-primary-600, #3b5c8c);
}

/* ---- 图形提示 ---- */
.qd-figure-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b4bb8;
  background: #efe9fb;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

/* ---- 题型标签 ---- */
.qd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.qd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  background: var(--p-primary-50, #eef3fa);
  color: var(--p-primary-600, #3b5c8c);
  border-radius: 999px;
  padding: 3px 10px;
}

.qd-tag-empty {
  color: var(--p-muted, #6b7280);
  background: #f1f3f6;
}

.qd-tag-remove {
  border: none;
  background: none;
  font-size: 11px;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

.qd-type-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

.qd-type-hint.is-ai {
  color: #3b6ea5;
}

.qd-type-hint.is-empty {
  color: #8a6d1f;
}

/* ---- 卡片底部操作 ---- */
.qd-actionrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--p-line, #e3e8ef);
}

.qd-analyze-hint {
  font-size: 12px;
  color: var(--p-muted, #6b7280);
  flex: 1;
}

.qd-del-card {
  margin-left: auto;
}

.qd-analyze-btn.is-busy,
.qd-analyze-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---- 底部 / 完成 ---- */
.qd-footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.qd-done-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--p-ink, #1f2933);
  text-align: center;
}

.qd-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ============================================================
 * 20. 学习设置 · 通关难度（Prompt 15c）
 * ------------------------------------------------------------ */

.setting-pass-level {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}

.setting-pass-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--p-ink, #1f2933);
  cursor: pointer;
}

.setting-pass-option input[type='radio'] {
  width: 16px;
  height: 16px;
  accent-color: var(--p-primary-500, #4a6fa5);
  cursor: pointer;
}

/* ============================================================
 * 21. AI 分步骤解析接入（Prompt 15d）
 * ============================================================ */

/* 图谱右侧错题列表：行 + 操作行 + 就地展开的解析 */
.pg-mrow-wrap {
  display: block;
}

.pg-mrow-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.pg-mrow-actions .btn {
  min-height: 30px;
  padding: 2px 10px;
  font-size: 12.5px;
}

.pg-mrow-steps {
  margin-top: 8px;
}

.pg-mrow-steps.is-hidden {
  display: none;
}

/* 批改结果卡：分步骤解析区块（默认收起） */
.pgrade-steps {
  margin: 10px 0 2px;
}

/* 答案卷打印：分步骤有序列表（每步单独一行，缩进对齐） */
.pex-steps {
  margin: 0;
  padding-left: 22px;
}

.pex-steps li {
  margin: 0;
  padding: 2px 0;
  line-height: 1.6;
}

.pex-steps li + li {
  border-top: 1px dashed #e0e0e0;
}

.pex-steps-dd {
  white-space: normal;
}

/* 打印时保证步骤完整展示、避免步骤行被拦腰截断 */
@media print {
  .pex-steps li {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ============================================================
   第 22 节 · Prompt 15f：笔记关联知识图谱（家长端）
   ============================================================ */

/* ---- 统计卡 4 列（新增「笔记」） ---- */
.pg-stats.is-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---- 错题 / 笔记 tab ---- */
.pg-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  border-bottom: 2px solid var(--p-line);
}

.pg-tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink-muted);
  padding: 7px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, background 0.15s ease;
}

.pg-tab:hover {
  color: var(--p-primary);
  background: var(--p-primary-50);
}

.pg-tab.is-active {
  color: var(--p-primary);
  border-bottom-color: var(--p-primary);
  background: none;
}

.pg-tab-num {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--p-line);
  color: var(--p-ink-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.pg-tab.is-active .pg-tab-num {
  background: var(--p-primary-100);
  color: var(--p-primary-dark);
}

/* ---- 笔记折叠头（家长端默认收起） ---- */
.pg-notes-fold {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-primary-50);
  cursor: pointer;
  user-select: none;
}

.pg-notes-fold:hover {
  border-color: var(--p-primary-200);
}

.pg-notes-fold-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink);
}

.pg-notes-fold-count {
  font-size: 13px;
  color: var(--p-primary-dark);
  background: var(--p-primary-100);
  border-radius: 999px;
  padding: 1px 9px;
}

.pg-notes-fold-arrow {
  margin-left: auto;
  font-size: 12px;
  color: var(--p-ink-muted);
  transition: transform 0.18s ease;
}

.pg-notes-fold.is-open .pg-notes-fold-arrow {
  transform: rotate(180deg);
}

/* ---- 笔记列表 ---- */
.pg-note-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 430px;
  overflow-y: auto;
}

.pg-note-skeleton {
  padding: 2px 0;
}

.pg-note-card {
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pg-note-card:hover {
  border-color: var(--p-primary-200);
  box-shadow: 0 4px 14px rgba(74, 111, 165, 0.14);
}

.pg-note-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pg-note-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pg-note-time {
  flex: none;
  font-size: 12px;
  color: var(--p-ink-muted);
}

.pg-note-excerpt {
  font-size: 13px;
  line-height: 1.6;
  color: var(--p-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pg-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pg-note-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
  border: 1px solid var(--p-primary-200);
}

.pg-note-tag.is-more,
.pg-note-tag.is-empty {
  background: var(--p-bg);
  color: var(--p-ink-muted);
  border-color: var(--p-line);
}

.pg-note-actions {
  display: flex;
  justify-content: flex-end;
}

.pg-note-more {
  align-self: center;
}

.pg-note-empty {
  text-align: center;
  padding: 18px 12px;
  border: 1px dashed var(--p-line-strong);
  border-radius: 10px;
  background: var(--p-bg);
  color: var(--p-ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pg-note-empty-icon {
  font-size: 24px;
}

/* ---- 笔记详情模态框（方案 C） ---- */
.pg-note-modal {
  /* 覆盖 .pg-modal 的 640px 宽度限制（Prompt 15f 六、2：最大宽度 800px） */
  width: min(800px, 100%);
}

.pg-note-modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--p-ink-muted);
  margin-bottom: 10px;
}

.pg-note-status {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
  border: 1px solid var(--p-primary-200);
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 600;
}

.pg-note-modal-thumb {
  margin-bottom: 12px;
}

.pg-note-modal-thumb img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--p-line);
  display: block;
}

.pg-note-modal-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.75;
  color: var(--p-ink);
  background: var(--p-bg);
  border: 1px solid var(--p-line);
  border-radius: 10px;
  padding: 12px 14px;
  max-height: 320px;
  overflow-y: auto;
}

.pg-note-modal-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.pg-note-modal-label {
  font-size: 13px;
  color: var(--p-ink-soft);
  font-weight: 600;
}

.pg-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--p-line);
}

/* ---- 上传确认页：关联知识点（Prompt 15f 第 11 条） ---- */
.uprelated {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uprelated-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--p-primary-200);
  border-radius: 8px;
  background: var(--p-primary-50);
  padding: 6px 10px;
  font-size: 13px;
}

.uprelated-path {
  font-weight: 600;
  color: var(--p-ink);
}

.uprelated-link {
  flex: none;
  color: var(--p-primary);
  font-weight: 600;
  text-decoration: none;
}

.uprelated-link:hover {
  text-decoration: underline;
}

.uprelated-empty {
  font-size: 13px;
  color: var(--p-ink-muted);
}

/* ============================================================
 * 通关后快速复习（Prompt 15e）—— 家长端
 * ------------------------------------------------------------
 * · .pmr-*            复习任务卡片（首页待处理 / mastery-review.html 列表）
 * · .pmr-plan-*       复习计划分层表
 * · .pmr-note-*       计划页关联笔记
 * · .pmr-switch       设置页开关
 * · .pmr-ignored-*    已忽略列表
 * ============================================================ */

/* ---- 首页待处理事项里的复习条目 ---- */
.ptodo-item.is-mastery {
  border-left: 3px solid var(--p-accent);
  background: linear-gradient(90deg, var(--p-primary-50), #ffffff 60%);
}

/* ---- 复习任务卡片 ---- */
.pmr-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  box-shadow: var(--p-shadow);
  padding: 16px 18px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pmr-card:hover {
  box-shadow: var(--p-shadow-hover);
  transform: translateY(-1px);
}

.pmr-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pmr-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--p-ink);
}

.pmr-sub {
  font-size: 13.5px;
  color: var(--p-ink-soft);
}

.pmr-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pmr-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pmr-excerpt {
  border-left: 3px solid var(--p-primary-200);
  background: var(--p-surface-soft);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--p-ink-soft);
}

.pmr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.pmr-badge-mastery {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  background: #ccfbf1;
  color: #0f766e;
  box-shadow: inset 0 0 0 1px #5eead4;
  white-space: nowrap;
}

.pmr-stale {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: #fff7ed;
  color: #c2410c;
  box-shadow: inset 0 0 0 1px #fed7aa;
  white-space: nowrap;
}

/* ---- 分层计划表 ---- */
.pmr-plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pmr-plan-row {
  display: grid;
  grid-template-columns: 92px 72px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-surface-soft);
  padding: 10px 14px;
}

.pmr-plan-level {
  font-weight: 700;
  color: var(--p-ink);
}

.pmr-plan-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--p-primary);
}

.pmr-plan-source {
  font-size: 13px;
  color: var(--p-ink-soft);
}

.pmr-plan-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--p-primary-50);
  border: 1px solid var(--p-primary-200);
  font-size: 14px;
  font-weight: 700;
  color: var(--p-primary-dark);
}

/* ---- 关联笔记 ---- */
.pmr-note-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pmr-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-surface-soft);
  padding: 9px 12px;
}

.pmr-note-text {
  font-size: 13.5px;
  color: var(--p-ink);
}

.pmr-empty {
  font-size: 13.5px;
  color: var(--p-ink-muted);
}

/* ---- 设置页开关 ---- */
.pmr-switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--p-line);
}

.pmr-switch-row:last-child {
  border-bottom: none;
}

.pmr-switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pmr-switch-label {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--p-ink);
}

.pmr-switch-hint {
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pmr-switch {
  position: relative;
  flex: none;
  width: 64px;
  height: 44px; /* 触控区 ≥44px（项目铁律） */
  border-radius: 22px;
  border: 1px solid var(--p-line-strong);
  background: #e6eaf1;
  cursor: pointer;
  transition: background 0.18s ease;
}

.pmr-switch::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(31, 42, 60, 0.25);
  transition: transform 0.18s ease;
}

.pmr-switch[aria-checked='true'] {
  background: var(--p-primary);
  border-color: var(--p-primary);
}

.pmr-switch[aria-checked='true']::after {
  transform: translateX(22px);
}

.pmr-switch:focus-visible {
  outline: 2px solid var(--p-primary);
  outline-offset: 2px;
}

/* ---- 已忽略列表 ---- */
.pmr-ignored-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-surface-soft);
  padding: 10px 14px;
}

.pmr-ignored-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pmr-ignored-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--p-ink);
}

.pmr-ignored-meta {
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

/* ============================================================
 * 题型标签共用组件（Prompt 16a 二）—— 桌面端补充
 * ------------------------------------------------------------
 * .uptags / .uptag / .uptag-empty 沿用原文定义，这里只补组件新引入的
 * 移除按钮（type-tags.js 渲染）。可点击区域按 44px 触控标准做。
 * ============================================================ */
.uptag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--p-primary-dark);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.uptag-x:hover {
  background: var(--p-primary-100, #ffe4cc);
}

/* ============================================================
 * 家长端错题本（Prompt 16b-2）：列表 + 筛选 + 批量操作 + 编辑弹窗 + 详情
 * ------------------------------------------------------------
 * 复用 --p-* 变量；桌面 1440 优先，<768px 切卡片布局。
 * 触控区 ≥ 44px。
 * ============================================================ */

/* ---- 筛选区 ---- */
.pmist-filter-card {
  margin-bottom: 16px;
}

.pmist-filters.is-collapsed .pmist-frow {
  display: none;
}
/* 桌面端不受折叠影响 */
.pmist-frow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--p-line);
}
.pmist-frow:last-child {
  border-bottom: none;
}

.pmist-flabel {
  flex: 0 0 52px;
  padding-top: 9px;
  color: var(--p-ink-soft);
  font-size: 13.5px;
  text-align: right;
}

.pmist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pmist-chip {
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid var(--p-line-strong);
  border-radius: 999px;
  background: var(--p-surface);
  color: var(--p-ink-soft);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.pmist-chip:hover {
  border-color: var(--p-primary);
  color: var(--p-primary-dark);
}
.pmist-chip.is-active {
  border-color: var(--p-primary);
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
  font-weight: 600;
}

.pmist-custom-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pmist-input {
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--p-line-strong);
  border-radius: 8px;
  background: var(--p-surface);
  color: var(--p-ink);
  font-size: 13.5px;
}
.pmist-input:focus {
  outline: none;
  border-color: var(--p-primary);
}
.pmist-input-date {
  width: 140px;
}
.pmist-input-kw {
  width: 240px;
}
.pmist-input-page {
  width: 72px;
  text-align: center;
}

.pmist-filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}
.pmist-mobile-toggle {
  display: none;
}

.pmist-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--p-ink-soft);
  font-size: 13.5px;
  cursor: pointer;
}
.pmist-check input {
  width: 18px;
  height: 18px;
}

/* ---- 批量操作栏 ---- */
.pmist-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 20px;
}
.pmist-count {
  color: var(--p-ink-soft);
  font-size: 14px;
}
/* Prompt 16c 风险 5：全库公式题干统计（弱化展示） */
.pmist-latex-stats {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 4px;
}
.pmist-batch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- 列表表格 ---- */
.pmist-table-wrap {
  overflow-x: auto;
}

.pmist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.pmist-table th,
.pmist-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--p-line);
  text-align: left;
  white-space: nowrap;
}
.pmist-table th {
  color: var(--p-ink-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.pmist-table td:nth-child(3) {
  white-space: normal;
  min-width: 220px;
  max-width: 340px;
}
.pmist-table tbody tr {
  cursor: default;
  transition: background 0.12s;
}
.pmist-table tbody tr:hover {
  background: var(--p-surface-soft);
}

.pmist-td-no {
  font-weight: 600;
  color: var(--p-ink);
}

.pmist-text-link {
  color: var(--p-ink);
  text-decoration: none;
}
.pmist-text-link:hover {
  color: var(--p-primary-dark);
  text-decoration: underline;
}

.pmist-rec-badge {
  margin-left: 6px;
}

.pmist-td-ops {
  text-align: right;
}

/* 已删除行：灰色 + 删除线 */
tr.is-deleted td,
.pmist-card.is-deleted {
  color: var(--p-ink-muted);
  background: var(--p-surface-soft);
}
tr.is-deleted .pmist-text-link {
  color: var(--p-ink-muted);
  text-decoration: line-through;
}
.pmist-card.is-deleted .pmist-text-link {
  color: var(--p-ink-muted);
  text-decoration: line-through;
}

/* ---- 行内 ··· 菜单 ---- */
.pmist-menu-wrap {
  position: relative;
  display: inline-block;
}
.pmist-menu-btn {
  min-width: 44px;
  min-height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--p-ink-soft);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.pmist-menu-btn:hover {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

.pmist-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 128px;
  padding: 6px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-surface);
  box-shadow: var(--p-shadow-hover);
}
.pmist-menu-item {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--p-ink);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.pmist-menu-item:hover {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

/* ---- 分页 ---- */
.pmist-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.pmist-pager.is-hidden {
  display: none;
}
.pmist-page-info {
  color: var(--p-ink-soft);
  font-size: 14px;
}

/* ---- 移动端卡片（默认隐藏，<768px 显示） ---- */
.pmist-cards {
  display: none;
}
.pmist-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--p-line);
}
.pmist-card:last-child {
  border-bottom: none;
}
.pmist-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
/* Prompt 24 极小补丁：状态徽标 + 来源角标 同一组（右侧），横向居中对齐、间距 6px */
.pmist-card-top-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.pmist-card-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}
.pmist-card-check input {
  width: 18px;
  height: 18px;
}
.pmist-card-meta {
  margin-top: 4px;
  color: var(--p-ink-muted);
  font-size: 12.5px;
}
.pmist-card-ops {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ---- 编辑弹窗（mistake-editor.js） ---- */
.pme-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 42, 60, 0.45);
  animation: pme-fade 0.15s ease;
}
@keyframes pme-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pme-modal {
  display: flex;
  flex-direction: column;
  width: 560px;
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--p-radius);
  background: var(--p-surface);
  box-shadow: var(--p-shadow-hover);
  animation: pme-rise 0.18s ease;
}
.pme-modal-sm {
  width: 320px;
}
@keyframes pme-rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--p-line);
}
.pme-title {
  margin: 0;
  font-size: 16.5px;
  color: var(--p-ink);
}
.pme-close {
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--p-ink-muted);
  font-size: 16px;
  cursor: pointer;
}
.pme-close:hover {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

.pme-body {
  flex: 1;
  padding: 10px 20px 16px;
  overflow-y: auto;
}
.pme-section-title {
  margin: 14px 0 6px;
  color: var(--p-primary-dark);
  font-size: 13px;
  font-weight: 700;
}
.pme-section-title:first-child {
  margin-top: 4px;
}

.pme-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.pme-field-row {
  display: flex;
  gap: 20px;
}
.pme-field-row .pme-field {
  flex: 1;
}
.pme-field-label {
  flex: 0 0 64px;
  color: var(--p-ink-soft);
  font-size: 13.5px;
}
.pme-input,
.pme-select {
  flex: 1;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--p-line-strong);
  border-radius: 8px;
  background: var(--p-surface);
  color: var(--p-ink);
  font-size: 14px;
}
.pme-input:focus,
.pme-select:focus,
.pme-textarea:focus {
  outline: none;
  border-color: var(--p-primary);
}
.pme-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--p-line-strong);
  border-radius: 8px;
  background: var(--p-surface);
  color: var(--p-ink);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}
.pme-hint {
  margin: 4px 0 0;
  color: var(--p-ink-muted);
  font-size: 12.5px;
}
/* Prompt 16b-3：编辑弹窗题干预览区（输入框上方实时渲染公式） */
.pme-preview {
  margin: 4px 0 8px;
  padding: 10px 12px;
  border: 1px dashed var(--p-line-strong);
  border-radius: 8px;
  background: var(--p-surface-soft);
  color: var(--p-ink);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 20px;
}
.pme-preview.is-empty {
  color: var(--p-ink-muted);
  font-size: 12.5px;
  border-style: solid;
}
.pme-tags-host {
  margin: 6px 0;
}

/* ---- Prompt 47：编辑弹窗内的 latex-field（学生作答 / 订正内容） ----
   组件基座样式复用下方 Prompt 31 的 .latex-field 区块，这里只做弹窗内的密度微调：
   弹窗空间比题库页紧凑，缩圆角 / 缩内边距，并让预览态与 .pme-textarea 观感一致。 */
.pme-latex-host {
  width: 100%;
}
.pme-latex-host .latex-field-preview {
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--p-surface);
}
.pme-latex-host .latex-field-input {
  font-size: 14px;
}
.pme-latex-host .latex-field-actions {
  padding-bottom: 8px;
}

.pme-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--p-line);
}

/* ---- 详情页 ---- */
.pmist-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pmist-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pmist-meta-text {
  color: var(--p-ink-muted);
  font-size: 13px;
}
.pmist-block {
  margin: 14px 0;
}
.pmist-block-title {
  margin-bottom: 6px;
  color: var(--p-ink-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.pmist-block-body {
  padding: 12px 14px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-surface-soft);
  color: var(--p-ink);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.pmist-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pmist-option {
  padding: 8px 12px;
  border: 1px solid var(--p-line);
  border-radius: 8px;
  background: var(--p-surface-soft);
}
.pmist-figure {
  max-width: 100%;
  max-height: 420px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
}
.pmist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pmist-grid .pmist-block {
  margin: 0;
}
.pmist-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--p-line);
  font-size: 13.5px;
}
.pmist-task-row:last-child {
  border-bottom: none;
}
.pmist-task-status {
  color: var(--p-orange);
  font-size: 12.5px;
}
.pmist-task-status.is-done {
  color: var(--p-green);
}

/* 状态徽标：待复习（补充 pbadge 家族） */
.pbadge-pending {
  background: #fdf3e4;
  color: var(--p-orange);
}

/* ---- 移动端（<768px）---- */
@media (max-width: 768px) {
  .pmist-filters.is-collapsed .pmist-frow {
    display: none;
  }
  .pmist-mobile-toggle {
    display: inline-flex;
  }
  .pmist-flabel {
    flex-basis: 44px;
    text-align: left;
  }
  .pmist-table-wrap {
    display: none;
  }
  .pmist-cards {
    display: block;
  }
  .pmist-input-kw {
    width: 100%;
  }
  .pmist-grid {
    grid-template-columns: 1fr;
  }
  .pme-field-row {
    flex-direction: column;
    gap: 0;
  }
  .pme-modal {
    max-height: 92vh;
  }
}

/* ============================================================ */

/* ============================================================
 * Prompt 16d：LaTeX 摘要 CSS 截断工具类（与 theme.css 同步）
 * ============================================================ */
.latex-clamp-1 {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}
.latex-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}
.latex-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}
/* Prompt 25：判定待确认页题干较长（含标准答案前的完整题干），四行截断 */
.latex-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  word-break: break-word;
}
.latex-clamp-1 .katex,
.latex-clamp-2 .katex,
.latex-clamp-3 .katex,
.latex-clamp-4 .katex {
  display: inline;
  max-width: none;
}
/* 表格题干列：auto 布局下用 min/max 宽度约束列宽（同 pmist-table 模式） */
.ptable td.qtext-td,
.pb-table td.qtext-td {
  white-space: normal;
  min-width: 220px;
  max-width: 460px;
}

/* ============================================================
 * Prompt 18：图谱题型 tab + 关联模块 + 高频考点页
 * ============================================================ */

/* ---- 详情面板「相关模块」提示 ---- */
.pg-related {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px dashed var(--p-primary-200);
  border-radius: 10px;
  background: var(--p-primary-50);
  font-size: 13px;
  line-height: 1.9;
}

.pg-related-label {
  font-weight: 700;
  color: var(--p-ink-700);
  margin-right: 4px;
}

.pg-related-item {
  display: inline-block;
  margin: 0 4px 0 0;
  color: var(--p-primary-dark);
  text-decoration: underline;
  cursor: pointer;
}

.pg-related-item:hover {
  color: var(--p-primary);
}

/* ---- 题型 tab 面板 ---- */
.pg-type-summary {
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

.pg-type-item {
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pg-type-item:hover {
  border-color: var(--p-primary-200);
  box-shadow: 0 2px 10px rgba(74, 111, 165, 0.1);
}

.pg-type-item:focus-visible {
  outline: 2px solid var(--p-primary);
  outline-offset: 2px;
}

.pg-type-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pg-type-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--p-ink-900);
}

.pg-type-hot {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fff1f0;
  color: #d6453d;
  border: 1px solid #ffc9c2;
}

.pg-type-hot.is-press {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
}

.pg-type-meta {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

.pg-type-rel {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--p-ink-muted);
}

.pg-type-rel-label {
  color: var(--p-ink-700);
  font-weight: 600;
}

.pg-type-rel-path {
  color: var(--p-primary-dark);
}

/* ============================================================
 * Prompt 18 五：高频考点页 hot-types.html
 * ============================================================ */
.hot-sub {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hot-summary {
  font-size: 14px;
  color: var(--p-ink-muted);
}

.hot-group {
  margin-top: 16px;
}

.hot-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-primary-50);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--p-ink-900);
  cursor: pointer;
  text-align: left;
}

.hot-group-head:hover {
  border-color: var(--p-primary-200);
}

.hot-group-count {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--p-ink-muted);
}

.hot-group-arrow {
  margin-left: auto;
  color: var(--p-ink-muted);
  transition: transform 0.15s ease;
}

.hot-group-head.is-open .hot-group-arrow {
  transform: rotate(180deg);
}

.hot-group-body {
  padding: 4px 6px 0;
}

.hot-group-body.is-hidden {
  display: none;
}

.hot-row {
  padding: 10px 12px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hot-row:hover {
  border-color: var(--p-primary-200);
  box-shadow: 0 2px 10px rgba(74, 111, 165, 0.1);
}

.hot-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hot-row-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--p-ink-900);
}

.hot-row-meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

.hot-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--p-line);
  color: var(--p-ink-700);
}

.hot-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--p-line);
}

.hot-detail .pg-modal-item {
  padding: 8px 10px;
}

@media (max-width: 768px) {
  .pg-related {
    font-size: 12.5px;
  }

  .hot-group-head {
    padding: 9px 10px;
  }
}

/* ============================================================
 * Prompt 20：家长端笔记管理（笔记本列表 / 笔记详情 / 编辑弹窗）
 * 说明：列表页复用错题本的 pmist-* 结构类（筛选区 / 表格 / 卡片 / 分页 / ··· 菜单），
 *       此处只补笔记特有的 pnote-* 样式，避免重复造轮子。
 * ============================================================ */

/* ---- 列表页：表格列宽（第 2 列标题 / 第 3 列摘要允许换行） ---- */
.pnote-table td:nth-child(2) {
  white-space: normal;
  min-width: 140px;
  max-width: 260px;
}

.pnote-td-title {
  font-weight: 600;
}

.pnote-del-badge {
  margin-left: 6px;
}

/* 摘要用次要色，与标题区分（正文本身不截断，靠 .latex-clamp-* 视觉省略） */
.pmist-text-link.is-plain {
  color: var(--p-ink-muted);
  font-weight: 400;
}

/* ---- 列表页：移动端卡片缩略图 ---- */
.pnote-thumb {
  display: block;
  width: 100%;
  max-width: 180px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--p-line);
  background: var(--p-surface-soft);
  margin: 6px 0 8px;
}

.pnote-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pnote-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pnote-thumb-ph {
  font-size: 28px;
  opacity: 0.6;
}

.pnote-card-date {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--p-ink-muted);
}

/* ---- 详情页 ---- */
.pnote-topbar {
  margin-bottom: 12px;
}

.pnote-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pnote-head-main {
  min-width: 0;
  flex: 1 1 260px;
}

.pnote-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  color: var(--p-ink-900);
  word-break: break-word;
}

.pnote-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pnote-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pnote-figure {
  max-width: 800px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--p-surface-soft);
  cursor: zoom-in;
}

.pnote-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.pnote-figure.is-hidden {
  display: none;
}

.pnote-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pnote-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pnote-text-wrap {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--p-line);
  border-radius: 10px;
  background: var(--p-surface-soft);
}

.pnote-text-wrap.is-hidden {
  display: none;
}

.pnote-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--p-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.pnote-placeholder {
  margin-top: 10px;
  min-height: 44px;
  border: 1px dashed var(--p-line);
  border-radius: 10px;
  background: var(--p-surface-soft);
}

@media (max-width: 768px) {
  .pnote-title {
    font-size: 19px;
  }

  .pnote-figure {
    max-width: 100%;
  }

  .pnote-thumb {
    max-width: 100%;
    height: 140px;
  }
}

/* ============================================================
 * 关联推荐面板（Prompt 22）—— 家长端覆盖为蓝灰专业配色
 * ------------------------------------------------------------
 * theme.css 里是孩子端暖橙基调，这里只覆盖颜色与区块间距，
 * 结构与尺寸沿用 theme.css，避免两端出现两套布局。
 * ============================================================ */

/* 错题详情：区块直接挂在 #detail-body 下，与 .pmist-block 的 14px 间距对齐 */
#detail-body > .related-section {
  margin: 14px 0;
}

/* 笔记详情：区块本身是 .pcard，标题跟随 .pcard-title 的浅灰小标题风格 */
.pcard.related-section .related-header {
  margin-bottom: 12px;
}

.related-header .related-title {
  color: var(--p-ink);
}

.related-card {
  background: var(--p-surface);
  border-color: var(--p-line);
}

.related-card:hover {
  border-color: var(--p-primary-200);
  box-shadow: var(--p-shadow-hover);
}

.related-thumb {
  background: var(--p-primary-50);
}

.related-card-title {
  color: var(--p-ink);
}

.related-card-excerpt {
  color: var(--p-ink-soft);
}

.related-card-reason {
  color: var(--p-ink-muted);
}

.related-qno {
  color: var(--p-primary);
}

.related-difficulty {
  color: var(--p-ink-muted);
  background: #eef1f6;
}

.related-difficulty.is-key {
  color: var(--p-orange);
  background: #fdf3e4;
}

/* 来源徽标：AI 灰 / 类型匹配淡色 */
.related-source.is-ai {
  color: var(--p-ink-muted);
  background: #eef1f6;
}

.related-source.is-shared {
  color: var(--p-ink-soft);
  background: #f2f5fa;
  border: 1px solid var(--p-line);
}

/* 相关度：≥0.9 绿 / 0.7~0.9 橙 / <0.7 灰 */
.related-score.is-high {
  color: var(--p-green);
  background: #e8f5ee;
}

.related-score.is-mid {
  color: var(--p-orange);
  background: #fdf3e4;
}

.related-score.is-low {
  color: var(--p-ink-muted);
  background: #eef1f6;
}

.related-empty {
  border-color: var(--p-line-strong);
  background: var(--p-surface-soft);
  color: var(--p-ink-muted);
}

.related-error {
  border-color: #f3c7cb;
  background: #fdf2f3;
  color: var(--p-red);
}

.related-updating {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

.related-skel-row {
  border-color: var(--p-line);
  background: var(--p-surface);
}

.related-skel-thumb {
  background: #eef1f6;
}

.related-skel-bar {
  background: linear-gradient(90deg, #eef1f6 0%, #dfe6f1 50%, #eef1f6 100%);
  background-size: 200% 100%;
}

.related-hint {
  color: var(--p-ink-muted);
}

/* ============================================================
   Prompt 24 小补丁：错题来源角标「来自挑战题」
   - 统一类名 .psrc-badge，4 个家长端页面（错题本 / 错题详情 / 周报 / 图谱）共用一套样式
   - 配色固定：紫底 #F3E5F5 + 深紫字 #6A1B9A，字号 11px（与 .pbadge 家族同一视觉层级）
   - .is-compact 只收窄内边距，字号保持 11px，保证「角标样式统一」
   ============================================================ */
.psrc-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 0;
  border-radius: 4px;
  background: #f3e5f5;
  color: #6a1b9a;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}

/* 详情页：角标是 <a>，需要可点击态的视觉反馈 */
a.psrc-badge:hover,
a.psrc-badge:focus-visible {
  background: #e1bee7;
  color: #4a148c;
  text-decoration: underline;
}

/* 周报错题摘要：紧凑版（只收内边距，不动字号） */
.psrc-badge.is-compact {
  padding: 0 5px;
  line-height: 15px;
}

/* 「文本 + 角标」并排容器：错题本错因单元格 / 图谱题号 */
.psrc-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 错题详情页标题：标题 + 角标 同一组，避免被 .pcard-title-row 的 space-between 拆散 */
.pcard-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ============================================================
   Prompt 31：latex-field —— 题干 / 选项「预览优先，点击切换编辑」
   视觉与 .pb-input / .pb-textarea 保持一致（题库页风格）
   ============================================================ */
.latex-field {
  width: 100%;
  box-sizing: border-box;
  font-size: 15px;
  font-family: inherit;
  color: var(--p-ink);
}

/* ---- 预览态：外观等同输入框，cursor 提示可点击 ---- */
.latex-field-preview {
  display: flex;
  align-items: flex-start;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--p-line-strong);
  border-radius: 12px;
  background: var(--p-surface-soft);
  cursor: text;
  transition: border-color .15s ease, background .15s ease;
}

.latex-field-preview:hover {
  border-color: var(--p-primary);
  background: #fff;
}

.latex-field-preview:focus-visible {
  outline: none;
  border-color: var(--p-primary);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, .15);
}

.latex-field-content {
  flex: 1;
  min-width: 0;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.latex-field-content.is-empty {
  color: var(--p-ink-muted);
}

/* 悬停提示：默认隐藏，悬停 / 聚焦时淡入 */
.latex-field-hint {
  flex: 0 0 auto;
  align-self: center;
  margin-left: 8px;
  font-size: 12px;
  color: var(--p-ink-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s ease;
}

.latex-field-preview:hover .latex-field-hint,
.latex-field-preview:focus-visible .latex-field-hint {
  opacity: 1;
}

/* ---- 编辑态：textarea 融入外框，无独立边框 ---- */
.latex-field-edit {
  padding: 8px 8px 0;
  border: 1px solid var(--p-primary);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 111, 165, .12);
}

.latex-field-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 6px 6px 8px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--p-ink);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.7;
  resize: none;
}

textarea.latex-field-input {
  min-height: 76px;
  max-height: 360px;
  overflow-y: auto;
}

/* 底部操作区右对齐 */
.latex-field-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 2px 8px;
}

.latex-field-edit-hint {
  margin-right: auto;
  font-size: 12px;
  color: var(--p-ink-muted);
}

.latex-field-done {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--p-primary);
  border-radius: 8px;
  background: var(--p-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.latex-field-done:hover {
  filter: brightness(1.06);
}

/* 选项行内：字段容器占满剩余宽度 */
.pb-optrow .pb-latexfield {
  flex: 1;
  min-width: 0;
}

/* ---- 移动端 375px：收窄内边距、隐藏提示文字 ---- */
@media (max-width: 480px) {
  .latex-field-hint {
    display: none;
  }

  .latex-field-edit-hint {
    display: none;
  }

  .latex-field-preview {
    padding: 9px 10px;
  }
}

/* ============================================================
   Prompt 40：题库字段 LaTeX 覆盖补齐
   ------------------------------------------------------------
   标准答案 / 图形说明 / 解析 接入 latex-field（题干 / 选项沿用 Prompt 31）。
   预览态的高度 / 内边距 / 圆角 / 背景与 .pb-input 完全一致
   （min-height 48px / padding 10px 12px / radius 12px / --p-surface-soft），
   因此这里不重复定义字段本身，只补「容器」与「图形说明下间距」两处增量。
   ============================================================ */
/* 字段容器：占满父级宽度，并允许在 flex 行内收缩（选项行 / is-inline 行） */
.pb-latexfield {
  width: 100%;
  min-width: 0;
}

/* 图形说明位于裁剪区上方：与下方缩略图 / 裁剪按钮拉开间距（上方间距由容器内联 margin-top 给） */
.pb-figbody > .pb-latexfield {
  margin-bottom: 8px;
}

/* ============================================================
 * Prompt 45：家长端 upload.html —— LaTeX 字段容器
 * ------------------------------------------------------------
 * 背景：错题/重点题确认表单的题干、选项、学生作答、订正、AI 答案原先是
 *      <textarea>/<input>，它们的 value 不属于 DOM 文本节点，
 *      KaTeX auto-render 碰不到 → 页面直接显示 $...$ 源码。
 *      改用 latex-field.js（组件自身样式见上方 .latex-field 区块）。
 * ============================================================ */

/* 字段宿主：占满所在 .field 宽度，外观交给 .latex-field 自己 */
.lf-host {
  width: 100%;
}

/* 选项行：latex-field 顶替原生 .input，接管 flex:1（原规则 .option-item .input 不再命中） */
.option-item .option-field {
  flex: 1;
  min-width: 0;
}

/* 选项为单行内容，与左侧字母块（48px）等高对齐 */
.option-item .latex-field-preview {
  min-height: 48px;
  padding: 8px 12px;
}

/* AI 答案：只读展示（不是 latex-field 实例），复刻输入框外观但不可点击进入编辑 */
.lf-readonly {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--p-line-strong);
  border-radius: 12px;
  background: var(--p-surface-soft);
}

.lf-readonly .latex-field-content {
  flex: 1;
  min-width: 0;
}

/* ============================================================
 * Prompt 46：作答分析（家长端蓝色调适配）
 * 组件见 /js/answer-analysis.js；基座样式在 theme.css
 * ============================================================ */
body.parent .aa-root {
  border-color: var(--p-line-strong);
  background: var(--p-surface);
}
body.parent .aa-head {
  background: var(--p-surface-soft);
  border-bottom-color: var(--p-line);
}
body.parent .aa-title { color: var(--p-ink); }
body.parent .aa-hint { color: var(--p-ink-muted); }
body.parent .aa-toggle { color: var(--p-primary-dark); }
body.parent .aa-label { color: var(--p-ink-soft); }
body.parent .aa-step-label { color: var(--p-red); }
body.parent .aa-step-detail {
  background: #fdf1f1;
  border-left-color: var(--p-red);
  color: var(--p-ink);
}
body.parent .aa-reason-text {
  background: var(--p-primary-50);
  color: var(--p-ink);
}
body.parent .aa-tag {
  background: #fdf6ea;
  border-color: #f6e3c8;
  color: #9a5b12;
}
body.parent .aa-item-body { color: var(--p-ink); }
body.parent .aa-no { color: var(--p-ink-muted); }
body.parent .aa-note { color: var(--p-red); }
body.parent .aa-item.is-correct .aa-status { color: var(--p-green); }
body.parent .aa-item.is-partial .aa-status { color: var(--p-orange); }
body.parent .aa-item.is-wrong .aa-status { color: var(--p-red); }
body.parent .aa-item.is-wrong .aa-item-body { color: var(--p-red); }
body.parent .aa-item.is-partial .aa-item-body { color: var(--p-orange); }

/* ============================================================
 * Prompt 46：题卡内 LaTeX 字段容器（question-doc-upload.js）
 * ------------------------------------------------------------
 * 题干 / 学生作答 / 订正 / 图形说明 / 标准答案 / 解析 改用 latex-field，
 * 这里只补「容器占满宽度」与「AI 答案只读块外观」两处增量。
 * ============================================================ */
.qd-latex-host {
  width: 100%;
}

/* 单行字段（图形说明 / 标准答案）：预览态压低高度，与 .qd-row 布局对齐 */
.qd-latex-host .latex-field-preview {
  min-height: 42px;
  padding: 8px 10px;
}

/* AI 生成答案：只读展示（非 latex-field 实例），复刻输入框外观 */
.qd-ai-answer {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--p-line-strong);
  border-radius: 12px;
  background: var(--p-surface-soft);
}

.qd-ai-answer .latex-field-content {
  flex: 1;
  min-width: 0;
}

/* 笔记文档确认页：latex-field 配色对齐家长端 */
.nd-content-host .latex-field {
  color: var(--p-ink);
}

.nd-content-host .latex-field-preview {
  border-color: var(--p-line-strong);
  background: var(--p-surface-soft);
}

.nd-content-host .latex-field-content.is-empty {
  color: var(--p-ink-muted);
}

/* ============================================================
 * Prompt 49（薄弱点图谱 · 阶段 1）：家长端「薄弱点」页面
 * ------------------------------------------------------------
 * 家长是决策者 → 这里用「薄弱点」的明确说法（与孩子端「待加强」区分）。
 * 折叠态给出：名称 + 错题数 + 最近一次摘要；展开态给出完整错题列表。
 * ============================================================ */

.pwk-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 20px;
}

.pwk-tip {
  font-size: 13px;
  color: var(--p-ink-muted);
}

.pwk-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pwk-item {
  padding: 16px 18px;
}

.pwk-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwk-item-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

.pwk-item-name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--p-ink);
  line-height: 1.5;
  word-break: break-word;
}

.pwk-item-count {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--p-primary-100);
  color: var(--p-primary-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pwk-item-latest {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--p-primary-200);
  border-radius: 0 8px 8px 0;
  background: var(--p-surface-soft);
  font-size: 13px;
  line-height: 1.6;
  color: var(--p-ink-soft);
  word-break: break-word;
}

.pwk-item-actions {
  margin-top: 12px;
}

.pwk-body {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--p-line-strong);
}

.pwk-item.is-open .pwk-body {
  display: block;
}

.pwk-hint {
  padding: 10px 0;
  font-size: 14px;
  color: var(--p-ink-muted);
}

.pwk-mistake {
  padding: 12px 14px;
  border: 1px solid var(--p-line);
  border-radius: 12px;
  background: var(--p-surface-soft);
}

.pwk-mistake + .pwk-mistake {
  margin-top: 10px;
}

.pwk-mistake-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.pwk-mistake-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--p-primary-dark);
  white-space: nowrap;
}

.pwk-mistake-tags {
  font-size: 12px;
  color: var(--p-ink-muted);
  text-align: right;
}

.pwk-mistake-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--p-ink);
}

.pwk-mistake-step {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--p-ink-soft);
}

.pwk-mistake-step-label {
  font-weight: 700;
  color: var(--p-orange);
  margin-right: 4px;
}

.pwk-mistake-foot {
  margin-top: 10px;
}

.pwk-note {
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--p-ink-muted);
}

.pwk-note b {
  color: var(--p-ink-soft);
}

/* ------------------------------------------------------------
 * Prompt 60b-2o：薄弱点通关状态
 * 待加强 / 已消除 tab + 进度条 + 已通关徽标 + 专项复习入口
 * ------------------------------------------------------------ */

.pwk-tabs {
  margin-bottom: 4px;
}

.pwk-tab-num {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(74, 111, 165, 0.12);
  color: var(--p-ink-muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.pwk-tabs button.is-active .pwk-tab-num {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* 进度条：已掌握 X / 总数 Y（分子分母同口径，恒 ≤ 100%） */
.pwk-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 2px;
}

.pwk-progress-bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: rgba(74, 111, 165, 0.12);
  overflow: hidden;
}

.pwk-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-300), var(--brand-500));
  transition: width 0.25s ease;
}

.pwk-progress-fill.is-full {
  background: linear-gradient(90deg, #5cb87a, #3d9c5c);
}

.pwk-progress-text {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--p-ink-muted);
  font-variant-numeric: tabular-nums;
}

.pwk-badge {
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.pwk-badge-passed {
  background: rgba(61, 156, 92, 0.14);
  color: #3d9c5c;
}

.pwk-badge-review {
  background: rgba(214, 138, 42, 0.16);
  color: #b5731c;
}

/* 已消除的卡片整体降饱和：一眼区分「历史战绩」与「当前待办」 */
.pwk-item-passed {
  opacity: 0.86;
}

.pwk-item-passed .pwk-item-name {
  color: var(--p-ink-soft);
}

/* 专项复习入口 */
.pwk-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(74, 111, 165, 0.06);
  border: 1px dashed rgba(74, 111, 165, 0.32);
}

.pwk-review-hint {
  font-size: 13px;
  color: var(--p-ink-soft);
}

/* ============================================================
 * Prompt 25：AI 初评 + 家长裁决
 * ------------------------------------------------------------
 * 页面：parent/pending-judgments.html
 * 场景：孩子自评与 AI 判定不一致 → judgment_status = pending_parent
 *       家长看完作答与双方判定后二选一（同意 AI / 同意孩子）
 * 设计：沿用家长端蓝灰基调；卡片左侧橙色细条 = 需人工介入
 * ============================================================ */

/* 标题行右侧的「N 条待裁决」 */
.pj-count-text {
  font-size: 13px;
  color: var(--p-orange);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pj-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pj-intro {
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--p-primary-50);
  border: 1px solid var(--p-primary-100);
  color: var(--p-ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

/* ---------------- 卡片 ---------------- */
/* 注意：.pcard + .pcard 已被置为 margin-top: 0，这里必须显式覆盖 */
.pj-card {
  margin-top: 16px;
  padding: 18px 20px 16px;
  border-left: 3px solid var(--p-orange);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.pj-card.is-resolved {
  opacity: 0;
  transform: translateX(12px);
}

.pj-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pj-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pj-date {
  font-size: 12px;
  color: var(--p-ink-muted);
  font-variant-numeric: tabular-nums;
}

.pj-origin-link {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--p-primary);
  text-decoration: none;
  padding: 4px 2px;
}

.pj-origin-link:hover {
  text-decoration: underline;
}

/* 题干：完整文本 + CSS 四行截断（含 LaTeX 不做字符串截断） */
.pj-question {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--p-surface-soft);
  border: 1px solid var(--p-line);
  color: var(--p-ink);
  font-size: 15px;
  line-height: 1.9;
}

/* ---------------- 内容块（标准答案 / 孩子作答） ---------------- */
.pj-block {
  margin-top: 12px;
}

.pj-block-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--p-ink-muted);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.pj-block-value {
  font-size: 14px;
  line-height: 1.85;
  color: var(--p-ink);
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--p-surface-soft);
  border: 1px solid var(--p-line);
  word-break: break-word;
}

.pj-block-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--p-ink-muted);
}

/* 作答图片：等比缩放、最长边不超过 320px，点开看原图 */
.pj-answer-img {
  display: block;
  max-width: 320px;
  max-height: 320px;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--p-line-strong);
  background: #fff;
  object-fit: contain;
}

/* ---------------- 双方判定并列 ---------------- */
.pj-judges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pj-judge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--p-surface-soft);
  border: 1px solid var(--p-line);
}

.pj-judge-who {
  font-size: 12px;
  color: var(--p-ink-muted);
  font-weight: 600;
}

.pj-judge-value {
  font-size: 15px;
  font-weight: 700;
}

.pj-judge-right {
  color: var(--p-green);
}

.pj-judge-wrong {
  color: var(--p-red);
}

/* ---------------- 裁决按钮 ---------------- */
.pj-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pj-actions .btn {
  min-height: 44px;
  flex: 1 1 0;
  min-width: 160px;
}

/* ---------------- 空态 ---------------- */
.pj-empty {
  padding: 56px 16px;
  text-align: center;
}

.pj-empty-emoji {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 14px;
}

.pj-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--p-ink);
  margin-bottom: 8px;
}

.pj-empty-sub {
  font-size: 13px;
  color: var(--p-ink-muted);
  line-height: 1.8;
  max-width: 420px;
  margin: 0 auto;
}

/* ---------------- 窄屏（<768px） ---------------- */
@media (max-width: 768px) {
  .pj-card {
    padding: 16px 14px 14px;
  }

  .pj-judges {
    grid-template-columns: minmax(0, 1fr);
  }

  .pj-answer-img {
    max-width: 100%;
    max-height: 260px;
  }

  .pj-actions .btn {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* P25：错题本页「判定待确认」入口条（有待裁决时才显示） */
.pjudge-inlet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(224, 138, 46, 0.1);
  border: 1px solid rgba(224, 138, 46, 0.34);
  color: var(--p-ink);
  text-decoration: none;
  min-height: 44px;
  transition: background 0.18s ease;
}

.pjudge-inlet:hover {
  background: rgba(224, 138, 46, 0.16);
}

.pjudge-inlet-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.pjudge-inlet-text {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--p-ink-soft);
  line-height: 1.6;
}

.pjudge-inlet-text strong {
  color: var(--p-orange);
  font-variant-numeric: tabular-nums;
}

.pjudge-inlet-arrow {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--p-orange);
  white-space: nowrap;
}

/* P31：错题本「重练」列 —— 未练（灰）与另两种状态区分开 */
.pbadge-muted {
  color: var(--p-gray, #6b7280);
  background: #f1f0ee;
}

/* ============================================================
 * V1-23b 导航分组
 * 说明：只追加，不改上方任何既有规则（46 页共用此文件）。
 * 结构：桌面一级 6 项（首页/学情/练习/错题·笔记/上传/更多），
 *       下拉组 hover + click 双通道展开；手机底部 6 项 + 半屏面板。
 * ============================================================ */

/* 桌面：下拉组容器与触发按钮（复用 .pnav-link 的既有外观变量） */
.pnav-item {
  position: relative;
  display: inline-flex;
}

/* V1-23b：作废批次徽标（bank-papers STATUS_META.void，灰调与 .pbadge-muted 一致） */
.badge-muted {
  background: #f1f0ee;
  color: var(--p-gray, #6b7280);
}

.pnav-drop {
  cursor: pointer;
  border: 0;
  background: none;
  font-family: inherit;
  white-space: nowrap;
}

.pnav-caret {
  font-size: 11px;
  margin-left: 3px;
  opacity: 0.7;
}

/* 一级标签不折行（1280px 下 6 项 + 品牌必须单行） */
.pnav-links .pnav-link {
  white-space: nowrap;
}

.pnav-menu {
  display: none;
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  min-width: 168px;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 1200;
}

.pnav-item.is-open .pnav-menu {
  display: block;
}

.pnav-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.pnav-menu-icon {
  font-size: 16px;
  line-height: 1;
}

.pnav-menu-link:hover {
  background: var(--p-primary-50);
  color: var(--p-primary-dark);
}

/* hover 通道（仅真指针设备）；触屏走 JS click 通道 */
@media (hover: hover) {
  .pnav-item:hover .pnav-menu {
    display: block;
  }
}

/* 手机底部：组按钮容器 + 半屏面板 + 遮罩（桌面隐藏） */
.pbottom-item {
  flex: 1;
  display: flex;
}

.pbottom-item .pbottom-link {
  width: 100%;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.pbottom-mask,
.pbottom-panel {
  display: none;
}

@media (max-width: 768px) {
  .pbottom-mask.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1180;
    background: rgba(0, 0, 0, 0.45);
  }

  .pbottom-panel.is-open {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1190;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--p-surface);
    border-top: 1px solid var(--p-line);
    border-radius: 16px 16px 0 0;
    padding: 14px 16px calc(20px + var(--p-bottom-nav-h, 64px) + env(safe-area-inset-bottom, 0px));
  }

  .pbottom-panel-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--p-primary-50);
    color: var(--p-ink-soft);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }

  .pbottom-panel-icon {
    font-size: 20px;
    line-height: 1;
  }

  /* 底部 6 项标签不折行、不溢出 */
  .pbottom-label {
    white-space: nowrap;
  }
}

/* V2-04：全站页脚（备案公示） */
.site-footer {
  margin-top: 32px;
  padding: 16px 0 20px;
  text-align: center;
  font-size: 12px;
  color: #9aa3ad;
}
.site-footer a { color: #9aa3ad; text-decoration: none; }
.site-footer a:hover { color: #6b7480; text-decoration: underline; }
.site-footer-sep { margin: 0 8px; color: #d5dade; }
@media print { .site-footer { display: none; } }

/* V1-27：学生作答编辑行（输入框 + 已确认后的「保存作答」按钮） */
.pgrade-answer-edit { display: flex; align-items: center; gap: 8px; }
.pgrade-answer-edit > .pgrade-answer-input { flex: 1 1 auto; width: auto; min-width: 0; }
