/* ================= 词邻 Word Neighbor · 毛玻璃卡片流 =================
   配色：中性石墨 + 雾白玻璃 + 单一低饱和雾青点缀。
   想换风格只改 :root 这一块（例如把 --accent 换成 #d8c3ae 即为暖砂调）。 */
:root {
  --bg-1: #15181d;
  --bg-2: #1d222a;
  --bg-3: #101318;
  --bg-glow-1: #6c8290;
  --bg-glow-2: #857c8d;
  --text: #f3f5f6;
  --text-soft: rgba(243,245,246,.70);
  --text-dim: rgba(243,245,246,.42);
  --accent: #b8d2d0;
  --accent-bright: #d9eae7;
  --accent-soft: rgba(184,210,208,.13);
  --accent-line: rgba(184,210,208,.24);
  --ink: #171b20;
  --white-soft: rgba(248,250,250,.90);
  --surface: rgba(255,255,255,.055);
  --surface-hover: rgba(255,255,255,.13);
  --line: rgba(255,255,255,.11);
  --glass-bg: linear-gradient(150deg, rgba(255,255,255,.105), rgba(255,255,255,.035));
  --glass-border: rgba(255,255,255,.15);
  --glass-shadow: 0 22px 60px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.10);
  --danger: rgba(224,142,142,.30);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-3);
}
button, input, textarea { font-family: inherit; }
button { cursor: pointer; border: 0; color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
[hidden] { display: none !important; }

/* ---------- 背景 ---------- */
.bg-stack { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(120% 100% at 15% 10%, rgba(108,130,144,.16) 0%, transparent 62%),
              radial-gradient(110% 100% at 85% 90%, rgba(133,124,141,.13) 0%, transparent 62%),
              linear-gradient(160deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
}
.bg-layer {
  position: absolute; inset: -6%;
  background-size: cover; background-position: center;
  filter: blur(26px) saturate(105%) brightness(.62);
  transform: scale(1.06);
  opacity: 0; transition: opacity 1.2s ease;
  will-change: opacity;
}
.bg-layer.is-visible { opacity: 1; }
.bg-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,10,13,.22) 0%, rgba(8,10,13,.10) 42%, rgba(8,10,13,.52) 100%);
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: .13; }
.glow-one { width: 46vw; height: 46vw; left: -12vw; top: -12vw; background: var(--bg-glow-1); }
.glow-two { width: 40vw; height: 40vw; right: -10vw; bottom: -14vw; background: var(--bg-glow-2); }

/* ---------- 通用玻璃 ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative; z-index: 30;
  margin: calc(14px + var(--safe-t)) 16px 0;
  padding: 10px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; align-items: center; flex: none; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 650; letter-spacing: 0;
  color: var(--text);
  background: linear-gradient(145deg, rgba(255,255,255,.20), rgba(255,255,255,.055));
  border: 1px solid rgba(255,255,255,.17);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 14px rgba(0,0,0,.14);
}

/* 顶部检索入口 */
.search-trigger {
  flex: 0 1 360px; max-width: 360px; min-width: 0; margin: 0 auto;
  height: 36px; padding: 0 12px; border-radius: 999px;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--glass-border);
  color: var(--text-dim); text-align: left;
  transition: background .25s ease, border-color .25s ease, transform .25s var(--ease);
}
.search-trigger:hover { background: var(--surface-hover); transform: translateY(-1px); }
/* 点击顶部检索框、以及搜索页输入框被程序自动聚焦时，都不显示亮色焦点线框 */
.search-trigger:focus, .search-trigger:focus-visible,
.search-input:focus, .search-input:focus-visible { outline: none; box-shadow: none; }
.search-glass { width: 15px; height: 15px; flex: none; opacity: .8; }
.search-glass.big { width: 21px; height: 21px; opacity: .7; }
.search-placeholder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12.5px; }
.search-kbd { flex: none; padding: 2px 7px; border-radius: 6px; font-size: 10px;
  background: rgba(255,255,255,.08); border: 1px solid var(--line); color: var(--text-dim); }

.filters { display: flex; gap: 4px; padding: 4px; border-radius: 999px; flex: none;
  background: var(--surface); border: 1px solid var(--line); }
.chip {
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 550;
  color: var(--text-soft); background: transparent; white-space: nowrap;
  transition: background .25s var(--ease), color .25s ease, transform .25s var(--ease);
}
.chip:hover { color: var(--text); }
.chip.is-active { color: var(--ink); background: var(--white-soft); box-shadow: 0 3px 12px rgba(0,0,0,.16); }

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.scope-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.09); border: 1px solid var(--glass-border);
  transition: transform .25s var(--ease), background .25s ease;
  white-space: nowrap;
}
.scope-btn:hover { background: var(--surface-hover); transform: translateY(-1px); }
.scope-btn.is-mine { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-bright); }
.scope-icon { font-size: 14px; line-height: 1; }

/* 账号入口：圆形头像 + 文字。未登录为描边用户图标，登录后变成昵称首字 */
.account-btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding: 4px 14px 4px 4px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--glass-border);
  transition: transform .25s var(--ease), background .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.account-btn:hover { background: var(--surface-hover); border-color: var(--accent-line); transform: translateY(-1px); }
.account-avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13);
  color: var(--text-soft);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.account-btn:hover .account-avatar { box-shadow: 0 0 0 3px rgba(184,210,208,.12); }
.avatar-icon { width: 16px; height: 16px; }
.avatar-initial { display: none; font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1; }
.account-avatar.is-user { background: var(--accent); border-color: transparent; }
.account-avatar.is-user .avatar-icon { display: none; }
.account-avatar.is-user .avatar-initial { display: block; }
.account-label { font-size: 12px; font-weight: 600; color: var(--text-soft);
  max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn.is-user .account-label { color: var(--text); }

/* ---------- 舞台 ---------- */
.stage {
  position: relative; z-index: 10;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 14px 16px 0;
}
.status-line { width: min(100%, 470px); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-right { display: flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; }
.scope-label { font-size: 12.5px; color: var(--text-soft); letter-spacing: .04em; }
.scope-label .sep { margin: 0 8px; color: var(--text-dim); }
.stats-strip { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-dim); }
.stats-strip b { color: var(--text); font-weight: 650; font-size: 13px; }

.deck {
  position: relative;
  width: min(100%, 470px);
  flex: 0 1 540px;
  min-height: 240px;
  max-height: 540px;
  touch-action: pan-y;
}

/* ---------- 卡片 ---------- */
.card {
  position: absolute; inset: 0;
  border-radius: 30px;
  padding: 22px 22px 16px;
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, rgba(255,255,255,.125), rgba(255,255,255,.04) 55%, rgba(255,255,255,.07));
  backdrop-filter: blur(30px) saturate(135%);
  -webkit-backdrop-filter: blur(30px) saturate(135%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 70px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(255,255,255,.05);
  transform-origin: 50% 50%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  /* 切换动画结束后（移除 is-dragging）毛玻璃一次性恢复，这里让它平滑过渡，避免「实色→毛玻璃」硬跳变 */
  transition: background .35s ease, backdrop-filter .35s ease, -webkit-backdrop-filter .35s ease;
}
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(90% 55% at 12% 0%, rgba(255,255,255,.09), transparent 70%);
}
/* 运动中的卡片临时关掉 backdrop-filter 实时采样，用接近的实色代替。
   这样整卡（含单词）作为一个合成层刚性移动，不会内容拖影、掉帧或淡出。 */
.card.is-moving {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(155deg, rgba(60,66,74,.96), rgba(42,47,54,.95) 55%, rgba(50,56,64,.96));
  box-shadow: 0 30px 70px rgba(0,0,0,.40), inset 0 1px 0 rgba(255,255,255,.14);
  will-change: transform, opacity;
}
/* 划走的卡片飞行途中也保持扁平，避免毛玻璃逐帧重算 */
.card.flying {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  will-change: transform, opacity;
}
/* 拖拽 / 切换动画期间：整副牌都切到扁平实色，彻底关闭毛玻璃实时采样，保证滑动不掉帧。
   动画结束（移除 is-dragging）后毛玻璃再一次性恢复，静态时几乎零开销。 */
.deck.is-dragging .card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: linear-gradient(155deg, rgba(60,66,74,.96), rgba(42,47,54,.95) 55%, rgba(50,56,64,.96));
  will-change: transform;
}
.card.is-top { cursor: grab; }
.card.is-top:active { cursor: grabbing; }
.card.flying { pointer-events: none; z-index: 60; }
.card:not(.is-top) { pointer-events: none; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 650; letter-spacing: .05em;
  border: 1px solid var(--glass-border); background: rgba(255,255,255,.10);
}
.tag-look { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-bright); }
.tag-meaning { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.17); color: var(--text-soft); }
.tag .dotmark { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
/* 右上角收藏：默认空心透明五角星，点亮后填充 */
.star-btn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border);
  transition: transform .28s var(--ease), background .25s ease, border-color .25s ease; }
.star-btn:hover { background: var(--surface-hover); transform: scale(1.09); }
.star-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text-soft); stroke-width: 1.6;
  stroke-linejoin: round; stroke-linecap: round; transition: fill .25s ease, stroke .25s ease; }
.star-btn.is-on { background: var(--accent-soft); border-color: var(--accent-line); }
.star-btn.is-on svg { fill: var(--accent); stroke: var(--accent); }
.star-btn.pop svg { animation: starPop .38s var(--ease); }
@keyframes starPop {
  0% { transform: scale(.6); }
  55% { transform: scale(1.28) rotate(-12deg); }
  100% { transform: scale(1); }
}

.card-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-top: 16px; padding-right: 2px;
  /* 关键：横向手势交给 JS 做滑动，纵向仍可滚动。否则手指在「相似点」等文字上横向拖会被浏览器当成滚动而打断滑动 */
  touch-action: pan-y; }
.card-scroll::-webkit-scrollbar { width: 4px; }
.card-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.word-list { display: flex; flex-direction: column; gap: 10px; }
.word-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 11px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.word { font-size: clamp(20px, 4.6vw, 27px); font-weight: 650; letter-spacing: -.01em; flex: none; }
.meaning { font-size: 13px; color: var(--text-soft); line-height: 1.45; flex: 1; text-align: right; }
.note-block { margin-top: 16px; padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.04); border-left: 2px solid var(--accent-line); }
.note-label { font-size: 10.5px; letter-spacing: .12em; color: var(--text-dim); font-weight: 650; }
.note-block p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }

/* 卡片最下方：记忆技巧默认收纳，点开才展开 */
.tip-block {
  flex: 0 0 auto; margin-top: 14px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(140deg, rgba(184,210,208,.075), rgba(255,255,255,.025));
  border: 1px solid var(--accent-line);
}
.tip-toggle, .tip-block.is-empty {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 11px 15px; text-align: left; background: transparent;
}
.tip-block.is-empty { color: var(--text-dim); }
.tip-label { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; color: var(--accent); white-space: nowrap; }
.spark { font-size: 13px; }
.tip-hint { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.tip-chevron { width: 14px; height: 14px; flex: none; margin-left: auto; opacity: .7;
  transition: transform .35s var(--ease); }
.tip-toggle:hover .tip-label { color: var(--accent-bright); }
.tip-content { max-height: 0; opacity: 0; overflow: hidden; overscroll-behavior: contain;
  padding: 0 15px;
  transition: max-height .4s var(--ease), opacity .3s ease, padding .4s var(--ease);
  /* 与卡片正文一致：横向手势交给滑动，展开后可纵向滚动 */
  touch-action: pan-y; }
.tip-block.is-open .tip-content { overflow-y: auto; }
.tip-content::-webkit-scrollbar { width: 4px; }
.tip-content::-webkit-scrollbar-thumb { background: rgba(184,210,208,.35); border-radius: 4px; }
.tip-content p { margin: 0; font-size: 13.5px; line-height: 1.65; color: rgba(243,245,246,.88);
  white-space: pre-wrap; word-break: break-word; }
.tip-block.is-open .tip-content { max-height: 180px; opacity: 1; padding: 0 15px 13px; }
.tip-block.is-open .tip-chevron { transform: rotate(180deg); }

.card-foot { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--text-dim); }
.author { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.views { flex: none; font-variant-numeric: tabular-nums; }
.owner-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.mini-btn { padding: 5px 10px; border-radius: 999px; font-size: 11px;
  background: rgba(255,255,255,.09); border: 1px solid var(--glass-border); transition: background .2s ease; }
.mini-btn:hover { background: var(--surface-hover); }
.mini-btn.danger:hover { background: var(--danger); }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; flex: none;
  background: rgba(255,255,255,.14); border: 1px solid var(--glass-border); transition: background .3s var(--ease); }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .3s var(--ease); }
.switch.is-on { background: rgba(184,210,208,.55); }
.switch.is-on i { transform: translateX(18px); }
.switch-label { font-size: 11px; color: var(--text-soft); }

/* 拖拽时的方向提示 */
.swipe-cue { position: absolute; top: 26px; padding: 8px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; opacity: 0; pointer-events: none;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.10); z-index: 40; }
.swipe-cue.next { right: 20px; transform: rotate(8deg); }
.swipe-cue.prev { left: 20px; transform: rotate(-8deg); }

/* ---------- 空状态 ---------- */
.empty-state { width: min(100%, 470px); padding: 46px 26px; border-radius: 28px; text-align: center; }
.empty-icon { font-size: 34px; color: var(--accent); opacity: .7; }
.empty-state h2 { margin: 14px 0 8px; font-size: 20px; font-weight: 650; }
.empty-state p { margin: 0 auto 22px; max-width: 300px; font-size: 13px; line-height: 1.7; color: var(--text-soft); }
.primary-btn { padding: 11px 24px; border-radius: 999px; font-size: 13px; font-weight: 650;
  color: var(--ink); background: var(--white-soft); transition: transform .25s var(--ease); }
.primary-btn:hover { transform: translateY(-2px); }

/* ---------- 底部 ---------- */
.drag-hint { position: relative; z-index: 10; font-size: 11px; color: var(--text-dim);
  letter-spacing: .04em; text-align: center; padding: 2px 12px 8px; }
.dock {
  position: relative; z-index: 20;
  margin: 0 16px calc(14px + var(--safe-b));
  padding: 8px 20px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  min-width: 84px; align-self: center;
}
.counter { font-size: 11.5px; color: var(--text-soft); font-variant-numeric: tabular-nums; letter-spacing: .14em; }

/* 「我的卡片」里的创建入口：复用 primary-btn 样式，与空状态提示一致 */
.mine-create { flex: 0 1 auto; }

/* ---------- 模态 ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8,10,13,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(100%, 460px); max-height: min(86dvh, 760px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 28px; padding: 26px; animation: modalIn .4s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 5px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.01em; }
.modal-head p { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.close-btn { width: 30px; height: 30px; flex: none; border-radius: 50%; font-size: 17px; line-height: 1;
  background: rgba(255,255,255,.10); border: 1px solid var(--glass-border); }
.close-btn:hover { background: var(--surface-hover); }

.field { margin-bottom: 16px; }
.field > label, .field-label { display: block; font-size: 11.5px; font-weight: 650; letter-spacing: .06em;
  color: var(--text-soft); margin-bottom: 8px; }
.field-hint { font-size: 11px; color: var(--text-dim); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.input, .textarea { width: 100%; padding: 12px 14px; border-radius: 14px; font-size: 16px;
  color: var(--text); background: var(--surface); border: 1px solid var(--glass-border);
  transition: border-color .2s ease, background .2s ease; }
.input::placeholder, .textarea::placeholder { color: rgba(243,245,246,.32); }
.input:focus, .textarea:focus { border-color: var(--accent-line); background: rgba(255,255,255,.085); outline: none; }
.textarea { resize: vertical; min-height: 78px; line-height: 1.6; }
.segmented { display: flex; gap: 6px; padding: 4px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); }
.segmented button { flex: 1; padding: 9px 6px; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  color: var(--text-soft); background: transparent; transition: all .25s var(--ease); }
.segmented button.is-active { color: var(--ink); background: var(--white-soft); }

.word-editor { display: flex; flex-direction: column; gap: 8px; }
.word-edit-row { display: flex; gap: 8px; align-items: center; }
.word-edit-row .input { flex: 1; min-width: 0; }
.word-edit-row .input.meaning-input { flex: 1.15; }
.row-del { width: 34px; height: 34px; flex: none; border-radius: 10px; font-size: 16px;
  background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.row-del:hover { background: var(--danger); }
.add-row { align-self: flex-start; margin-top: 4px; padding: 7px 13px; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); }
.add-row:hover { background: var(--surface-hover); }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.toggle-row .toggle-text { flex: 1; }
.toggle-row strong { display: block; font-size: 13px; font-weight: 600; }
.toggle-row small { display: block; margin-top: 3px; font-size: 11px; color: var(--text-dim); }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions button { flex: 1; padding: 13px; border-radius: 14px; font-size: 13.5px; font-weight: 650; }
.ghost-btn { background: rgba(255,255,255,.08); border: 1px solid var(--glass-border); }
.ghost-btn:hover { background: var(--surface-hover); }
.solid-btn { color: var(--ink); background: var(--white-soft); }
.solid-btn:hover { background: #fff; }
.solid-btn:disabled { opacity: .5; cursor: default; }
.form-error { margin-top: 12px; font-size: 12px; color: #edb6b6; min-height: 16px; }
.tab-switch { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-dim); }
.tab-switch button { background: none; color: var(--accent); font-weight: 650; font-size: 12px; padding: 4px; }

/* ---------- 全屏检索页 ---------- */
.search-page { position: fixed; inset: 0; z-index: 90; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(10,12,16,.72); backdrop-filter: blur(30px) saturate(115%);
  -webkit-backdrop-filter: blur(30px) saturate(115%);
  animation: searchIn .38s var(--ease); }
@keyframes searchIn { from { opacity: 0; transform: translateY(-14px) scale(.99); } to { opacity: 1; transform: none; } }
.search-page-inner { width: min(calc(100% - 32px), 700px); margin: 0 auto;
  padding: calc(26px + var(--safe-t)) 0 calc(30px + var(--safe-b)); }
.search-head { padding: 14px; border-radius: 22px; display: flex; flex-direction: column; gap: 12px; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 2px 8px 2px 14px; border-radius: 16px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.search-input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; outline: none;
  color: var(--text); font-size: 19px; font-weight: 550; letter-spacing: -.01em; }
.search-input::placeholder { color: var(--text-dim); font-weight: 400; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-scope { display: flex; gap: 6px; }
.search-scope .chip { padding: 6px 15px; font-size: 12px; }
.search-meta { margin: 18px 4px 12px; font-size: 12px; color: var(--text-dim); min-height: 16px; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.result-item { display: block; width: 100%; text-align: left; padding: 15px 17px; border-radius: 20px;
  transition: transform .25s var(--ease), border-color .25s ease; }
.result-item:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.result-top .tag { padding: 4px 10px; font-size: 10px; }
.result-count { font-size: 11px; color: var(--text-dim); }
.result-words { display: flex; flex-wrap: wrap; gap: 7px; }
.r-pair { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.r-pair.is-hit { background: var(--accent-soft); border-color: var(--accent-line); }
.r-word { font-size: 15px; font-weight: 650; }
.r-mean { font-size: 11px; color: var(--text-soft); }
mark { background: transparent; color: var(--accent-bright); font-weight: 750; }
.result-tip { margin-top: 11px; font-size: 12px; color: var(--text-soft); line-height: 1.6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-foot { margin-top: 10px; font-size: 10.5px; color: var(--text-dim); display: flex; gap: 10px; }
.search-tip { font-size: 12px; color: var(--text-dim); margin: 4px 2px 12px; }
.suggest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest-chip { padding: 8px 15px; border-radius: 999px; font-size: 13px;
  background: rgba(255,255,255,.07); border: 1px solid var(--glass-border); }
.suggest-chip:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.search-empty { padding: 50px 20px; text-align: center; font-size: 13px; color: var(--text-soft); line-height: 1.8; }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(76px + var(--safe-b));
  transform: translate(-50%, 14px); padding: 11px 20px; border-radius: 999px; font-size: 12.5px;
  color: var(--text); background: rgba(22,25,30,.84); border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s var(--ease); white-space: nowrap; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 手机适配 ---------- */
@media (max-width: 720px) {
  /* 手机 GPU 上降低模糊半径，保证滑动不掉帧 */
  .bg-layer { filter: blur(16px) saturate(100%) brightness(.62); }
  .card { backdrop-filter: blur(20px) saturate(125%); -webkit-backdrop-filter: blur(20px) saturate(125%); }
  .topbar {
    margin: calc(8px + var(--safe-t)) 10px 0; padding: 9px 11px; border-radius: 18px; gap: 8px;
  }
  .brand-mark { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
  .search-trigger { height: 32px; padding: 0 10px; max-width: none; }
  .search-placeholder { font-size: 11.5px; }
  .search-kbd { display: none; }
  .top-actions { gap: 6px; }
  .scope-btn { height: 32px; padding: 0 11px; font-size: 11.5px; }
  .account-btn { height: 32px; padding: 3px 10px 3px 3px; gap: 6px; }
  .account-avatar { width: 26px; height: 26px; }
  .avatar-icon { width: 14px; height: 14px; }
  .account-label { font-size: 11px; max-width: 64px; }

  .stage { padding: 10px 12px 0; gap: 9px; }
  .status-line { flex-wrap: wrap; gap: 7px; font-size: 11.5px; }
  .filters { order: 1; flex: 1 1 100%; }
  .filters .chip { flex: 1; padding: 8px 4px; text-align: center; font-size: 12px; }
  .status-right { order: 2; width: 100%; justify-content: space-between; }
  .stats-strip { gap: 8px; font-size: 10.5px; }
  .stats-strip b { font-size: 12px; }
  .deck { flex: 0 1 500px; min-height: 220px; }
  .card { border-radius: 26px; padding: 18px 16px 13px; }
  .word-row { padding: 9px 11px; gap: 8px; }
  .word { font-size: clamp(19px, 5.4vw, 24px); }
  .meaning { font-size: 12px; }
  .note-block { padding: 11px 12px; }
  .tip-toggle, .tip-block.is-empty { padding: 10px 12px; }
  .tip-content { padding: 0 12px; }
  .tip-block.is-open .tip-content { max-height: 160px; padding: 0 12px 12px; }
  .tip-content p { font-size: 12.5px; }
  .card-foot { flex-wrap: wrap; gap: 6px; }
  .owner-tools { width: 100%; order: 3; justify-content: flex-end; }
  .mini-btn { padding: 6px 11px; }

  .dock { margin: 0 12px calc(10px + var(--safe-b)); padding: 7px 16px; border-radius: 999px;
          min-width: 76px; width: auto; }
  .drag-hint { font-size: 10px; padding-bottom: 4px; }
  .mine-create { order: 1; flex: 1 1 100%; }

  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-width: none; max-height: 90dvh; border-radius: 26px 26px 0 0;
    padding: 22px 18px calc(22px + var(--safe-b)); animation: sheetIn .42s var(--ease); }
  @keyframes sheetIn { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
  .modal-head h2 { font-size: 19px; }
  .word-edit-row .input { font-size: 16px; }
  .toast { bottom: calc(62px + var(--safe-b)); }

  .search-page-inner { width: calc(100% - 20px); padding-top: calc(14px + var(--safe-t)); }
  .search-head { padding: 11px; border-radius: 18px; gap: 10px; }
  .search-input { height: 42px; font-size: 16px; }
  .search-scope .chip { flex: 1; text-align: center; }
  .search-meta { margin: 14px 2px 10px; }
  .result-item { padding: 13px 14px; border-radius: 17px; }
  .r-word { font-size: 14px; }
  .result-tip { font-size: 11.5px; }
}

@media (max-width: 380px) {
  .scope-btn span:last-child { display: none; }
  .scope-btn { width: 34px; justify-content: center; padding: 0; }
  .account-label { display: none; }
  .account-btn { padding: 3px; }
  .card { padding: 15px 13px 11px; }
  .word-row { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
