:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --card-2: #f7f9fc;
  --text: #161b23;
  --muted: #7b8596;
  --line: #e5e9f1;
  --accent: #2f6bff;
  --accent-2: #7c4dff;
  --accent-weak: #eaf0ff;
  --green: #0f9d6e;
  --green-weak: #e7f8f1;
  --red: #e5484d;
  --red-weak: #fdecec;
  --amber: #b45309;
  --violet: #7c3aed;
  --mark: #fde68a;
  --shadow: 0 8px 24px rgba(25, 40, 70, .07);
  --shadow-2: 0 14px 40px rgba(25, 40, 70, .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1219;
    --card: #171c25;
    --card-2: #1c2230;
    --text: #e9edf5;
    --muted: #8d97a8;
    --line: #262e3c;
    --accent: #6f9bff;
    --accent-2: #b18cff;
    --accent-weak: #1b2a46;
    --green: #4fd1a5;
    --green-weak: #12332a;
    --red: #ff7b7f;
    --red-weak: #3a1d20;
    --amber: #e0a35c;
    --violet: #b794f6;
    --mark: #6b5312;
    --shadow: 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-2: 0 14px 40px rgba(0, 0, 0, .35);
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Noto Sans SC", "Noto Sans CJK SC", "Noto Sans",
               "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

button { font-family: inherit; }

[hidden] { display: none !important; }

/* ---------- 顶部 ---------- */
#topbar {
  flex: none;
  background: var(--card);
  padding: 10px 16px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}

.titlebar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

#topbar.no-search .titlebar { margin-bottom: 0; }

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}

.sub {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 11px;
  height: 44px;
}

.searchbar svg { flex: none; opacity: .45; }

#q {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  padding: 0;
  caret-color: var(--accent);
}

#q::placeholder { color: var(--muted); }
#q::-webkit-search-cancel-button { display: none; }

.clear {
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

/* ---------- 主内容 ---------- */
#content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(env(safe-area-inset-bottom) + 18px);
}

#pane-search {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

/* ---------- 列表 ---------- */
.list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 14px;
}

.item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 12px 16px;
  font-family: inherit;
  cursor: pointer;
}

.item:active { background: var(--accent-weak); }

.item .w {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .2px;
  overflow-wrap: anywhere;
}

.item .p {
  font-size: 12.5px;
  color: var(--amber);
  margin-top: 1px;
  overflow-wrap: anywhere;
}

.item .m {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item .row-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------- 等级标签 ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

.pill-4 { color: #1d4ed8; background: #e8efff; }
.pill-6 { color: #6d28d9; background: #f1eaff; }
.pill-both { color: #0f766e; background: #e3f7f2; }
.pill-base { color: #475569; background: #eef2f7; }
.pill-ext { color: #a16207; background: #fef9c3; }
@media (prefers-color-scheme: dark) {
  .pill-4 { color: #9ab8ff; background: #1b2a46; }
  .pill-6 { color: #c6a8ff; background: #2a1f44; }
  .pill-both { color: #6fe0c6; background: #12332e; }
  .pill-base { color: #b8c4d6; background: #222b38; }
  .pill-ext { color: #f0cf74; background: #332b12; }
}

/* ---------- 空状态 / 无结果 ---------- */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 26px 54px;
  color: var(--muted);
  text-align: center;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.65;
  overflow-y: auto;
}

.empty .big {
  font-size: 15px;
  color: var(--text);
  font-weight: 650;
}

.empty-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  box-shadow: var(--shadow);
}

.empty-hint { font-size: 12.5px; }

.empty.small { min-height: 180px; padding: 34px 24px 40px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.chip:active { background: var(--accent-weak); }

.history { margin-top: 16px; width: 100%; max-width: 420px; }
.history-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.notice {
  padding: 52px 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.notice .big {
  font-size: 15px;
  color: var(--text);
  font-weight: 650;
  margin-bottom: 8px;
}

/* ---------- 底部导航 ---------- */
#tabbar {
  flex: none;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative;
  z-index: 8;
}

.tab {
  flex: 1;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 9px;
  font-size: 11px;
  cursor: pointer;
}

.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--accent); }

.badge {
  position: absolute;
  top: 4px;
  left: 54%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
  text-align: center;
}

/* ---------- 测验首页 ---------- */
.quiz-home,
#pane-wrong,
.quiz-play,
.quiz-result {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 28px;
}

.hero {
  background: linear-gradient(135deg, #2f6bff 0%, #6a5cff 60%, #9b5cff 100%);
  border-radius: 22px;
  padding: 22px 20px 18px;
  color: #fff;
  box-shadow: 0 14px 34px rgba(47, 107, 255, .28);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  right: -55px;
  top: -70px;
  background: rgba(255, 255, 255, .13);
}

.hero-kicker {
  font-size: 11px;
  letter-spacing: 1.6px;
  opacity: .78;
  font-weight: 700;
}

.hero-title {
  font-size: 27px;
  font-weight: 800;
  margin-top: 5px;
  letter-spacing: .5px;
}

.hero-sub {
  font-size: 12.5px;
  opacity: .85;
  margin-top: 5px;
}

.hero-stats {
  display: flex;
  margin-top: 18px;
  background: rgba(255, 255, 255, .14);
  border-radius: 13px;
  padding: 9px 4px;
}

.hero-stats > div {
  flex: 1;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, .2);
}

.hero-stats > div:last-child { border-right: 0; }
.hero-stats b { display: block; font-size: 16px; font-weight: 750; }
.hero-stats span { font-size: 10.5px; opacity: .78; }

.section-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .5px;
  margin: 20px 2px 9px;
}

.level-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

@media (min-width: 560px) {
  .level-grid { grid-template-columns: 1fr 1fr; }
}

.level-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  padding: 15px 16px 13px;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.level-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.level-card.lv4::before { background: #2f6bff; }
.level-card.lv6::before { background: #8b5cf6; }

.level-card:active { transform: scale(.99); }

.level-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.level-count {
  font-size: 11px;
  color: var(--muted);
}

.level-title {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: .2px;
}

.level-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.level-go {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-card.lv6 .level-go { color: #8b5cf6; }
.level-go span { font-size: 18px; line-height: 1; }

.seg {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}

.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.seg button.active {
  background: var(--accent-weak);
  color: var(--accent);
}

.tip-card {
  margin-top: 18px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.tip-icon {
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ---------- 做题 ---------- */
.quiz-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 11px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  padding: 6px 2px;
  cursor: pointer;
}

.text-btn.danger { color: var(--red); }

.quiz-progress-text {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.quiz-score {
  min-width: 46px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

.progress {
  height: 5px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}

#quiz-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width .2s ease;
}

.question-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 18px 15px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}

.question-kicker {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .4px;
}

.question-word {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1.2;
  margin-top: 9px;
  overflow-wrap: anywhere;
}

.question-word.zh {
  font-size: 21px;
  line-height: 1.45;
  font-weight: 700;
}

.question-phon {
  font-size: 14px;
  color: var(--amber);
  margin-top: 5px;
  min-height: 18px;
  overflow-wrap: anywhere;
}

.question-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 13px;
}

.round-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.round-btn.on {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 13px;
  font-size: 15px;
  line-height: 1.45;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}

.option:active { background: var(--accent-weak); }
.option[disabled] { cursor: default; opacity: 1; }

.option .letter {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.option .opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.option.correct {
  border-color: var(--green);
  background: var(--green-weak);
}
.option.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }

.option.wrong {
  border-color: var(--red);
  background: var(--red-weak);
}
.option.wrong .letter { background: var(--red); border-color: var(--red); color: #fff; }

.feedback {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 10px;
  box-shadow: var(--shadow);
}

.feedback-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

.feedback-title.ok { color: var(--green); }
.feedback-title.bad { color: var(--red); }

.feedback-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 5px;
}

.feedback-body b { color: var(--text); font-weight: 650; }

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
}

.feedback-actions .text-btn { flex: 1; text-align: left; }

.primary-btn {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #6a5cff);
  color: #fff;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 107, 255, .2);
}

.primary-btn:disabled { opacity: .45; box-shadow: none; }
.primary-btn.wide { width: 100%; margin-top: 4px; }

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- 结果 ---------- */
.quiz-result { display: flex; align-items: flex-start; justify-content: center; }

.result-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 18px 18px;
  text-align: center;
  box-shadow: var(--shadow-2);
  margin-top: 6px;
}

.result-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  margin: 0 auto 13px;
  border: 8px solid var(--accent-weak);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  display: flex;
  align-items: baseline;
  justify-content: center;
  line-height: 100px;
}

.result-ring b { font-size: 35px; font-weight: 800; }
.result-ring span { font-size: 13px; color: var(--muted); margin-left: 2px; }

.result-title { font-size: 20px; font-weight: 800; }
.result-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

.result-wrong {
  text-align: left;
  margin-top: 15px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.result-wrong .rw-title {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 6px;
}

.rw-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.rw-item:last-child { border-bottom: 0; }
.rw-item .rw-w { font-weight: 650; }
.rw-item .rw-m { color: var(--muted); text-align: right; overflow-wrap: anywhere; }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.result-actions .primary-btn { width: 100%; }

/* ---------- 错题本 ---------- */
.wrong-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 10px;
}

.pane-title { font-size: 25px; font-weight: 800; letter-spacing: .3px; }

#wrong-filter { margin-bottom: 10px; }

.wrong-list { margin-top: 3px; }

.wrong-card {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 13px;
  margin-bottom: 9px;
  cursor: pointer;
}

.wrong-card .wc-main { flex: 1; min-width: 0; }

.wc-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wc-word { font-size: 16px; font-weight: 700; }

.wc-phon { font-size: 12px; color: var(--amber); margin-top: 2px; }

.wc-mean {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-right {
  font-size: 10.5px;
  color: var(--green);
  background: var(--green-weak);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 5px;
}

.wc-del {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.wc-del:active { background: var(--red-weak); color: var(--red); }

/* ---------- 详情 ---------- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
  will-change: transform;
}

.detail.open { transform: translateX(0); }

.detail-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  padding: calc(env(safe-area-inset-top) + 6px) 10px 6px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.detail-head .spacer { flex: 1; }

.icon-btn {
  border: 0;
  background: var(--accent-weak);
  color: var(--accent);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.icon-btn.on { background: var(--accent); color: #fff; }

.detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 30px;
  padding: 18px 18px calc(env(safe-area-inset-bottom) + 30px);
}

.detail-body > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.d-head { margin-bottom: 4px; }

.word {
  font-size: 31px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.word-phon {
  font-size: 15px;
  color: var(--amber);
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.word-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.form-ref {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.form-ref-label { color: var(--muted); }

.word-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.form-tag {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.form-mean {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.form-mean-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .3px;
  margin-bottom: 3px;
}

.local-note {
  margin: 8px 2px 14px;
  padding: 9px 11px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--card);
  font-size: 11.5px;
  line-height: 1.55;
}

.word-level {
  font-size: 11px;
  color: var(--muted);
}

.sep { height: 1px; background: var(--line); margin: 16px 0 12px; }

.senses { display: flex; flex-direction: column; gap: 2px; }

.row {
  display: grid;
  grid-template-columns: 30px auto auto 1fr;
  align-items: start;
  column-gap: 8px;
  padding: 5px 0;
}

.row .num {
  grid-column: 1;
  color: var(--violet);
  font-size: 12.5px;
  font-weight: 700;
  padding-top: 2px;
  text-align: right;
}

.row .phon { grid-column: 2; color: var(--amber); font-size: 12.5px; padding-top: 2px; }
.row .pos {
  grid-column: 3;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  padding-top: 2px;
  white-space: nowrap;
}
.row .mean { grid-column: 4; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }

.row.no-num { grid-template-columns: auto auto 1fr; }
.row.no-num .num { display: none; }
.row.no-num .phon { grid-column: 1; }
.row.no-num .pos { grid-column: 2; }
.row.no-num .mean { grid-column: 3; }

.sec { margin-top: 20px; }

.sec-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  letter-spacing: .6px;
  margin-bottom: 8px;
}

.sec-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}

.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.form-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}

button.form-item { cursor: pointer; }

.form-item b {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .3px;
  margin-bottom: 2px;
}

.phrase-list { display: flex; flex-direction: column; gap: 5px; }

.phrase {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  cursor: pointer;
}

.phrase:active { background: var(--accent-weak); }
.phrase .ph-en { font-size: 14px; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.phrase .ph-zh { font-size: 12px; color: var(--muted); margin-top: 2px; }

.example {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  margin-bottom: 6px;
}
.example .ex-en { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.example .ex-zh { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 3px; }

.family-list { display: flex; flex-wrap: wrap; gap: 7px; }

.family-item {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.family-item b { font-size: 13.5px; }
.family-item span { color: var(--muted); }

.note {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

.note.more { margin: 0; padding: 16px; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(20, 26, 36, .92);
  color: #fff;
  font-size: 12.5px;
  padding: 9px 15px;
  border-radius: 99px;
  z-index: 40;
  max-width: 84vw;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  pointer-events: none;
}

/* ---------- 滚动条 ---------- */
.list::-webkit-scrollbar,
.detail-body::-webkit-scrollbar,
.pane::-webkit-scrollbar { width: 4px; }
.list::-webkit-scrollbar-thumb,
.detail-body::-webkit-scrollbar-thumb,
.pane::-webkit-scrollbar-thumb {
  background: rgba(120, 130, 150, .25);
  border-radius: 4px;
}
.list::-webkit-scrollbar-track,
.detail-body::-webkit-scrollbar-track,
.pane::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 370px) {
  .hero-title { font-size: 24px; }
  .question-word { font-size: 29px; }
  .word { font-size: 27px; }
  .tab { font-size: 10.5px; }
}
