/* ==========================================================================
   SLS · 界面规范收敛层  __SLS_R324_UI2__
   --------------------------------------------------------------------------
   依据：12-界面设计-交付/走查-基线.md（W-02/W-06/W-11/W-13）+ design-tokens.css
   参考：总平台已落地的有数皮肤（sls-youshu.css 的 --ys-* 变量与卡片观感），
         本层不定义新色板，颜色一律优先取 --ys-*，取不到再退回旧粉。
   --------------------------------------------------------------------------
   硬约束（设计交付验收口径）：
     · 正文 ≥15px，辅助 14px，caption 12px（仅徽标/时间戳）
     · 可点元素 ≥44×44px，主操作 48~52px
     · 卡片：白底 + 1px 细边 + 极轻阴影 + 16px 圆角
     · 页面底部预留固定栏高度，别盖住最后一行
   --------------------------------------------------------------------------
   边界（重要）：
     · 只作用于首页壳（#mobHome / header#hdWho）与通用空态类；
     · 绝不触碰 .ys-* / #ys* / .ai-* / .lb 等悬浮球与总平台皮肤的命名空间；
     · 不改 DOM、不改 JS，纯 CSS；卸载 = 删掉 student.html 里那一行 link。
   ========================================================================== */

:root {
  /* 字阶：6 档收敛（对照 design-tokens.css 第 4 节） */
  --u2-caption: 12px;
  --u2-aux: 14px;
  --u2-body: 15px;
  --u2-body-lg: 16px;
  --u2-title: 20px;
  --u2-headline: 24px;

  /* 触控 */
  --u2-touch: 44px;
  --u2-touch-lg: 48px;

  /* 圆角 / 间距 / 阴影 */
  --u2-r: 16px;
  --u2-r-sm: 12px;
  --u2-gap: 12px;
  --u2-section: 24px;
  --u2-shadow: 0 1px 3px rgba(31, 36, 48, .06);
  --u2-shadow-2: 0 4px 12px rgba(31, 36, 48, .10);

  /* 颜色：跟随有数皮肤，退回旧粉 */
  --u2-ink: var(--ys-ink, #3d2b37);
  --u2-ink2: var(--ys-ink2, #5d4453);
  --u2-muted: var(--ys-muted, #bfa6b3);
  --u2-line: var(--ys-line, #f3d6e4);
  --u2-soft: var(--ys-soft, #fff0f6);
  --u2-primary: var(--ys-primary, #e8548f);
  --u2-surface: var(--ys-surface, #ffffff);
  --u2-bg: var(--ys-bg, #fdf2f7);
  --u2-bottom-safe: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 1. 顶栏：账号行/副标题不再低于 14px（W-11） ---------- */
#hdWho { font-size: var(--u2-aux) !important; line-height: 1.5; }
#devSessLine { font-size: var(--u2-aux) !important; line-height: 1.6; }

/* ---------- 2. 首页壳：卡片、间距、字号（W-11 / W-13） ---------- */
/* 账号条：整行可点区域补到 44px，「改昵称 / 换账号」也补齐（W-06） */
#mobHome .mh-acc { border-radius: var(--u2-r); gap: 10px; padding: 12px 14px; }
#mobHome .mh-acc-n { font-size: var(--u2-body); color: var(--u2-ink2); }
#mobHome .mh-acc-b {
  min-height: var(--u2-touch); padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--u2-aux); border-radius: 999px;
}

/* 招呼卡 */
#mobHome .mh-head { border-radius: var(--u2-r); padding: 16px; border-color: var(--u2-line); box-shadow: var(--u2-shadow); }
#mobHome .mh-hi { font-size: var(--u2-title); color: var(--u2-ink); letter-spacing: .2px; }
#mobHome .mh-sub { font-size: var(--u2-aux); color: var(--u2-muted); margin-top: 6px; line-height: 1.55; }
#mobHome .mh-sw {
  min-height: var(--u2-touch); padding: 0 16px;
  display: inline-flex; align-items: center;
  font-size: var(--u2-aux); border-radius: 999px; border-color: var(--u2-line);
}

/* 磁贴：2 列整格 ≥108px，标题 16、描述 14、角标 12 */
/* 列宽必须 minmax(0,1fr)：1fr 的最小值是 min-content，角标/标题一旦变长（字号提到 12/16 后）
   就会把整列撑宽 → 2 列比容器还宽 → 手机横向溢出。行等高用 grid-auto-rows。 */
#mobHome .mh-grid { gap: var(--u2-gap); grid-auto-rows: 1fr; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#mobHome .mh-card {
  min-height: 104px; min-width: 0; padding: 12px 14px; gap: 4px;
  border-radius: var(--u2-r); border-color: var(--u2-line);
  box-shadow: var(--u2-shadow); transition: transform .12s ease, box-shadow .12s ease;
}
#mobHome .mh-card:active { transform: scale(.985); box-shadow: var(--u2-shadow-2); }
#mobHome .mh-ico { font-size: 20px; line-height: 1.1; }
#mobHome .mh-t { font-size: var(--u2-body-lg); font-weight: 800; color: var(--u2-ink); letter-spacing: .2px; }
#mobHome .mh-d {
  font-size: var(--u2-aux); color: var(--u2-muted); line-height: 1.55;
  /* 描述最多两行：「按章节找题 · A4 出卷」这类会被挤成三行、把同一行的两张卡拉成不等高 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#mobHome .mh-badge {
  margin-top: auto; font-size: var(--u2-caption); font-weight: 700;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .2px;
}

/* 页脚提示：11 → 13，别再糊成一片 */
#mobHome .mh-tip { font-size: 13px; color: var(--u2-muted); line-height: 1.75; }
#mobHome .mh-foot { margin-top: var(--u2-section); }

/* ---------- 3. 底部安全区（W-04：别让固定栏盖住最后一行） ---------- */
#mobHome { padding-bottom: var(--u2-bottom-safe); }

/* ---------- 4. 通用空态壳（W-13：图标 + 一句话 + 主行动，各页复用） ---------- */
.sls-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 32px 20px; text-align: center;
}
.sls-empty__art {
  width: 72px; height: 72px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--u2-soft); font-size: 32px; line-height: 1;
}
.sls-empty__title { font-size: var(--u2-title); font-weight: 600; color: var(--u2-ink); }
.sls-empty__desc { font-size: var(--u2-body); color: var(--u2-muted); line-height: 1.55; }

/* ---------- 5. 主/次按钮：48px 起，圆角收敛（design-tokens 第 12 节） ---------- */
.sls-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--u2-touch-lg); min-width: var(--u2-touch);
  padding: 0 20px; border: none; border-radius: 999px;
  font: 500 var(--u2-body)/1 inherit; cursor: pointer; user-select: none;
  transition: transform .12s ease, filter .12s ease;
}
.sls-btn:active { transform: scale(.97); filter: brightness(.95); }
.sls-btn--primary { background: var(--u2-primary); color: #fff; }
.sls-btn--ghost { background: var(--u2-surface); color: var(--u2-ink); border: 1.5px solid var(--u2-line); }
.sls-btn--strong { min-height: 52px; font-size: var(--u2-body-lg); }

/* ---------- 6. 手机 390/430 下的收紧（不动桌面宽屏） ---------- */
@media (max-width: 480px) {
  #mobHome .mh-card { min-height: 104px; padding: 13px 14px; }
  #mobHome .mh-d { font-size: var(--u2-aux); }
}

/* ==========================================================================
   7. 题库 · 水平测评做题页（W-03 选项触控 / W-07 顶栏）
   --------------------------------------------------------------------------
   只作用于测评题纸 .dqpaper，不影响 A4 打印稿（.paper 的另一套渲染）。
   选项在测评流里是「展示 + 自评」，不可点选，所以这里只做卡片化与 48px 触控高度，
   不加选中态，避免让学生误以为能点。
   ========================================================================== */
.dqpaper .pp-opts { gap: 10px 12px; margin-top: 12px; }
.dqpaper .pp-opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 12px;
  border: 1.5px solid #E9E3EE; border-radius: 12px; background: #fff;
  font-size: 16px; line-height: 1.45; text-align: left;
}
.dqpaper .pp-opt .optk {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #F6EDFA; color: #8A5CA6; font-size: 14px; font-weight: 700;
}
.dqpaper .pp-opt .optv { min-width: 0; overflow-wrap: anywhere; }
/* 一行放 4 个时（短选项）卡片会变窄，徽标同步收小 */
.dqpaper .pp-opts.four .pp-opt { min-height: 48px; gap: 8px; padding: 8px 10px; font-size: 15px; }
.dqpaper .pp-opts.four .pp-opt .optk { width: 24px; height: 24px; font-size: 13px; }
/* 单列（长选项）更宽松 */
.dqpaper .pp-opts.one .pp-opt { min-height: 56px; }
@media (max-width: 480px) {
  .dqpaper .pp-opts { grid-template-columns: 1fr 1fr; }
  .dqpaper .pp-opts.one { grid-template-columns: 1fr; }
  .dqpaper .pp-opts.four { grid-template-columns: 1fr 1fr; }
  .dqpaper .pp-opt { font-size: 15px; min-height: 50px; }
}

/* W-07 顶栏不再折行：章节名过长时省略，按钮保持 44px 触控 */
.dtop .dt-t { min-width: 0; }
#dTopTitle {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px; line-height: 1.45; display: block;
}
#dTopTitle b { font-size: 15px; }

/* ==========================================================================
   8. 过程留痕（W-01）：题卡内双入口 + 手写板浮层 + 大图查看
   --------------------------------------------------------------------------
   作用域 .tr-*，只由 sls-trace.js 创建，不碰题纸（.paper/.dqpaper）与悬浮球。
   颜色沿用第 7 节：细边 #E9E3EE、主色 #8A5CA6，和选项徽标同一套。
   ========================================================================== */
.tr-panel { margin-top: 14px; padding-top: 13px; border-top: 1px dashed #E9E3EE; }
.tr-hint {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 13px; line-height: 1.6; color: #6b7280; margin-bottom: 10px;
}
.tr-hint b { color: #111827; font-weight: 700; }

.tr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-btn {
  min-height: 78px; padding: 10px 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  background: #fff; border: 1.5px solid #E9E3EE; border-radius: 12px;
  font-family: inherit; transition: transform .12s ease, border-color .12s ease;
}
.tr-btn:active { transform: scale(.978); border-color: #d9cbe4; }
.tr-btn .ico { font-size: 22px; line-height: 1.2; }
.tr-btn b { font-size: 14.5px; font-weight: 700; color: #111827; }
.tr-btn small { font-size: 11.5px; font-weight: 400; color: #9aa3af; }

.tr-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tr-th {
  position: relative; width: 76px; height: 76px; margin: 0; cursor: pointer;
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; background: #fff;
}
.tr-th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tr-th em {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 0;
  font-style: normal; font-size: 10px; text-align: center;
  color: #fff; background: rgba(17,24,39,.62);
}
.tr-th .x {
  position: absolute; top: 0; right: 0; width: 21px; height: 21px; padding: 0;
  border: 0; border-radius: 0 0 0 9px; cursor: pointer;
  background: rgba(17,24,39,.7); color: #fff; font-size: 11px; line-height: 21px;
}
.tr-tip { margin-top: 9px; font-size: 12px; line-height: 1.6; color: #b0b7c3; min-height: 18px; }
.tr-tip.ok { color: #15803d; }
.tr-tip.err { color: #b91c1c; }

/* 手写板浮层：低于符号键盘(#smp 10099)与手写板(10070)，高于底栏(300)/弹层(400) */
.tr-mask {
  position: fixed; inset: 0; z-index: 10060; display: flex;
  align-items: flex-end; justify-content: center;
  background: rgba(15,23,42,.46);
}
.tr-sheet {
  width: 100%; max-width: 560px; max-height: 96vh; display: flex; flex-direction: column;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(15,23,42,.18);
}
.tr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.tr-head b { font-size: 15.5px; color: #111827; }
.tr-hr { display: flex; align-items: center; gap: 8px; }
.tr-w {
  min-height: 32px; padding: 0 11px; cursor: pointer; font-family: inherit;
  background: #fff; border: 1.5px solid #E9E3EE; border-radius: 999px;
  font-size: 12.5px; color: #4b5563; white-space: nowrap;
}
.tr-x {
  width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
  background: #f5f3f7; color: #6b7280; font-size: 15px; line-height: 1;
}
.tr-tools { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.tr-tools button { flex: 0 0 auto; }
.tr-tools button {
  min-height: 36px; padding: 0 12px; cursor: pointer;
  background: #fff; border: 1.5px solid #E9E3EE; border-radius: 999px;
  font-family: inherit; font-size: 13px; color: #4b5563;
}
.tr-tools button.on { background: #F6EDFA; border-color: #d9c2ea; color: #8A5CA6; font-weight: 700; }
.tr-cwrap { position: relative; }
.tr-cwrap canvas {
  display: block; width: 100%; background: #fff;
  border: 1px solid #dfe5ee; border-radius: 10px; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.tr-ph {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; font-size: 13px; color: #c2c8d2; pointer-events: none; padding: 0 24px;
}
.tr-pad { display: flex; gap: 10px; margin-top: 11px; }
.tr-pad button {
  flex: 1; min-height: 46px; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700;
}
.tr-pad .ghost { background: #fff; border: 1.5px solid #E9E3EE; color: #4b5563; }
.tr-pad .pri { background: #8A5CA6; border: 1.5px solid #8A5CA6; color: #fff; }

/* 大图查看 */
.tr-lb {
  position: fixed; inset: 0; z-index: 10070; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 16px;
  background: rgba(9,11,20,.92); cursor: zoom-out;
}
.tr-lb img { max-width: 100%; max-height: 88%; border-radius: 10px; background: #fff; }
.tr-lb-t { font-size: 12.5px; color: rgba(255,255,255,.72); }

@media (max-width: 380px) {
  .tr-btn { min-height: 72px; }
  .tr-btn b { font-size: 13.5px; }
}

/* 宽屏收敛：两个入口在 1440 下会被拉到 260px，比例失衡；限宽后留白在右侧，读起来更像卡片 */
@media (min-width: 720px) {
  .tr-hint { max-width: 660px; }
  .tr-btns { max-width: 560px; }
  .tr-btn { min-height: 72px; }
}

/* 交老师：次级描边按钮，不跟上面两个主入口抢注意力 */
.tr-send {
  display: block; width: 100%; margin-top: 10px; min-height: 46px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: .2px;
  color: #8A5CA6; background: #FBF7FD; border: 1.5px solid #d9c2ea; border-radius: 12px;
  transition: transform .12s ease, background .12s ease;
}
.tr-send:active { transform: scale(.985); background: #F6EDFA; }
.tr-send:disabled { opacity: .62; cursor: default; }
/* display:block 会把 hidden 属性的 display:none 盖掉，必须显式压回去 */
.tr-send[hidden] { display: none; }
@media (min-width: 720px) { .tr-send { max-width: 560px; } }
