/* The phone and the app's screens, drawn in dp (412 × 916) like the app and scaled with CSS
   zoom so text is laid out at its final size. Colours are the page's 天光 tokens unless a phone
   carries its own (scoped custom properties + data-family). States are classes (st-1, st-2 …)
   that page scripts add as their chapter plays; transitions use the app's springs. */

/* course swatches (CoursePalette) per family */
[data-family='light'] {
  --cb0: #e4e8f4; --cf0: #2c3d78; --cb1: #e2ecdd; --cf1: #33532a; --cb2: #f2e6d1; --cf2: #6a4615;
  --cb3: #daecea; --cf3: #1d5551; --cb4: #ece2ee; --cf4: #583261; --cb5: #f3dfda; --cf5: #77301f;
  --scrim: rgb(30 22 14 / .3);
}
[data-family='dark'] {
  --cb0: #262e48; --cf0: #c9d3f3; --cb1: #263624; --cf1: #c6dcbe; --cb2: #3a2e1b; --cf2: #ebd2a8;
  --cb3: #1c3634; --cf3: #b3ddd8; --cb4: #36263c; --cf4: #dfc7e5; --cb5: #40231e; --cf5: #efc3ba;
  --scrim: rgb(0 0 0 / .56);
}

.phone { --s: .8; width: calc(434px * var(--s)); position: relative; flex: none; -webkit-user-select: none; user-select: none; }
.phone-body {
  position: relative; width: 434px; height: 938px; zoom: var(--s); border-radius: 58px;
  background: linear-gradient(145deg, #2b2824, #0f0e0c 55%, #1d1b18);
  box-shadow: 0 40px 90px -30px rgb(25 18 10 / .45), 0 12px 30px -10px rgb(25 18 10 / .3), inset 0 0 0 1.5px rgb(255 255 255 / .1);
}
html[data-family='dark'] .phone-body { box-shadow: 0 40px 90px -30px rgb(0 0 0 / .85), 0 12px 30px -10px rgb(0 0 0 / .6), inset 0 0 0 1.5px rgb(255 255 255 / .12); }
.phone-screen {
  position: absolute; left: 11px; top: 11px; width: 412px; height: 916px; border-radius: 47px; overflow: hidden; isolation: isolate;
  background: var(--bg); color: var(--text); font: 400 14px/1.4 var(--sans); letter-spacing: 0; text-align: left;
  transition: background-color .3s;
}
.phone-screen::after { content: ''; position: absolute; left: 199px; top: 9px; width: 14px; height: 14px; border-radius: 7px; background: #050505; z-index: 30; }
.phone .layer { position: absolute; inset: 0; background: var(--bg); }
.phone .abs { position: absolute; }
.phone .serif { font-family: var(--serif); font-weight: 700; }
.phone svg { display: block; }
.phone .tnum { font-variant-numeric: tabular-nums; }

/* screen changes inside one phone: fade-through (tabs) and push (sub pages) */
.phone .layer { transition: opacity 240ms var(--exit), transform var(--d-std) var(--spring); }
.phone .layer[data-off] { opacity: 0; pointer-events: none; transform: scale(.96); }
.phone .layer[data-off='push'] { transform: translateX(25%); }
.phone .layer.enter { transition: opacity 380ms 120ms var(--spring), transform var(--d-std) 120ms var(--spring); }

/* ---- shell ---- */
.p-sb { position: absolute; left: 0; top: 0; width: 412px; height: 30px; display: flex; align-items: center; padding: 0 24px; font-size: 14px; font-weight: 600; z-index: 20; color: var(--text); }
.p-sb .ic { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.p-sb.light { color: #f4f1ec; }
.p-bb { position: absolute; left: 0; bottom: 0; width: 412px; height: 81px; background: var(--bg); border-top: 1px solid var(--line); z-index: 15; }
.p-bb .tabs { height: 64px; display: flex; align-items: center; justify-content: space-around; padding: 0 6px; }
.p-bb .tab { width: 64px; display: flex; flex-direction: column; align-items: center; color: var(--text-2); font-size: 11px; font-weight: 500; gap: 3px; }
.p-bb .tab::after { content: ''; width: 4px; height: 4px; border-radius: 2px; background: transparent; }
.p-bb .tab.on { color: var(--text); }
.p-bb .tab.on::after { background: var(--accent); }
.p-bb .fab { width: 52px; height: 52px; border-radius: 26px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.p-bb .home { position: absolute; left: 152px; bottom: 6px; width: 108px; height: 4px; border-radius: 2px; background: color-mix(in oklab, var(--text) 35%, transparent); }
.p-title { position: absolute; left: 0; top: 30px; width: 412px; height: 60px; display: flex; align-items: center; padding: 0 12px 0 20px; }
.p-title h3 { flex: 1; font: 600 28px/1 var(--serif); }
.p-gear { width: 36px; height: 36px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.p-sub { position: absolute; left: 0; top: 30px; width: 412px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 10px 20px 10px 12px; z-index: 3; background: var(--bg); }
.p-sub b { display: block; font: 600 21px/28px var(--serif); }
.p-sub small { display: block; font-size: 12px; line-height: 18px; color: var(--text-2); }
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.p-seg { display: inline-flex; padding: 3px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.p-seg span { min-width: 44px; height: 26px; padding: 0 10px; border-radius: 13px; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background-color var(--d-fast) var(--spring-fast), color .2s; }
.p-seg span.on { background: var(--text); color: var(--bg); }
.p-pill { font-size: 11px; font-weight: 600; line-height: 20px; padding: 0 8px; border-radius: 10px; white-space: nowrap; background: var(--accent-soft); color: var(--accent); }
.p-chip { height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--text-3); display: grid; place-items: center; font-size: 13px; white-space: nowrap; }

/* ---- 今日 ---- */
.p-today .hdr { position: absolute; left: 20px; top: 38px; width: 372px; height: 48px; display: flex; align-items: center; }
.p-today .syncp { margin-left: auto; height: 32px; border-radius: 16px; border: 1px solid var(--line); padding: 0 12px; display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.p-today .date { position: absolute; left: 20px; top: 92px; }
.p-today .date .wk { font-size: 13px; line-height: 20px; color: var(--text-2); }
.p-today .date .d { font: 600 34px/40px var(--serif); margin-top: 4px; }
.p-today .date .tag { font: 600 15px/24px var(--serif); color: var(--text-2); margin-top: 6px; }
.p-today .hz { position: absolute; left: 260px; top: 112px; width: 132px; height: 72px; overflow: visible; }
.p-next { position: absolute; left: 20px; top: 200px; width: 372px; padding: 16px 18px; }
.p-next .lb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent); font-weight: 600; }
.p-next .lb::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: var(--accent); }
.p-next .t { font: 600 21px/28px var(--serif); margin-top: 6px; }
.p-next .m { font-size: 13px; line-height: 18px; color: var(--text-2); margin-top: 2px; }
.p-days { position: absolute; left: 14px; top: 320px; width: 384px; display: flex; justify-content: space-between; }
.p-days div { width: 46px; height: 62px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.p-days small { font-size: 12px; color: var(--text-2); }
.p-days b { font-size: 17px; font-weight: 600; line-height: 24px; font-variant-numeric: tabular-nums; }
.p-days i { display: flex; gap: 3px; height: 4px; }
.p-days i::before, .p-days i::after { content: ''; width: 4px; height: 4px; border-radius: 2px; background: var(--d1, transparent); }
.p-days i::after { background: var(--d2, transparent); }
.p-days .sel { background: var(--text); }
.p-days .sel small { color: color-mix(in oklab, var(--bg) 75%, transparent); }
.p-days .sel b { color: var(--bg); }
.p-today .dayhd { position: absolute; left: 20px; top: 398px; width: 372px; display: flex; align-items: center; }
.p-today .dayhd b { font: 600 21px/1.3 var(--serif); }
.p-today .dayhd .p-seg { margin-left: auto; }
.p-today .trackln { position: absolute; left: 77.5px; top: 474px; width: 1px; height: 310px; background: var(--line); }
.p-rows { position: absolute; left: 0; top: 452px; width: 412px; transition: opacity .3s; }
.p-row { position: relative; height: 62px; transition: height var(--d-std) var(--spring), opacity .3s; }
.p-row.past { opacity: .55; }
.p-row .tm { position: absolute; left: 20px; top: 12px; width: 46px; font-variant-numeric: tabular-nums; }
.p-row .tm b { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 18px; }
.p-row .tm small { display: block; font-size: 11px; color: var(--text-3); line-height: 16px; }
.p-row .node { position: absolute; left: 69px; top: 13px; width: 18px; height: 18px; display: grid; place-items: center; }
.p-row .node .course { width: 12px; height: 12px; border-radius: 6px; background: var(--sw, var(--cf0)); box-shadow: 0 0 0 3px var(--bg); }
.p-row .node .event { width: 13px; height: 13px; border-radius: 7px; border: 1.6px dashed var(--text-2); background: var(--bg); }
.p-row .node .exam { width: 11px; height: 11px; transform: rotate(45deg); background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.p-row .node .task { position: relative; width: 18px; height: 18px; }
.p-row .node .task::before { content: ''; position: absolute; inset: 0; border-radius: 9px; border: 1.7px solid var(--text-2); background: var(--bg); transition: border-color .2s; }
.p-row .node .task::after { content: ''; position: absolute; inset: 0; border-radius: 9px; background: var(--accent); transform: scale(0); transition: transform 260ms var(--spring-fast); }
.p-row .node .task svg { position: absolute; inset: 0; z-index: 1; }
.p-row .node .task path { stroke: var(--on-accent); stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 220ms 200ms ease-out; }
.p-row .bd { position: absolute; left: 98px; top: 9px; right: 20px; display: flex; align-items: flex-start; }
.p-row .bd > div { flex: 1; min-width: 0; }
.p-row .bd b { position: relative; display: inline-block; font-size: 15px; font-weight: 600; line-height: 22px; white-space: nowrap; transition: color .3s .35s; }
.p-row .bd b::after { content: ''; position: absolute; left: 0; top: 12px; height: 1.5px; width: 0; background: var(--text-2); transition: width 320ms 420ms ease-out; }
.p-row .bd small { display: block; font-size: 12px; line-height: 18px; color: var(--text-2); white-space: nowrap; }
.p-row .bd .p-pill { margin-top: 2px; }
.p-row.checked .node .task::before { border-color: var(--accent); }
.p-row.checked .node .task::after { transform: scale(1); }
.p-row.checked .node .task path { stroke-dashoffset: 0; }
.p-row.checked .bd b { color: color-mix(in oklab, var(--text) 50%, transparent); }
.p-row.checked .bd b::after { width: 100%; }
.p-row.gone { height: 0; opacity: 0; overflow: hidden; transition-delay: .9s; }
.p-done { position: absolute; left: 20px; font-size: 13px; color: var(--text-2); opacity: 0; transition: opacity .4s 1.2s; }
.p-today.checked .p-done { opacity: .8; }

/* week view */
.p-week { position: absolute; left: 0; top: 436px; width: 412px; height: 399px; background: var(--bg); opacity: 0; transform: scale(.96); transform-origin: 50% 0; pointer-events: none; transition: opacity 300ms, transform var(--d-std) var(--spring); }
.p-today.week .p-week { opacity: 1; transform: none; }
.p-today.week .p-rows, .p-today.week .trackln { opacity: 0; }
.p-week .hd { position: absolute; left: 20px; top: 0; height: 44px; display: flex; align-items: center; font-size: 13px; }
.p-week .today-col { position: absolute; top: 44px; width: 52px; height: 354px; border-radius: 12px; background: var(--accent-soft); }
.p-week .dn { position: absolute; top: 46px; width: 52px; text-align: center; font-size: 11px; line-height: 13px; color: var(--text-2); white-space: pre; }
.p-week .dn.on { color: var(--accent); }
.p-week .hl { position: absolute; left: 36px; width: 364px; height: 1px; background: var(--line); }
.p-week .pn { position: absolute; left: 12px; width: 22px; height: 32px; display: grid; place-items: center; font-size: 11px; color: var(--text-2); }
.p-week .blk { position: absolute; border-radius: 9px; padding: 5px 4px; overflow: hidden; background: var(--cb); color: var(--cf); }
.p-week .blk b { display: block; font-size: 11px; font-weight: 600; line-height: 14px; }
.p-week .blk small { display: block; font-size: 9.5px; line-height: 12px; opacity: .8; margin-top: 2px; }
.p-week .blk.exam { background: var(--accent); color: var(--on-accent); }
.p-week .now { position: absolute; height: 2px; border-radius: 1px; background: var(--accent); }

/* ---- 校园 + 同步全部 ---- */
.p-campus .acct { position: absolute; left: 20px; top: 96px; width: 372px; height: 92px; display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; }
.p-avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 18px/1 var(--serif); flex: none; }
.p-campus .acct .who { flex: 1; font-size: 12px; color: var(--text-2); line-height: 1.4; }
.p-campus .acct .who b { display: block; font-size: 16px; font-weight: 600; color: var(--text); }
.p-campus .sync { position: absolute; left: 20px; top: 202px; width: 372px; height: 176px; padding: 18px; }
.p-campus .sync .row1 { display: flex; align-items: center; gap: 12px; }
.p-campus .sync .row1 > div { flex: 1; font-size: 12px; line-height: 18px; color: var(--text-2); }
.p-campus .sync .row1 b { display: block; font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.p-btn { height: 44px; padding: 0 18px; border-radius: 22px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; flex: none; }
.p-tiles { display: flex; gap: 8px; margin-top: 16px; }
.p-tiles div { flex: 1; background: var(--bg); border-radius: 14px; padding: 10px 6px 9px 10px; font-size: 11px; color: var(--text-2); }
.p-tiles b { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin-top: 2px; }
.p-entry { position: absolute; width: 180px; height: 132px; padding: 16px; }
.p-entry small { display: block; font-size: 13px; color: var(--text-2); }
.p-entry b { display: block; font: 700 30px/40px var(--serif); margin-top: 8px; }
.p-entry span { display: block; font-size: 12px; line-height: 17px; color: var(--text-2); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .35s; z-index: 16; pointer-events: none; }
.p-sheet { position: absolute; left: 0; bottom: 0; width: 412px; border-radius: 28px 28px 0 0; background: var(--raised); box-shadow: 0 -10px 40px rgb(0 0 0 / .12); transform: translateY(105%); transition: transform var(--d-std) var(--spring); z-index: 17; padding: 26px 20px 34px; }
.p-sheet::before { content: ''; position: absolute; left: 188px; top: 10px; width: 36px; height: 4px; border-radius: 2px; background: var(--line); }
.open > .p-scrim, .open .p-scrim { opacity: 1; }
.open > .p-sheet, .open .p-sheet { transform: none; }
.p-sheet .sh { display: flex; align-items: baseline; }
.p-sheet .sh b { flex: 1; font: 600 21px/28px var(--serif); }
.p-sheet .sh small { font-size: 12px; color: var(--text-2); }
.p-srows { margin-top: 22px; }
.p-srow { position: relative; height: 64px; display: flex; align-items: center; gap: 14px; }
.p-srow + .p-srow { border-top: 1px solid var(--line); }
.p-srow .st { width: 28px; height: 28px; position: relative; flex: none; }
.p-srow .st > * { position: absolute; inset: 0; transition: opacity .25s, transform .35s var(--spring-fast); }
.p-srow .tx { flex: 1; }
.p-srow .tx b { display: block; font-size: 15px; font-weight: 400; }
.p-srow .tx small { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; }
.p-srow .ct { font-size: 14px; opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .4s var(--spring); }
.p-srow .ring { border-radius: 50%; border: 1.5px solid var(--text-3); inset: 3px; }
.p-srow .spin { border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); inset: 3px; opacity: 0; animation: spin .8s linear infinite; }
.p-srow .ok { border-radius: 50%; background: var(--accent-soft); opacity: 0; transform: scale(.6); }
.p-srow .ok path { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 260ms 120ms ease-out; }
.p-srow[data-state='running'] .ring { opacity: 0; }
.p-srow[data-state='running'] .spin { opacity: 1; }
.p-srow[data-state='ok'] .ring { opacity: 0; }
.p-srow[data-state='ok'] .ok { opacity: 1; transform: none; }
.p-srow[data-state='ok'] .ok path { stroke-dashoffset: 0; }
.p-srow[data-state='ok'] .ct { opacity: 1; transform: none; }
.p-srow::before { content: ''; position: absolute; inset: 2px -10px; border-radius: 14px; background: var(--accent); opacity: 0; transition: opacity .6s; }
.p-srow.flash::before { opacity: .1; transition: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-sheet .note { margin-top: 12px; font-size: 12px; line-height: 18px; color: var(--text-2); }
.p-sheet .btns { margin-top: 16px; display: flex; gap: 10px; opacity: .35; transition: opacity .3s; }
.p-sheet .btns div { flex: 1; height: 48px; border-radius: 24px; border: 1px solid var(--text-3); display: grid; place-items: center; font-size: 15px; }
.p-sheet .btns div:last-child { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; }
.p-sheet.done .btns { opacity: 1; }

/* ---- lock screen with 课间 notifications ---- */
.p-lock { background: radial-gradient(130% 70% at 50% 0%, color-mix(in oklab, var(--accent) 22%, var(--bg)), var(--bg) 70%); }
.p-lock .clk { position: absolute; left: 0; width: 412px; top: 96px; text-align: center; }
.p-lock .clk b { display: block; font: 700 92px/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.p-lock .clk small { display: block; font-size: 15px; color: var(--text-2); margin-top: 10px; }
.p-notes { position: absolute; left: 14px; top: 300px; width: 384px; display: grid; gap: 10px; }
.p-note { border-radius: 24px; background: color-mix(in oklab, var(--raised) 92%, transparent); border: 1px solid color-mix(in oklab, var(--line) 90%, transparent); padding: 14px 18px 15px; box-shadow: 0 8px 24px -14px rgb(0 0 0 / .35); opacity: 0; transform: translateY(-26px) scale(.96); transition: opacity .3s, transform var(--d-std) var(--spring); }
.p-note.in { opacity: 1; transform: none; }
.p-note .hd { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.p-note .hd svg { width: 20px; height: 20px; border-radius: 6px; background: #fbf8f2; flex: none; }
.p-note .hd span:last-child { margin-left: auto; }
.p-note .hd .up { color: var(--accent); }
.p-note b { display: block; font-size: 16px; font-weight: 700; margin-top: 6px; }
.p-note small { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ---- 成绩 ---- */
.p-grades .top { position: absolute; left: 0; top: 30px; width: 412px; height: 56px; display: flex; align-items: center; padding: 0 12px 0 8px; z-index: 3; background: var(--bg); }
.p-grades .top span { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.p-grades .vp { position: absolute; left: 0; top: 86px; width: 412px; height: 830px; overflow: hidden; }
.p-grades .ct { position: absolute; left: 0; top: -86px; width: 412px; transition: transform 900ms var(--spring-gentle); }
.p-grades.scrolled .ct { transform: translateY(-430px); }
.p-grades .hero { position: absolute; left: 20px; top: 90px; }
.p-grades .hero > small { font-size: 13px; line-height: 20px; color: var(--text-2); }
.p-grades .gpa { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; }
.p-grades .gpa b { font: 700 64px/68px var(--serif); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.p-grades .gpa span { font-size: 15px; color: var(--text-2); padding-bottom: 10px; }
.p-grades .stat { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.p-grades .rank { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.p-bars { position: absolute; left: 28px; top: 282px; width: 356px; height: 156px; }
.p-bar { position: absolute; bottom: 20px; width: 56.8px; display: flex; flex-direction: column; align-items: center; }
.p-bar i { width: 56.8px; max-width: 60px; height: calc(var(--h) * 1px); border-radius: 12px 12px 4px 4px; background: var(--text-3); transform-origin: 50% 100%; transform: scaleY(0); transition: transform 800ms var(--spring); transition-delay: calc(200ms + var(--n) * 120ms); }
.p-bar.last i { background: var(--accent); }
.p-bar em { font-style: normal; font-size: 13px; margin-bottom: 6px; opacity: 0; transition: opacity .4s; transition-delay: calc(500ms + var(--n) * 120ms); }
.p-bar small { position: absolute; top: 100%; margin-top: 6px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.p-grades.grow .p-bar i { transform: none; }
.p-grades.grow .p-bar em { opacity: 1; }
.p-grades .chips { position: absolute; left: 20px; top: 458px; display: flex; gap: 8px; }
.p-term { position: absolute; left: 20px; width: 372px; display: flex; align-items: center; font-size: 15px; font-weight: 500; }
.p-term small { margin-left: auto; font-size: 12px; color: var(--text-2); font-weight: 400; }
.p-courses { position: absolute; left: 20px; width: 372px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.p-course + .p-course { border-top: 1px solid var(--line); }
.p-course .r { height: 60px; display: flex; align-items: center; padding: 0 16px; gap: 12px; transition: background-color .2s; }
.p-course .r > div:first-child { flex: 1; font-size: 15px; line-height: 22px; }
.p-course .r small { display: block; font-size: 12px; color: var(--text-2); }
.p-course .sc { text-align: right; }
.p-course .sc b { display: block; font: 600 19px/25px var(--serif); }
.p-course .sc small { font-size: 11px; }
.p-course .x { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-std) var(--spring); }
.p-course .x > div { overflow: hidden; }
.p-course .x .in { padding: 0 16px 16px; opacity: 0; transition: opacity .3s; }
.p-course.open .x { grid-template-rows: 1fr; }
.p-course.open .x .in { opacity: 1; transition-delay: .12s; }
.p-course.press .r { background: color-mix(in oklab, var(--text) 8%, transparent); }
.p-kv { display: flex; gap: 8px; }
.p-kv div { flex: 1; background: var(--bg); border-radius: 12px; padding: 8px 10px; font-size: 11px; color: var(--text-2); }
.p-kv b { display: block; font-size: 15px; color: var(--text); font-weight: 400; margin-top: 2px; }
.p-rk { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }
.p-rk:first-of-type { margin-top: 12px; }
.p-rk span:first-child { width: 30px; color: var(--text-2); }
.p-rk i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.p-rk i::before { content: ''; display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--c, var(--text)); transform-origin: 0 0; transform: scaleX(0); transition: transform 700ms var(--spring); transition-delay: calc(250ms + var(--n) * 80ms); }
.p-course.open .p-rk i::before { transform: none; }
.p-rk span:last-child { width: 56px; text-align: right; }

/* ---- 问答 ---- */
.p-chat .top { position: absolute; left: 0; top: 30px; width: 412px; height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 16px 0 12px; border-bottom: 1px solid var(--line); }
.p-chat .top b { flex: 1; font: 600 18px/1 var(--serif); }
.p-chat .model { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 10px; border: 1px solid var(--line); color: var(--text-2); }
.p-q { position: absolute; right: 16px; top: 104px; width: 236px; border-radius: 18px 18px 6px 18px; background: var(--accent-soft); padding: 8px; }
.p-q .t { font-size: 15px; padding: 8px 6px 2px; }
.p-photo { width: 220px; height: 104px; border-radius: 12px; overflow: hidden; position: relative; background: linear-gradient(160deg, #efe8da, #e2d8c6); color: #23212a; background-image: repeating-linear-gradient(transparent 0 13px, rgb(80 110 160 / .18) 13px 14px, transparent 14px 22px), linear-gradient(160deg, #efe8da, #e2d8c6); }
.p-photo .hw { position: absolute; left: 12px; top: 10px; font: 12px 'Segoe Print', 'Ink Free', 'Kaiti SC', 'KaiTi', cursive; transform: rotate(-2deg); }
.p-photo .pm { position: absolute; left: 16px; top: 34px; transform: rotate(-2.5deg); font-size: 17px; }
.p-ans { position: absolute; left: 20px; top: 272px; width: 372px; }
.p-ans .lb { font-size: 12px; letter-spacing: .1em; color: var(--text-2); }
.p-ans .box { margin-top: 8px; padding: 14px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 21px; transition: box-shadow .5s; }
.p-ans .say { font-size: 15px; line-height: 23px; margin-top: 10px; }
.p-ans .part { opacity: 0; transform: translateY(14px); filter: blur(6px); transition: opacity .45s, transform var(--d-std) var(--spring), filter .45s; }
.p-ans .part.in { opacity: 1; transform: none; filter: none; }
.p-ans .sum { clip-path: inset(0 100% 0 0); opacity: 0; transition: clip-path 700ms var(--spring-gentle), opacity .3s; }
.p-ans .sum.in { clip-path: inset(0 0 0 0); opacity: 1; }
.p-step { display: flex; align-items: center; gap: 10px; height: 46px; margin-top: 6px; padding: 0 10px; border-radius: 12px; background: color-mix(in oklab, var(--surface) 70%, transparent); border: 1px solid color-mix(in oklab, var(--line) 80%, transparent); font-size: 14px; white-space: nowrap; }
.p-step .n { width: 22px; height: 22px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.p-saved { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.p-saved span:first-child { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.p-input { position: absolute; left: 12px; bottom: 24px; width: 388px; height: 52px; display: flex; align-items: center; gap: 8px; }
.p-input > div { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.p-input .f { flex: 1; width: auto; border-radius: 22px; background: var(--surface); justify-items: start; padding: 0 16px; color: var(--text-3); }
.p-input .go { background: var(--accent); color: var(--on-accent); border: 0; }
.p-chat.done .box { box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 45%, transparent); }
.m { font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', 'Times New Roman', serif; white-space: nowrap; display: inline-flex; align-items: center; gap: .25em; }
.m i { font-style: italic; }
.m .lim { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.m .lim small { font-size: .62em; margin-top: 2px; }
.m .fr { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; margin: 0 .12em; }
.m .fr > span { padding: 0 .15em; }
.m .fr > span:first-child { border-bottom: max(1px, .06em) solid currentColor; }
.m sup { font-size: .65em; }
.p-step .m { font-size: 15px; }
.p-step .m .fr { font-size: 13px; }

/* ---- 扫描 ---- */
.p-scan { background: #0b0a09; color: #f4f1ec; }
.p-scan .desk { position: absolute; left: 0; top: 86px; width: 412px; height: 640px; background: radial-gradient(420px 520px at 50% 45%, #3a3027, #1a1612 75%); overflow: hidden; }
.p-scan .top { position: absolute; left: 0; top: 30px; width: 412px; height: 56px; display: flex; align-items: center; padding: 0 18px; }
.p-scan .top span { margin: 0 auto; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 14px; background: rgb(255 255 255 / .12); }
.p-scan .bot { position: absolute; left: 0; bottom: 0; width: 412px; height: 190px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px 40px; }
.p-scan .thumb { width: 46px; height: 58px; border-radius: 8px; background: rgb(255 255 255 / .14); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #2a2722; transition: background-color .3s, box-shadow .3s; }
.p-scan.shot .thumb { background: #ede6d8; box-shadow: 0 0 0 2px rgb(255 255 255 / .7); }
.p-scan .shutter { width: 76px; height: 76px; border-radius: 38px; border: 4px solid #f4f1ec; display: grid; place-items: center; }
.p-scan .shutter::after { content: ''; width: 60px; height: 60px; border-radius: 30px; background: #f4f1ec; transition: transform .15s; }
.p-scan.press .shutter::after { transform: scale(.88); }
.p-scan .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 5; }
.p-scan.flashing .flash { opacity: .55; transition: none; }
.p-doc { position: absolute; left: 56px; top: 114px; width: 300px; height: 400px; transform: perspective(760px) rotateX(20deg) rotateZ(-7deg) rotateY(-6deg) scale(.86); transition: transform 900ms var(--spring-gentle); }
.p-scan.flat .p-doc { transform: scale(1.18); }
.p-paper { position: absolute; inset: 0; border-radius: 3px; background: #ece5d6; color: #2a2722; overflow: hidden; box-shadow: 0 20px 40px rgb(0 0 0 / .45); transition: background-color .6s .4s, box-shadow .6s; }
.p-scan.flat .p-paper { background: #fdfaf3; box-shadow: none; }
.p-paper h4 { position: absolute; left: 22px; top: 20px; font: 700 17px/1.3 var(--serif); }
.p-paper .s { position: absolute; left: 22px; top: 48px; font-size: 10px; opacity: .6; }
.p-paper .ln { position: absolute; left: 22px; height: 5px; border-radius: 2px; background: currentColor; opacity: .22; transition: opacity .6s .4s; }
.p-scan.flat .p-paper .ln { opacity: .38; }
.p-paper svg { position: absolute; left: 22px; top: 148px; }
.p-paper .eq { position: absolute; left: 22px; top: 352px; font: italic 14px 'Cambria Math', 'Times New Roman', serif; }
.p-paper::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgb(255 255 255 / .16), transparent 40%, rgb(60 40 20 / .16)); transition: opacity .6s .4s; }
.p-scan.flat .p-paper::after { opacity: 0; }
.p-brk { position: absolute; width: 38px; height: 38px; border: 0 solid #e3a54e; opacity: 0; transform: scale(1.25); transition: opacity .3s, transform .45s var(--spring-fast); }
.p-brk::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 7px; background: #e3a54e; box-shadow: 0 0 0 3px rgb(255 255 255 / .85); }
.p-brk.tl { left: -9px; top: -9px; border-left-width: 3px; border-top-width: 3px; } .p-brk.tl::after { left: -8px; top: -8px; }
.p-brk.tr { right: -9px; top: -9px; border-right-width: 3px; border-top-width: 3px; transition-delay: 60ms; } .p-brk.tr::after { right: -8px; top: -8px; }
.p-brk.br { right: -9px; bottom: -9px; border-right-width: 3px; border-bottom-width: 3px; transition-delay: 120ms; } .p-brk.br::after { right: -8px; bottom: -8px; }
.p-brk.bl { left: -9px; bottom: -9px; border-left-width: 3px; border-bottom-width: 3px; transition-delay: 180ms; } .p-brk.bl::after { left: -8px; bottom: -8px; }
.p-scan.detect .p-brk { opacity: 1; transform: none; }
.p-scan.flat .p-brk { opacity: 0; transition-delay: 0s; }
.p-beam { position: absolute; inset: 0; overflow: hidden; border-radius: 3px; opacity: 0; transition: opacity .3s; }
.p-beam::before { content: ''; position: absolute; left: 0; right: 0; height: 84px; top: -84px; background: linear-gradient(transparent, rgb(227 165 78 / .34)); border-bottom: 2.5px solid #e3a54e; animation: beam 1.6s ease-in-out infinite alternate; }
@keyframes beam { to { transform: translateY(400px); } }
.p-scan.sweep .p-beam { opacity: 1; }
.p-scan.flat .p-beam { opacity: 0; }
.p-scan .outline { position: absolute; inset: -2px; border: 2px solid rgb(227 165 78 / .7); border-radius: 3px; opacity: 0; transition: opacity .3s; }
.p-scan.detect .outline { opacity: 1; }
.p-scan.flat .outline { opacity: 0; }

/* ---- 资料 ---- */
.p-lib .segw { position: absolute; left: 20px; top: 96px; }
.p-lib .segw .p-seg span { min-width: 88px; }
.p-search { position: absolute; left: 20px; top: 148px; width: 372px; height: 46px; border-radius: 23px; background: var(--surface); border: 1.5px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--text-2); font-size: 15px; transition: border-color .3s; }
.p-search .q { color: var(--text-3); }
.p-search .q.on { color: var(--text); }
.p-search .caret { width: 2px; height: 20px; margin-left: -8px; background: var(--accent); animation: caret 1s steps(1) infinite; opacity: 0; }
@keyframes caret { 50% { opacity: 0; } }
.p-lib.typing .p-search { border-color: var(--accent); }
.p-lib.typing .p-search .caret { opacity: 1; }
.p-kb { position: absolute; left: 20px; top: 214px; width: 372px; }
.p-kbc { height: 112px; margin-bottom: 12px; padding: 14px 16px; position: relative; transition: transform var(--d-std) var(--spring), opacity .3s, height var(--d-std) var(--spring), margin var(--d-std) var(--spring), padding var(--d-std) var(--spring); overflow: hidden; }
.p-kbc .hd { display: flex; align-items: center; }
.p-kbc .cat { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.p-kbc .hd small { margin-left: auto; font-size: 11px; color: var(--text-3); }
.p-kbc b { display: block; font: 600 17px/24px var(--serif); margin-top: 7px; }
.p-kbc p { font-size: 12px; line-height: 18px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-kbc mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.p-lib.filtered .p-kbc.miss { height: 0; margin-bottom: 0; padding-block: 0; opacity: 0; border-width: 0; transform: scale(.96); }
.p-lib.filtered .p-kbc.hit { box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 50%, transparent); }
