/* ============ 豆芽词 · 设计系统 ============ */
:root {
  --brand: #ff6b2c;
  --brand-deep: #e8541a;
  --brand-soft: #fff1e9;
  --accent: #2f80ed;
  --accent-soft: #eaf2fe;
  --green: #17b26a;
  --green-soft: #e7f8ef;
  --red: #f04438;
  --red-soft: #feecea;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --muted: #8a9099;
  --line: #edeff3;
  --bg: #f7f4f1;
  --card: #ffffff;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 6px 24px rgba(31, 35, 41, .06);
  --shadow-lg: 0 16px 40px rgba(255, 107, 44, .18);
  --nav-h: 62px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-h) + 18px);
}
@media (min-width: 520px) {
  body { background: #efe9e3; }
  .app { box-shadow: 0 0 60px rgba(0, 0, 0, .08); min-height: 100vh; }
}

.wrap { padding: 0 18px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 8px;
}
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -.2px; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar .grow { flex: 1; min-width: 0; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #ffb27a, var(--brand));
  color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(255, 107, 44, .3);
  position: relative; overflow: hidden; flex: none;
}
.avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit;
}
img.emoji {
  width: 1em; height: 1em; display: inline-block;
  vertical-align: -0.12em; object-fit: contain;
}
.streak-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow);
}
.streak-pill b { color: var(--brand); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title .link { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- 今日任务 ---------- */
.hero {
  position: relative;
  background: linear-gradient(140deg, #ff8a4c 0%, #ff6b2c 55%, #f4531b 100%);
  color: #fff;
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .13);
}
.hero::before {
  content: ""; position: absolute; right: 30px; bottom: -60px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
}
.hero-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.hero h2 { margin: 0; font-size: 17px; font-weight: 700; }
.hero .hint { font-size: 12px; opacity: .85; margin-top: 4px; }
.hero-stats { display: flex; gap: 18px; margin-top: 16px; position: relative; z-index: 1; }
.hero-stats div { font-size: 12px; opacity: .9; }
.hero-stats b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.hero .btn-white { margin-top: 16px; position: relative; z-index: 1; }

/* 进度环 */
.ring { position: relative; width: 74px; height: 74px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-bg { stroke: rgba(255, 255, 255, .28); }
.ring .ring-fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 700;
  background: var(--brand); color: #fff;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  box-shadow: 0 8px 20px rgba(255, 107, 44, .28);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.block { display: flex; width: 100%; }
.btn.white { background: #fff; color: var(--brand-deep); box-shadow: 0 8px 20px rgba(0, 0, 0, .12); }
.btn.ghost { background: var(--brand-soft); color: var(--brand-deep); box-shadow: none; }
.btn.grey { background: #f2f3f5; color: var(--ink-2); box-shadow: none; }
.hero .btn-review { margin-top: 9px; height: 38px; font-size: 13px; background: rgba(255,255,255,.16); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.5); }
.btn.green { background: var(--green); box-shadow: 0 8px 20px rgba(23, 178, 106, .25); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }

/* ---------- 统计网格 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini {
  background: var(--card); border-radius: var(--radius-sm); padding: 14px;
  box-shadow: var(--shadow);
}
.mini .k { font-size: 12px; color: var(--muted); }
.mini .v { font-size: 22px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; }
.mini .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }

/* ---------- 快捷入口 ---------- */
.quick { display: flex; gap: 10px; }
.quick a {
  flex: 1; background: #fff; border-radius: var(--radius-sm);
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow);
  transition: transform .15s;
}
.quick a:active { transform: scale(.97); }
.quick .ico { font-size: 22px; line-height: 1; }
.quick .t { font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.quick .s { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 480px; margin: 0 auto;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid rgba(0, 0, 0, .05);
  display: flex; align-items: center; padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--muted); font-weight: 500;
}
.nav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav a.on { color: var(--brand); font-weight: 700; }
.nav a.on svg { stroke: var(--brand); }

/* ---------- 学习页 ---------- */
.study-app { padding-bottom: 24px; }
.study-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px 6px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow); flex: none;
}
.icon-btn svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 2; }
.bar { flex: 1; height: 8px; background: #e9e5e1; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ffb27a, var(--brand)); transition: width .35s ease; }
.study-count { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 42px; text-align: right; }

.word-card {
  background: #fff; border-radius: 26px; margin: 8px 18px 0;
  padding: 30px 22px 26px; text-align: center; box-shadow: var(--shadow);
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
  animation: cardIn .35s cubic-bezier(.2, .9, .3, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.word-emoji { font-size: 62px; line-height: 1; margin-bottom: 14px; }
.word-emoji.sm { font-size: 46px; }

/* 抽象词/功能词的场景配图（按例句生成的水彩插画） */
.word-scene {
  width: 100%; max-width: 252px; aspect-ratio: 1 / 1;
  border-radius: 18px; object-fit: cover; margin-bottom: 14px;
  background: #f2f3f5; box-shadow: 0 4px 16px rgba(31, 35, 41, .1);
  animation: fadeUp .35s ease;
}
.word-scene.sm { max-width: 92px; margin-bottom: 8px; border-radius: 12px; }

/* 无配图的抽象词：语境卡（词性 + 挖空例句）代替图片 */
.ctx-card {
  width: 100%; max-width: 300px; margin: 0 auto 16px;
  background: linear-gradient(160deg, #fff7f2, #fff);
  border: 1px solid #ffe0d0; border-radius: 16px;
  padding: 18px 16px; text-align: left;
}
.ctx-card.sm { max-width: 280px; padding: 14px 14px; margin-bottom: 12px; }
.ctx-pos {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  color: var(--brand-deep); background: var(--brand-soft);
  border-radius: 6px; padding: 2px 8px; margin-bottom: 8px;
}
.ctx-sentence {
  font-size: 16px; line-height: 1.65; color: var(--ink-2);
  font-family: Georgia, "Times New Roman", serif;
}
.ctx-card.sm .ctx-sentence { font-size: 14.5px; }
.ctx-zh { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.ctx-blank {
  color: var(--brand-deep); letter-spacing: 1px;
  border-bottom: 2px solid var(--brand); padding-bottom: 1px;
}

/* 连例句都没有时的兜底：首字母字母牌 */
.monogram {
  width: 104px; height: 104px; margin: 0 auto 16px; border-radius: 26px;
  display: grid; place-items: center;
  font-size: 48px; font-weight: 800; color: #fff; letter-spacing: -1px;
  background: linear-gradient(135deg, #ffb27a, var(--brand));
  box-shadow: 0 10px 24px rgba(255, 107, 44, .28);
}
.monogram.sm { width: 76px; height: 76px; border-radius: 20px; font-size: 34px; margin-bottom: 12px; }
.word-text { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 0; line-height: 1.15; }
.word-phonetic { color: var(--muted); font-size: 14px; margin-top: 6px; letter-spacing: .3px; }
.word-pos { display: inline-block; font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: 3px; }
.speak {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--brand-deep); background: var(--brand-soft);
  padding: 7px 14px; border-radius: 999px; font-weight: 600;
}
.word-meaning {
  margin-top: 18px; font-size: 22px; font-weight: 700; color: var(--ink);
  animation: fadeUp .3s ease;
}
.word-example {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 13.5px; color: var(--ink-2); line-height: 1.65; animation: fadeUp .35s ease;
}
.word-example .zh { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.options { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.option {
  width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line);
  border-radius: 16px; padding: 15px 16px; font-size: 15.5px; font-weight: 600;
  display: flex; align-items: center; gap: 12px; transition: all .18s ease;
  box-shadow: 0 2px 8px rgba(31, 35, 41, .03);
}
.option .key {
  width: 26px; height: 26px; border-radius: 8px; background: #f5f6f8; color: var(--muted);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.option:active { transform: scale(.99); }
.option.correct { border-color: var(--green); background: var(--green-soft); color: #0b7a46; }
.option.correct .key { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: var(--red-soft); color: #a5281d; }
.option.wrong .key { background: var(--red); color: #fff; }
.option.dim { opacity: .45; }

.study-foot { padding: 16px 18px 0; }
.feedback {
  margin: 14px 18px 0; padding: 14px 16px; border-radius: 16px;
  font-size: 13.5px; display: none; animation: fadeUp .25s ease;
}
.feedback.show { display: block; }
.feedback.ok { background: var(--green-soft); color: #0b7a46; }
.feedback.no { background: var(--red-soft); color: #a5281d; }
.feedback b { font-size: 14px; }

/* 结算 */
.result { padding: 40px 22px; text-align: center; }
.result .big { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.result h2 { margin: 6px 0 4px; font-size: 22px; }
.result .sub { color: var(--muted); font-size: 13.5px; }
.result .score-card {
  display: flex; justify-content: space-around; background: #fff; border-radius: var(--radius);
  padding: 18px 10px; margin: 22px 0; box-shadow: var(--shadow);
}
.result .score-card div { font-size: 12px; color: var(--muted); }
.result .score-card b { display: block; font-size: 24px; color: var(--ink); margin-bottom: 2px; }
.result .score-card b.g { color: var(--green); }
.result .score-card b.r { color: var(--red); }
.result .score-card b.o { color: var(--brand); }

/* ---------- 闪卡 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line);
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
/* 画面已自带字幕的片源：叠加字幕开关置灰、不可点 */
.chip:disabled, .chip.hardsub-off {
  background: #f2f3f5; color: #a6abb5; border-color: #e6e8ec;
  cursor: not-allowed; opacity: 1; -webkit-tap-highlight-color: transparent;
}

.card-item {
  background: #fff; border-radius: var(--radius-sm); padding: 15px 16px;
  box-shadow: var(--shadow); margin-bottom: 10px; position: relative;
  transition: transform .15s;
}
.card-item .front { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card-item .front .ph { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-item .back { font-size: 14px; color: var(--ink-2); margin-top: 5px; }
.card-item .meta { display: flex; gap: 8px; align-items: center; margin-top: 9px; font-size: 11px; color: var(--muted); }
.tag { background: var(--brand-soft); color: var(--brand-deep); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.card-actions { display: flex; gap: 6px; }
.card-item .star { position: absolute; right: 12px; top: 12px; font-size: 16px; opacity: .35; }
.card-item .star.on { opacity: 1; }
.flipcard {
  margin: 8px 18px 0; height: 400px; perspective: 1200px; cursor: pointer;
}
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3, .9, .3, 1); transform-style: preserve-3d; }
.flipcard.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 26px;
  background: #fff; box-shadow: var(--shadow); padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.flip-face.back { transform: rotateY(180deg); background: linear-gradient(160deg, #fff, #fff6f0); }
.flip-face .hint { position: absolute; bottom: 16px; font-size: 11.5px; color: var(--muted); }

/* ---------- 商城 ---------- */
.points-hero {
  background: linear-gradient(135deg, #2b2f36, #171a1f);
  color: #fff; border-radius: 24px; padding: 20px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 14px 30px rgba(23, 26, 31, .22);
}
.points-hero .num { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.points-hero .lbl { font-size: 12px; opacity: .65; }
.points-hero .go { background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; }

.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.goods {
  background: #fff; border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.goods .pic {
  height: 92px; border-radius: 12px; display: grid; place-items: center;
  font-size: 44px; background: linear-gradient(160deg, #fff6f0, #ffeadd); margin-bottom: 10px;
}
.goods .nm { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.goods .ds { font-size: 11px; color: var(--muted); margin-top: 3px; min-height: 28px; }
.goods .price { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.goods .cost { font-size: 15px; font-weight: 800; color: var(--brand-deep); }
.goods .cost small { font-size: 10px; font-weight: 600; margin-left: 1px; }
.goods .stock { font-size: 10.5px; color: var(--muted); }

.order-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.order-row:last-child { border-bottom: none; }
.order-row .st { margin-left: auto; font-size: 11px; color: var(--brgreen, var(--green)); background: var(--green-soft); padding: 2px 8px; border-radius: 999px; }

/* ---------- 我的 ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.profile .avatar { width: 58px; height: 58px; font-size: 22px; }
.profile h2 { margin: 0; font-size: 19px; }
.profile .em { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.vip { display: inline-block; font-size: 10.5px; font-weight: 700; color: #93610a; background: linear-gradient(135deg, #ffe7ac, #ffcf5c); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 3px; }

.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 6px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: #f1f0ee; display: block; }
.heat i.l1 { background: #ffe0cd; }
.heat i.l2 { background: #ffc09b; }
.heat i.l3 { background: #ff9057; }
.heat i.l4 { background: var(--brand); }
.heat-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: block; }

.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.row:last-child { border-bottom: none; }
.row .k { color: var(--ink-2); }
.row .v { color: var(--muted); font-size: 13px; font-weight: 600; }
.log { display: flex; align-items: center; padding: 9px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.log:last-child { border-bottom: none; }
.log .rs { color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .dt { color: var(--muted); font-size: 11px; margin-left: 10px; }
.log .dl { font-weight: 700; margin-left: 10px; }
.log .dl.plus { color: var(--green); }
.log .dl.minus { color: var(--red); }

select.sel, input.inp, textarea.inp {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; background: #fff; color: var(--ink); outline: none;
  transition: border-color .2s;
}
select.sel:focus, input.inp:focus, textarea.inp:focus { border-color: var(--brand); }
textarea.inp { resize: none; min-height: 74px; line-height: 1.6; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(20, 22, 26, .45);
  z-index: 90; display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.mask.show { display: flex; }
.sheet {
  width: 100%; max-width: 480px; background: #fff;
  border-radius: 24px 24px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1);
  max-height: 88vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet h3 { margin: 0 0 4px; font-size: 17px; }
.sheet .desc { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 14px);
  background: rgba(31, 35, 41, .92); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; z-index: 120; opacity: 0;
  transition: all .28s cubic-bezier(.2, .9, .3, 1); pointer-events: none;
  max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); font-size: 13.5px; }
.empty .e { font-size: 44px; display: block; margin-bottom: 10px; opacity: .8; }

/* ---------- 登录 ---------- */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 40px 26px; background: #fff; max-width: 480px; margin: 0 auto;
}
.auth .logo { font-size: 40px; }
.auth h1 { font-size: 25px; margin: 14px 0 4px; letter-spacing: -.4px; }
.auth .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.auth .field input { height: 50px; }
.auth .btn { height: 50px; margin-top: 10px; }
.auth .foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth .foot a { color: var(--brand-deep); font-weight: 700; }
.alert {
  background: var(--red-soft); color: #a5281d; font-size: 13px;
  padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600;
}
.hintbox { background: #f7f8fa; border-radius: 12px; padding: 12px 14px; font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 18px; }

/* ---------- 动效 / 杂项 ---------- */
.fade-in { animation: fadeUp .35s ease both; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mb0 { margin-bottom: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.f12 { font-size: 12px; }
.f13 { font-size: 13px; }
.bold { font-weight: 700; }
.orange { color: var(--brand-deep); }
.hidden { display: none !important; }
body.study-mode .nav { display: none; }
body.study-mode .app { padding-bottom: 0; }

/* ===================== 人物形象系统 ===================== */
.me-avatar { width: 92px; height: 110px; flex: none; border-radius: 20px;
  background: linear-gradient(160deg, var(--brand-soft), #fff); display: flex;
  align-items: flex-end; justify-content: center; overflow: hidden; }
.me-avatar svg { width: 78px; height: 94px; }

.avatar-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 100%; }
.avatar-picker .pick { border: 2px solid transparent; border-radius: 16px;
  background: #f8f7f5; padding: 10px 6px 8px; cursor: pointer; text-align: center;
  transition: all .18s ease; font-family: inherit; min-width: 0; overflow: hidden; }
.avatar-picker .pick .pic { height: 84px; display: flex; align-items: flex-end; justify-content: center; }
.avatar-picker .pick .pic svg { width: 66px; max-width: 100%; height: 80px; }
.avatar-picker .pick .nm { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-picker .pick .st { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.avatar-picker .pick.on { border-color: var(--pc, var(--brand)); background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.avatar-picker.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.avatar-picker.small .pick .pic { height: 58px; }
.avatar-picker.small .pick .pic svg { width: 46px; max-width: 100%; height: 56px; }
.avatar-picker.small .pick .st { display: none; }

.workshop { display: flex; gap: 16px; align-items: flex-start; }
.workshop .stage { flex: none; width: 150px; max-width: 40%; height: 180px; border-radius: 22px;
  background: linear-gradient(160deg, #fff7f2, #fdeede); display: flex;
  align-items: flex-end; justify-content: center; overflow: hidden; }
.workshop .stage svg { width: 128px; max-width: 100%; height: 154px; }
.workshop .side { flex: 1; min-width: 0; }
.workshop .hint { font-size: 12px; color: var(--ink-2); margin-top: 8px; }

.wardrobe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.wardrobe-grid .witem { border: 1.5px solid #f0efec; border-radius: 14px; padding: 8px; text-align: center; min-width: 0; overflow: hidden; }
.wardrobe-grid .witem.equipped { border-color: var(--brand); background: var(--brand-soft); }
.wardrobe-grid .witem .pic { height: 74px; display: flex; align-items: flex-end; justify-content: center; }
.wardrobe-grid .witem .pic svg { width: 58px; height: 70px; }
.wardrobe-grid .witem .nm { font-size: 12px; font-weight: 600; color: var(--ink); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-grid .witem .act { font-size: 11px; margin-top: 4px; border: none; background: none;
  color: var(--brand-deep); font-weight: 700; cursor: pointer; padding: 2px 8px; }
.wardrobe-grid .witem .act.off { color: var(--ink-2); }
.wardrobe-grid .witem .act:hover { text-decoration: underline; }

.cat-title { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.cat-title::after { content: ""; flex: 1; height: 1px; background: #f0efec; }
.goods .tryon { height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.goods .tryon svg { width: 86px; height: 104px; }
.badge-owned { display: inline-block; font-size: 10px; color: #1f9d55; background: #e8f7ef;
  border-radius: 999px; padding: 2px 8px; margin-top: 4px; }

/* ---- 打卡成长树 ---- */
.tree-box { padding: 8px 14px 2px; }
.tree-box svg { display: block; max-width: 100%; height: auto; }

/* ===================== 看动画学单词 ===================== */
.movie-card {
  display: flex; gap: 14px; padding: 12px; margin-top: 14px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  border: 1px solid var(--line);
}
.movie-cover {
  position: relative; width: 132px; min-width: 132px; height: 88px;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--mc, #ccc);
}
.movie-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-level {
  position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px;
}
.movie-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.movie-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.movie-title .movie-en { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.movie-desc {
  font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.movie-meta {
  margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.movie-meta i { width: 1px; height: 10px; background: var(--line); }
.movie-saved { color: var(--green); }
.movie-go { margin-left: auto; color: var(--mc, var(--brand)); font-weight: 600; }

/* 选集页 */
.movie-head { display: flex; gap: 12px; padding: 12px; margin-top: 14px; align-items: center; }
.movie-head img { width: 108px; min-width: 108px; border-radius: var(--radius-sm); aspect-ratio: 16/9; object-fit: cover; }
.mh-txt { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.ep-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 12px; margin-top: 12px;
  background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.ep-no {
  width: 46px; height: 46px; min-width: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--mc) 14%, white); color: var(--mc);
  font-weight: 800; font-size: 14px;
}
.ep-info { flex: 1; min-width: 0; }
.ep-title { font-size: 15px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.ep-meta i { width: 1px; height: 10px; background: var(--line); }
.ep-sync { color: #c47f17; }
.ep-right { display: flex; align-items: center; gap: 8px; }
.ep-saved { font-size: 12px; color: var(--green); background: var(--green-soft); padding: 3px 8px; border-radius: 999px; }
.ep-play {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--mc); color: #fff; font-size: 13px; padding-left: 3px;
}

/* 播放页：视频固定在上，只有字幕区滚动 */
body.player-page { overflow: hidden; }
body.player-page .app {
  height: 100vh; height: 100dvh;
  min-height: 0;            /* 覆盖基础样式的 min-height:100vh，否则地址栏展开时会溢出 */
  padding-bottom: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.player-wrap {
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  display: flex; flex-direction: column;
  overflow: hidden; padding: 0;
}
.player-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; flex: none; }
.pt-title { display: flex; flex-direction: column; min-width: 0; }
.pt-title b { font-size: 16px; }
.pt-title .sub { font-size: 12px; color: var(--muted); }
.video-box {
  position: relative; flex: none; background: #000;
  border-radius: var(--radius-sm); overflow: hidden; margin: 0 14px;
}
.video-box video {
  display: block; width: 100%; aspect-ratio: 16/9;
  max-height: 44dvh; object-fit: contain;
}
.video-sub {
  position: absolute; left: 0; right: 0; bottom: 10px; padding: 0 16px; text-align: center;
  pointer-events: none; transition: bottom .18s ease;
}
.video-sub[hidden] { display: none; }
/* 暂停时原生控制条会盖住底部，把叠加字幕抬上去 */
.video-box.controls-on .video-sub { bottom: 58px; }
.video-sub span {
  display: inline-block; background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 15px; line-height: 1.45; padding: 4px 12px; border-radius: 8px;
}
.video-sub .zh { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }
.sub-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px 6px; flex: none;
}
.sub-toolbar .tip { font-size: 12px; color: var(--muted); margin-left: auto; }
.sub-list {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 2px 14px 18px;
}
.sub-line {
  padding: 10px 12px; border-radius: var(--radius-sm); margin-top: 6px;
  cursor: pointer; border: 1px solid transparent;
}
.sub-line:active { background: #f2f3f5; }
.sub-line.cur { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.sub-en { font-size: 16px; line-height: 1.6; color: var(--ink); }
.sub-line.cur .sub-en { font-weight: 600; }
.sub-zh { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tok { cursor: pointer; border-radius: 4px; padding: 0 1px; }
.tok:hover { background: var(--accent-soft); }
.tok.saved { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.sub-idx { display: none; }

/* 取词弹层 */
.word-sheet .w-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.w-word { font-size: 22px; font-weight: 800; color: var(--ink); }
.w-ph { font-size: 13px; color: var(--muted); margin-top: 2px; min-height: 16px; }
.w-meaning { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-top: 10px;
  max-height: 120px; overflow: auto; white-space: pre-wrap; }
.w-ctx {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg); font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.w-ctx .zh { color: var(--muted); font-size: 12px; margin-top: 3px; }
.w-ctx b { color: var(--ink); }
.word-sheet.added #wAdd { background: var(--green-soft); color: var(--green); box-shadow: none; }

/* ---------- 磨耳朵（音频复读） ---------- */
.ear-entry {
  display: flex; align-items: center; gap: 12px; margin-top: 2px;
  padding: 13px 14px; border-radius: var(--radius);
  background: linear-gradient(120deg, #2f80ed, #5b9cf8); color: #fff;
  box-shadow: 0 8px 22px rgba(47, 128, 237, .2);
}
.ear-entry-icon {
  width: 46px; height: 46px; min-width: 46px; border-radius: 15px;
  background: rgba(255, 255, 255, .22); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
/* 耳机用 SVG 画，尺寸/颜色不受系统 emoji 字体影响 */
.ear-entry-icon svg, .ear-hero-icon svg {
  display: block; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.ear-entry-icon svg { width: 27px; height: 27px; }
.ear-entry-txt { flex: 1; min-width: 0; }
.ear-entry-txt b { display: block; font-size: 15px; }
.ear-entry-txt span { display: block; font-size: 11px; opacity: .88; margin-top: 2px; line-height: 1.4; }
.ear-entry-go { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ep-ear-link {
  display: flex; justify-content: space-between; align-items: center;
  margin: -6px 12px 12px; padding: 9px 14px 9px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.ear-hero {
  margin-top: 12px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #eaf2fe, #f6efe9);
  border: 1px solid #e4ebf5;
}
.ear-hero-head { display: flex; align-items: center; gap: 12px; }
.ear-hero-icon {
  width: 52px; height: 52px; min-width: 52px; border-radius: 17px;
  background: #fff; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(47, 128, 237, .16);
}
.ear-hero-icon svg { width: 31px; height: 31px; }
.ear-hero-head b { display: block; font-size: 15px; }
/* 只作用于右侧副标题；此前 .ear-hero-head span 会连图标一起命中，把 24px 压成 12px */
.ear-hero-head > div > span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ear-hero p { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); margin: 10px 0 12px; }
.ear-stats { display: flex; background: rgba(255, 255, 255, .75); border-radius: var(--radius-sm); padding: 10px 0; }
.ear-stats div { flex: 1; text-align: center; border-right: 1px solid #e8edf5; }
.ear-stats div:last-child { border-right: none; }
.ear-stats b { display: block; font-size: 20px; color: var(--accent); }
.ear-stats span { font-size: 11px; color: var(--muted); }
.ear-hero-foot { font-size: 11px; color: var(--muted); text-align: center; margin-top: 9px; }
.ear-group { font-size: 14px; font-weight: 700; margin: 20px 2px 2px; }
.ear-group span { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.ear-ep .ep-meta + .ep-meta { margin-top: 2px; }
.ear-ep .ep-listened { color: var(--accent); }
.ear-ep .ep-saved { background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 1px 7px; }

body.listen-page { overflow: hidden; }
body.listen-page .app {
  height: 100vh; height: 100dvh; min-height: 0; padding-bottom: 0;
  overflow: hidden; display: flex; flex-direction: column;
}
.listen-wrap {
  height: calc(100dvh - var(--nav-h)); display: flex; flex-direction: column; overflow: hidden;
}
.ear-stage {
  flex: none; margin: 4px 14px 0; padding: 12px 14px 10px; min-height: 118px;
  border-radius: var(--radius); background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; position: relative;
}
.ear-wave { display: flex; align-items: center; gap: 3px; height: 14px; margin-bottom: 2px; }
.ear-wave i { width: 3px; height: 5px; border-radius: 3px; background: #c8d6ea; }
.ear-stage.playing .ear-wave i { background: var(--accent); animation: earwave .9s ease-in-out infinite alternate; }
.ear-stage.playing .ear-wave i:nth-child(2) { animation-delay: .12s; }
.ear-stage.playing .ear-wave i:nth-child(3) { animation-delay: .24s; }
.ear-stage.playing .ear-wave i:nth-child(4) { animation-delay: .36s; }
.ear-stage.playing .ear-wave i:nth-child(5) { animation-delay: .18s; }
.ear-stage.playing .ear-wave i:nth-child(6) { animation-delay: .3s; }
.ear-stage.playing .ear-wave i:nth-child(7) { animation-delay: .06s; }
@keyframes earwave { from { height: 5px; } to { height: 14px; } }
.ear-cur { font-size: 19px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.ear-cur-zh { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.ear-hidden-tip { display: none; font-size: 13px; color: var(--muted); }
.ear-words { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.ear-word { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.listen-wrap[data-sub="en"] .ear-cur-zh,
.listen-wrap[data-sub="en"] .sub-zh { display: none; }
.listen-wrap[data-sub="hide"] .ear-cur,
.listen-wrap[data-sub="hide"] .ear-cur-zh,
.listen-wrap[data-sub="hide"] .ear-words,
.listen-wrap[data-sub="hide"] .sub-en,
.listen-wrap[data-sub="hide"] .sub-zh { display: none; }
.listen-wrap[data-sub="hide"] .ear-hidden-tip { display: block; }
.listen-wrap[data-sub="hide"] .sub-line::before {
  content: "第 " attr(data-no) " 句"; font-size: 12px; color: var(--muted);
}

.ear-progress { padding: 10px 18px 0; flex: none; }
.ear-progress input[type="range"] {
  width: 100%; height: 5px; margin: 0; border-radius: 5px; outline: none;
  background: #e6eaf0; appearance: none; -webkit-appearance: none;
}
.ear-progress input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .18);
}
.ear-progress input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2px solid #fff;
}
.ear-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.ear-time #todayTip { color: var(--accent); }
/* 三列等宽：中间列 auto，左右 1fr 必须相等，播放键严格落在容器中线 */
.ear-controls {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; justify-items: center; column-gap: 22px;
  padding: 8px 14px 6px; flex: none;
}
.ear-btn { font-size: 13px; color: var(--ink-2); padding: 8px 6px; min-width: 0; white-space: nowrap; }
.ear-btn#back5 { justify-self: end; }
.ear-btn#fwd5 { justify-self: start; }
.ear-play {
  width: 52px; height: 52px; padding: 0; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(47, 128, 237, .28);
}
.ear-play svg { width: 22px; height: 22px; display: block; fill: currentColor; }
.ear-play:active { transform: scale(.95); }
/* 睡前定时：夜间配色，到点渐弱停止 */
.ear-sleep {
  flex: none; margin: 2px 14px 8px; padding: 8px 11px 9px;
  border-radius: var(--radius-sm); border: 1px solid #e4e5f5;
  background: linear-gradient(110deg, #eef1fd, #f6eef7);
}
.ear-sleep.on { border-color: #c3cdf5; background: linear-gradient(110deg, #e6ebfd, #f1e9fa); }
.ear-sleep [hidden] { display: none !important; }
.ear-sleep-head { display: flex; align-items: center; gap: 7px; }
.ear-sleep-moon { font-size: 15px; line-height: 1; }
.ear-sleep-head b { font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.ear-sleep-state {
  flex: 1; min-width: 0; text-align: right; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ear-sleep.on .ear-sleep-state { color: #5a55a8; font-weight: 700; font-variant-numeric: tabular-nums; }
.ear-sleep-cancel {
  font-size: 11px; color: #6b5fc0; background: #fff; border: 1px solid #d9d3f0;
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.ear-sleep-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 7px; }
.ear-sleep-row .chip { font-size: 11px; padding: 4px 9px; background: #fff; border-color: #ded9f2; color: #5a55a8; }
.ear-sleep-row .chip.on { background: #6b62c9; color: #fff; border-color: #6b62c9; }
.ear-sleep-custom { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); min-width: 0; }
.ear-sleep-custom input[type="range"] { width: 76px; height: 4px; margin: 0; accent-color: #6b62c9; }
.ear-sleep-custom b { color: #5a55a8; min-width: 30px; font-variant-numeric: tabular-nums; }
@media (max-width: 360px) {
  .ear-sleep-custom input[type="range"] { width: 52px; }
  .ear-sleep-row .chip { padding: 4px 7px; }
}
.ear-settings { flex: none; padding: 2px 14px 8px; border-bottom: 1px solid var(--line); }
.ear-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.ear-row > label { font-size: 11px; color: var(--muted); width: 30px; min-width: 30px; }
.ear-chips { padding: 0; gap: 5px; overflow: visible; }
.ear-chips .chip { font-size: 11px; padding: 4px 9px; }
.ear-row > .chip { font-size: 11px; padding: 4px 9px; }
.sub-line.has-word { border-left: 3px solid var(--green); }
.sub-line.has-word .sub-en::after {
  content: "生词"; font-size: 10px; color: var(--green); background: var(--green-soft);
  padding: 1px 5px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; font-weight: 500;
}
.listen-wrap .sub-list { padding: 6px 14px 18px; }

/* ---------- 同桌 ---------- */
.duo-page .app { padding-bottom: calc(var(--nav-h) + 10px); }
.duo-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 18px 4px;
}
.duo-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.duo-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.duo-more {
  width: 34px; height: 34px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow); color: var(--muted); font-size: 15px; line-height: 1;
  letter-spacing: 1px; flex: none;
}

.duo-empty {
  margin: 8px 16px 0; border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); background: #f5f0e4;
}
.duo-illust { display: block; }

.duo-panel {
  margin: 14px 16px 0; background: #fff; border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow);
}
.duo-panel h2 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.duo-tip { margin: 6px 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.code-box {
  margin-top: 12px; text-align: center; background: var(--brand-soft);
  border-radius: 14px; padding: 14px 12px 12px;
}
.code {
  font-size: 30px; font-weight: 800; letter-spacing: 7px; color: var(--brand-deep);
  font-family: ui-monospace, Menlo, Consolas, monospace; padding-left: 7px;
}
.code-tip { font-size: 12px; color: #a8795c; margin: 4px 0 10px; }

.join-row { display: flex; gap: 10px; margin-top: 10px; }
.code-input {
  flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--line);
  background: #fbfaf9; padding: 0 14px; font-size: 18px; font-weight: 600;
  letter-spacing: 4px; text-align: center; text-transform: uppercase; color: var(--ink);
  outline: none; min-width: 0;
}
.code-input:focus { border-color: var(--brand); background: #fff; }

.room-wrap {
  margin: 6px 12px 0; border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); background: #f5f0e4;
}
.room-svg { display: block; }

.duo-stats { text-align: center; font-size: 12.5px; color: var(--muted); margin: 12px 16px 0; }
.duo-stats b { color: var(--brand-deep); font-size: 15px; font-weight: 800; }

.seat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 16px 0; }
.seat-card { background: #fff; border-radius: 16px; padding: 12px 11px; box-shadow: var(--shadow); }
.seat-top { display: flex; align-items: center; gap: 7px; }
.seat-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft);
  display: grid; place-items: center; overflow: hidden; flex: none;
  font-size: 13px; font-weight: 700; color: var(--brand-deep);
}
.seat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seat-avatar svg { width: 100%; height: 100%; display: block; }
.seat-who { flex: 1; min-width: 0; }
.seat-who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-who span { font-size: 10.5px; color: var(--muted); }
.seat-pill {
  font-size: 10px; padding: 3px 6px; border-radius: 999px;
  background: #f2f3f5; color: var(--muted); white-space: nowrap;
}
.seat-pill.ok { background: var(--green-soft); color: #0f7a45; }
.seat-num { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.seat-num b { font-size: 19px; color: var(--ink); }
.seat-bar { height: 6px; border-radius: 999px; background: #f1ece6; overflow: hidden; margin-top: 6px; }
.seat-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #9ccc55, #3f8f3a); }
.seat-dots { display: flex; gap: 4px; margin-top: 9px; }
.seat-dots i { flex: 1; height: 5px; border-radius: 999px; background: #eee9e2; }
.seat-dots i.on { background: #8fbe5c; }

.duo-actions { margin: 14px 16px 0; }
.duo-incoming { margin: 10px 16px 0; }

/* 教室装饰 */
.duo-deco {
  margin: 16px 16px 0; background: #fff; border-radius: 16px;
  padding: 12px 13px 13px; box-shadow: var(--shadow);
}
.deco-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.deco-head b { font-size: 13.5px; }
.deco-shop { font-size: 12px; font-weight: 600; color: var(--brand); text-decoration: none; }
.deco-row { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; }
.deco-lbl { flex: none; width: 58px; padding-top: 5px; font-size: 11.5px; color: var(--muted); }
.deco-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.deco-chip {
  font-family: inherit; font-size: 11.5px; line-height: 1.2; padding: 6px 10px;
  border-radius: 999px; border: 1px solid #eae4dc; background: #faf8f5;
  color: #5b5347; cursor: pointer; text-decoration: none;
}
.deco-chip.on {
  background: var(--green-soft); border-color: #8fbe5c; color: #2f6b1f; font-weight: 700;
}
.deco-chip.locked { border-style: dashed; color: #a79d90; }
.goods .room-thumb { height: 92px; border-radius: 12px; background: linear-gradient(160deg, #f7f3ec, #efe6d8);
  display: grid; place-items: center; margin-bottom: 10px; }
.nudge-item {
  background: var(--accent-soft); color: #1c5dad; font-size: 12.5px;
  padding: 9px 12px; border-radius: 12px; margin-bottom: 6px;
}

.nav a { position: relative; }
.nav-dot {
  position: absolute; top: 2px; left: 50%; margin-left: 6px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .92);
}
