/* ============================================================
   palabra · 西班牙语查词站
   明快活泼的卡片风格，暖白 + 番茄橙 + 海水绿
   ============================================================ */

:root {
  --bg: #fff8ef;
  --bg-2: #ffefdc;
  --surface: #ffffff;
  --surface-2: #fff3e6;
  --surface-3: #ffe9d6;
  --ink: #26190f;
  --ink-2: #4e3a2c;
  --muted: #8a7263;
  --line: #f2dfcb;
  --line-strong: #e6cdb4;
  --orange: #f2542d;
  --orange-dark: #d13d18;
  --orange-soft: #ffe2d5;
  --teal: #0f9082;
  --teal-soft: #d8f2ed;
  --yellow: #ffc247;
  --yellow-soft: #fff1cf;
  --red: #d92d20;
  --purple: #6b4ee6;
  --purple-soft: #e9e4ff;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 12px 32px rgba(97, 58, 24, 0.09);
  --shadow-sm: 0 4px 14px rgba(97, 58, 24, 0.07);
  --font: "Nunito", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-es: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --max: 1120px;
}

html[data-theme="dark"] {
  --bg: #171210;
  --bg-2: #211812;
  --surface: #251c16;
  --surface-2: #2f241c;
  --surface-3: #3a2c22;
  --ink: #f8ede2;
  --ink-2: #e2cdbb;
  --muted: #b09a88;
  --line: #3a2c22;
  --line-strong: #4a382b;
  --orange: #ff7a4d;
  --orange-dark: #ff9166;
  --orange-soft: #4a2a1d;
  --teal: #3fc4b2;
  --teal-soft: #143833;
  --yellow: #ffcb63;
  --yellow-soft: #3d3016;
  --purple: #9c86ff;
  --purple-soft: #2b2450;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, #ffe6cf 0%, transparent 55%),
    radial-gradient(900px 500px at 92% 0%, #ffe0d2 0%, transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(1000px 500px at 10% -10%, #2e1f16 0%, transparent 60%),
    radial-gradient(800px 460px at 95% 0%, #33221a 0%, transparent 55%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 0 0 12px 0; z-index: 99;
}
.skip:focus { left: 0; }

.wrap { width: min(100% - 40px, var(--max)); margin-inline: auto; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

.topbar-in {
  display: flex; align-items: center; gap: 22px;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }

.brand-mark {
  width: 38px; height: 38px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #ff8b5e, var(--orange));
  color: #fff; font-weight: 900; font-size: 22px; line-height: 1;
  box-shadow: 0 6px 14px rgba(242, 84, 45, 0.3);
  font-family: var(--font-es);
  padding-top: 4px;
}

.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name strong { font-size: 19px; letter-spacing: -0.02em; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a {
  padding: 8px 13px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a.is-active { background: var(--ink); color: var(--bg); }

.top-actions { display: flex; gap: 6px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  font-size: 16px;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- 视图切换 ---------- */

main { padding: 30px 0 90px; }
.view { animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.view[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- 首页 ---------- */

.hero { position: relative; padding: 30px 0 8px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--orange-dark);
  background: var(--orange-soft);
  padding: 6px 13px; border-radius: 999px; margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.16; letter-spacing: -0.035em; margin: 0 0 16px; font-weight: 850;
  max-width: 22ch;
}
.hero h1 em {
  font-style: normal; color: var(--orange);
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 0.16em;
  text-underline-offset: 0.12em;
  text-decoration-skip-ink: none;
}
.lede { font-size: clamp(16px, 2vw, 18.5px); color: var(--ink-2); max-width: 58ch; margin: 0 0 26px; }

/* ---------- 搜索 ---------- */

.search {
  position: relative;
  width: min(100%, 640px);
}
.search form { display: flex; align-items: center; gap: 10px; }

.search-box {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 2px solid var(--line-strong);
  border-radius: 18px; padding: 0 8px 0 16px; height: 58px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 5px color-mix(in srgb, var(--orange) 14%, transparent), var(--shadow-sm); }
.search-box svg { flex: none; color: var(--muted); }
.search-box input {
  flex: 1; border: 0; background: none; font: inherit; font-size: 17px; color: var(--ink);
  min-width: 0; height: 100%;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus { outline: none; }
.search-go {
  border: 0; background: var(--orange); color: #fff; font-weight: 800;
  height: 42px; padding: 0 18px; border-radius: 12px; cursor: pointer; font-size: 15px;
  transition: background 0.15s, transform 0.12s; flex: none;
}
.search-go:hover { background: var(--orange-dark); }
.search-go:active { transform: scale(0.96); }

.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; padding: 6px;
  max-height: 380px; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest a {
  display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 11px;
}
.suggest a:hover, .suggest a.is-sel { background: var(--surface-2); }
.suggest .s-w { font-weight: 800; font-size: 16px; }
.suggest .s-pos { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.suggest .s-zh { margin-left: auto; font-size: 13.5px; color: var(--ink-2); text-align: right; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .s-more { padding: 8px 12px; font-size: 12.5px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.chips .chips-label { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.chip:hover { background: var(--surface-2); border-color: var(--line-strong); }
.chip:active { transform: scale(0.96); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

/* ---------- 数据条 ---------- */

.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 38px 0 10px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat { text-align: center; }
.stat strong { display: block; font-size: clamp(22px, 3vw, 30px); font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat + .stat { border-left: 1px dashed var(--line-strong); }

/* ---------- 通用卡片 / 区块 ---------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 44px 0 16px;
}
.section-head h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0; font-weight: 800; }
.section-head h2 span { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 8px; letter-spacing: 0; }
.section-head a { font-size: 13.5px; font-weight: 700; color: var(--orange-dark); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.feature-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }

.word-of-day { padding: 24px 26px; position: relative; overflow: hidden; }
.word-of-day::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  background: var(--yellow-soft); border-radius: 50%;
}
.word-of-day .wod-label { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.word-of-day h3 { font-family: var(--font-es); font-size: 40px; margin: 6px 0 2px; letter-spacing: -0.01em; position: relative; }
.word-of-day .wod-pos { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.word-of-day p { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; position: relative; }
.word-of-day .wod-ex { font-style: italic; color: var(--ink); margin-top: 12px; font-family: var(--font-es); font-size: 16.5px; }
.word-of-day .wod-en { font-size: 13.5px; color: var(--muted); }

.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-link {
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px; transition: transform 0.15s, box-shadow 0.15s;
}
.quick-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quick-link .ql-icon { font-size: 24px; }
.quick-link strong { font-size: 15.5px; }
.quick-link span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.unit-card {
  padding: 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; position: relative;
}
.unit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.unit-card .uc-top { display: flex; align-items: center; justify-content: space-between; }
.unit-card .uc-emoji { font-size: 26px; line-height: 1; }
.unit-card .uc-num { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.08em; }
.unit-card strong { font-size: 17px; letter-spacing: -0.01em; }
.unit-card .uc-zh { font-size: 13.5px; color: var(--muted); }
.unit-card .uc-meta { font-size: 12px; color: var(--teal); font-weight: 700; margin-top: 4px; }

/* ---------- 词条页 ---------- */

.entry-head {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.entry-title { flex: 1; min-width: 240px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
}
.badge.pos-v { background: var(--orange-soft); color: var(--orange-dark); }
.badge.pos-n { background: var(--teal-soft); color: var(--teal); }
.badge.pos-adj { background: var(--purple-soft); color: var(--purple); }
.badge.pos-expr { background: var(--yellow-soft); color: #a06a00; }
html[data-theme="dark"] .badge.pos-expr { color: var(--yellow); }
.badge.level { background: var(--ink); color: var(--bg); }
.badge.freq { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

.lemma {
  font-family: var(--font-es); font-size: clamp(42px, 7vw, 64px); line-height: 1.05;
  margin: 0; letter-spacing: -0.015em; font-weight: 700;
}
.lemma small { font-family: var(--font); font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 10px; letter-spacing: 0; }

.ipa { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.speak {
  border: 1px solid var(--line); background: var(--surface); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--teal);
  transition: background 0.15s, transform 0.12s;
}
.speak:hover { background: var(--teal-soft); }
.speak:active { transform: scale(0.9); }

.entry-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 9px 15px; border-radius: 12px; font-size: 14px; font-weight: 700;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn.is-on { background: var(--yellow-soft); border-color: var(--yellow); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-ghost { background: transparent; }

.entry-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 26px; margin-top: 26px; }
.block { margin-bottom: 30px; }
.block > h2 {
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px; font-weight: 800; display: flex; align-items: center; gap: 8px;
}
.block > h2 .count { font-size: 11px; background: var(--surface-2); padding: 1px 7px; border-radius: 999px; letter-spacing: 0; }

.sense-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sense { display: flex; gap: 12px; }
.sense .num {
  flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--orange-soft);
  color: var(--orange-dark); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; margin-top: 2px;
}
.sense .s-es { font-size: 16px; color: var(--ink); margin: 0 0 3px; font-family: var(--font-es); }
.sense .s-zh { font-size: 15px; font-weight: 700; margin: 0; }
.sense .s-en { font-size: 13.5px; color: var(--muted); margin: 1px 0 0; }

.examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.example {
  padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2);
  border-left: 3px solid var(--orange);
}
.example .ex-es { font-family: var(--font-es); font-size: 17px; margin: 0 0 4px; display: flex; gap: 8px; align-items: baseline; }
.example .ex-zh { font-size: 14px; color: var(--ink-2); margin: 0; }
.example .ex-en { font-size: 13px; color: var(--muted); margin: 2px 0 0; font-style: italic; }
.example .ex-es .speak { width: 26px; height: 26px; margin-left: auto; flex: none; opacity: 0.55; }
.example .ex-es .speak:hover { opacity: 1; }

.col-list, .rel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.col-item { padding: 10px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.col-item .c-es { font-family: var(--font-es); font-size: 15.5px; }
.col-item .c-zh { font-size: 13px; color: var(--ink-2); }
.col-item .c-en { font-size: 12px; color: var(--muted); }

.expr-card {
  padding: 14px 15px; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--yellow-soft), var(--surface));
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, var(--line));
  margin-bottom: 10px;
}
.expr-card .x-es { font-family: var(--font-es); font-size: 16.5px; font-weight: 700; margin: 0 0 3px; display: flex; gap: 8px; align-items: baseline; }
.expr-card .x-zh { font-size: 14px; font-weight: 700; margin: 0; }
.expr-card .x-en { font-size: 12.5px; color: var(--muted); margin: 1px 0 0; }
.expr-card .x-note {
  font-size: 12.8px; color: var(--ink-2); margin: 8px 0 0; padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--yellow) 60%, transparent);
  display: flex; gap: 6px;
}
.expr-card .x-note::before { content: "用法"; font-weight: 800; color: #a06a00; flex: none; }
html[data-theme="dark"] .expr-card .x-note::before { color: var(--yellow); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
a.tag:hover { border-color: var(--orange); color: var(--orange-dark); }

/* ---------- 性数 / 变位 ---------- */

.decl-table, .conj-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.decl-table td, .conj-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.decl-table tr:last-child td, .conj-table tr:last-child td { border-bottom: 0; }
.decl-table td:first-child, .conj-table td:first-child { color: var(--muted); font-size: 12.5px; width: 42%; }
.decl-table td:last-child, .conj-table td:last-child { font-family: var(--font-es); font-size: 16px; font-weight: 600; }
.decl-table .art { color: var(--muted); font-weight: 400; margin-right: 5px; font-size: 13px; }
.conj-table tr:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.conj-table .is-irr { color: var(--orange-dark); font-weight: 800; }
.conj-table .is-irr::after { content: "·"; margin-left: 2px; color: var(--orange); }

.conj-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.nf-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.nf {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.nf .nf-label { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.nf .nf-form { font-family: var(--font-es); font-size: 16px; font-weight: 700; }
.nf.is-irr { border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.nf.is-irr .nf-form { color: var(--orange-dark); }

.mood-title {
  display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px;
  font-size: 15px; font-weight: 800; letter-spacing: 0.01em;
}
.mood-title span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mood-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.tense-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.tense {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  overflow: hidden;
}
.tense[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.tense summary {
  cursor: pointer; padding: 11px 14px; display: flex; align-items: baseline; gap: 8px;
  list-style: none; font-weight: 700; font-size: 14.5px;
}
.tense summary::-webkit-details-marker { display: none; }
.tense summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 800; }
.tense[open] summary::after { content: "−"; }
.tense summary .t-es { font-family: var(--font-es); font-size: 15.5px; }
.tense summary .t-zh { font-size: 12px; color: var(--muted); }
.tense .t-note { padding: 0 14px 6px; font-size: 12.5px; color: var(--muted); margin: 0; }
.tense table { border-top: 1px solid var(--line); }
.tense .conj-table td { padding: 6px 14px; font-size: 14px; }

.imperative-table td:nth-child(3) { color: var(--muted); font-family: var(--font-es); }

/* ---------- 主题单元 ---------- */

.unit-hero {
  padding: 26px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.unit-hero .uh-num { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: var(--orange-dark); text-transform: uppercase; }
.unit-hero h1 { font-size: clamp(28px, 4.4vw, 42px); margin: 4px 0 2px; letter-spacing: -0.02em; }
.unit-hero .uh-zh { font-size: 18px; color: var(--ink-2); margin: 0 0 12px; }
.unit-hero p { max-width: 62ch; color: var(--ink-2); margin: 0; }
.can-do { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.can-do span {
  font-size: 13px; background: var(--teal-soft); color: var(--teal); font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.can-do span::before { content: "✓ "; }

.vocab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.vocab-item {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  display: flex; flex-direction: column; gap: 2px; transition: border-color 0.15s, transform 0.12s;
}
.vocab-item:hover { border-color: var(--orange); transform: translateY(-2px); }
.vocab-item .v-w { font-family: var(--font-es); font-size: 18px; font-weight: 700; }
.vocab-item .v-pos { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.vocab-item .v-zh { font-size: 13.5px; color: var(--ink-2); }

.phrase-list { display: flex; flex-direction: column; gap: 8px; }
.phrase {
  display: flex; gap: 12px; align-items: baseline; padding: 11px 14px;
  background: var(--surface-2); border-radius: 12px;
}
.phrase .p-es { font-family: var(--font-es); font-size: 16px; flex: 1; }
.phrase .p-zh { font-size: 13.5px; color: var(--ink-2); }

.dialogue { display: flex; flex-direction: column; gap: 10px; }
.bubble { display: flex; gap: 10px; max-width: 86%; }
.bubble .who {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.bubble:nth-child(even) { align-self: flex-end; flex-direction: row-reverse; }
.bubble:nth-child(even) .who { background: var(--orange); }
.bubble .bubble-body { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 13px; }
.bubble .b-es { font-family: var(--font-es); font-size: 15.5px; margin: 0; }
.bubble .b-zh { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }

.tip-card {
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--purple-soft); border: 1px solid color-mix(in srgb, var(--purple) 30%, var(--line));
}
.tip-card h3 { margin: 0 0 6px; font-size: 14px; color: var(--purple); letter-spacing: 0.02em; }
.tip-card p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- 闪卡 ---------- */

.cards-wrap { max-width: 640px; margin: 0 auto; }
.deck-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.deck-bar .deck-progress { flex: 1; display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--yellow)); border-radius: 99px; transition: width 0.4s; }

.flashcard {
  min-height: 320px; border-radius: 26px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center; cursor: pointer; position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.flashcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(97, 58, 24, 0.13); }
.flashcard .fc-cat { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.flashcard .fc-word { font-family: var(--font-es); font-size: clamp(38px, 8vw, 56px); margin: 8px 0 4px; font-weight: 700; }
.flashcard .fc-ipa { color: var(--muted); font-size: 14px; }
.flashcard .fc-hint { margin-top: 26px; font-size: 13px; color: var(--muted); }
.flashcard .fc-back { display: none; }
.flashcard.is-flipped .fc-front { display: none; }
.flashcard.is-flipped .fc-back { display: block; animation: rise 0.25s; }
.flashcard .fc-back .fb-zh { font-size: 22px; font-weight: 800; margin: 10px 0 6px; }
.flashcard .fc-back .fb-en { color: var(--muted); font-size: 15px; }
.flashcard .fc-back .fb-ex { margin-top: 16px; font-family: var(--font-es); font-size: 16px; color: var(--ink-2); }
.flashcard .fc-back .fb-ex-zh { font-size: 13px; color: var(--muted); }

.grade-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.grade {
  padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 800; font-size: 14.5px;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  transition: transform 0.12s, background 0.15s;
}
.grade small { font-size: 11px; color: var(--muted); font-weight: 600; }
.grade:hover { background: var(--surface-2); }
.grade:active { transform: scale(0.97); }
.grade.g-again { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.grade.g-good { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.grade.g-easy { border-color: color-mix(in srgb, var(--yellow) 70%, var(--line)); }
.grade[disabled] { opacity: 0.4; cursor: default; }

.empty {
  text-align: center; padding: 50px 20px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.empty .e-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

/* ---------- 生词本 / 进度 ---------- */

.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.fav-row .fr-w { font-family: var(--font-es); font-size: 19px; font-weight: 700; min-width: 90px; }
.fav-row .fr-zh { font-size: 14px; color: var(--ink-2); flex: 1; }
.fav-row .fr-lvl { font-size: 11px; font-weight: 800; color: var(--muted); }
.fav-row .icon-btn { width: 32px; height: 32px; border: 0; background: transparent; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { padding: 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.stat-card strong { display: block; font-size: 28px; letter-spacing: -0.03em; }
.stat-card span { font-size: 12.5px; color: var(--muted); }

.level-bars { display: flex; flex-direction: column; gap: 12px; }
.level-bar { display: grid; grid-template-columns: 40px 1fr 60px; gap: 12px; align-items: center; font-size: 13px; }
.level-bar .lb-track { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.level-bar .lb-fill { height: 100%; border-radius: 99px; background: var(--orange); }
.level-bar span:last-child { text-align: right; color: var(--muted); }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history .h-w { font-family: var(--font-es); font-weight: 700; font-size: 16px; min-width: 110px; }
.history .h-zh { color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .h-time { color: var(--muted); font-size: 12px; }

/* ---------- 空状态 / 提示 ---------- */

.notice {
  display: flex; gap: 10px; padding: 13px 15px; border-radius: 14px;
  background: var(--teal-soft); color: var(--ink-2); font-size: 13.5px; margin-bottom: 18px;
}
.notice b { color: var(--teal); }

/* ---------- 页脚 ---------- */

footer {
  border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 13px;
}
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 底部导航（手机） ---------- */

.bottom-nav { display: none; }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .entry-body { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .tense-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar-in { height: 60px; gap: 12px; }
  .topnav { display: none; }
  .brand-sub { display: none; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stat:nth-child(3) { border-left: 0; }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(even) { border-left: 1px dashed var(--line-strong); }
  main { padding-bottom: 110px; }
  body { padding-bottom: 0; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 10px;
  }
  .bottom-nav a .bn-icon { font-size: 18px; line-height: 1.2; }
  .bottom-nav a.is-active { color: var(--orange); background: var(--orange-soft); }

  .hero { padding-top: 16px; }
  .hero h1 { max-width: 100%; }
  .search-box { height: 52px; }
  .search-go { display: none; }
  .quick-links { grid-template-columns: 1fr; }
  .entry-head { gap: 12px; }
  .entry-actions { width: 100%; }
  .entry-actions .btn { flex: 1; justify-content: center; }
  .mood-title { margin-top: 18px; }
  .flashcard { min-height: 280px; padding: 24px; }
  .grade-row { gap: 6px; }
  .grade { font-size: 13px; padding: 12px 4px; }
  .bubble { max-width: 94%; }
  .history .h-w { min-width: 84px; }
}

/* ---------- 补充：词条细节 ---------- */

.decl-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
}
.decl-wrap .decl-table td { padding: 10px 14px; }

.rel-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 9px; }
.rel-row:last-child { margin-bottom: 0; }
.rel-k {
  font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: 0.04em;
  width: 32px; flex: none; padding-top: 5px;
}
.entry-body aside { min-width: 0; }

.flashcard:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--orange) 45%, transparent);
  outline-offset: 3px;
}

.imperative-table td:first-child { width: 34%; }
.imperative-table td:nth-child(2), .imperative-table td:nth-child(3) { font-family: var(--font-es); }
.imperative-table td:nth-child(3) { color: var(--muted); font-weight: 400; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
