/* ==========================================================================
   WordBook — 界面样式
   设计基调：中性灰阶为主、单一强调色、克制的层次与阴影、大量留白。
   浅色与深色跟随系统偏好，不引入外部字体。
   ========================================================================== */

:root {
  /* 中性色阶 */
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-sunken: #f5f5f7;
  --bg-hover: #f0f0f2;

  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-quaternary: #aeaeb2;

  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-strong: rgba(0, 0, 0, 0.14);

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --accent-soft-strong: rgba(0, 113, 227, 0.14);

  --star: #f0a020;
  --positive: #1d9a58;
  --warning: #b26a00;
  --warning-bg: rgba(203, 125, 0, 0.08);
  --danger: #d70015;
  --danger-bg: rgba(215, 0, 21, 0.06);

  --material: rgba(251, 251, 253, 0.72);
  --material-strong: rgba(255, 255, 255, 0.86);

  /* 阴影：多层叠加，模拟 Apple 的柔和深度 */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 24px 60px rgba(0, 0, 0, 0.12);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --dur: 0.22s;

  --nav-h: 52px;
  --page-max: 1120px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --bg-elevated: #16161a;
    --bg-sunken: #101014;
    --bg-hover: #1f1f24;

    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --text-quaternary: #5c5c61;

    --hairline: rgba(255, 255, 255, 0.1);
    --hairline-strong: rgba(255, 255, 255, 0.18);

    --accent: #0a84ff;
    --accent-hover: #3d9bff;
    --accent-soft: rgba(10, 132, 255, 0.14);
    --accent-soft-strong: rgba(10, 132, 255, 0.22);

    --star: #ffb340;
    --positive: #30d158;
    --warning: #ffb340;
    --warning-bg: rgba(255, 179, 64, 0.12);
    --danger: #ff453a;
    --danger-bg: rgba(255, 69, 58, 0.12);

    --material: rgba(11, 11, 13, 0.72);
    --material-strong: rgba(22, 22, 26, 0.86);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.36);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.65);
  }
}

/* ------------------------------- 基础 -------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft-strong);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-quaternary) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--text-quaternary);
  background-clip: content-box;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-14 { width: 14px; height: 14px; }
.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }

.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* ------------------------------ 顶部导航 ----------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: var(--material);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 28px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
  opacity: 0.72;
}
.brand .icon {
  color: var(--text-secondary);
}

.nav-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
}

.stat {
  font-size: 12px;
  color: var(--text-secondary);
 background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 980px;
  padding: 3px 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stat b {
  font-weight: 600;
  color: var(--text);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* -------------------------------- 按钮 ------------------------------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 9px 18px;
  border: none;
  border-radius: 980px;
  background: var(--bg-sunken);
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform 0.12s var(--ease), opacity var(--dur);
}
.btn:hover {
  background: var(--bg-hover);
}
.btn:active {
  transform: scale(0.975);
}
.btn:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-quiet {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 980px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn-quiet:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.btn-quiet[aria-pressed='true'] {
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--hairline-strong);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn.is-playing {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
}

/* 收藏星标 */
.star-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-quaternary);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), transform 0.14s var(--ease);
}
.star-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
  transform: scale(1.08);
}
.star-btn.is-on {
  color: var(--star);
}
.star-btn.is-on .icon {
  fill: currentColor;
  stroke: currentColor;
}

/* ------------------------------- 页面 -------------------------------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 28px) 96px;
}
.page-narrow {
  max-width: 840px;
}

/* -------------------------------- Hero ------------------------------- */

.hero {
  text-align: center;
  margin-bottom: clamp(36px, 6vw, 60px);
}

.hero-title {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: -0.012em;
  margin-bottom: 26px;
}

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

.search {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.search-input {
  width: 100%;
  font-size: 17px;
  letter-spacing: -0.015em;
  padding: 15px 54px 15px 46px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-input::placeholder {
  color: var(--text-quaternary);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft);
}

.search-kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 7px;
  pointer-events: none;
}
.search-input:focus ~ .search-kbd {
  opacity: 0;
}

/* --------------------------- 搜索推荐下拉 ---------------------------- */

.suggest-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: var(--material-strong);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: pop 0.16s var(--ease);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s var(--ease);
}
.suggest-item:hover,
.suggest-item.is-active {
  background: var(--accent);
  color: #fff;
}
.suggest-item:hover .suggest-word,
.suggest-item.is-active .suggest-word {
  color: #fff;
}
.suggest-item:hover .suggest-gloss,
.suggest-item:hover .suggest-count,
.suggest-item.is-active .suggest-gloss,
.suggest-item.is-active .suggest-count {
  color: rgba(255, 255, 255, 0.82);
}

.suggest-word {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
}

.suggest-gloss {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-count {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-quaternary);
  white-space: nowrap;
}

.suggest-empty,
.suggest-loading {
  padding: 14px 14px;
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* -------------------------------- 板块 ------------------------------- */

.section {
  margin-top: clamp(40px, 6vw, 64px);
}
.section:first-of-type {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.028em;
}

.section-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.section-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}

.section-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter {
  width: 128px;
  font-size: 13px;
  padding: 6px 12px;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: 980px;
  outline: none;
  transition: all var(--dur) var(--ease);
}
.filter::placeholder {
  color: var(--text-quaternary);
}
.filter:focus {
  width: 168px;
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ------------------------------- 卡片格 ------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  padding: 4px 4px 4px 2px;
  scrollbar-gutter: stable;
  margin: -4px;
}

.word-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 132px;
  padding: 18px 18px 14px;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.word-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--hairline-strong);
}
.word-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.rank {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-quaternary);
  letter-spacing: 0;
}
.word-card.is-top .rank {
  color: var(--text-secondary);
}

.card-star {
  margin-left: auto;
}

.card-word {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-phonetic {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-gloss {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: -0.008em;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--text-quaternary);
  font-variant-numeric: tabular-nums;
}
.card-foot .count {
  color: var(--text-secondary);
  font-weight: 500;
}
.card-foot .spacer {
  margin-left: auto;
}

.empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-tertiary);
  background: var(--bg-sunken);
  border-radius: var(--radius-lg);
}

/* ------------------------------- 通用卡片 ---------------------------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: clamp(22px, 3.4vw, 34px);
}

.card + .card {
  margin-top: 18px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-tertiary);
  text-transform: none;
  margin-bottom: 18px;
}
.card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* ------------------------------ 单词页 ------------------------------- */

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  font-size: 15px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--hairline-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-card {
  box-shadow: var(--shadow-md);
}

.entry-word {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  word-break: break-word;
}

.title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.entry-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.phonetic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.phonetic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: 980px;
}
.phonetic-chip .accent-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
/* 标记这是真人录音而非合成语音 */
.phonetic-chip .tag-real {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--positive);
}
.phonetic-chip .ipa {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
}

.entry-gloss {
  margin-top: 16px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.45;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.chip {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-sunken);
  border-radius: 980px;
  padding: 4px 12px;
  white-space: nowrap;
}
.chip.is-accent {
  color: var(--accent);
  background: var(--accent-soft);
}
.chip-button {
  cursor: pointer;
  border: none;
  transition: background var(--dur) var(--ease);
}
.chip-button:hover {
  background: var(--bg-hover);
}

.entry-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.entry-meta b {
  color: var(--text-secondary);
  font-weight: 600;
}

/* 义项 */

.sense {
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}
.sense:first-child {
  padding-top: 0;
  border-top: none;
}
.sense:last-child {
  padding-bottom: 0;
}

.sense-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pos-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  padding: 3px 9px;
  white-space: nowrap;
}
.pos-zh {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.sense-zh {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.5;
  color: var(--text);
}

.sense-en {
  margin-top: 7px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.sense-usage {
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-sunken);
  border-radius: var(--radius-sm);
}

.sense-examples {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.sense-examples li {
  padding-left: 14px;
  border-left: 2px solid var(--accent-soft-strong);
}
.example-en {
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.55;
}
.example-zh {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.sense-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.tag-label {
  font-size: 11.5px;
  color: var(--text-quaternary);
  align-self: center;
  margin-right: 2px;
}

/* 词形 / 短语 / 辨析 */

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.kv {
  background: var(--bg-elevated);
  padding: 13px 16px;
}
.kv .k {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.kv .v {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  font-family: var(--font-mono);
}

.list-rows {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 16px;
  background: var(--bg-elevated);
}
.list-row .term {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.list-row .desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.note-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* ----------------------------- 追问 AI ------------------------------ */

.qa-list {
  display: grid;
  gap: 20px;
  margin-bottom: 22px;
}
.qa-list:empty {
  margin-bottom: 0;
}

.qa-item {
  padding-left: 14px;
  border-left: 2px solid var(--hairline-strong);
}

.qa-question {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 6px;
}

.qa-answer {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.qa-answer strong {
  color: var(--text);
  font-weight: 600;
}

.ask-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ask-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  letter-spacing: -0.012em;
  line-height: 1.5;
  padding: 12px 16px;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
  resize: none;
  max-height: 160px;
  transition: all var(--dur) var(--ease);
}
.ask-input::placeholder {
  color: var(--text-quaternary);
}
.ask-input:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ask-send {
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.ask-hints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  vertical-align: -0.16em;
  background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* -------------------------------- 提示 ------------------------------- */

.toast-layer {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(92vw, 440px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: 100%;
  padding: 11px 20px;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--material-strong);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--hairline);
  border-radius: 980px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s var(--ease);
}
.toast.is-error {
  color: var(--danger);
}
.toast.is-out {
  animation: toast-out 0.2s var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

/* ------------------------------- 提示块 ------------------------------ */

.notice {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  border-radius: var(--radius-sm);
}
.notice-info {
  color: var(--text-secondary);
  background: var(--accent-soft);
}
.notice-warn {
  color: var(--warning);
  background: var(--warning-bg);
}
.notice-error {
  color: var(--danger);
  background: var(--danger-bg);
}
.notice code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(127, 127, 127, 0.14);
}

.miss-text {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ------------------------------- 登录页 ------------------------------ */

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 40px 34px 32px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  color: var(--text-secondary);
}
.auth-mark .icon {
  width: 26px;
  height: 26px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.field {
  text-align: left;
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  padding-left: 2px;
}
.field input {
  width: 100%;
  font-size: 15px;
  padding: 12px 15px;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: var(--radius);
  outline: none;
  transition: all var(--dur) var(--ease);
}
.field input:focus {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-card .btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  margin-top: 10px;
}

.auth-msg {
  min-height: 19px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.auth-msg.is-error {
  color: var(--danger);
}
.auth-msg.is-ok {
  color: var(--positive);
}

.auth-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-tertiary);
}

/* -------------------------------- 404 ------------------------------- */

.center-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}
.center-page h1 {
  font-size: 60px;
  font-weight: 600;
  letter-spacing: -0.05em;
  margin-bottom: 10px;
}
.center-page p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

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

@media (max-width: 760px) {
  .nav-stats {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 10px;
    max-height: 460px;
  }
  .word-card {
    min-height: 118px;
    padding: 15px 15px 12px;
    border-radius: var(--radius);
  }
  .card-word {
    font-size: 18px;
  }
  .section-tools .filter {
    width: 96px;
  }
  .section-tools .filter:focus {
    width: 124px;
  }
  .entry-actions {
    margin-left: 0;
    width: 100%;
    margin-top: 6px;
  }
  .hero {
    text-align: left;
  }
  .page {
    padding-bottom: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
