/* =====================================================================
 * 颜色和尺寸
 * ===================================================================== */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #14161b;
  --text-2: #3b404b;
  --muted: #6c7280;
  --faint: #a1a6b2;
  --line: #e8eaef;
  --line-strong: #d8dbe3;

  --accent: #4f55e3;
  --accent-hover: #4147cf;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --accent-soft-2: #e0e3ff;

  --done: #16a35b;
  --done-soft: #e7f6ee;
  --warn: #b45f13;
  --danger: #d0342c;

  --mask: #eceef3;
  --seg-on: #ffffff;
  --topbar-bg: rgba(244, 245, 248, 0.82);

  --shadow-sm: 0 1px 2px rgba(20, 22, 40, 0.04), 0 1px 3px rgba(20, 22, 40, 0.05);
  --shadow-md: 0 2px 6px rgba(20, 22, 40, 0.04), 0 8px 24px rgba(20, 22, 40, 0.06);
  --shadow-up: 0 -1px 0 var(--line), 0 -8px 24px rgba(20, 22, 40, 0.05);

  --radius: 16px;
  --radius-sm: 11px;
  --wrap: 880px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-ipa: "Lucida Sans Unicode", "Segoe UI", "Arial Unicode MS", "Noto Sans", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #171a20;
    --surface-2: #1c2028;
    --text: #eceef2;
    --text-2: #c7cbd4;
    --muted: #949aa7;
    --faint: #626876;
    --line: #252932;
    --line-strong: #323744;

    --accent: #8f94ff;
    --accent-hover: #a5a9ff;
    --accent-ink: #10121a;
    --accent-soft: #1d2040;
    --accent-soft-2: #272b57;

    --done: #4cc98a;
    --done-soft: #15291f;
    --warn: #e8a465;
    --danger: #ff8a80;

    --mask: #232731;
    --seg-on: #343a48;
    --topbar-bg: rgba(14, 16, 20, 0.8);

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-up: 0 -1px 0 var(--line);
    color-scheme: dark;
  }
}

/* =====================================================================
 * 基础
 * ===================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-display); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.005em; }
h3 { font-size: 1.08rem; font-weight: 650; }

.icon { flex: none; display: block; }
.meta { color: var(--muted); font-size: 0.875rem; margin: 0; }
.meta b { color: var(--text); font-weight: 600; }
.warn { color: var(--warn); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 20px 72px;
}

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =====================================================================
 * 顶栏
 * ===================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6c72f0, #4249d6);
  box-shadow: 0 2px 6px rgba(79, 85, 227, 0.35);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-left: -6px;
  padding: 6px 10px 6px 4px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
}
.back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back:hover { background: var(--mask); text-decoration: none; color: var(--text); }

.pos { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.pos b { color: var(--text); font-size: 1.02rem; font-weight: 700; font-family: var(--font-display); }

.topbar-progress { height: 3px; background: transparent; margin-bottom: -1px; }
.topbar-progress span { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; transition: width 0.3s ease; }

/* =====================================================================
 * 通用组件
 * ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card.empty { text-align: center; padding: 32px 20px; }
.card.empty p { margin: 0 0 8px; }
.card.empty p:last-child { margin: 16px 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn:disabled:hover { background: var(--surface); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(79, 85, 227, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--mask); color: var(--text); }
.btn.ghost:disabled:hover { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 13px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.end { justify-content: flex-end; }

.section { margin-top: 32px; }
.section:first-child { margin-top: 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 12px;
}

/* 分段选择（遮挡方式、导入方式） */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--mask);
}
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: var(--seg-on);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 22, 40, 0.08), 0 1px 1px rgba(20, 22, 40, 0.04);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px 1px 6px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.ok { background: var(--done-soft); color: var(--done); }

/* 进度环 */
.ring {
  --size: 56px;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
}
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.2; }
.ring-bg { stroke: var(--mask); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.4s ease; }
.ring b {
  position: relative;
  font-family: var(--font-display);
  font-size: calc(var(--size) * 0.26);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ring b small { font-size: 0.6em; font-weight: 600; color: var(--muted); margin-left: 1px; }

/* 表单 */
textarea, input[type="text"], select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus, input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}
textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, var(--font);
  font-size: 0.88rem;
  line-height: 1.65;
  background: var(--surface-2);
}
input[type="text"] { padding: 8px 12px; min-height: 40px; }
select { padding: 6px 30px 6px 10px; min-height: 40px; cursor: pointer; }

/* =====================================================================
 * 首页
 * ===================================================================== */
.hero { padding: 28px 2px 4px; }
.hero h1 { font-size: 2rem; }
.hero p { margin: 10px 0 0; color: var(--muted); font-size: 1rem; max-width: 34em; }

.dict-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dict-card { display: flex; flex-direction: column; gap: 18px; transition: box-shadow 0.2s, border-color 0.2s; }
.dict-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.dict-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dict-card-title { min-width: 0; }
.dict-card-title h3 { font-size: 1.15rem; margin-bottom: 4px; }
.dict-card-title h3 a { color: var(--text); }
.dict-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }

/* 导入 */
.import-card { padding: 0; overflow: hidden; }
.import-card .tabs { margin: 16px 20px 0; }
.tab-panel { padding: 18px 20px 4px; }
.panel-note { margin: 0 0 18px; color: var(--muted); font-size: 0.875rem; }

.preset-group + .preset-group { margin-top: 18px; }
.preset-group h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.08em;
  margin: 0 2px 8px;
}
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.preset {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.preset:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.preset:disabled { cursor: default; opacity: 0.5; }
.preset-text { display: flex; flex-direction: column; min-width: 0; }
.preset-text b { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.preset-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--faint);
  transition: color 0.15s, background 0.15s;
}
.preset:hover:not(:disabled) .preset-icon { color: var(--accent); background: var(--accent-soft); }
.preset-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.preset-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.preset.loading { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.preset.loading .preset-count { color: var(--accent); }
.preset.loading .preset-icon { color: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 32px 16px;
  margin-bottom: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.drop b { color: var(--text); font-weight: 600; }

.formats { margin-top: 14px; border-top: 1px solid var(--line); padding: 14px 20px; }
.formats summary, .more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.875rem;
  width: fit-content;
}
.formats summary:hover, .more summary:hover { color: var(--text); }
.formats-body { font-size: 0.9rem; color: var(--text-2); }
.formats-body p { margin: 14px 0 6px; }
pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
}

/* 导入预览 */
.preview { margin-top: 14px; border-color: var(--accent-soft-2); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm); }
.preview > h3 { font-size: 1.15rem; }
.preview > p { margin: 4px 0 14px; }
.preview-rows { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.preview-row:first-child { border-top: 0; }
.preview-row b { font-weight: 600; overflow-wrap: anywhere; }
.preview-row .ph { color: var(--muted); font-family: var(--font-ipa); overflow-wrap: anywhere; }

.form { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; color: var(--muted); font-weight: 500; }
.field input[type="text"] { width: 240px; max-width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* =====================================================================
 * 词典页
 * ===================================================================== */
.dict-hero { padding: 24px; margin-bottom: 28px; }
.dict-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dict-hero-title { min-width: 0; }
.dict-hero-title h1 { overflow-wrap: anywhere; }
.dict-hero-title .meta { margin-top: 6px; font-size: 0.92rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.stats div { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.8rem; color: var(--muted); }

.dict-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.done { background: var(--done); }
.dot.next { box-shadow: inset 0 0 0 2px var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.tile:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); text-decoration: none; }
.tile-num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.tile-word { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.done { background: var(--done-soft); border-color: transparent; }
.tile.done .tile-num { color: var(--done); }
.tile.done .tile-word { color: var(--done); opacity: 0.75; }
.tile.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.tile.next .tile-num { color: var(--accent); }

.more { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }
.more .actions { margin-top: 12px; }

/* =====================================================================
 * List 页
 * ===================================================================== */
.list-wrap { padding-top: 20px; padding-bottom: 32px; }

.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.toggles { display: flex; gap: 6px; flex-wrap: wrap; }

.range {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 18px 4px 10px;
  color: var(--muted);
  font-size: 0.85rem;
}
.range-tip { color: var(--faint); }

.words {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 6px 20px;
  align-items: start;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  transition: background 0.15s;
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }

.num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border-radius: 7px;
  background: var(--mask);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.en-line { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.word {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ph { margin-top: 2px; color: var(--muted); font-family: var(--font-ipa); font-size: 0.88rem; overflow-wrap: anywhere; }
.say {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
  color: var(--faint);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.say:hover { color: var(--accent); background: var(--accent-soft); }

.meaning { padding-top: 4px; color: var(--text-2); overflow-wrap: anywhere; }
.ex {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--accent-soft-2);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* 遮挡：内容模糊掉，点一下单独显示 */
.masked {
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  background: var(--mask);
  min-height: 34px;
  margin: -2px -6px;
  padding: 2px 6px;
  transition: background 0.15s;
}
.masked > * { filter: blur(7px); opacity: 0.55; pointer-events: none; }
.masked::after {
  content: "点击显示";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}
.masked:hover { background: var(--accent-soft); }
.masked:hover::after { opacity: 1; }

.hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 22px 0 0;
  color: var(--faint);
  font-size: 0.8rem;
}
.hint .sep { width: 1px; height: 12px; background: var(--line-strong); margin: 0 8px; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 0.72rem/1 var(--font);
}

/* 底部操作栏：长 list 也不用滚到底才能翻页 */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow-up);
}
.action-bar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
}
.action-bar #next { justify-self: end; min-width: 200px; min-height: 46px; font-size: 1rem; border-radius: 13px; }
.action-bar .btn.ghost { min-height: 46px; }

/* =====================================================================
 * 提示
 * ===================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 30;
  animation: toast-in 0.2s ease;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }

/* =====================================================================
 * 手机
 * ===================================================================== */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 18px 16px 56px; }
  .topbar-inner { padding: 0 16px; height: 52px; }
  h1, .hero h1 { font-size: 1.5rem; }
  .hero { padding-top: 16px; }

  .dict-cards { grid-template-columns: minmax(0, 1fr); }
  .import-card .tabs { margin: 14px 14px 0; display: flex; }
  .import-card .tabs button { flex: 1; padding: 7px 6px; }
  .import-card .tabs .icon { display: none; }
  .tab-panel { padding: 16px 14px 4px; }
  .formats { padding: 12px 14px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .dict-hero { padding: 18px; }
  .stats div { padding: 10px 12px; }
  .stats b { font-size: 1.15rem; }
  .dict-bar .btn.big { width: 100%; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

  .controls { flex-direction: column; align-items: stretch; }
  .controls .seg { display: flex; }
  .controls .seg button { flex: 1; padding: 8px 4px; }
  .row { grid-template-columns: 24px minmax(0, 1fr); padding: 14px 14px 14px 12px; gap: 6px 12px; }
  .row .cn { grid-column: 2; }
  .num { width: 22px; height: 22px; }
  .word { font-size: 1.22rem; }

  .action-bar-inner { grid-template-columns: auto auto 1fr; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 4px; }
  .action-bar #next { min-width: 0; width: 100%; padding: 0 12px; }
  .action-bar #prev span { display: none; }
  .action-bar .btn.ghost { padding: 0 10px; }
  .hint { display: none; }
  .preview-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
  .preview-row .ph { display: none; }
}
