/* 固定浅色（同读书会的结论：多人看到的必须完全一致，不做深色模式） */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --teal: #0d9488;
  --amber: #d97706;
  --red: #dc2626;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6;
}
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .back { border: none; background: none; font-size: 22px; line-height: 1; color: var(--primary); padding: 2px 6px; cursor: pointer; }
.topbar h1 { font-size: 17px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { font-size: 13px; color: var(--muted); }

.page { padding: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.card h3 { font-size: 15px; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.en { font-family: Georgia, "Times New Roman", serif; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 12px; padding: 12px 20px; font-size: 15px; font-weight: 600;
  background: var(--primary); color: #fff; cursor: pointer; width: 100%;
}
.btn:active { background: var(--primary-dark); }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.danger { background: #fef2f2; color: var(--red); }
.btn:disabled { opacity: .5; }
.btn.sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 10px; }

/* 登录 */
.login-wrap { padding: 18vh 28px 0; }
.login-wrap .logo { font-size: 40px; }
.login-wrap h2 { font-size: 24px; margin: 8px 0 4px; }
.login-wrap p { color: var(--muted); margin-bottom: 28px; }
.field { margin-bottom: 14px; }
.field input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 16px; background: #fff; outline: none;
}
.field input:focus { border-color: var(--primary); }

/* 首页 */
.hero { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; border-radius: var(--radius); padding: 20px 18px; margin-bottom: 14px; }
.hero .hi { font-size: 19px; font-weight: 700; }
.hero .sub { opacity: .85; font-size: 13px; margin-top: 2px; }
.hero .nums { display: flex; gap: 0; margin-top: 16px; }
.hero .num { flex: 1; text-align: center; }
.hero .num b { display: block; font-size: 22px; }
.hero .num span { font-size: 12px; opacity: .8; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry {
  background: var(--card); border-radius: var(--radius); padding: 18px 16px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.entry .ico { font-size: 26px; }
.entry b { display: block; margin-top: 8px; font-size: 15px; }
.entry span { font-size: 12px; color: var(--muted); }

/* 列表 */
.list-item {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; font-size: 15px; }
.list-item .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chev { color: #cbd5e1; font-size: 18px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.pill.t { background: #f0fdfa; color: var(--teal); }
.pill.a { background: #fffbeb; color: var(--amber); }
.pill.g { background: #f5f3ff; color: #7c3aed; }

/* 筛选 chips */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.chip {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: #475569;
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 错误画像条形 */
.bar { height: 8px; background: #eef2f7; border-radius: 999px; margin-top: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #4f46e5); border-radius: 999px; }

/* 模拟考官 */
.exam-q { font-weight: 600; font-size: 14.5px; margin: 10px 0 4px; }
.exam-a { background: var(--primary-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; color: #334155; }

/* 复习卡片 */
.flash { text-align: center; padding: 36px 20px; }
.flash .fword { font-size: 30px; font-weight: 700; }
.flash .fmean { font-size: 17px; margin-top: 14px; color: var(--ink); }
#judgeBtns { display: flex; }

/* 练习页 */
.q-text { font-size: 17px; font-weight: 600; line-height: 1.55; }
.cues { margin-top: 10px; padding-left: 4px; }
.cues li { list-style: none; padding-left: 20px; position: relative; color: #334155; font-size: 14.5px; margin: 4px 0; }
.cues li::before { content: "•"; position: absolute; left: 6px; color: var(--primary); }
.timer { text-align: center; font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer.warn { color: var(--red); }
.rec-zone { text-align: center; padding: 8px 0 4px; }
.rec-btn {
  width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 30px; box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.rec-btn.recording { background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(220,38,38,.45)} 70%{box-shadow:0 0 0 18px rgba(220,38,38,0)} 100%{box-shadow:0 0 0 0 rgba(220,38,38,0)} }
.rec-hint { margin-top: 10px; font-size: 13px; color: var(--muted); }
audio { width: 100%; margin-top: 10px; }
.chart-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.chart-box svg { width: 100%; height: auto; display: block; }

/* 拍照 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.photo-grid .ph { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; cursor: pointer; }
.photo-add {
  aspect-ratio: 3/4; border: 1.5px dashed #cbd5e1; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--muted); cursor: pointer; font-size: 13px; background: #fff;
}
.photo-add .plus { font-size: 26px; color: var(--primary); }

/* 结果页 */
.band-hero { text-align: center; padding: 22px 16px; background: linear-gradient(135deg,#2563eb,#4f46e5); color: #fff; border-radius: var(--radius); margin-bottom: 12px; }
.band-hero .big { font-size: 46px; font-weight: 800; line-height: 1.1; }
.band-hero .lbl { font-size: 13px; opacity: .85; }
.dims { display: flex; gap: 8px; margin-top: 14px; }
.dim { flex: 1; background: rgba(255,255,255,.14); border-radius: 10px; padding: 8px 4px; }
.dim b { display: block; font-size: 18px; }
.dim span { font-size: 11px; opacity: .85; }
.fb-list li { list-style: none; padding: 6px 0 6px 24px; position: relative; font-size: 14.5px; }
.fb-list li::before { position: absolute; left: 0; }
.fb-list.good li::before { content: "✓"; color: var(--teal); font-weight: 700; }
.fb-list.bad li::before { content: "!"; color: var(--amber); font-weight: 800; }
.upgrade { border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.upgrade .orig { color: var(--red); text-decoration: line-through; text-decoration-thickness: 1px; }
.upgrade .better { color: var(--primary-dark); font-weight: 600; }
.upgrade .why { color: var(--muted); font-size: 13px; margin-top: 4px; }
.sample { white-space: pre-wrap; font-size: 14.5px; background: #f8fafc; border-radius: 10px; padding: 12px; margin-top: 8px; }
.collapse-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; font-size: 15px; }
details.card summary { list-style: none; }
details.card summary::-webkit-details-marker { display: none; }

/* 词汇 */
.vword { border-bottom: 1px solid var(--line); padding: 10px 0; }
.vword:last-child { border-bottom: none; }
.vword .w { font-weight: 700; font-size: 15.5px; }
.vword .m { color: var(--muted); font-size: 13px; margin-left: 8px; }
.vword .c { font-size: 13px; color: var(--teal); margin-top: 2px; }
.vword .e { font-size: 13.5px; color: #475569; margin-top: 2px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); max-width: 640px; margin: 0 auto;
}
.tabbar button { flex: 1; border: none; background: none; padding: 8px 0 6px; cursor: pointer; color: var(--muted); font-size: 11px; }
.tabbar button .ti { display: block; font-size: 21px; line-height: 1.2; }
.tabbar button.on { color: var(--primary); font-weight: 600; }

/* 等待遮罩 */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(255,255,255,.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px; text-align: center;
}
.spinner { width: 44px; height: 44px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60;
  background: rgba(30,41,59,.92); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  max-width: 84vw; text-align: center;
}
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .ico { font-size: 40px; }

/* 跟读 */
.mic-btn {
  float: right; border: 1px solid var(--line); background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.wchip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 999px;
  font-size: 14px; font-weight: 600; font-family: Georgia, serif; background: #f1f5f9; color: var(--ink);
}
.wchip i { font-style: normal; font-size: 11px; font-weight: 700; opacity: .75; }
.wchip.good { background: #f0fdf4; color: #15803d; }
.wchip.mid { background: #fffbeb; color: var(--amber); }
.wchip.bad { background: #fef2f2; color: var(--red); }
.shadow-sent {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0;
  font-size: 14px; cursor: pointer; background: #fff;
}
.shadow-sent:active { background: var(--primary-soft); }
.shadow-sent .mic { flex-shrink: 0; }

/* 设置页 */
.set-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.set-row label { width: 76px; flex-shrink: 0; font-size: 14px; color: #475569; }
.sel, .inp {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; outline: none;
}
.sel:focus, .inp:focus { border-color: var(--primary); }
.member-row { border-top: 1px solid var(--line); padding: 12px 0; }
.member-row:first-of-type { border-top: none; }
.member-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.member-ctrls { display: flex; gap: 8px; align-items: center; }
.member-ctrls .sel { flex: 0 0 112px; }
.member-ctrls .btn.sm { flex-shrink: 0; }
