:root {
  --bg: #f6f4f1;
  --card: #ffffff;
  --ink: #1c1c1e;
  --muted: #6b7280;
  --line: #e6e1da;
  --brand: #e4622a;
  --brand-soft: #fdece3;
  --ok: #0f8a5f;
  --bad: #cf3b2e;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 8px 24px rgba(28, 25, 23, .06);
  color-scheme: light;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Heiti SC", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  touch-action: manipulation;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  min-height: 44px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  transition: transform .06s ease, opacity .15s ease;
}
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button.subtle { background: #f1ede8; color: var(--ink); }
button.danger { background: #fff; color: var(--bad); border-color: #f2cfcb; }
button.small { padding: 7px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: rgba(246, 244, 241, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .5px; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 17px;
}
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.topbar .who { font-size: 13px; color: var(--muted); text-align: right; }

.wrap { max-width: 920px; margin: 0 auto; padding: 18px 16px 120px; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 160px; }

/* 登录 */
.login-wrap { max-width: 420px; margin: 8vh auto 0; padding: 0 16px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .big { font-size: 34px; font-weight: 800; letter-spacing: 2px; }
.login-logo .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* 上传 */
.drop {
  border: 2px dashed #d9d2c7; border-radius: 14px; background: #fffdfb;
  padding: 26px 16px; text-align: center; color: var(--muted);
  cursor: pointer;
}
.drop:active { background: var(--brand-soft); }
.drop strong { color: var(--ink); display: block; margin-bottom: 4px; font-size: 16px; }
.preview { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; }
.preview img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* 作业列表 */
.hw {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid #f1ece5; cursor: pointer;
}
.hw:last-child { border-bottom: 0; }
.hw .t { font-weight: 600; }
.hw .m { color: var(--muted); font-size: 13px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 600; background: #f1ede8; color: var(--muted);
}
.badge.bad { background: #fdeceb; color: var(--bad); }
.badge.ok { background: #e7f4ee; color: var(--ok); }
.badge.warn { background: #fdf3e0; color: #a2620a; }

/* 报告 */
.q {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; background: #fff;
}
.q.ok { border-color: #d8ede3; }
.q.bad { border-color: #f4d6d2; background: #fffbfa; }
.q .stem { font-size: 15px; white-space: pre-wrap; }
.q .meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.q .ans { margin-top: 8px; font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.q .ans .wrong { color: var(--bad); }
.q .ans .right { color: var(--ok); }
.q .acts { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.drawer-mask.full { align-items: stretch; }
.drawer.fullscreen {
  max-width: 100%; width: 100%;
  /* 键盘弹出时整块缩短，输入框自然落在键盘上方 */
  height: calc(100% - var(--kb, 0px)); max-height: calc(100% - var(--kb, 0px));
  border-radius: 0; overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 10px) 16px calc(env(safe-area-inset-bottom) + 16px);
  display: flex; flex-direction: column;
}
/* 顶部按钮常驻，滚动时也看得到 */
.drawer.fullscreen .close-row {
  position: sticky; top: calc(-1 * (env(safe-area-inset-top) + 10px));
  background: #fff; padding: 10px 0 8px; margin: -2px 0 8px; z-index: 5;
}
.drawer.fullscreen .chat { flex: 1 1 auto; overflow-y: auto; }


/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(20, 18, 16, .38); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
}
.drawer {
  background: #fff; width: 100%; max-width: 720px; max-height: 92vh; overflow: auto;
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up .18s ease-out;
}
.msg .replay {
  float: right; margin: -2px 0 0 8px; font-size: 14px; opacity: .45;
  cursor: pointer; user-select: none;
}
.msg .replay:active { opacity: .9; }
@keyframes up { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer h2 { margin: 0 0 2px; font-size: 18px; }
.drawer .close-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* 聊天 */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; }
.msg.assistant { background: var(--brand-soft); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.user { background: #eef1f5; align-self: flex-end; border-bottom-right-radius: 6px; }
/* BAB-32R：引导模式示意图（内联 SVG，viewBox + 100% 宽，窄屏不溢出） */
.msg .fig { margin: 8px 0 2px; max-width: 100%; }
.msg .fig svg { display: block; width: 100%; height: auto; }
/* 输入框吸在可视区底部：键盘弹出时用 --kb 把它顶到键盘上方 */
.chat-input {
  display: flex; gap: 8px; position: sticky; bottom: 0;
  background: #fff; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 6; transition: bottom .12s ease-out;
}
.chat-input input { flex: 1 1 auto; width: auto; min-width: 0; }
.chat-input button { flex: 0 0 auto; white-space: nowrap; }
.chat-input .mic {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 0 12px; font-size: 18px;
}
.chat-input .mic.listening {
  background: var(--bad); color: #fff; border-color: var(--bad);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.typing { color: var(--muted); font-size: 13px; }

/* 家长 */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; background: #efeae3; padding: 5px; border-radius: 12px; overflow-x: auto; }
.tabs button {
  flex: 1 0 auto; background: transparent; color: var(--muted); min-height: 40px;
  padding: 8px 10px; border-radius: 9px; white-space: nowrap; font-size: 15px;
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 26px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }

.bars { margin-top: 10px; }
.bar { margin-bottom: 8px; }
.bar .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
.bar .track { height: 8px; background: #f1ece5; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--brand); border-radius: 99px; }

.wq-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f1ece5; }
.wq-item:last-child { border-bottom: 0; }
.wq-item input[type=checkbox] { width: 22px; height: 22px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--brand); }
.wq-item .body { flex: 1; min-width: 0; }
.wq-item .stem { font-size: 14.5px; }
.wq-item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

.fab {
  position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 14px 20px;
  box-shadow: 0 10px 24px rgba(0,0,0,.22); font-weight: 600;
}

/* 弹窗 */
dialog {
  border: 0; border-radius: 18px; padding: 20px; width: min(400px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(20, 18, 16, .45); }
dialog h3 { margin: 0 0 6px; font-size: 18px; }
dialog p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
dialog .err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: rgba(28, 28, 30, .94); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 14px; z-index: 90; max-width: 88vw; text-align: center;
}

.assist-card {
  border: 1px solid #f0d8c4; background: #fffaf5; border-radius: 14px;
  padding: 14px; margin: 12px 0;
}
.assist-head { font-weight: 700; color: #8a4b16; margin-bottom: 8px; }
.assist-praise { font-size: 14px; margin-bottom: 8px; }
.assist-steps { margin: 0 0 10px; padding-left: 22px; font-size: 15px; line-height: 1.8; }
.assist-answer { font-size: 15px; padding-top: 8px; border-top: 1px dashed #e8d3c0; }
.assist-tip { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

.praise {
  background: #fff7ed; border: 1px solid #f6dcc2; color: #8a4b16;
  border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px;
}
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 720px) {
  .drawer { border-radius: 20px; margin-bottom: 24px; }
  .drawer-mask { align-items: center; }
}

/* 横屏（平板/手机横过来）：思考区占 2/3 屏并居中，两边都留着看作业照片 */
@media (orientation: landscape) and (min-width: 780px) {
  .drawer.fullscreen {
    width: 66.67%; max-width: 980px;
    margin: 0 auto;                      /* 横屏时居中，不贴右边 */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(60, 40, 20, .16);
  }
  .drawer-mask.full { justify-content: center; }
  .drawer.fullscreen .chat { max-height: none; }
}

.practice-card {
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  padding: 14px; margin-top: 10px;
}
.practice-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; }
.practice-list { margin: 0; padding-left: 20px; }
.practice-list li { margin-bottom: 12px; }
.practice-list .stem { font-size: 15px; }
.practice-list details { margin-top: 4px; font-size: 13px; color: var(--muted); }
.check-row { padding: 10px 0; border-top: 1px dashed #eee; font-size: 14px; }
.check-row .check-line { display: flex; gap: 8px; align-items: center; }
.check-row .check-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.theme-group { margin-bottom: 12px; }
.theme-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 8px 14px; min-height: 40px; border-radius: 999px; font-size: 14px; font-weight: 500;
}
.chip.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }

.install-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff7ed; border: 1px solid #f6dcc2; color: #8a4b16;
  border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px;
}
.install-tip button { flex: 0 0 auto; }
ol.steps { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.9; }

.crop-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
.crop-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); touch-action: none; user-select: none; }
.crop-wrap img { display: block; width: 100%; height: auto; }
#crop-rect { position: absolute; border: 2px dashed var(--brand); background: rgba(228,98,42,.12); border-radius: 6px; pointer-events: none; }

.pill {
  background: #fff7ed; color: #a2620a; border: 1px solid #f6dcc2;
  border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 14px; font-weight: 700;
}
.reward-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #f1ece5; font-size: 14px;
}
.reward-row:last-child { border-bottom: 0; }
.point-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed #f1ece5; font-size: 14px;
}
.point-row:last-child { border-bottom: 0; }
.review-list { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.9; }

.companion-card { background: linear-gradient(180deg, #fffaf5 0%, #fff 70%); }
.companion-top { display: flex; gap: 16px; align-items: center; }
.hero { position: relative; width: 112px; height: 112px; flex: 0 0 auto; }
.hero-base, .hero-fill { position: absolute; inset: 0; display: grid; place-items: center; font-size: 82px; line-height: 1; }
.hero-base { filter: grayscale(1) brightness(0.2); opacity: .18; }
.hero-fill { clip-path: inset(calc(100% - var(--fill, 0%)) 0 0 0); transition: clip-path .6s ease; }
.companion-info { flex: 1; min-width: 0; }
.companion-name { font-weight: 800; font-size: 17px; }
.companion-power { color: var(--brand); font-weight: 700; font-size: 13px; margin: 2px 0 8px; }
.progress { height: 12px; background: #f1ece5; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #f0a15f, var(--brand)); border-radius: 99px; transition: width .6s ease; }
.companion-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.companion-info button { margin-top: 8px; }
.slots { display: flex; gap: 8px; margin-top: 14px; }
.slot { flex: 1; text-align: center; border: 1px dashed #e6ddd2; border-radius: 12px; padding: 8px 4px; background: #fff; }
.slot.got { border-style: solid; border-color: #f0c9a8; background: #fff7ed; }
.slot-emoji { font-size: 22px; }
.slot-name { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.hand-card { border: 1px dashed #e4d6c3; background: #fffdf9; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.hand-head { font-weight: 700; font-size: 14px; color: #8a4b16; }
.hand-note { font-size: 14px; margin-top: 4px; line-height: 1.7; }
.hand-tip { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* 顶栏伙伴（BAB-23）：头像放大到 62px（原 44，放大 1.4 倍）+ 右边「X的玩伴」和「和我聊天」 */
.hero-block { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.hero-name {
  font-size: 12.5px; font-weight: 700; color: #8a4b16; line-height: 1.15; letter-spacing: .2px;
  max-width: 92px; white-space: normal; word-break: break-word;
}
.hero-chat {
  border: 0; border-radius: 10px; background: var(--brand); color: #fff;
  font-size: 12.5px; font-weight: 700; padding: 5px 10px; white-space: nowrap; cursor: pointer;
}
.hero-chat:active { transform: translateY(1px); }
.hero-mini {
  position: relative; width: 62px; height: 62px; padding: 0; border-radius: 18px;
  background: #fff7ed; border: 1px solid #f6dcc2; display: grid; place-items: center;
  overflow: hidden; flex: 0 0 auto;
}
.hero-mini.ready { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); animation: heroPulse 1.6s ease-in-out infinite; }
@keyframes heroPulse { 0%,100% { box-shadow: 0 0 0 2px var(--brand-soft); } 50% { box-shadow: 0 0 0 5px rgba(228,98,42,.22); } }
.champion-tag { margin-top: 8px; font-size: 13px; font-weight: 700; color: #a2620a; }
.hero-mini-emoji { font-size: 22px; line-height: 1; transform: translateY(-3px); }
.hero-mini-hp {
  position: absolute; left: 6px; right: 6px; bottom: 6px; height: 6px;
  background: #f0e6da; border-radius: 99px; overflow: hidden;
}
.hero-mini-hp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#f0a15f,var(--brand)); border-radius: 99px; transition: width .5s ease; }
.hero-mini-badge { display: none; }
.slot.active { border-color: var(--brand); border-style: dashed; background: #fff7ed; }

.crop-dialog { width: min(560px, 94vw); padding: 18px; }
.crop-dialog h3 { margin: 0 0 6px; font-size: 18px; }
.crop-dialog p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.crop-dialog .crop-wrap { max-height: 52vh; overflow: hidden; display: flex; justify-content: center; background: #f7f4f0; border-radius: 12px; }
.crop-dialog .crop-wrap img { max-height: 52vh; width: auto; max-width: 100%; }
.crop-dialog .row { justify-content: flex-end; }

/* 开始批改：右下角，位于"切换家长"上方，拇指可达 */
#upload-btn {
  bottom: calc(86px + env(safe-area-inset-bottom));
  background: var(--brand); color: #fff; font-size: 16px; padding: 15px 22px;
}
#upload-btn:disabled { background: #d9b8a4; }

.acc-card { background: #f3f9f5; border: 1px solid #d8eee2; color: #0f8a5f; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.crop-hint-row { font-size: 12.5px; color: #a2620a; background: #fff7ed; border: 1px dashed #f0d3b8; border-radius: 8px; padding: 6px 10px; margin-top: 10px; }
#crop-wrap { touch-action: none; }
#crop-wrap img { pointer-events: none; }

/* 上传进度卡片：照片一直看得见 */
.upload-card {
  display: flex; gap: 12px; align-items: center; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 10px;
}
.upload-card img {
  width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: #f4f1ec; cursor: zoom-in;
}
.upload-meta { flex: 1; min-width: 0; }
.upload-state { font-size: 13.5px; margin-bottom: 6px; }
.upload-bar { height: 8px; background: #f1ece5; border-radius: 99px; overflow: hidden; }
.upload-bar i { display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg,#f0a15f,var(--brand)); transition: width .3s ease; }
.upload-bar.indeterminate i { width: 40% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.upload-pct { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 照片查看 / 打叉 */
.photo-view { position: relative; display: block; max-width: 100%; margin-bottom: 6px; }
.photo-view img { display: block; width: 100%; border-radius: 10px; }
.photo-view .mark {
  position: absolute; transform: translate(-50%, -50%); color: #e11d48;
  font-size: 30px; font-weight: 800; line-height: 1; text-shadow: 0 0 4px #fff;
  pointer-events: none;
}
.photo-view.marking { cursor: crosshair; }

/* 作业列表：缩略图 + 状态 */
.hw { align-items: flex-start; gap: 12px; cursor: default; }
.hw-thumb {
  width: 62px; height: 62px; flex: 0 0 auto; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: #f4f1ec; cursor: zoom-in;
}
.hw-thumb.placeholder { display: grid; place-items: center; font-size: 24px; }
.hw-main { flex: 1; min-width: 0; cursor: pointer; }
.hw-status { display: inline-block; margin-top: 4px; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: #f1ece5; color: var(--muted); }
.hw-status.ok { background: #e7f4ee; color: var(--ok); }
.hw-status.working { background: #fdf3e0; color: #a2620a; }
.hw-status.bad { background: #fdeceb; color: var(--bad); }
.photo-view .mark.hit, .photo-view #photo-view .mark {
  pointer-events: auto; cursor: pointer; font-size: 34px;
  /* 手机上叉只有 30px 宽，点不中；撑出一个 56px 的透明热区 */
  min-width: 56px; min-height: 56px; display: flex; align-items: center;
  justify-content: center; border-radius: 50%;
}
.photo-view .mark.hit:active { background: rgba(225, 29, 72, .12); }
.photo-view .mark.hit:hover { transform: translate(-50%, -50%) scale(1.15); }

.lesson-row { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px dashed #f1ece5; font-size: 13.5px; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row.off { opacity: .55; }
.lesson-main { flex: 1; min-width: 0; }
.lesson-stem { font-weight: 600; }
.lesson-ans { color: var(--muted); margin: 2px 0; }

/* 伙伴头像：颜色+名字首字，换人一眼能看出来 */
.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; box-shadow: inset 0 -4px 8px rgba(0,0,0,.12); }
.avatar.mini { width: 30px; height: 30px; font-size: 13px; }
.avatar.big { width: 104px; height: 104px; }
.avatar { background: #fff7ed; border: 1px solid #f2ddc7; }
.avatar .avatar-pic { font-size: 1.6em; line-height: 1; }
.avatar.big .avatar-pic { font-size: 58px; }
.avatar.mini .avatar-pic { font-size: 20px; }
.mini-pic { font-size: 24px; }
/* 战王：五个形象合体 */
.champion-hero { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.champion-pics { display: flex; flex-wrap: wrap; gap: 2px; width: 92px; justify-content: center; }
.champion-pics span { font-size: 22px; line-height: 1; }
.champion-crown { position: absolute; top: -6px; right: -4px; font-size: 30px; }
.hero-mini .avatar.mini { width: 46px; height: 46px; }
.hero-mini .avatar.mini .avatar-pic { font-size: 27px; }

.hw-preview { font-size: 13px; color: #3f3a35; margin: 2px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

#photo-view.marking { cursor: crosshair; outline: 2px dashed #f59e0b; outline-offset: -2px; }

.photo-view .mark.auto { pointer-events: none; opacity: .9; }

.photo-view .mark.review { color: #f59e0b; text-shadow: 0 0 4px #fff, 0 0 2px #fff; }

/* ---------------- 背诵 ---------------- */
.recite-text {
  background: #fffdfb; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; line-height: 2; font-size: 17px; white-space: pre-wrap;
  max-height: 42vh; overflow-y: auto;
}
.recite-mic {
  width: 100%; margin-top: 14px; padding: 18px; font-size: 18px; font-weight: 700;
  border: 0; border-radius: 16px; background: var(--accent, #c2542a); color: #fff;
  box-shadow: 0 6px 18px rgba(194, 84, 42, .25);
}
.recite-mic.recording { background: #e11d48; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .68; } }
.recite-live {
  margin-top: 12px; padding: 12px; border-radius: 12px; background: #f7f4ef;
  font-size: 15px; line-height: 1.7; max-height: 160px; overflow-y: auto;
}
.recite-live .said { color: #1c1c1e; }
.recite-live .interim { color: var(--muted, #8a7f74); }
.recite-score { text-align: center; margin: 16px 0 6px; }
.recite-score .big { font-size: 44px; font-weight: 800; color: var(--accent, #c2542a); line-height: 1.1; }
.recite-praise { text-align: center; font-size: 15px; margin: 6px 0 14px; }
.recite-block { margin-top: 12px; font-size: 14.5px; line-height: 1.9; }
.recite-miss { color: #e11d48; font-weight: 700; background: #ffe9ee; border-radius: 6px; padding: 1px 5px; }
.recite-extra { color: #b45309; background: #fff4e5; border-radius: 6px; padding: 1px 5px; }
.recite-wrong { color: #7c3aed; }

/* 未做：黄色，区别于做错的红色 */
.badge.todo { background: #fff4d6; color: #a2620a; border: 1px solid #f0d69b; }
.q.todo { border-left: 4px solid #f0b429; background: #fffdf3; }
.q.todo .ans b.todo { color: #a2620a; }
.hw-status.todo { color: #a2620a; }
.todo-chip { background: #fff4d6; color: #a2620a; border-radius: 8px; padding: 1px 6px; margin-left: 6px; font-size: 12px; }
.photo-view .mark.todo { color: #f0b429; }

/* http 下引导装证书（可折叠，不阻塞使用） */
.https-tip {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 14px;
  background: #fff4d6; border: 1px solid #f0d69b; color: #7a4a06; font-size: 14px;
}
.https-tip > summary { cursor: pointer; font-weight: 600; }
.https-tip-body { margin-top: 8px; }
.https-tip ol, .cert-tip ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.85; }
.https-tip a, .cert-tip a { color: #7a4a06; font-weight: 700; }
.cert-tip {
  margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px;
  background: #fff7e6; border: 1px solid #f0b429; color: #7a4a06; font-size: 14px; line-height: 1.7;
}
.cert-tip-title { font-weight: 700; font-size: 15.5px; margin-bottom: 2px; }
.cert-tip .hint { color: #8a6a3a; font-size: 12.5px; margin-top: 8px; }

/* ---------------- 学生端功能区块：一行两个 ---------------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin-top: 12px;
}
.feature-card { display: flex; flex-direction: column; }
.feature-wide { grid-column: 1 / -1; }
.feature-wide-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feature-wide-row > div { flex: 1 1 200px; min-width: 0; }
.feature-wide-row button { flex: 0 0 auto; white-space: nowrap; }
.feature-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.feature-head h2 { margin: 0; font-size: 17px; }
.feature-icon { font-size: 20px; line-height: 1; }
.feature-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.feature-actions button { flex: 1 1 0; }
/* 卡片窄，按钮文字别折行 */
.feature-card button {
  white-space: nowrap; padding-left: 8px; padding-right: 8px; font-size: 15px;
}
@media (max-width: 420px) {
  /* 手机太窄也保持两个，只把字号缩小一点 */
  .feature-card { padding: 12px; }
  .feature-head h2 { font-size: 15px; }
}

/* 记录分类切换 */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 12px 0 10px;
  background: #f3efe9; border-radius: 12px; max-width: 100%;
}
.seg button { white-space: nowrap; }
.seg button {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 9px;
  font-size: 14px; color: var(--muted, #8a7f74); cursor: pointer;
}
.seg button.active { background: #fff; color: #1c1c1e; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.recite-thumb {
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: #fff4d6; color: #a2620a;
}

/* 家长端 tabs 在窄屏可横向滑，不再挤成两行 */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; white-space: nowrap; }

/* 家长端背诵列表 */
.wq { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; background: #fff; }
.wq-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 15px; }

/* 卡片标题行：标题可换行，按钮不被挤走 */
.card-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card-head-main { flex: 1 1 auto; min-width: 0; }
.card-head button { flex: 0 0 auto; }

/* 出卷练习表单 */
.sp-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.sp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-row > span { width: 42px; color: var(--muted); font-size: 14px; }
.sp-row .seg { margin: 0; }

/* 挑题列表 */
.pick-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pick-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 14px;
  border-bottom: 1px solid #f4efe9; font-size: 15px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pick-item:last-child { border-bottom: 0; }
.pick-item.on { background: #fff7ea; }
.pick-check {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  border: 1.5px solid #d9cfc2; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; background: #fff;
}
.pick-item.on .pick-check { background: var(--accent, #c2542a); border-color: var(--accent, #c2542a); }
.pick-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pick-title { font-weight: 600; font-size: 14.5px; }
.pick-stem {
  color: #6b6259; font-size: 13.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 一行三个快捷动作 */
/* BAB-23：删掉「成长小聊」后剩 3 个，按实际个数均分，不再固定 4 列（固定列数会挤爆文字） */
.quick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.quick-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font-size: 15px; color: inherit; white-space: nowrap;
}
.quick-btn span { font-size: 17px; }
.quick-btn:active { background: #f7f3ee; }
@media (max-width: 360px) { .quick-btn { font-size: 14px; padding: 10px 4px; } }

/* 出卷结果卡 */
.paper-result {
  border: 1px solid #e6ddcf; border-radius: 14px; padding: 14px;
  background: #fffdf7; margin-top: 10px;
}
.paper-result-title { font-weight: 700; font-size: 15px; }

/* 在线做题 */
.pp-list { display: flex; flex-direction: column; gap: 10px; }
.pp-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.pp-stem { font-size: 15px; line-height: 1.7; }
.pp-input {
  width: 100%; margin-top: 8px; min-height: 64px; padding: 10px 12px;
  border: 1px solid #e2d8ca; border-radius: 10px; font-size: 15px; font-family: inherit;
  background: #fffdfb;
}

/* 疑似判错提示框 */
.suspect-box {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: #fff7e0; border: 1px solid #f0d69b; font-size: 14px; color: #7a4a06;
}

/* 总览：待复核提醒条 */
.suspect-alert {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px; padding: 12px 14px; border-radius: 14px;
  background: #fff7e0; border: 1px solid #f0d69b; color: #7a4a06; font-size: 14.5px;
}

/* ---------------- 登录页 / 个人中心（BAB-11 账号体系） ---------------- */
#view-login { min-height: 100%; display: flex; align-items: center; }
.login-wrap { width: 100%; max-width: 420px; margin: 0 auto; padding: 28px 18px 40px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; margin-bottom: 18px; }
.login-brand .logo { width: 42px; height: 42px; border-radius: 13px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 18px; }
.login-brand small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; }
.login-card .err { color: var(--bad); font-size: 13.5px; min-height: 0; margin-bottom: 8px; }
.login-card .err:empty { display: none; }
.login-foot { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }
.login-foot a { color: var(--brand); text-decoration: none; font-weight: 600; }

/* BAB-20 登录页整改 */
.login-lead { margin: 0 0 14px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
/* 只在真被 DEVICE_NOT_BOUND 拦下时出现（初始 hidden，JS 才显示） */
.login-alert { margin: 0 0 12px; padding: 11px 13px; border-radius: 12px; font-size: 14px; line-height: 1.6;
  background: #fdf0ee; border: 1px solid #f2cfcb; color: #a8352a; font-weight: 500; }
.login-alert.hidden { display: none; }
.login-forgot { display: block; margin: 10px 0 0 auto; padding: 2px 0; min-height: 0; background: none;
  border: 0; color: var(--brand); font-size: 13.5px; font-weight: 600; }
.login-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.login-actions > button, .login-actions > .btn-line { width: 100%; margin: 0; }
.login-actions .btn-line { display: grid; place-items: center; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.3; }
@media (max-width: 480px) {
  .login-actions { grid-template-columns: 1fr; }   /* 窄屏竖排 */
}
.reset-block { margin-top: 4px; }
.reset-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.reset-hint { margin: 0 0 12px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.reset-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  background: #f4f2ee; color: #4b5563; word-break: break-word; }
.reset-note.ok { background: #edf9f2; color: #0f6b49; }
.reset-note.bad { background: #fdf0ee; color: #a8352a; }
.reset-note.hidden { display: none; }
/* 设备标识折叠区：家长看不到，排查时点开 */
.dev-info { margin: 18px auto 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.dev-info summary { cursor: pointer; color: #9a948a; list-style: none; }
.dev-info summary::-webkit-details-marker { display: none; }
.dev-info summary::after { content: ' ▾'; }
.dev-info[open] summary::after { content: ' ▴'; }
.dev-info-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 10px; }
.dev-info code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--ink); }

.profile-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.profile-row:last-child { border-bottom: 0; }
.profile-row b { font-weight: 600; }
.profile-list { margin: 6px 0 0; padding: 0; list-style: none; }
.profile-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.profile-list li:last-child { border-bottom: 0; }
.profile-dev { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; color: var(--muted); }

/* 孩子切换下拉（BAB-13）：多个孩子才有，只有一个时不显示 */
.topbar .row { flex-wrap: nowrap; }
.topbar .row .who { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* BAB-23：窄屏优先保证头像 + 称呼 + 和我聊天不被挤掉，名字等级那块让位 */
@media (max-width: 640px) {
  .topbar .row .who { display: none; }
}
@media (max-width: 420px) {
  .topbar .row { gap: 6px !important; }
  .hero-block { gap: 6px; }
  .hero-name { font-size: 12px; max-width: 76px; }
  .hero-chat { font-size: 12px; padding: 5px 8px; }
  #points-btn { font-size: 13px; padding: 6px 9px; }
}
select.pill#child-switch { appearance: none; -webkit-appearance: none; padding: 6px 26px 6px 10px;
  max-width: 108px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, #a2620a 50%), linear-gradient(135deg, #a2620a 50%, transparent 50%);
  background-position: right 12px top 16px, right 7px top 16px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.child-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.child-row:last-child { border-bottom: 0; }
.child-row .child-name { font-weight: 600; }
.child-row .child-meta { color: var(--muted); font-size: 12.5px; }

/* 成长小聊（BAB-12）：顶部两行「家长可见 / 每日更新」小字 + 摘要卡 */
.growth-notice { color: var(--muted); font-size: 12px; line-height: 1.5; }
.growth-weak { font-size: 13.5px; line-height: 1.65; color: #3c3830; }
.risk-note {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 10px;
  background: #fdf1ef; color: #8a3b2e; font-size: 13px; line-height: 1.6;
}

/* ---------------- BAB-19 判错复核 ---------------- */
.suspect-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start;
  border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 12px;
}
.suspect-card + .suspect-card { margin-top: 10px; }
.suspect-thumb {
  width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line);
  background: #faf8f5; object-fit: contain; cursor: zoom-in; display: block;
}
.suspect-thumb.none { display: grid; place-items: center; font-size: 12px; color: var(--muted); cursor: default; }
.suspect-main .t { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.suspect-say {
  margin-top: 6px; padding: 7px 10px; border-radius: 10px; font-size: 13px;
  background: #fff7e0; border: 1px solid #f0d69b; color: #7a4a06;
}
@media (max-width: 520px) {
  .suspect-card { grid-template-columns: 72px 1fr; gap: 10px; }
  .suspect-thumb { width: 72px; height: 72px; }
}

/* 全屏看图：黑底浮层，滚轮/双指缩放、拖动平移、双击复位（自写，不用库） */
#zoom-layer img {
  position: absolute; left: 50%; top: 50%; transform-origin: center center;
  max-width: none; user-select: none; -webkit-user-drag: none;
}
#zoom-layer .zoom-hint {
  position: absolute; left: 12px; top: 14px; color: rgba(255,255,255,.72); font-size: 12px; z-index: 2;
}
#zoom-layer .zoom-close {
  position: absolute; right: 12px; top: 12px; z-index: 2; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: 6px 14px; font-size: 14px;
}
#zoom-layer .zoom-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: rgba(0,0,0,.55); z-index: 2;
}
#zoom-layer .zoom-bar button {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
}

/* ---------------- BAB-21：设备绑定码 + 本周小结 + 余额估算 ---------------- */
.bind-code-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.bind-code-input {
  width: 100%; font-size: 24px; letter-spacing: 10px; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px 10px;
}
.bind-code-box {
  margin-top: 12px; padding: 14px; border: 1px dashed var(--brand);
  border-radius: 14px; background: var(--brand-soft); text-align: center;
}
.bind-code-num {
  font-size: 32px; font-weight: 700; letter-spacing: 12px; color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.weekly-line { font-size: 15px; line-height: 1.8; }
.weekly-line b { font-size: 18px; }
.weekly-sub { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.est-line { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }

/* ================================================================
   BAB-28 家长端信息密度与按钮归位
   —— 作用域：所有规则都以 #view-parent 开头。
      家长端与孩子端共用 .card/.row/.hw/.hint 等类名，加了 id 前缀的
      只命中家长端；孩子端与登录页一行未动（改完截图对比孩子端首页）。
      间距尺：8 / 16 / 24 三档，只保留 8 的倍数。
   ================================================================ */
#view-parent {
  --p-pad: 12px;       /* 卡片内边距 */
  --p-gap: 8px;        /* 元素间距 / 卡片间距 */
  --p-radius: 14px;    /* 家长端统一圆角（原 16px） */
  --p-fs-title: 15px;  /* 卡片标题（原 17px） */
  --p-fs-text: 13px;   /* 卡片内次要文字（原 14px） */
  --p-fs-num: 22px;    /* 统计数字（原 26px） */
  --p-btn: 38px;       /* 按钮常规高度（原 44px） */
  --p-btn-sm: 30px;    /* 按钮小号高度（原 36px） */
}

/* ---------- 骨架：顶栏 / 页签 / 卡片 ---------- */
#view-parent .topbar { padding: 8px 12px; gap: var(--p-gap); }
#view-parent .brand { font-size: 15px; gap: 6px; }
#view-parent .brand .logo { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
#view-parent .brand small { font-size: 11px; }
#view-parent .wrap { padding: 12px 12px 96px; }

#view-parent .tabs { gap: 4px; padding: 3px; margin-bottom: var(--p-gap); border-radius: 10px; }
#view-parent .tabs button { min-height: 34px; padding: 4px 10px; font-size: 15px; border-radius: 8px; }

#view-parent .card {
  padding: var(--p-pad);
  margin-bottom: var(--p-gap);
  border-radius: var(--p-radius);
}
#view-parent .card h2 { font-size: var(--p-fs-title); margin: 0 0 3px; }
#view-parent .card .hint { font-size: var(--p-fs-text); margin: 0 0 var(--p-gap); line-height: 1.55; }
#view-parent .card .hint:last-child { margin-bottom: 0; }
#view-parent .p-h3 { font-size: 13.5px; font-weight: 700; margin: 16px 0 4px; color: var(--muted); }

/* ---------- 按钮：只保留「常规 / small」两档 ---------- */
#view-parent button { min-height: var(--p-btn); padding: 8px 14px; font-size: 14px; border-radius: 10px; }
#view-parent button.small { min-height: var(--p-btn-sm); padding: 4px 10px; font-size: 13px; border-radius: 8px; }
#view-parent input:not([type="checkbox"]):not([type="range"]),
#view-parent select,
#view-parent textarea { padding: 9px 11px; border-radius: 10px; }
#view-parent label { font-size: 13.5px; }
#view-parent .row { gap: var(--p-gap); }
#view-parent .err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: var(--p-gap); }

/* ---------- 操作区：卡片右上角 / 行尾靠右 ---------- */
#view-parent .card-head { gap: var(--p-gap); flex-wrap: wrap; align-items: flex-start; }
#view-parent .card-head-main { flex: 1 1 auto; min-width: 0; }
#view-parent .card-head .hint { margin: 2px 0 0; }
#view-parent .p-acts {
  display: flex; gap: var(--p-gap); flex-wrap: wrap;
  justify-content: flex-end; align-items: center;
  flex: 0 0 auto; margin-left: auto;
}
#view-parent .p-acts.p-right { margin-left: auto; }
#view-parent .pager {
  display: flex; gap: var(--p-gap); align-items: center; justify-content: center;
  font-size: var(--p-fs-text); color: var(--muted);
}
#view-parent .pager #page-info { min-width: 44px; text-align: center; }

/* ---------- 间距工具（8 的倍数） ---------- */
#view-parent .p-mt { margin-top: var(--p-gap); }
#view-parent .p-mb { margin-bottom: var(--p-gap); }
#view-parent .row.p-right { justify-content: flex-end; }
#view-parent .p-sp { height: var(--p-gap); }
#view-parent .p-inline { margin: 0; white-space: nowrap; }
#view-parent .p-label {
  display: flex; align-items: center; gap: var(--p-gap);
  font-size: var(--p-fs-text); color: var(--ink);
}
#view-parent .p-label input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }

/* ---------- 总览：统计格 / 图表 ---------- */
#view-parent .stats { gap: var(--p-gap); grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
#view-parent .stat { padding: 8px 10px; border-radius: 12px; }
#view-parent .stat b { font-size: var(--p-fs-num); line-height: 1.15; }
#view-parent .stat span { font-size: 12px; }
#view-parent .stat b.p-text { font-size: 15px; line-height: 1.4; font-weight: 700; }
/* 行尾操作：无论按钮在 DOM 哪一段，都贴到所在行的最右边（AI 判错） */
#view-parent .p-end { margin-left: auto; }

#view-parent .bars { margin-top: var(--p-gap); }
#view-parent .bar { margin-bottom: 6px; }
#view-parent .bar:last-child { margin-bottom: 0; }
#view-parent .bar .lbl { font-size: 12.5px; margin-bottom: 2px; }
#view-parent .bar .track { height: 6px; }
#view-parent .est-line { margin: var(--p-gap) 0 0; font-size: 12.5px; }
#view-parent .suspect-alert { margin: 0 0 var(--p-gap); padding: 8px 10px; border-radius: 12px; font-size: 13px; }
#view-parent .suspect-alert button { min-height: var(--p-btn-sm); padding: 4px 10px; font-size: 13px; }
#view-parent .weekly-line { font-size: 14px; line-height: 1.7; }
#view-parent .weekly-line b { font-size: 15px; }
#view-parent .weekly-sub { font-size: 12.5px; margin-top: 6px; }
#view-parent .empty { font-size: 13px; }
#view-parent .empty { padding: 16px 8px; }

/* ---------- 列表行：行高收紧、行内操作靠右 ---------- */
#view-parent .hw { padding: 8px 0; gap: var(--p-gap); align-items: center; }
#view-parent .hw .t { font-size: 14px; }
#view-parent .hw .m,
#view-parent .hw-preview { font-size: 12.5px; }
#view-parent .hw-thumb { width: 44px; height: 44px; border-radius: 8px; font-size: 18px; }
#view-parent .hw-status { font-size: 12px; padding: 1px 6px; }
#view-parent .wq-item { padding: 8px 0; gap: var(--p-gap); align-items: flex-start; }
#view-parent .wq-item input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; }
#view-parent .wq-item .stem { font-size: 13.5px; line-height: 1.5; }
#view-parent .wq-item .meta { font-size: 12px; gap: 6px; margin-top: 4px; align-items: center; }
#view-parent .wq-item .meta .badge { padding: 1px 6px; font-size: 11.5px; }
/* 「AI 判错」是行内操作：不吃 flex 挤位，永远贴到这一行最右边 */
#view-parent .wq-item .meta [data-ai-wrong] { margin-left: auto; }
#view-parent .wq { padding: 8px 10px; margin-top: var(--p-gap); border-radius: 12px; }
#view-parent .wq-head { font-size: 13.5px; gap: 6px; }
#view-parent .reward-row,
#view-parent .point-row { padding: 6px 0; font-size: 13px; gap: var(--p-gap); }
#view-parent .reward-row .row,
#view-parent .point-row .row { gap: 6px; }
#view-parent .lesson-row { padding: 6px 0; font-size: 12.5px; gap: var(--p-gap); }
#view-parent .suspect-card { padding: 8px; gap: var(--p-gap); border-radius: 12px; grid-template-columns: 88px 1fr; }
#view-parent .suspect-card + .suspect-card { margin-top: var(--p-gap); }
#view-parent .suspect-thumb { width: 88px; height: 88px; border-radius: 10px; }
#view-parent .suspect-main .t { font-size: 13.5px; }
#view-parent .suspect-main .hint { font-size: 12.5px; margin: 2px 0 0; }
#view-parent .suspect-say { margin-top: 4px; padding: 6px 8px; font-size: 12.5px; border-radius: 8px; }
#view-parent .suspect-main .row { justify-content: flex-end; margin-top: var(--p-gap); gap: 6px; }
#view-parent .bind-code-box { margin-top: var(--p-gap); padding: 10px; border-radius: 12px; }
#view-parent .bind-code-num { font-size: 26px; letter-spacing: 8px; }
#view-parent .profile-row,
#view-parent .child-row { padding: 6px 0; font-size: 13px; }
#view-parent .profile-list li { padding: 6px 0; font-size: 12.5px; }
#view-parent ol.steps { font-size: 13px; line-height: 1.7; }
#view-parent .seg { padding: 3px; gap: 2px; margin: 0; border-radius: 10px; }
#view-parent .seg button { min-height: var(--p-btn-sm); padding: 3px 10px; font-size: 13px; border-radius: 7px; }
#view-parent .chip { min-height: var(--p-btn-sm); padding: 3px 10px; font-size: 13px; border-radius: 999px; }
#view-parent .badge { font-size: 11.5px; padding: 1px 7px; }

/* 窄屏（≤420）：卡片头里的操作区独占一行、右对齐，不和标题抢宽度 */
@media (max-width: 420px) {
  #view-parent .wrap { padding: 8px 8px 88px; }
  #view-parent .card { padding: 10px; }
  #view-parent .card-head .p-acts { flex: 1 1 100%; }
  #view-parent .hw { flex-wrap: wrap; }
  #view-parent .suspect-card { grid-template-columns: 72px 1fr; }
  #view-parent .suspect-thumb { width: 72px; height: 72px; }
}
