/* ---------- 听写页 ---------- */
.speaker.need-tap { animation: tapPulse 1.4s ease-in-out infinite; }
.btn.need-tap { border-color: var(--fill); color: var(--primary); animation: tapPulse 1.4s ease-in-out infinite; }
@keyframes tapPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--glow); } 50% { box-shadow: 0 0 0 14px transparent; } }
.dc-plain { color: inherit; }
.dc-miss { color: var(--warn); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.dc-extra { color: var(--danger); text-decoration: line-through; opacity: .8; }
.res-yours .dc-bad { text-decoration: none; font-weight: 700; }
.dc-gap { color: var(--warn); font-weight: 700; margin: 0 1px; }
.yours-diff { font-weight: 600; letter-spacing: .02em; }
.diff-legend { margin-top: -10px; } .diff-legend span { font-weight: 600; }
.drill-form { font-size: 18px; font-weight: 500; color: var(--text); text-align: center; line-height: 1.6; max-width: 640px; }
.drill-gap { display: inline-block; width: 110px; margin: 0 4px; border-bottom: 2px solid var(--muted); vertical-align: -3px; height: 1em; }
.drill-prompt { font-size: 15px; color: var(--muted); background: var(--surface-2); padding: 8px 16px; border-radius: 99px; }
.res-word.res-word-drill { font-size: 32px; }
.drill-say { font-family: var(--font); } .drill-say > div:last-child { font-size: 15.5px; margin-top: 2px; }

/* ---------- 雅思专项 ---------- */
.drill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.drill-card { position: relative; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: .15s; }
.drill-card:hover { border-color: var(--primary); }
.drill-card.active { border-color: var(--fill); background: var(--primary-50); }
.drill-card .drill-check { position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: #fff; opacity: 0; transition: .15s; }
.drill-card.active .drill-check { opacity: 1; }
@media (max-width: 760px) { .drill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 排行榜 / 名次动画 ---------- */
.rk-modal { width: min(440px, 100%); }
.rk-side, .rk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rk-ttl { display: none; font-size: 15px; font-weight: 700; }
.rk { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.rk-cap { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.rk-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.rk-hero-l { display: flex; flex-direction: column; gap: 2px; }
.rk-rankline { display: flex; align-items: baseline; gap: 4px; font-size: 15px; font-weight: 600; color: var(--muted); }
.rk-big { font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; min-width: .6em; text-align: center; }
.rk-hero-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rk-hero-r b { font-size: 26px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-burst { position: relative; width: 0; height: 0; }
.rk-spark { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 2px; pointer-events: none; animation: spark 1.1s ease-out forwards; }
@keyframes spark { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(220deg) scale(.4); opacity: 0; } }
.rk-msg { margin-top: -4px; color: var(--text); }
.rk-flame { display: block; width: 34px; height: 34px; flex: none; margin-right: 10px; transform-origin: 50% 90%; } .rk-flame svg { width: 100%; height: 100%; display: block; }
.rk-streak.hot .rk-flame { animation: rkFlicker 2.4s ease-in-out infinite; }
@keyframes rkFlicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.04, 1.08) rotate(-2deg); } 60% { transform: scale(.98, 1.02) rotate(1.5deg); } }
.rk-streak { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rk-streak-l { display: flex; align-items: center; min-width: 0; } .rk-streak-l > div { display: flex; flex-direction: column; min-width: 0; }
.rk-streak b { font-size: 14px; white-space: nowrap; }
@media (max-width: 420px) { .rk-days { gap: 4px; } .rk-day i { width: 20px; height: 20px; } .rk-flame { width: 30px; height: 30px; margin-right: 8px; } } .rk-streak .muted { font-size: 12px; }
.rk-days { display: flex; gap: 5px; flex: none; }
.rk-day { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rk-day i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); color: #fff; }
.rk-day.on i { background: var(--fill); }
.rk-day.today i { box-shadow: 0 0 0 1.5px var(--fill); }
.rk-day small { font-size: 10px; color: var(--muted); line-height: 1; }
.rk-sec { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--muted); }
.rk-sec b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.rk-sec-list { margin-bottom: -8px; }
.rk-today { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); }
.rk-today.pop { animation: rkPop .5s cubic-bezier(.2,.9,.3,1.2) .4s both; }
@keyframes rkPop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.rk-ledger { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rk-ledger span:nth-child(even) { text-align: right; font-weight: 600; }
.rk-ledger .gain { color: var(--success); }
.rk-prog { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rk-prog i { display: block; height: 100%; min-width: 6px; border-radius: 99px; background: var(--fill); }
.rk-prog-l { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.rk-list { width: 100%; display: flex; flex-direction: column; text-align: left; }
.rk-full { max-height: 300px; overflow: auto; }
.rk-fullwrap { width: 100%; }
.rk-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; position: relative; will-change: transform; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, var(--surface-2) var(--w), transparent var(--w)); }
.rk-row:last-child { border-bottom: 0; }
.rk-row.me { background: linear-gradient(90deg, var(--primary-50) var(--w), transparent var(--w)); z-index: 1; }
.rk-row.me::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--fill); }
.rk-row.me.lift { animation: rowGlow 1.2s ease-out .5s; }
@keyframes rowGlow { 0% { box-shadow: 0 0 0 0 var(--glow); } 60% { box-shadow: 0 0 0 10px transparent; } }
.rk-rank { width: 24px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-rank.top1 { color: #c8921a; } .rk-rank.top2 { color: #7d8aa3; } .rk-rank.top3 { color: #b0713a; }
.rk-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name em { font-style: normal; font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--fill); color: #fff; vertical-align: 1px; }
.rk-xp { font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-dots { text-align: center; color: var(--muted); font-size: 13px; padding: 4px 0; }
.rk-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rk-link { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 4px 0; font-size: 13px; font-weight: 600; color: var(--primary); }
.rk-help { position: relative; display: inline-flex; }
.rk-q { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1; }
.rk-q:hover, .rk-help.open .rk-q { color: var(--primary); border-color: var(--primary); }
.rk-tip { display: none; position: fixed; left: 0; top: 0; width: 250px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.14); font-size: 13px; line-height: 1.6; color: var(--text); text-align: left; z-index: 5; }
.rk-tip b { display: block; margin-bottom: 3px; }
.rk-help.open .rk-tip { display: block; }
@media (hover: hover) { .rk-help:hover .rk-tip { display: block; } }
.share-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.share-img { width: min(300px, 100%); border-radius: 14px; box-shadow: var(--shadow-lg); }
@media (prefers-reduced-motion: reduce) { .rk-streak.hot .rk-flame, .rk-today.pop, .speaker.need-tap, .btn.need-tap { animation: none; } }

/* ---------- 拼写弱点 ---------- */
.weak-list { display: flex; flex-direction: column; gap: 4px; }
.weak-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 4px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 10px; }
.weak-head:hover { background: var(--surface-2); }
.weak-head > .icon { color: var(--muted); transition: transform .15s; } .weak-head.open > .icon { transform: rotate(180deg); }
.weak-label { width: 96px; flex: none; font-weight: 600; }
.weak-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; } .weak-bar i { display: block; height: 100%; border-radius: 99px; background: var(--fill); }
.weak-n { width: 42px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.weak-detail { padding: 2px 4px 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.weak-ex { display: flex; flex-wrap: wrap; gap: 6px; }
.weak-pair { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 13.5px; }
.weak-pair s { color: var(--danger); }

/* ---------- 班级 ---------- */
.list-gap { display: flex; flex-direction: column; gap: 10px; }
.class-card { display: flex; align-items: center; gap: 14px; color: var(--text); transition: .15s; }
.class-card:hover { border-color: var(--primary); }
.class-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.class-ic.lg { width: 64px; height: 64px; border-radius: 18px; }
.invite { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.invite-code { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: .14em; color: var(--primary); margin: 2px 0 4px; }
.asg-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; }
.asg .chip .icon { vertical-align: -2px; }
.join-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 36px 20px; }
.stats-row.three { grid-template-columns: repeat(3, 1fr); }
.modal h4 { margin: 0 0 8px; font-size: 14px; }
.source-seg { margin-bottom: -4px; }

.deco { position: fixed; top: 0; right: 0; width: min(820px, 72vw); height: 260px; pointer-events: none; z-index: 0; display: none;
  -webkit-mask-image: radial-gradient(120% 100% at 100% 0%, #000 20%, transparent 72%); mask-image: radial-gradient(120% 100% at 100% 0%, #000 20%, transparent 72%); }
.deco i, .pat-tile i, .tp-pat { display: block; width: 100%; height: 100%; background: var(--primary); opacity: .32;
  -webkit-mask-image: var(--pat); mask-image: var(--pat); -webkit-mask-size: var(--pw) var(--ph); mask-size: var(--pw) var(--ph); -webkit-mask-repeat: repeat; mask-repeat: repeat; }
:root[data-scheme="dark"] .deco i, :root[data-scheme="dark"] .tp-pat { opacity: .24; }
:root[data-pattern]:not([data-pattern="none"]) .deco { display: block; }
#app { position: relative; z-index: 1; }
body.fullscreen .deco { height: 200px; }
@media (max-width: 900px) { .deco { width: 100vw; height: 170px; } }

/* 彩色侧栏上也铺一层白色花纹 */
:root[data-chrome="color"] .shell .sidebar { overflow: hidden; }
:root[data-chrome="color"] .shell .sidebar > * { position: relative; z-index: 1; }
:root[data-chrome="color"][data-pattern]:not([data-pattern="none"]) .shell .sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 340px; background: #fff; opacity: .14; pointer-events: none;
  -webkit-mask-image: var(--pat), linear-gradient(#000, transparent); mask-image: var(--pat), linear-gradient(#000, transparent);
  -webkit-mask-size: var(--pw) var(--ph), 100% 100%; mask-size: var(--pw) var(--ph), 100% 100%; -webkit-mask-composite: source-in; mask-composite: intersect; }

:root[data-scheme="dark"][data-chrome="color"][data-pattern]:not([data-pattern="none"]) .shell .sidebar::before { opacity: .07; }

/* 设置：花纹选择 */
.pat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pat-tile { display: flex; flex-direction: column; gap: 6px; align-items: stretch; border: 0; background: none; padding: 0; cursor: pointer; font-size: 13px; color: var(--muted); text-align: center; }
.pat-tile > span:first-child { height: 58px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; display: block; transition: .15s; }
.pat-tile:hover > span:first-child { border-color: var(--primary); }
.pat-tile.active { color: var(--text); font-weight: 600; }
.pat-tile.active > span:first-child { border-color: var(--fill); box-shadow: 0 0 0 2px var(--fill); }
.pat-tile i { opacity: .5; -webkit-mask-size: calc(var(--pw) * .5) calc(var(--ph) * .5); mask-size: calc(var(--pw) * .5) calc(var(--ph) * .5); }
.pat-tile[data-p="none"] i { display: none; }
.tp-main { position: relative; }
.tp-pat { position: absolute; inset: 0; opacity: .22; -webkit-mask-image: var(--pat), radial-gradient(130% 120% at 100% 0%, #000 25%, transparent 75%); mask-image: var(--pat), radial-gradient(130% 120% at 100% 0%, #000 25%, transparent 75%);
  -webkit-mask-size: var(--pw) var(--ph), 100% 100%; mask-size: var(--pw) var(--ph), 100% 100%; -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat; -webkit-mask-composite: source-in; mask-composite: intersect; }
:root:not([data-pattern]) .tp-pat, :root[data-pattern="none"] .tp-pat { display: none; }
.tp-main > :not(.tp-pat) { position: relative; }
@media (max-width: 560px) { .pat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } }


/* ---------- 后台补充 ---------- */
.maint-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; background: var(--danger); color: #fff; font-size: 13px; font-weight: 600; }
.maint-bar:hover { color: #fff; opacity: .92; }
.table tr.row-warn td { background: var(--danger-50); }
.log-detail { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.weak-n.wide { width: 72px; }
.chip[href] { color: var(--text); } .chip[href]:hover { color: var(--primary); }

/* 安装到主屏幕 */
/* 设置分页 */
.settings-tabs { width: 100%; flex-wrap: nowrap; } .settings-tabs .seg-a { flex: 1; text-align: center; padding: 8px 6px; }
.form-card .list-row .strong .badge { margin-left: 8px; vertical-align: 1px; }
.pwa-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.6; }
.pwa-steps li { display: flex; gap: 12px; align-items: flex-start; }
.pwa-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 13px; }
.pwa-tip .icon-btn { margin-right: -6px; }
.feedback-text { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.rank-strip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s; }
.rank-strip:hover { border-color: var(--warn); }
.rank-strip > svg { color: var(--muted); flex: none; }
.rs-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--warn-50); color: var(--warn); display: grid; place-items: center; flex: none; }
.rs-body { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.rs-top { display: inline-flex; align-items: baseline; gap: 8px; flex: none; } .rs-top .muted { font-size: 13px; }
.rs-cheer { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rs-tag { flex: none; padding: 3px 10px; border-radius: 99px; background: var(--warn-50); color: var(--warn); font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.rs-tag.up { background: var(--success-50); color: var(--success); }
.rs-tag.soft { background: var(--surface-2); color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  .rank-strip { padding: 9px 12px; gap: 10px; }
  .rs-body { flex-direction: column; align-items: stretch; gap: 1px; }
  .rs-cheer { font-size: 12px; }
}

/* 排行榜弹窗：电脑端两栏（放在最后，覆盖上面的基础样式） */
@media (min-width: 820px) {
  .rk-modal { width: min(900px, calc(100vw - 48px)); }
  .rk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; align-items: start; }
  .rk-side { padding-right: 36px; border-right: 1px solid var(--border); gap: 18px; }
  .rk-main { gap: 8px; }
  .rk-main .rk-fullwrap.hidden { display: block !important; }
  .rk-main .rk-link { display: none; }
  .rk-ttl { display: block; }
  .rk-main .rk-full { max-height: min(520px, calc(100vh - 300px)); }
  .rk-big { font-size: 72px; }
  .rk-hero-r b { font-size: 32px; }
  .rk-flame { width: 40px; height: 40px; }
  .rk-streak b { font-size: 16px; }
  .rk-day i { width: 26px; height: 26px; }
}
.th-grid { margin-top: 16px; }

/* 设置页：液态玻璃开关和等级 */
.glass-set { display: flex; flex-direction: column; gap: 10px; }
.glass-lv { margin: 0; max-width: 360px; }
