/* 智能组卷 · 12 类统一元素（P1）
   在 main.css 之后加载；只收敛尺寸/圆角/状态/层级，不改布局与业务。
   依赖 skins/skins.css 提供的语义 token（--accent/--ink/...）。 */

/* 1) 按钮 */
#appView button,
#authView button,
.mask button,
.pdrawer button {
  border-radius: var(--r-btn, 6px);
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
#appView button:focus-visible,
#authView button:focus-visible,
.mask button:focus-visible,
.pdrawer button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 统一高度：只收常见操作按钮，图标/紧凑按钮不强行改 */
#appView button.primary,
#appView button.ghost,
#authView button.primary,
.mask button.primary,
.mask button.ghost { min-height: 32px; }
#appView button.primary:disabled,
#authView button.primary:disabled { opacity: .45; cursor: not-allowed; }

/* 2) 输入 / 选择 */
#appView input:not([type="checkbox"]):not([type="radio"]),
#appView select,
#appView textarea,
#authView input,
#authView select {
  min-height: 34px;
  border-radius: var(--r-btn, 6px);
  background: var(--panel);
  color: var(--ink);
}
#appView input:focus,
#appView select:focus,
#appView textarea:focus,
#authView input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* 3) 页签 / 分段 */
#appView .tabs button {
  padding: 7px 12px;
  border-radius: var(--r-btn, 6px) var(--r-btn, 6px) 0 0;
}
#appView .tabs button.on {
  border-bottom: 2px solid var(--accent);
}
#appView .toolrow .seg {
  border-radius: var(--r-btn, 6px);
  background: var(--sunken);
}
#appView .toolrow .seg > button { border-radius: 4px; }

/* 4) 表格 */
#appView table { border-collapse: collapse; }
#appView table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
  background: var(--sunken);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
#appView table td {
  font-size: 13px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink2);
}
#appView table tr:last-child td { border-bottom: 0; }

/* 5) 弹窗 */
.mask .mbox {
  border-radius: var(--r-card, 10px);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(10, 16, 26, .22);
  color: var(--ink);
}
.mask .mbox h3,
.mask .mbox h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.mask .mbox .mfoot,
.mask .mbox .btnrow { gap: 8px; }

/* 6) 抽屉 */
.pdrawer {
  background: var(--panel);
  color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(10, 16, 26, .16);
}
.pdrawer .pdhead { border-bottom: 1px solid var(--line); }

/* 7) 状态标签 / 徽标 */
#appView .chip,
#appView .kpchip,
#appView .tag,
#appView .clBadge {
  border-radius: 999px;
  font-size: 11.5px;
  padding: 1px 8px;
  border: 1px solid transparent;
  font-weight: 500;
}

/* 8) 卡片 */
#appView .card {
  border-radius: var(--r-card, 10px);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}
#appView .card > h3 { font-size: 14px; font-weight: 600; color: var(--ink); }

/* 9) 表单行 */
#appView .lbl,
#appView .fld > label,
#authView .lbl {
  font-size: 12.5px;
  color: var(--ink3);
  margin-bottom: 4px;
}
#appView .fld { margin-bottom: 12px; }

/* 10) 提示条 */
#appView .banner {
  border-radius: var(--r-card, 10px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--panel);
  color: var(--ink2);
  padding: 10px 12px;
}
#appView .banner.info { border-left-color: var(--accent); background: var(--accent-bg); }
#appView .banner.warn { border-left-color: var(--amber); background: var(--amber-bg); }
#appView .banner.error,
#appView .banner.bad { border-left-color: var(--rose); background: var(--rose-bg); }

/* 11) 空态 / 加载 */
#appView .empty,
#appView .anaempty,
#appView .cr-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--t4);
  font-size: 13px;
  background: var(--panel);
  border-radius: var(--r-card, 10px);
}

/* 12) 分页 / 工具条 */
#appView .pager button {
  min-width: 28px;
  height: 28px;
  border-radius: var(--r-btn, 6px);
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--ink2);
  font-size: 12px;
}
#appView .pager button.cur {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#appView .toolrow { gap: 8px; }

/* 深色皮肤下图标/线框按钮的可读性兜底 */
html[data-skin="f"] #appView table th,
html[data-skin="f"] #appView table td { border-color: var(--line); }

/* ===== P2：全站细节统一（基于 v4.69 真实页审计） =====
   目标刻度：按钮 36（常规）/ 32（紧凑）/ 28（迷你）；输入 36；圆角 6/10；
   标题 26/20/16；控件间距 8/12/16；次要文字对比度 ≥4.5:1。 */

/* 标题字阶：h1 26 / h2 20 / h3 16，卡片内标题 14.5 */
#appView h1, #authView h1 { font-size: 26px; line-height: 1.3; font-weight: 600; letter-spacing: -.2px; }
#appView h2 { font-size: 20px; line-height: 1.4; font-weight: 600; }
#appView h3 { font-size: 16px; line-height: 1.45; font-weight: 600; }
#appView .card > h3, #appView .spanel > h3 { font-size: 14.5px; }

/* 按钮三档：常规 36 / 紧凑 32 / 迷你 28；圆角 token；文字按钮留足内边距 */
#appView button:not(:has(svg)):not(.avbtn):not(.tabmore):not(.pager button):not(.tabs button) {
  min-height: 32px;
}
#appView .toolrow button:not(:has(svg)),
#appView .card button:not(:has(svg)),
#appView .spanel button:not(:has(svg)),
#appView .mask button:not(:has(svg)),
#appView .pdrawer button:not(:has(svg)) {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-btn, 6px);
  font-size: 13.5px;
}
#appView button:not(.avbtn):not(.tabmore):not(.pager button) { border-radius: var(--r-btn, 6px); }
#appView .pager button { min-height: 28px; height: 28px; min-width: 28px; padding: 0; }
#appView .avbtn, #appView .who button, #appView .tabs .tabmore { border-radius: 999px; }

/* 页签：统一高度与内边距，选中态 2px 主色底边 */
#appView .tabs button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--r-btn, 6px) var(--r-btn, 6px) 0 0;
  font-size: 13.5px;
}
#appView .tabs { align-items: stretch; }

/* 输入：36 高、6 圆角、focus 主色环；多行不压高度 */
#appView input:not([type="checkbox"]):not([type="radio"]),
#appView select,
#authView input:not([type="checkbox"]):not([type="radio"]),
#authView select {
  height: 36px;
  min-height: 36px;
  border-radius: var(--r-btn, 6px);
  font-size: 13.5px;
}
#appView textarea, #authView textarea { min-height: 84px; border-radius: var(--r-btn, 6px); font-size: 13.5px; }

/* 工具条：统一底色/描边/内边距，和卡片同一圆角 */
#appView .toolrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card, 10px);
  background: var(--panel);
}
#appView .toolrow input, #appView .toolrow select { flex: 0 1 auto; }

/* 卡片：统一内边距与边框，卡片之间 14 间距 */
#appView .card {
  border-radius: var(--r-card, 10px);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 18px;
}
#appView .card + .card { margin-top: 14px; }

/* 弹窗 / 抽屉：标题 15、头脚内边距 14×16 */
.mask .mbox { border-radius: var(--r-card, 10px); }
.mask .mbox > h3, .mask .mbox .mh, .mask .mbox > header { font-size: 15px; padding: 14px 16px; }
.mask .mbox .mfoot, .mask .mbox .btnrow { padding: 12px 16px; gap: 8px; }
.pdrawer .pdhead { padding: 14px 16px; font-size: 14.5px; }

/* 标签 / 徽标：胶囊、11.5、1px 透明边，语义色由 token 控制 */
#appView .chip, #appView .kpchip, #appView .tag, #appView .clBadge,
#appView .badge, #appView .pill {
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1.7;
  padding: 1px 8px;
  border: 1px solid transparent;
}

/* 间距节奏：常见“卡片/分区”之间统一 14–16 */
#appView section > .card:last-child { margin-bottom: 0; }

/* 次要文字对比度（#98a2b3 在白底 2.7:1 不达标） */
#appView .muted, #appView .sub, #appView .hint, #appView .meta,
#appView small { color: var(--ink3); }

/* 链接：主色 + hover 下划线，不用紫色/默认蓝 */
#appView a:not(.btn) { color: var(--accent); }
#appView a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }

/* 统一焦点环（键盘可见） */
#appView a:focus-visible, #appView [tabindex]:focus-visible,
#authView a:focus-visible, #authView button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== 定点收敛（审计后剩余异常项） ===== */
#appView .who button, #appView #btnLogout {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--r-btn, 6px);
}
#appView .home-actions button {
  height: 36px;
  min-height: 36px;
}
html[data-skin] #authView input:not([type=checkbox]):not([type=radio]),
html[data-skin] #authView select {
  height: 36px;
  min-height: 36px;
  border-radius: 6px;
}
/* 二级页签（题库子页签、备课左栏）保持直角，但统一高度节奏 */
#appView .subtabs button, #appView .subtabs > button { border-radius: 0; }

/* ===== 页面切换横向漂移修正 ===== */
/* 高页面出现滚动条、短页面没有 → 内容宽度 15px 跳变；预留滚动槽，所有页签宽度一致 */
html{scrollbar-gutter:stable}
/* 整卷切题进入全屏时卡片内边距清零；页签保持与题目/试卷总览同一左边界（x=52） */
/* 全屏切题不再把卡片拍平：保持与其它子视图同一外边距、卡片圆角与内边距 */
/* ★ 2026-11-04：不覆盖 main 宽度，保持与其它页签一致 */
/* ★ 2026-11-04：card 外框交给默认样式，避免切页签漂移 */
/* ★ 2026-11-04：toolrow 内边距交给默认样式 */
body.split-full #physicsSplitFrame{border:1px solid var(--line);border-radius:8px}
/* ===== 全局可点击反馈：两套皮肤自适应 ===== */
@media (hover:hover){
  a,button:not(:disabled),[role="button"],[onclick]{
    transition:filter .15s ease,background-color .15s ease,border-color .15s ease;
    cursor:pointer;
  }
  a:hover,button:not(:disabled):hover,[role="button"]:hover,[onclick]:hover{
    filter:brightness(1.045);
  }
}
#tabNav button:not(.on):hover{
  background:color-mix(in srgb,var(--accent,#2f5fd0) 14%,transparent)!important;
  border-radius:4px;
}
/* 整卷切题 iframe：两套皮肤都保留普通页的内容边距 */
body.split-full main{
  padding-left:20px!important;padding-right:20px!important;
  max-width:1620px!important;margin:0 auto!important;
}
/* 顶栏皮肤按钮：独立浅色胶囊，文字不能被顶栏浅字规则吃掉 */
#spSkinSwitch > button{
  background:var(--panel,#fff)!important;color:var(--ink2,#1B2942)!important;
  border:1px solid var(--line2,#C7D7F2)!important;
  font-size:12.5px!important;border-radius:999px!important;
}
#spSkinSwitch > button i{background:var(--accent,#2B4CFF)!important}
#spSkinSwitch > button:hover{background:var(--tint,#F3F7FF)!important;color:var(--ink,#1B2942)!important}
/* 皮肤按钮：荧光下白底深字，避免被顶栏浅字规则覆盖 */
html[data-skin="e"] #tabNav #spSkinSwitch > button{
  background:#FFFFFF!important;color:#182B4A!important;border-color:#B9CCF2!important;
}
html[data-skin="e"] #tabNav #spSkinSwitch > button i{background:#2B4CFF!important}

/* ==========================================================================
   2026-11-04（老师：课堂反馈缩略图上的复制/旋转/删除小图标看不见）
   原因：本文件的 `html[data-skin] #appView button { background:var(--panel)!important }`
        把缩略图上的小图标也刷成了白底，配白字 → 隐形。
        这些是「浮在照片上的操作小标」，必须用深色半透明底 + 白字。
   说明：本文件加载在 main.css 之后，所以修复必须写在这里才压得住。
   ========================================================================== */
html[data-skin] #appView .fbimg button.fbcopy,
html[data-skin] #appView .fbimg button.fbrot,
html[data-skin] #appView .fbimg button.fbimgx,
html[data-skin] #appView .fbimg button[data-fbcopy],
html[data-skin] #appView .fbimg button[data-fbrot],
html[data-skin] #appView .fbimg button[data-fbimgx]{
  background:rgba(17,24,39,.78) !important;
  background-color:rgba(17,24,39,.78) !important;
  color:#fff !important;
  border:0 !important;
  box-shadow:none !important;
  opacity:1 !important;
  visibility:visible !important;
  padding:0 !important;
  min-width:0 !important;
  min-height:0 !important;
  font-weight:400 !important;
  line-height:1 !important;
  position:absolute !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  z-index:3;
}
/* 复制：左下一个扁标（保留内边距，因为要包住两个字） */
html[data-skin] #appView .fbimg button.fbcopy,
html[data-skin] #appView .fbimg button[data-fbcopy]{
  left:3px !important; bottom:3px !important; top:auto !important; right:auto !important;
  padding:1px 6px !important;
  border-radius:4px !important;
  font-size:10.5px !important;
  width:auto !important; height:auto !important;
}
/* 旋转：右下圆钮 */
html[data-skin] #appView .fbimg button.fbrot,
html[data-skin] #appView .fbimg button[data-fbrot]{
  left:auto !important; top:auto !important;
  right:3px !important; bottom:3px !important;
  width:19px !important; height:19px !important;
  border-radius:50% !important;
  font-size:12px !important;
}
/* 删除：右上圆钮 */
html[data-skin] #appView .fbimg button.fbimgx,
html[data-skin] #appView .fbimg button[data-fbimgx]{
  left:auto !important; bottom:auto !important;
  top:3px !important; right:3px !important;
  width:19px !important; height:19px !important;
  border-radius:50% !important;
  font-size:13px !important;
}
html[data-skin] #appView .fbimg button.fbcopy:hover,
html[data-skin] #appView .fbimg button.fbrot:hover{
  background:rgba(47,111,237,.95) !important; background-color:rgba(47,111,237,.95) !important;
}
html[data-skin] #appView .fbimg button.fbimgx:hover{
  background:rgba(220,38,38,.95) !important; background-color:rgba(220,38,38,.95) !important;
}

/* ==========================================================================
   2026-11-04（老师：很多表格下面的横线没有呈现出来）
   原因：本文件的 `#appView table tr:last-child td{border-bottom:0}` 是给**列表类表格**
        去掉末行下边线用的（避免和外框重复）；但题干里的数据表格（.mdtab）常只有
        「表头 + 1 行数据」，数据行正好是 last-child → 底边线被清掉，看起来缺一条线。
   修法：题干内的数据表格恢复四边齐全，不受 last-child 影响。
   ========================================================================== */
#appView .mdtab tr:last-child td,
#appView .mdtab tr:last-child th,
#appView .qcontent table.mdtab tr:last-child td,
html[data-skin] #appView .mdtab tr:last-child td,
html[data-skin] #appView .mdtab tr:last-child th{
  border-bottom:1px solid var(--line2) !important;
}
/* 表格本体也补一圈外框，视觉上更完整（只对题干数据表格） */
#appView .mdtab,
html[data-skin] #appView .mdtab{
  border:1px solid var(--line2) !important;
}
/* 最后一行若同时是 tbody 末行，仍保留底边 */
#appView .mdtab tbody tr:last-child td,
html[data-skin] #appView .mdtab tbody tr:last-child td{
  border-bottom:1px solid var(--line2) !important;
}

/* ★★★ 2026-11-09：答案来源标注（老板要求）
   · .std  标准答案（录入）—— 绿，AI 不会覆盖
   · .ai   由 AI 生成 —— 黄
   · .ref  AI 参考（不覆盖标准答案）—— 灰 */
.qai-badge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:0;
  font-size:11px;line-height:1.6;font-weight:600;vertical-align:middle;white-space:nowrap;
  border:1px solid currentColor}
.qai-badge.std{color:#0a7f3f;background:#e8f7ee;border-color:#0a7f3f}
.qai-badge.ai{color:#8a5a00;background:#fff7e0;border-color:#c99a00}
.qai-badge.ref{color:#5b6470;background:#f1f3f5;border-color:#a8b0ba}
.qai-ai-ref{margin-top:10px;padding:10px 12px;border:1px dashed #a8b0ba;background:#fafbfc}
.qai-ai-ref-head{display:flex;align-items:center;gap:6px;margin-bottom:6px}
.qai-ai-ref-head b{font-size:13px}

/* ★★★ 2026-11-09（老板反馈）：教辅题卡补齐「考点」「易错点」标签
   原来只显示 .wbq-kp（知识点），考点和易错点数据入库了但从不渲染。
   ⚠ 放在 unified.css（版本号可控），不放 main.css（文件名带 hash 会永久缓存）。 */
.wbq-kps{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0 2px}
.wbq-kp{display:inline-block;padding:1px 8px;border-radius:0;font-size:11.5px;line-height:1.65;
  font-weight:600;white-space:nowrap;background:#eef2f7;color:#3a4a5c;border:1px solid #c3cedb}
.wbq-kd{display:inline-block;padding:1px 8px;border-radius:0;font-size:11.5px;line-height:1.65;
  font-weight:600;white-space:nowrap;background:#e8f1ff;color:#1a5fb4;border:1px solid #9dc0ea}
.wbq-err{display:inline-block;padding:1px 8px;border-radius:0;font-size:11.5px;line-height:1.65;
  font-weight:600;white-space:nowrap;background:#fff0ec;color:#b03a1a;border:1px solid #e8a892}
