/* 文昊学习工作台 · 游戏化活力风 v0.5
   配色：深空蓝底 + 电光紫蓝渐变 + 青绿 XP 流光 + 荧光金传说色
   注意：所有 flex/grid 子项统一 min-width:0，杜绝横向溢出。 */

:root {
  --bg: #080c1a;
  --bg2: #101735;
  --panel: rgba(255, 255, 255, .06);
  --panel2: rgba(255, 255, 255, .1);
  --stroke: rgba(255, 255, 255, .12);
  --txt: #e9edfb;
  --muted: #98a4c8;
  --brand: #7c5cff;
  --brand2: #3fd0ff;
  --xp: #34e5b0;
  --gold: #ffd54d;
  --danger: #ff7a92;
  --r: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
  height: 100%;           /* 让 height: 100vh 的子级能撑住 */
}

body {
  height: 100vh;          /* 兜底：JS 没运行时也合理 */
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(124, 92, 255, .34), transparent 62%),
    radial-gradient(900px 520px at 96% 4%, rgba(63, 208, 255, .22), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 46%, #070a16 100%);
  background-attachment: fixed;
  color: var(--txt);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 560px;
  height: var(--app-h, 100vh);   /* 关键：锁高度，键盘弹起时由 JS 收窄 */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;        /* 关键：整页不滚，滚动只发生在内部区块 */
}

/* 测试环境横幅 */
.envbanner {
  padding: 7px 14px;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
  color: #ffe3ac;
  background: linear-gradient(90deg, rgba(255, 170, 60, .28), rgba(255, 122, 90, .22));
  border-bottom: 1px solid rgba(255, 190, 90, .42);
  overflow-wrap: anywhere;
}

/* ============ 顶部状态栏 ============ */
.topbar {
  flex: 0 0 auto;         /* 在 flex 流中锁住高度，不参与滚动 */
  position: relative;     /* 不再用 sticky：.app 已是 overflow:hidden 流 */
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(10, 14, 30, .96), rgba(10, 14, 30, .78));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--stroke);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.tb-id { min-width: 0; flex: 1; }
.tb-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lv {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 92, 255, .5);
}
.tb-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tb-right { flex: 0 0 auto; }
.streak {
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 180, 60, .22), rgba(255, 90, 60, .18));
  border: 1px solid rgba(255, 190, 90, .38);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* 向导精灵立绘（塞尔达风） */
.sprite { width: 42px; height: 42px; flex: 0 0 auto; animation: float 4.5s ease-in-out infinite; }
.sprite svg { width: 100%; height: 100%; display: block; }
.sprite .orbits { transform-origin: 32px 32px; animation: spin 14s linear infinite; }
.sprite .sparkle { animation: twinkle 2.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-5px);} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* XP 条 */
.xpbar {
  margin-top: 5px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  position: relative;
}
.xpfill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--xp), var(--brand2) 55%, var(--brand));
  background-size: 220% 100%;
  box-shadow: 0 0 12px rgba(52, 229, 176, .55);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
  animation: flow 3.2s linear infinite;
}
@keyframes flow { to { background-position: 220% 0; } }
.xpbar.big { height: 11px; }

/* ============ 页面 ============ */
.pages {
  flex: 1 1 0;            /* 抢走头部/底部之外的全部空间 */
  min-height: 0;          /* 关键：允许子级收缩，否则 flex:1 撑不开滚动容器 */
  overflow: hidden;       /* 整页不滚，滚动只发生在内部区块 */
  position: relative;
}
.page {
  display: none;
  flex-direction: column; /* 三段式：welcome / chat / composer */
  padding: 10px 12px 8px;
  min-height: 0;
  height: 100%;
}
.page.active { display: flex; animation: rise .32s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ 对话页 ============ */
.welcome {
  flex: 0 0 auto;         /* 锁高度，不参与"抢空间" */
  border-radius: var(--r);
  padding: 13px 15px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .26), rgba(63, 208, 255, .12));
  border: 1px solid rgba(124, 92, 255, .34);
  box-shadow: 0 10px 30px rgba(60, 40, 160, .28);
}
.w-title { font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.w-sub { margin-top: 4px; font-size: 13.5px; color: #cfd8f5; }
.w-next {
  margin-top: 9px;
  display: inline-block;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: #dbe3ff;
  overflow-wrap: anywhere;
}

.chat {
  flex: 1 1 0;            /* 关键：抢走 welcome 与 composer 之间的全部空间 */
  min-height: 0;          /* 关键：没有这个，flex 子项最小高度 = 内容高度，撑不开滚动 */
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
  min-width: 0;
  overflow-y: auto;       /* 关键：只有这块自己滚 */
  overscroll-behavior: contain;  /* 滚到顶/底时不带动整页橡皮筋 */
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 24px;  /* 底部多留 24px，让最后一条不被输入框压住 */
  scrollbar-gutter: stable;
}
  scrollbar-gutter: stable;
}
.msg { display: flex; min-width: 0; }
.msg.user { justify-content: flex-end; }
.msg .bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: pop .28s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.agent .bubble {
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--stroke);
  border-bottom-left-radius: 5px;
  backdrop-filter: blur(8px);
}
.msg.user .bubble {
  background: linear-gradient(135deg, var(--brand), #5b46d6);
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 20px rgba(124, 92, 255, .34);
}
.bubble img.pic {
  display: block;
  max-width: 100%;
  width: 190px;
  border-radius: 11px;
  margin-bottom: 6px;
}
.typing .tlabel {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 5px;
  min-height: 1em;
}
.typing span:not(.tlabel) {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--brand2);
  animation: blink 1.1s infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

/* 草稿卡 */
.draft {
  margin: 4px 0;
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(52, 229, 176, .14), rgba(124, 92, 255, .1));
  border: 1px solid rgba(52, 229, 176, .38);
  padding: 12px;
  min-width: 0;
  animation: pop .3s ease both;
}
.draft-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 14px; }
.draft-h .tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(52, 229, 176, .2); border: 1px solid rgba(52, 229, 176, .4);
}
.draft.warn { background: linear-gradient(160deg, rgba(255, 180, 60, .14), rgba(255, 122, 146, .08)); border-color: rgba(255, 190, 90, .4); }
.draft-note { font-size: 12px; color: var(--muted); margin: 7px 0 9px; overflow-wrap: anywhere; }
.ditem {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 30px;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
  min-width: 0;
}
.ditem input, .ditem select {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .3);
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
}
.ditem input:focus, .ditem select:focus { outline: none; border-color: var(--brand2); }
.ditem .del {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 122, 146, .14);
  color: var(--danger); cursor: pointer; font-size: 14px; line-height: 1;
}
.dact { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--xp), #1fb894); color: #04231b; box-shadow: 0 6px 18px rgba(52, 229, 176, .34); }
.btn.ghost { background: rgba(255, 255, 255, .08); border: 1px solid var(--stroke); color: var(--txt); flex: 0 0 auto; }

/* 输入区 */
.composer {
  flex: 0 0 auto;         /* 锁高度，永远在视口底部 */
  padding: 6px 0 4px;
  background: linear-gradient(180deg, rgba(8, 12, 26, 0), rgba(8, 12, 26, .92) 34%);
  min-width: 0;
}
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; }
.thumbs img {
  width: 62px; height: 62px; object-fit: cover; border-radius: 11px;
  border: 1px solid var(--stroke); flex: 0 0 auto;
}
.crow { display: flex; gap: 7px; align-items: center; min-width: 0; }
.icobtn.disabled { opacity: .35; pointer-events: none; }
.crow2 .chip.ghost { margin-left: auto; opacity: .7; font-size: 12px; padding: 5px 10px; }
.icobtn {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .08);
  color: var(--txt);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icobtn.send { background: linear-gradient(135deg, var(--brand), #5b46d6); border: none; color: #fff; }
.icobtn.mic.on { background: linear-gradient(135deg, #ff5f6d, #ff9a5b); border: none; animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 146, .6); }
  70% { box-shadow: 0 0 0 13px rgba(255, 122, 146, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 146, 0); }
}
#msgInput {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .32);
  color: var(--txt);
  font-size: 14px;
  font-family: inherit;
}
#msgInput:focus { outline: none; border-color: var(--brand2); }
.crow2 { display: flex; align-items: center; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.chip.on { background: rgba(124, 92, 255, .28); border-color: rgba(124, 92, 255, .6); color: #fff; }
.hint { font-size: 11px; color: var(--muted); }

/* ============ 通用卡片 ============ */
.card {
  border-radius: var(--r);
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  padding: 13px 14px;
  margin-bottom: 12px;
  min-width: 0;
}
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px; font-weight: 800; margin-bottom: 10px;
}
.mini {
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .07); color: var(--txt);
  cursor: pointer; font-family: inherit; flex: 0 0 auto;
}
.empty { font-size: 13px; color: var(--muted); padding: 6px 0; }
.wk { font-size: 11px; color: var(--muted); font-weight: 500; }

.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat {
  border-radius: 14px; padding: 11px 6px; text-align: center;
  background: var(--panel); border: 1px solid var(--stroke); min-width: 0;
}
.sv { font-size: 21px; font-weight: 800; background: linear-gradient(135deg, var(--xp), var(--brand2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 档案 */
.pf-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 4px 0; min-width: 0; }
.pf-row span:first-child { color: var(--muted); flex: 0 0 auto; }
.pf-row span:last-child { text-align: right; overflow-wrap: anywhere; }
.pf-form { display: flex; flex-direction: column; gap: 8px; }
.pf-form input, .pf-form select {
  width: 100%; padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--stroke); background: rgba(0, 0, 0, .3);
  color: var(--txt); font-size: 13.5px; font-family: inherit;
}
.pf-form input:focus, .pf-form select:focus { outline: none; border-color: var(--brand2); }

/* Flag */
.goals { list-style: none; margin: 0; padding: 0; }
.goals li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--stroke); font-size: 14px; min-width: 0;
}
.goals li:last-child { border-bottom: none; }
.goals li .g-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.goals li .g-x { flex: 0 0 auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }

/* 作业清单 */
.tasks { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.task {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px 11px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--stroke);
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.task.done { opacity: .5; }
.task.done .t-name { text-decoration: line-through; }
.task.hit { transform: scale(1.025); box-shadow: 0 0 0 1px rgba(52, 229, 176, .6), 0 8px 22px rgba(52, 229, 176, .22); background: rgba(52, 229, 176, .1); }
.ck {
  width: 22px; height: 22px; border-radius: 7px;
  border: 1.6px solid var(--brand2);
  background: transparent; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 13px; line-height: 1;
}
.task.done .ck { background: linear-gradient(135deg, var(--xp), #1fb894); border-color: transparent; color: #04231b; }
.t-main { min-width: 0; }
.t-name { font-size: 13.8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.t-side { flex: 0 0 auto; font-size: 11px; color: var(--muted); text-align: right; }
.subj {
  display: inline-block; padding: 1px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: #06121f; margin-right: 5px;
}

/* 错题 */
.tipbar {
  border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px;
  background: rgba(124, 92, 255, .14); border: 1px solid rgba(124, 92, 255, .3); color: #d9d2ff;
}
.duebar {
  border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px;
  background: rgba(255, 190, 90, .14); border: 1px solid rgba(255, 190, 90, .34); color: #ffe3ac;
}
.mlist { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mcard {
  border-radius: 14px; padding: 12px; min-width: 0;
  background: var(--panel); border: 1px solid var(--stroke);
  border-left: 4px solid var(--brand);
}
.mcard.mastered { opacity: .55; border-left-color: var(--xp); }
.m-h { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }
.m-body { font-size: 13.5px; overflow-wrap: anywhere; }
.m-body .row { display: flex; gap: 6px; margin-bottom: 3px; }
.m-body .row b { color: var(--muted); font-weight: 600; flex: 0 0 auto; }
.m-body .row span { min-width: 0; overflow-wrap: anywhere; }
.m-a { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }

/* 成就 */
.levelcard { display: flex; align-items: center; gap: 16px; }
.lc-l { flex: 0 0 auto; text-align: center; }
.lc-lv {
  font-size: 30px; font-weight: 900;
  background: linear-gradient(135deg, var(--gold), #ff9a5b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lc-xp { font-size: 12px; color: var(--muted); }
.lc-r { flex: 1 1 auto; min-width: 0; }
.lc-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.badge {
  text-align: center; padding: 12px 6px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke);
}
.badge.owned {
  background: linear-gradient(160deg, rgba(255, 213, 77, .18), rgba(124, 92, 255, .12));
  border-color: rgba(255, 213, 77, .5);
  box-shadow: 0 6px 18px rgba(255, 180, 60, .16);
}
.badge .bi { font-size: 26px; filter: grayscale(1); opacity: .35; }
.badge.owned .bi { filter: none; opacity: 1; }
.badge .bn { font-size: 12px; font-weight: 700; margin-top: 4px; }
.badge .bd { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.rowbtn {
  padding: 11px 12px; border-radius: 12px; font-size: 13.5px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke);
}

/* 底部导航 */
.tabbar {
  flex: 0 0 auto;         /* 在 flex 流中固定高度，聊天区才是唯一滚动者 */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(9, 13, 28, .94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--stroke);
  z-index: 50;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0; border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 11px; font-family: inherit; min-width: 0;
}
.tab span { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .6; }
.tab.active { color: #fff; }
.tab.active span { filter: none; opacity: 1; transform: translateY(-1px); }

/* Toast（居中且永不溢出） */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 14px);
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(52, 229, 176, .96), rgba(31, 184, 148, .96));
  color: #04231b;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s ease, transform .26s ease;
  z-index: 90;
  text-align: center;
  overflow-wrap: anywhere;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.badge { background: linear-gradient(135deg, #ffd54d, #ff9a5b); color: #3a2200; }
.toast.level { background: linear-gradient(135deg, #7c5cff, #3fd0ff); color: #fff; }

.hidden { display: none !important; }

/* ---------- 课程表网格 ---------- */
.schedgrid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.schedtable {
  width: 100%; border-collapse: separate; border-spacing: 2px;
  table-layout: fixed; font-size: 10.5px;
}
.schedtable th {
  font-size: 10px; opacity: .6; font-weight: 600;
  padding: 3px 1px; text-align: center;
}
.schedtable th.corner { width: 20px; }
.schedtable td { padding: 0; text-align: center; vertical-align: middle; }
.schedtable td.pd { font-size: 10px; opacity: .45; width: 20px; }
.schedtable td.cell {
  border-radius: 5px; padding: 5px 1px; line-height: 1.2;
  font-weight: 600; word-break: break-all;
}
.schedtable td.blank { background: rgba(255, 255, 255, .035); }

/* ---------- 作业批改卡片 ---------- */
.qlist {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 8px; max-height: 320px; overflow-y: auto;
}
.qitem {
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border-left: 3px solid var(--muted);
}
.qitem.ok  { border-left-color: #34e5b0; }
.qitem.bad { border-left-color: #ff7a92; }
/* 待补答：用琥珀色区分，代表"不是你错了，是我没看清" */
.qitem.uc  { border-left-color: #ffc861; background: rgba(255, 200, 97, .07); }
.q-h { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.q-t { font-size: 12px; opacity: .8; line-height: 1.45; margin-bottom: 4px; white-space: pre-wrap; }
.q-a { font-size: 11.5px; opacity: .9; line-height: 1.45; }
.q-k { font-size: 11px; opacity: .7; margin-top: 4px; }

@media (max-width: 360px) {
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ditem { grid-template-columns: 78px minmax(0, 1fr) 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
