/* 手机端 */
html, body { min-height: 100%; }
body { background: var(--bg); }
@media (min-width: 520px) {
  body { background: #e4ddcf; }
  .app { box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 10px 60px rgba(40, 50, 45, .18); }
}
.app {
  max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
.app.no-tabs { padding-bottom: 24px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 54px; padding: 0 12px 0 16px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(246, 242, 234, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar h1 { font-size: 19px; font-weight: 700; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .2px; }
.topbar .back {
  width: 36px; height: 36px; margin-left: -8px; border: 0; background: transparent; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.topbar .back:hover { background: var(--bg-deep); }
.topbar .back-text { font-size: 15px; color: var(--teal-700); border: 0; background: none; cursor: pointer; display: flex; align-items: center; gap: 2px; padding: 6px 4px 6px 0; margin-left: -6px; }
.topbar .who {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 4px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.topbar .who .av { width: 24px; height: 24px; border-radius: 50%; background: var(--teal-700); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }

.live-off {
  margin: 0 16px 8px; padding: 6px 12px; border-radius: 10px; background: var(--amber-bg); color: #8a6100; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}

.view { padding: 4px 16px 16px; }
.view.flush { padding-left: 0; padding-right: 0; }

/* 底栏 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; z-index: 30;
  display: flex; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 58px; color: var(--ink-3); font-size: 11px; position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--teal-700); font-weight: 600; }
.tabbar a .tab-badge {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
}

/* 登录 */
.login { min-height: 100vh; padding: 0 24px 40px; display: flex; flex-direction: column; justify-content: center; }
.login .brand { text-align: center; margin-bottom: 36px; }
.login .logo {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; background: var(--teal-700); color: #fbe7b5;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(13, 78, 75, .3);
}
.login h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: 1px; }
.login .brand p { margin: 0; color: var(--ink-2); }
.role-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid transparent; border-radius: 18px; padding: 18px; margin-bottom: 12px;
  box-shadow: var(--shadow); transition: border-color .15s, transform .1s;
}
.role-card:hover { border-color: var(--teal-200); }
.role-card:active { transform: scale(.99); }
.role-card .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--teal-50); color: var(--teal-700); display: flex; align-items: center; justify-content: center; flex: none; }
.role-card b { display: block; font-size: 17px; margin-bottom: 2px; }
.role-card span { color: var(--ink-2); font-size: 13px; }
.role-card .chev { margin-left: auto; color: var(--ink-3); }
.login .foot { text-align: center; margin-top: 20px; }

/* 孩子卡片 */
.kid { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; background: linear-gradient(145deg, #f4d9a8, #e9bf7a); color: #6b4a12;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px;
}
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.kid-name { font-size: 18px; font-weight: 700; }
.kid-name .muted { font-weight: 400; font-size: 13px; margin-left: 4px; }
.lamp-line { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.lamp-line .state { color: var(--teal-700); font-weight: 600; }
.lamp-line.off { color: var(--ink-3); }

/* 今日数据 */
.today-wrap { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring .ring-bg { stroke: var(--line-2); }
.ring .ring-fg { transition: stroke-dashoffset .6s ease, stroke .3s; }
.ring .ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .ring-text b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ring .ring-text span { font-size: 11px; color: var(--ink-3); }
.stat-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 8px; }
.stat b { display: block; font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.stat span { font-size: 12px; color: var(--ink-3); }
.stat.red b { color: var(--red); }
.today-note { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--amber-bg); color: #8a6100; font-size: 13px; }
.today-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.today-head b { font-size: 16px; }

/* 作业流 */
.feed { display: flex; flex-direction: column; gap: 10px; }
.page-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; color: inherit;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); transition: background 1.2s ease;
}
.page-item.flash { background: #e3f3ef; animation: popIn .35s ease-out; }
@keyframes popIn { from { transform: translateY(-6px); opacity: .3; } to { transform: none; opacity: 1; } }
.page-item .thumb {
  width: 58px; height: 76px; border-radius: 8px; overflow: hidden; flex: none; background: var(--line-2); position: relative;
  border: 1px solid var(--line);
}
.page-item .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.page-item .thumb .proc { position: absolute; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; }
.pi-title { font-weight: 600; font-size: 15px; }
.pi-meta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.pi-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.chev { color: var(--ink-3); flex: none; }

.sess-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin: 6px 4px -2px; }
.sess-head:first-child { margin-top: 0; }

/* 页详情 */
.pd-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.viewer-card { background: #2a3332; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.viewer {
  max-height: 64vh; overflow: auto; touch-action: pan-x pan-y; overscroll-behavior: contain; position: relative;
  scrollbar-width: thin;
}
.stage { position: relative; width: 100%; transform-origin: 0 0; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.qbox {
  position: absolute; border: 2px solid var(--green); border-radius: 4px; background: rgba(44, 154, 88, .08);
  cursor: pointer; padding: 0; transition: box-shadow .15s, background .15s;
}
.qbox.wrong { border-color: var(--red); background: rgba(208, 69, 58, .10); }
.qbox.uncertain { border-color: var(--amber); background: rgba(212, 147, 10, .12); }
.qbox.unanswered { border-color: var(--grey); border-style: dashed; background: rgba(140, 150, 147, .1); }
.qbox:hover, .qbox.sel { box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 5px currentColor; }
.qbox .tag {
  position: absolute; right: -2px; top: 50%; transform: translate(50%, -50%);
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px; font-size: 11px; line-height: 18px; font-weight: 700;
  background: var(--green); color: #fff; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.qbox.wrong .tag { background: var(--red); }
.qbox.uncertain .tag { background: var(--amber); }
.qbox.unanswered .tag { background: var(--grey); }
.qbox.correct { color: var(--green); } .qbox.wrong { color: var(--red); } .qbox.uncertain { color: var(--amber); } .qbox.unanswered { color: var(--grey); }
.viewer-tools {
  position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 2px; z-index: 3;
  background: rgba(20, 30, 29, .78); border-radius: 12px; padding: 3px; color: #fff;
}
.viewer-tools button { width: 34px; height: 32px; border: 0; background: transparent; color: #fff; border-radius: 9px; cursor: pointer; font-size: 18px; line-height: 1; }
.viewer-tools button:hover { background: rgba(255,255,255,.12); }
.viewer-tools .zv { min-width: 44px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.viewer-tools .fit { width: auto; padding: 0 10px; font-size: 13px; }
.viewer-mask {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.55); color: var(--ink); font-weight: 600;
}
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin: 10px 2px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 2px solid; margin-right: 4px; vertical-align: -1px; }
.q-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.q-row:last-child { border-bottom: 0; }
.q-row .qno { font-weight: 700; font-size: 13px; color: var(--ink-2); min-width: 36px; }
.q-row .qstem { flex: 1; min-width: 0; font-size: 14px; }

/* 底部弹层 */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(15, 25, 24, .42); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%); width: 100%; max-width: 430px; z-index: 100;
  background: var(--surface); border-radius: 22px 22px 0 0; max-height: 86vh; overflow: auto;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--shadow-lg);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h3 { margin: 0; font-size: 18px; }
.sheet .close-x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; color: var(--ink-2); font-size: 18px; }

.qcard-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-right: 36px; }
.qcard-head .qtype { color: var(--ink-3); font-size: 13px; }
.qcard .stem { font-size: 16px; line-height: 1.6; margin-bottom: 12px; }
.qcard .crop { border-radius: 10px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 12px; background: #fff; }
.qcard .crop img { display: block; width: 100%; }
.ans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ans-box { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.ans-box span { display: block; font-size: 12px; color: var(--ink-3); }
.ans-box b { font-size: 17px; word-break: break-all; }
.ans-box.bad b { color: var(--red); }
.ans-box.good b { color: var(--green); }
.analysis { background: var(--teal-50); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
.analysis span { display: block; font-size: 12px; color: var(--teal-700); font-weight: 600; margin-bottom: 2px; }
.qmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-bottom: 16px; }

/* 错题本 */
.wb-filters { position: sticky; top: 54px; z-index: 10; background: var(--bg); padding: 2px 0 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.wb-filters .chips { margin-top: 8px; }
.wb-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 10px; font-size: 13px; color: var(--ink-3); }
.wb-list { display: flex; flex-direction: column; gap: 12px; }
.wb-card { padding: 14px; transition: box-shadow .15s, opacity .3s, transform .3s; }
.wb-card.sel { box-shadow: 0 0 0 2px var(--teal-600), var(--shadow); }
.wb-card.leaving { opacity: 0; transform: translateX(30px); }
.wb-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wb-top .kp { font-size: 13px; color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: transparent; padding: 0; }
.check.on { background: var(--teal-700); border-color: var(--teal-700); color: #fff; }
.wb-img { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; margin-bottom: 10px; min-height: 40px; }
.wb-img img { display: block; width: 100%; max-height: 180px; object-fit: contain; object-position: left center; }
.wb-img .img-toggle {
  position: absolute; right: 6px; bottom: 6px; height: 24px; padding: 0 8px; border-radius: 12px; border: 0; cursor: pointer;
  background: rgba(20, 30, 29, .72); color: #fff; font-size: 12px;
}
.wb-stem { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.wb-ans { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; flex-wrap: wrap; }
.wb-ans b { font-size: 14px; }
.wb-ans .bad { color: var(--red); } .wb-ans .good { color: var(--green); }
.wb-analysis { font-size: 13px; background: var(--teal-50); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; line-height: 1.6; }
.wb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 4px; }
.wb-foot .meta { font-size: 12px; color: var(--ink-3); }
.wb-foot .meta b { color: var(--red); font-weight: 600; }
.link-btn { border: 0; background: none; color: var(--teal-700); font-size: 13px; cursor: pointer; padding: 0; }

.print-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 25;
  width: calc(100% - 24px); max-width: 406px; background: var(--teal-800); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); animation: barIn .22s ease-out;
}
@keyframes barIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.print-bar .grow { font-size: 14px; }
.print-bar label { display: flex; align-items: center; gap: 4px; font-size: 12px; opacity: .85; cursor: pointer; }
.print-bar .btn { min-height: 36px; }
.print-bar .btn-light { background: #fff; color: var(--teal-800); border-color: #fff; }
.print-bar .btn-clear { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; padding: 0 10px; }

/* 学情 */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.kp-row { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.kp-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kp-row:first-child { padding-top: 0; }
.kp-row .kp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.kp-row .kp-name { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; }
.kp-row .kp-num { font-size: 12px; color: var(--ink-3); }
.bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--green); transition: width .5s ease; }
.bar i.red { background: var(--red); } .bar i.amber { background: var(--amber); } .bar i.teal { background: var(--teal-600); }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }
.bar-row .pct { font-size: 12px; font-weight: 600; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.note { font-size: 12px; color: var(--ink-3); margin: 8px 4px 0; }

/* 打印 */
.printer-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-50); color: var(--teal-700); display: flex; align-items: center; justify-content: center; flex: none; }
.pr-name { font-weight: 600; }
.pr-status { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pr-other { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.pr-other .list-item { padding: 10px 0; }
.setting-row { display: flex; align-items: center; gap: 12px; }
.setting-row + .setting-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.setting-row .grow b { display: block; font-size: 15px; font-weight: 600; }
.setting-row .grow span { font-size: 12px; color: var(--ink-3); }
.mini-seg { display: flex; gap: 4px; }
.mini-seg button { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.mini-seg button.on { background: var(--teal-700); border-color: var(--teal-700); color: #fff; font-weight: 600; }
.job { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.job:last-child { border-bottom: 0; padding-bottom: 0; }
.job:first-child { padding-top: 0; }
.job .jp { width: 40px; height: 52px; border-radius: 5px; border: 1px solid var(--line); background: #fff; flex: none; overflow: hidden; }
.job .jp img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.job .jt { font-weight: 600; font-size: 14px; }
.job .jm { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.job .je { font-size: 12px; color: var(--red); margin-top: 2px; }
.job .jr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.job.flash { animation: popIn .35s ease-out; }

/* 教师 */
.class-head { margin: 2px 2px 14px; }
.class-head h2 { margin: 0; font-size: 22px; }
.class-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; color: inherit; display: block; }
.tile b { display: block; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.tile span { font-size: 12px; color: var(--ink-3); }
.tile.amber { background: var(--amber-bg); }
.tile.amber b { color: #a46f00; }
.tile .bar { margin-top: 8px; height: 5px; }
.common-row { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.common-row:last-child { border-bottom: 0; padding-bottom: 0; }
.common-row:first-child { padding-top: 0; }
.pend-card { padding: 14px; transition: opacity .3s, transform .3s, max-height .35s; }
.pend-card.leaving { opacity: 0; transform: translateX(40px); }
.pend-card .crop { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 10px 0; background: #fff; }
.pend-card .crop img { display: block; width: 100%; max-height: 160px; object-fit: contain; object-position: left center; }
.pend-who { font-size: 12px; color: var(--ink-3); }
.stu-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; color: inherit; }
.stu-row:last-child { border-bottom: 0; padding-bottom: 0; }
.stu-row:first-child { padding-top: 0; }
.stu-row .sname { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stu-row .smeta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.stu-acc { text-align: right; }
.stu-acc b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stu-acc span { display: block; font-size: 11px; color: var(--ink-3); }

.role-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; margin-top: 10px; text-align: left; }
.role-opt.on { border-color: var(--teal-600); background: var(--teal-50); }
.role-opt b { display: block; }
.role-opt span { font-size: 12px; color: var(--ink-3); }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--ink-3); font-size: 14px; }
.err-box { text-align: center; padding: 30px 20px; color: var(--ink-2); }
.err-box p { margin: 0 0 12px; }

/* ===== 12-02 改版：科目切换、台灯场景、单元、名师精批 ===== */
/* 点击区域放大到 44 左右 */
.topbar .who { height: 40px; }
.sheet .close-x { width: 40px; height: 40px; }
.viewer-tools button { width: 40px; height: 40px; }
.mini-seg button { width: 44px; height: 40px; }
.chip { height: 36px; }
.seg button { height: 36px; }
.job .jr a.pdf-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; font-size: 13px; }
.role-card.busy { border-color: var(--teal-500); transform: scale(.99); }
.role-card:active { transform: scale(.98); }
.role-card .chev .spinner { width: 18px; height: 18px; }

/* 顶栏下的科目切换 */
.subnav { position: sticky; top: 54px; z-index: 19; padding: 2px 16px 8px; background: rgba(246, 242, 234, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 6px; }
.seg a { flex: 1; display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 9px; font-size: 14px; color: var(--ink-2); }
.seg a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stu-seg { background: var(--teal-100); }

/* 台灯下的小人 */
.scene-card { padding: 0; overflow: hidden; }
.scene { position: relative; background: linear-gradient(180deg, #fbf3e4, #f4e6cf); }
.scene svg { display: block; width: 100%; height: auto; }
.scene .kid, .scene .cone, .scene .lamp-head, .scene .bulb { transition: opacity .6s, fill .6s; }
.scene .hand, .scene .head, .scene .flip { transform-box: fill-box; }
.scene .hand { transform-origin: 20% 10%; }
.scene .head { transform-origin: 50% 90%; }
.scene .flip { transform-origin: 0% 50%; opacity: 0; }
.scene .snap { opacity: 0; pointer-events: none; }
.scene.writing .hand { animation: sceneWrite .7s ease-in-out infinite alternate; }
.scene.writing .head { animation: sceneNod 3.2s ease-in-out infinite; }
.scene.flipping .flip { opacity: 1; animation: sceneFlip 1.1s ease-in-out infinite; }
.scene.flipping .hand { transform: translate(-8px, -6px) rotate(-8deg); transition: transform .3s; }
.scene.flash .snap { animation: sceneSnap .55s ease-out; }
.scene.flash .cone { animation: sceneBeam .55s ease-out; }
.scene.away .kid, .scene.away .cone { opacity: 0; }
.scene.away .lamp-head { fill: #9aa39f; }
.scene.away .bulb { fill: #d9d4ca; }
@keyframes sceneWrite { from { transform: translate(-3px, 0) rotate(-4deg); } to { transform: translate(4px, 1px) rotate(3deg); } }
@keyframes sceneNod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(2.5deg); } }
@keyframes sceneFlip { 0% { transform: scaleX(1); } 50% { transform: scaleX(.05); } 100% { transform: scaleX(-1); } }
@keyframes sceneSnap { 0% { opacity: .75; } 100% { opacity: 0; } }
@keyframes sceneBeam { 0% { opacity: 1; filter: brightness(1.4); } 100% { opacity: .9; } }
.scene-bubble {
  position: absolute; left: 57%; top: 6px; max-width: 46%; padding: 6px 12px; border-radius: 14px; background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 700; box-shadow: 0 3px 10px rgba(60, 40, 20, .16); opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .25s, transform .25s;
  pointer-events: none; white-space: nowrap;
}
.scene-bubble::after { content: ""; position: absolute; left: 12px; bottom: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.scene-bubble.show { opacity: 1; transform: none; }
.scene-bubble.bad { color: var(--red); }
.scene-bubble.good { color: var(--green); }
.scene-off { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-size: 14px; color: var(--ink-2); opacity: 0; transition: opacity .4s; pointer-events: none; }
.scene.away .scene-off { opacity: 1; }
.kid-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px; }
.kid-line .kl-main { flex: 1; min-width: 0; }
.kid-line .kid-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 17px; }
.kid-line .kid-name .muted { margin-left: 0; }
.kid-prof { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-height: 44px; padding: 0 2px 0 8px; color: var(--teal-700); font-size: 12px; text-align: right; flex: none; }
.kid-prof span { color: var(--ink-3); }
.kid-prof b { font-size: 13px; }

/* 今日各科 */
.subj-card { padding-bottom: 6px; }
.subj-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; background: transparent; border-radius: 12px; cursor: pointer; text-align: left; }
.subj-row.on { background: var(--teal-50); box-shadow: inset 0 0 0 1.5px var(--teal-500); }
.subj-row .sr-name { width: 34px; font-weight: 700; font-size: 15px; flex: none; }
.subj-row .sr-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.subj-row .sr-meta { font-size: 12px; color: var(--ink-3); }
.subj-row .sr-acc { width: 46px; text-align: right; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; flex: none; }
.subj-row .sr-acc small { font-size: 11px; font-weight: 600; }
.bar i.teal { background: var(--teal-500); }
.bar i.green { background: var(--green); }
.bar i.amber { background: var(--amber); }

/* 打印出问题 */
.print-alert { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--amber-bg); border: 1px solid #f0d58f; }
.print-alert.failed { background: #fff2ef; border-color: #f2c3bc; }
.print-alert .pa-text b { display: block; font-size: 15px; }
.print-alert .pa-text span { font-size: 14px; color: var(--ink-2); }
.print-alert .pa-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.print-alert .pa-btns .btn { min-height: 38px; }
.job .je.wait { color: #8a5d00; }
.job .jacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.job .jacts .btn { min-height: 36px; }
.found-title { font-size: 13px; color: var(--ink-3); margin: 12px 0 2px; }
.list-item.found .btn { flex: none; }
.confirm-body p { margin: 6px 0 0; }

/* 页和题的标签 */
.pi-title { display: flex; align-items: baseline; gap: 8px; }
.pi-time { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.pi-tag { font-size: 12.5px; color: var(--teal-700); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-tag { font-size: 14px; color: var(--teal-700); font-weight: 600; margin: 2px 2px 8px; }
.q-tag { font-size: 13px; color: var(--teal-700); margin: -6px 0 10px; }
.qbox .tag {
  right: 1px; top: 1px; transform: none;
  min-width: 13px; height: 13px; border-radius: 7px; padding: 0 2px; font-size: 9px; line-height: 13px; opacity: .92;
}
.stage { background: #3a4544 center / 100% 100% no-repeat; }
.img-loading { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 14px; background: rgba(20, 30, 29, .7); pointer-events: none; }

/* 错题本按单元分组 */
.wb-group { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 14px 4px 8px; font-size: 14px; }
.wb-group b { color: var(--teal-800); }
.wb-group span { color: var(--ink-3); font-size: 12px; flex: none; }
.wb-group:first-child { margin-top: 4px; }
.wb-tag { flex: 1; min-width: 0; font-size: 13px; color: var(--teal-700); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-kp { font-size: 13px; color: var(--ink-2); margin: -2px 0 6px; }
#wbSeg button b { font-variant-numeric: tabular-nums; margin-left: 2px; }

/* 学情：各科、单元 */
.subj-sum { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit; }
.subj-sum .ss-top { display: flex; align-items: center; gap: 8px; }
.subj-sum .ss-top b { font-size: 17px; }
.subj-sum .ss-top span { flex: 1; font-size: 12px; color: var(--ink-3); }
.subj-sum .ss-top svg { color: var(--ink-3); }
.subj-sum .ss-nums { display: flex; gap: 18px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.subj-sum .ss-nums b { font-size: 16px; color: var(--ink); }
.subj-sum .ss-weak { margin-top: 6px; font-size: 13px; color: var(--red); }
.subj-sum .ss-weak span { color: var(--ink-3); margin-left: 6px; font-size: 12px; }
.subj-sum .ss-weak.ok { color: var(--green); }
.kp-unit { font-size: 12px; color: var(--teal-700); margin: 2px 0 6px; }
.book-card { display: flex; align-items: center; gap: 10px; }
.book-card b { font-size: 17px; margin-right: 8px; }
.book-card span { font-size: 13px; color: var(--ink-3); }
.units { padding-top: 6px; padding-bottom: 6px; }
.unit-row { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.unit-row:last-child { border-bottom: 0; }
.unit-row .ur-top { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.unit-row .ur-top:disabled { cursor: default; }
.unit-row .ur-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.unit-row .ur-pct { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.unit-row .ur-pct.red { color: var(--red); }
.unit-row .ur-pct.amber { color: #a46f00; }
.unit-row .ur-pct.green { color: var(--green); }
.unit-row .ur-top .chev { transition: transform .2s; }
.unit-row.open .ur-top .chev { transform: rotate(90deg); }
.unit-row .bar { margin-top: 4px; }
.unit-row .ur-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.unit-row .ur-kps { display: none; margin-top: 8px; padding: 4px 10px; border-radius: 10px; background: var(--surface-2); }
.unit-row.open .ur-kps { display: block; }
.unit-row.dim .ur-name, .unit-row.dim .ur-pct { color: var(--ink-3); font-weight: 400; }
.kp-row .kp-top .kp-num { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* 档案 */
.field-hint { display: block; font-style: normal; font-size: 12px; color: #a46f00; margin-top: 4px; }
.field-hint:empty { display: none; }

/* 名师精批 */
.tutor-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--teal-200); background: var(--teal-50); color: var(--teal-800);
}
.tutor-btn .tb-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--teal-700); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.tutor-btn .tb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tutor-btn .tb-t b { font-size: 15px; }
.tutor-btn .tb-t span { font-size: 12px; color: var(--ink-2); }
.tutor-btn.hot { border: 0; background: linear-gradient(135deg, #b8452f, #d8743a); color: #fff; box-shadow: 0 6px 16px rgba(184, 69, 47, .3); }
.tutor-btn.hot .tb-ic { background: rgba(255, 255, 255, .2); }
.tutor-btn.hot .tb-t span, .tutor-btn.hot .chev { color: rgba(255, 255, 255, .85); }
.tutor-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 6px 10px; text-align: center; }
.tutor-wait > b { font-size: 18px; }
.tutor-wait .tw-av { position: relative; width: 64px; height: 64px; border-radius: 20px; background: var(--teal-700); color: #fff; display: flex; align-items: center; justify-content: center; animation: twBob 1.6s ease-in-out infinite; }
.tutor-wait .tw-av svg { width: 34px; height: 34px; }
.tutor-wait .tw-pen { position: absolute; right: -6px; bottom: 6px; width: 18px; height: 4px; border-radius: 2px; background: #f0a92e; transform: rotate(-40deg); animation: twPen .5s ease-in-out infinite alternate; }
.tutor-wait .tw-step { font-size: 14px; color: var(--ink-2); min-height: 21px; }
.tutor-wait .tw-bar { width: 72%; height: 6px; border-radius: 3px; background: var(--bg-deep); overflow: hidden; margin: 4px 0; }
.tutor-wait .tw-bar i { display: block; height: 100%; width: 0; background: var(--teal-500); border-radius: 3px; animation: twFill 12s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes twBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes twPen { from { transform: translate(0, 0) rotate(-40deg); } to { transform: translate(-4px, 2px) rotate(-30deg); } }
@keyframes twFill { 0% { width: 4%; } 100% { width: 94%; } }
.tutor-head { display: flex; align-items: center; gap: 12px; margin: 2px 36px 14px 0; }
.tutor-head .t-av { width: 44px; height: 44px; border-radius: 14px; background: var(--teal-700); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.tutor-head b { display: block; font-size: 17px; }
.tutor-head span { font-size: 13px; color: var(--ink-3); }
.tutor section { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.tutor section h4 { margin: 0 0 6px; font-size: 14px; color: var(--teal-800); }
.tutor section p { margin: 0 0 6px; font-size: 15px; line-height: 1.65; }
.tutor section p:last-child { margin-bottom: 0; }
.tutor section ol { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.65; }
.tutor section.tip { background: var(--amber-bg); }
.tutor section.tip h4 { color: #8a5d00; }
.buy-points { margin: 0 0 14px; padding-left: 20px; font-size: 14px; color: var(--ink-2); line-height: 1.8; }
.plans { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.plan { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.plan.on { border-color: var(--teal-600); background: var(--teal-50); }
.plan .pl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan .pl-t b { font-size: 15px; }
.plan .pl-t span { font-size: 12px; color: var(--ink-3); }
.plan .pl-p { text-align: right; flex: none; }
.plan .pl-p b { font-size: 22px; color: var(--teal-800); }
.plan .pl-p span { display: block; font-size: 11px; color: var(--ink-3); }
.btn.big { min-height: 48px; font-size: 16px; }
.buy .btn + .btn { margin-top: 8px; }
.buy-note { text-align: center; font-size: 11px; color: var(--ink-3); margin: 12px 0 0; }
