/* 配色参照 iOS 系统颜色。深浅色由 <html data-theme> 决定（见 index.html 头部脚本和设置里的「外观」） */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.18);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --blue: #007aff;
  --orange: #ff9500;
  --green: #34c759;
  --green-text: #248a3d;
  --red: #ff3b30;
  --pink: #ff2d55;
  --pink-text: #d3124a;
  --switch-off: #e9e9eb;
  --seg-active: #ffffff;
  /* 白字实心按钮（认识 / Kill / 蓝色按钮）的底色：比系统色深一档，白字对比度约 4.4–4.7:1
     （系统绿 #34c759 上白字只有 2.2:1，看不清）。改颜色时请重新算对比度 */
  --fill-known: #1c8a41;
  --fill-kill: #dc3027;
  --fill-unknown: #e0245a;
  --fill-accent: #0a6fe8;
  --fill-warm: #b85c00;
  --card-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.06);
  --radius-card: 1.75rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* 两侧留白：手机 20px，平板约屏宽 5%，最多 64px */
  --gutter: clamp(20px, 5vw, 64px);
  --gutter-l: calc(var(--safe-left) + var(--gutter));
  --gutter-r: calc(var(--safe-right) + var(--gutter));
  --btn-h: 3.25rem;
  --ease: cubic-bezier(0.32, 0.72, 0, 1); /* iOS 弹出面板 */
  /* ---- 动画规范：全局统一的时长和缓动 ---- */
  --dur-press: 90ms; /* 按下：几乎立即 */
  --dur-release: 160ms; /* 松开回弹 */
  --dur-state: 220ms; /* 状态切换：颜色、开关、选中 */
  --dur-card: 300ms; /* 卡片、页面过渡 */
  --dur-flip: 420ms; /* 卡片翻面（3D 翻转需要稍长一点才自然） */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* 轻快减速：大多数进入和回弹 */
  --ease-in: cubic-bezier(0.4, 0, 1, 1); /* 加速离开 */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --press-scale: 0.96; /* 按钮按下的缩放 */
  --ease-spring: cubic-bezier(0.3, 1.2, 0.4, 1); /* 轻微回弹：分段滑块、开关 */
  /* ---- 磨砂玻璃：半透明底色 + 背景模糊 + 细亮边（三套主题各有一组，见文件末尾「磨砂玻璃」） ---- */
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-hi: rgba(255, 255, 255, 0.9); /* 顶部的一线高光 */
  --glass-blur: saturate(180%) blur(22px);
  --sheet-bg: rgba(242, 242, 247, 0.74);
  --group-bg: rgba(255, 255, 255, 0.74);
  --toast-bg: rgba(30, 30, 32, 0.74);
  --scrim: rgba(0, 0, 0, 0.3);
  /* 页面背景上几团很淡的色彩，让玻璃后面有东西可透；顶部保持纯色，和状态栏接得上 */
  --bg-art: radial-gradient(44rem 30rem at -10% 105%, rgba(0, 122, 255, 0.17), transparent 70%),
    radial-gradient(36rem 28rem at 112% 48%, rgba(175, 82, 222, 0.12), transparent 70%),
    radial-gradient(30rem 22rem at 70% 112%, rgba(52, 199, 89, 0.1), transparent 70%);
  /* ---- 立体单词卡：表面渐变、上下棱边、下面压着的两层纸、落在背景上的大阴影 ---- */
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.86) 55%, rgba(246, 247, 252, 0.8) 100%);
  --card-edge: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 0 rgba(20, 30, 60, 0.07), 0 0.5px 1px rgba(0, 0, 0, 0.06);
  --card-stack: 0 7px 0 -4px rgba(255, 255, 255, 0.82), 0 8px 2px -4px rgba(20, 30, 60, 0.12),
    0 14px 0 -8px rgba(255, 255, 255, 0.6), 0 15px 3px -8px rgba(20, 30, 60, 0.1);
  --card-drop: 0 10px 22px -8px rgba(20, 30, 60, 0.16), 0 32px 56px -18px rgba(20, 30, 60, 0.26);
  --card-shadow: var(--card-edge), var(--card-drop);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -1.5px 0 rgba(0, 0, 0, 0.1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --separator: rgba(84, 84, 88, 0.6);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.16);
  --blue: #0a84ff;
  --orange: #ff9f0a;
  --green: #30d158;
  --green-text: #30d158;
  --red: #ff453a;
  --pink: #ff375f;
  --pink-text: #ff6482;
  --switch-off: rgba(120, 120, 128, 0.32);
  --seg-active: #636366;
  --fill-known: #228c42;
  --fill-kill: #d63a2f;
  --fill-unknown: #e0245a;
  --fill-accent: #0a6fe8;
  --fill-warm: #b85c00;
  --glass: rgba(72, 72, 78, 0.46);
  --glass-strong: rgba(50, 50, 54, 0.74);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --sheet-bg: rgba(28, 28, 30, 0.72);
  --group-bg: rgba(62, 62, 68, 0.56);
  --toast-bg: rgba(58, 58, 62, 0.74);
  --scrim: rgba(0, 0, 0, 0.45);
  --bg-art: radial-gradient(44rem 30rem at -10% 105%, rgba(10, 132, 255, 0.24), transparent 70%),
    radial-gradient(36rem 28rem at 112% 48%, rgba(191, 90, 242, 0.16), transparent 70%),
    radial-gradient(30rem 22rem at 70% 112%, rgba(48, 209, 88, 0.1), transparent 70%);
  --card-bg: linear-gradient(160deg, rgba(58, 58, 62, 0.94) 0%, rgba(36, 36, 39, 0.92) 55%, rgba(26, 26, 28, 0.92) 100%);
  --card-edge: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1.5px 0 rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  --card-stack: 0 7px 0 -4px rgba(44, 44, 48, 0.95), 0 8px 2px -4px rgba(0, 0, 0, 0.6),
    0 14px 0 -8px rgba(32, 32, 35, 0.95), 0 15px 3px -8px rgba(0, 0, 0, 0.6);
  --card-drop: 0 12px 24px -8px rgba(0, 0, 0, 0.6), 0 32px 60px -18px rgba(0, 0, 0, 0.8);
  --btn-hi: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -1.5px 0 rgba(0, 0, 0, 0.22);
  color-scheme: dark;
}

/* 护眼模式（设置 → 外观 → 护眼）：背景用经典的豆沙绿 #c7edcc，卡片和面板是更浅的绿，
   文字是深墨绿，主色从蓝色换成深绿；红、粉、橙也调得柔和一些，整体没有刺眼的纯白和高饱和色。
   对比度（WCAG，2026-11-12 核算）：三级文字和所有强调色在最深的底色 #c7edcc 上都不低于 4.5:1，
   白字压在强调色上不低于 5.6:1。改颜色时请重新算，别低于 4.5:1 */
:root[data-theme="eye"] {
  --bg: #c7edcc;
  --surface: #e6f6e7;
  --label: #1c2e21;
  --label-2: rgba(30, 58, 38, 0.88);
  --label-3: rgba(30, 58, 38, 0.74);
  --separator: rgba(34, 80, 46, 0.2);
  --fill: rgba(46, 110, 62, 0.15);
  --fill-2: rgba(46, 110, 62, 0.09);
  --blue: #237043;
  --orange: #855a0e;
  --green: #247242;
  --green-text: #1f6a3a;
  --red: #a84030;
  --pink: #a4425a;
  --pink-text: #9c3a50;
  --switch-off: #a5d0ad;
  --seg-active: #eefaef;
  --fill-known: #247242;
  --fill-kill: #a84030;
  --fill-unknown: #a4425a;
  --fill-accent: #237043;
  --fill-warm: #855a0e;
  --glass: rgba(236, 249, 237, 0.55);
  --glass-strong: rgba(234, 248, 235, 0.78);
  --glass-border: rgba(247, 255, 248, 0.7);
  --glass-hi: rgba(250, 255, 250, 0.85);
  --sheet-bg: rgba(199, 237, 204, 0.76);
  --group-bg: rgba(236, 249, 237, 0.72);
  --toast-bg: rgba(24, 48, 32, 0.78);
  --scrim: rgba(12, 36, 20, 0.3);
  --bg-art: radial-gradient(44rem 30rem at -10% 105%, rgba(72, 170, 110, 0.3), transparent 70%),
    radial-gradient(36rem 28rem at 112% 48%, rgba(190, 220, 130, 0.3), transparent 70%),
    radial-gradient(30rem 22rem at 70% 112%, rgba(110, 190, 170, 0.2), transparent 70%);
  --card-bg: linear-gradient(160deg, rgba(240, 251, 241, 0.96) 0%, rgba(230, 246, 231, 0.9) 55%, rgba(218, 240, 221, 0.86) 100%);
  --card-edge: inset 0 1px 0 rgba(250, 255, 250, 0.95), inset 0 -1.5px 0 rgba(20, 60, 32, 0.1), 0 0.5px 1px rgba(20, 60, 32, 0.1);
  --card-stack: 0 7px 0 -4px rgba(226, 244, 228, 0.9), 0 8px 2px -4px rgba(20, 60, 32, 0.16),
    0 14px 0 -8px rgba(214, 238, 217, 0.8), 0 15px 3px -8px rgba(20, 60, 32, 0.14);
  --card-drop: 0 10px 22px -8px rgba(20, 60, 32, 0.2), 0 32px 56px -18px rgba(20, 60, 32, 0.32);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

/* 根字号随屏幕大小缩放，其它字号都用 rem：
   iPhone 竖屏约 16px，iPhone 横屏约 15px，iPad 约 19px，大屏最大 22px。
   同时参考宽和高，手机横屏不会因为变宽而把字放大。 */
html {
  font-size: clamp(15px, calc(10px + 0.35vw + 0.55vh), 22px);
}

/* 旋转 / 改变窗口大小期间关掉过渡，避免卡片重放翻转、布局跳动。
   不关动画（animation）：关掉再恢复会让弹出面板、换卡等进入动画重播一遍 */
html.resizing *,
html.resizing *::before,
html.resizing *::after {
  transition: none !important;
}

body {
  background: var(--bg);
  color: var(--label);
  /* 2026-11-18 用户选「思源黑体 + Inter」：英文、数字用 Inter，中文用思源黑体（Noto Sans SC），都在 App 里（css/fonts.css）；
     韩文两种字体都没有，交给后面的系统字体（苹果 SD 黑体 / Malgun Gothic） */
  font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "PingFang SC",
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei", sans-serif;  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  cursor: pointer;
}

/* 按钮、导航栏、标签等界面元素不允许选中文字（连续点击时不会出现灰色的选中底色）；
   单词、释义、例句等内容仍可选中 */
button,
h1,
.sheet-nav,
.segmented,
.stat-nums,
.hint,
.group-header,
.group-footer,
.cell,
.tags,
.actions,
.side-title,
.side-counts,
.side-label {
  -webkit-user-select: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

/* ---------- 整体布局 ----------
   默认（手机竖屏、平板竖屏）：单列，上中下排列，宽度用满屏幕。
   手机横屏、平板横屏 / 大屏的两栏布局见文件末尾的「自适应布局」。 */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 48rem;
  margin: 0 auto;
  background: var(--bg);
}

/* ---------- 大标题导航栏 ---------- */
.topbar {
  padding: calc(var(--safe-top) + 0.75rem) var(--gutter-r) 0 var(--gutter-l);
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.25rem;
}

h1 {
  margin: 0;
  font-size: 2.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

/* 主页问候语（U-007）：比原大标题略小；过长折成两行，不挤右侧按钮 */
.title-row {
  gap: 0.75rem;
}

h1.greeting {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: 0;
  /* 中文折行时尽量在标点处断（「傍晚好，/夕阳和单词都在」），单段过长时仍可任意断 */
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h1.greeting.greeting-sm {
  font-size: 1.375rem;
}

.title-actions {
  flex: 0 0 auto;
}

/* 主页顶部小折线：未来 7 天复习量，在问候语和查词按钮之间；没有坐标轴，今天的点用橙色 */
.due-spark {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
}
.due-spark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.due-spark .sp-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.due-spark .sp-area {
  fill: currentColor;
  opacity: 0.12;
}
.due-spark .sp-dot {
  fill: var(--orange);
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--blue);
}

/* iOS 分段控件 */
.segmented {
  position: relative;
  display: flex;
  margin-top: 10px;
  padding: 2px;
  border-radius: 9px;
  background: var(--fill);
}

.segmented > button {
  position: relative;
  flex: 1;
  min-height: 2rem;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--label);
  transition: background var(--dur-state) var(--ease-out), box-shadow var(--dur-state) var(--ease-out),
    opacity var(--dur-state) var(--ease-out);
}

.segmented > button.active {
  background: var(--seg-active);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}

.segmented > button:not(.active):active {
  opacity: 0.55;
}

/* 有滑块时（motion.js 加上 .has-thumb）：选中背景由滑块平滑移过去，按钮本身透明 */
.segmented.has-thumb > button.active {
  background: transparent;
  box-shadow: none;
}

.seg-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  border-radius: 7px;
  background: var(--seg-active);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  /* 位置（--x）和按住时的缩小（--s）由 motion.js 设置；松手后带一点点回弹地滑到位 */
  transform: translateX(var(--x, 0px)) scale(var(--s, 1));
  transition: transform 380ms var(--ease-spring), width 320ms var(--ease-out), opacity var(--dur-state);
  will-change: transform;
}

/* 按住滑块：略微缩小（同 iOS）；拖动中紧跟手指，只留很短的平滑，避免一格一格地跳 */
.seg-thumb.pressing {
  --s: 0.95;
}

.seg-thumb.dragging {
  transition: transform 70ms linear, width 70ms linear;
}

.seg-thumb.no-anim {
  transition: none;
}

/* 控件上的横向滑动交给 motion.js 拖动滑块，竖向仍然滚动页面 */
.segmented.has-thumb {
  touch-action: pan-y;
}

.segmented.seg-dragging,
.segmented.seg-dragging > button {
  cursor: grabbing;
}

.segmented.seg-dragging > button:active {
  opacity: 1;
}

/* 设置里的小号分段控件 */
.seg-sm {
  flex: none;
  margin-top: 0;
}

.seg-sm > button {
  flex: none;
  min-height: 28px;
  padding: 0 12px;
}

/* ---------- 进度 ---------- */
.stats {
  margin-top: 16px;
}

.bar {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--fill);
}

/* 本轮进度；一轮完成时变成绿色 */
.bar-round {
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.45s var(--ease-out), background var(--dur-card) var(--ease-out);
}

.bar-round.complete {
  background: var(--green);
}

.stat-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--label-2);
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stat b {
  display: inline-block;
  font-weight: 600;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-round {
  background: var(--blue);
}

.dot-due {
  background: var(--orange);
}

/* ---------- 卡片 ---------- */
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.25rem var(--gutter-r) 0 var(--gutter-l);
}

.card {
  position: relative;
  flex: 1;
  min-height: 12rem;
  max-height: 46rem;
  perspective: 1400px;
  outline: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform var(--dur-flip) var(--ease-out);
}

/* 按压卡片：整张卡轻微下沉，松开回弹 */
.card {
  transition: transform var(--dur-release) var(--ease-out);
}

/* 只在正面做：背面是滚动区域，松手时卡片从缩小弹回会让 iPhone 立刻停掉惯性滚动 */
.card:active:not(.empty):not(.flipped) {
  transform: scale(0.985);
  transition-duration: var(--dur-press);
}
/* 按的是卡片里的按钮、链接、可点的单词或牛津区域（这些不翻面）时，卡片不下沉 */
.card:active:not(.empty):has(button:active, a:active, .w:active, .chip:active, .oald-wrap:active) {
  transform: none;
}

/* 翻面后，背面内容在翻转后半段淡入、轻微上移 */
.card .back-head,
.card .back-body {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 120ms var(--ease-out), transform 120ms var(--ease-out);
}

.card.flipped .back-head,
.card.flipped .back-body {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-card) var(--ease-out) 160ms, transform var(--dur-card) var(--ease-out) 160ms;
}

.card.flipped .back-body {
  transition-delay: 210ms;
}

.card.no-anim .back-head,
.card.no-anim .back-body {
  transition: none;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card.no-anim .card-inner {
  transition: none;
}

/* 翻到背面、翻转动画结束后（app.js 加 .settled）：去掉 3D，外观不变。
   iPhone 上 3D 变换里的滚动区域滚动会卡顿；翻回正面、换卡前 app.js 会先无动画地恢复 3D 状态 */
.card.flipped.settled {
  perspective: none;
}
.card.flipped.settled .card-inner {
  transition: none; /* 切换是瞬间的，不能再播一次翻转 */
  transform: none;
  transform-style: flat;
  -webkit-transform-style: flat;
}
.card.flipped.settled .front {
  visibility: hidden;
}
.card.flipped.settled .back {
  transform: none;
}

.card:focus-visible .face {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius-card);
  /* 立体感：表面从左上到右下略微变暗，上沿一线高光、下沿一线暗边，
     下面压着两层露出边的纸，再加一个落得比较远的大阴影（变量见文件开头） */
  background: var(--card-bg);
  box-shadow: var(--card-edge), var(--card-stack), var(--card-drop);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow-y: auto;
}

/* 卡片里的滚动条：细的圆角滑块，浮在卡片内侧，上下避开圆角 */
.face::-webkit-scrollbar,
.sheet-scroll::-webkit-scrollbar {
  width: 12px;
}

.face::-webkit-scrollbar-track,
.sheet-scroll::-webkit-scrollbar-track {
  margin: calc(var(--radius-card) - 4px) 0;
  background: transparent;
}

.face::-webkit-scrollbar-thumb,
.sheet-scroll::-webkit-scrollbar-thumb {
  /* 透明边框 + padding-box 让滑块变细并离开卡片边缘 */
  border: 4px solid transparent;
  border-radius: 999px;
  background: var(--label-3) padding-box;
}

.face::-webkit-scrollbar-thumb:hover,
.sheet-scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--label-2);
}

.face::-webkit-scrollbar-button,
.sheet-scroll::-webkit-scrollbar-button {
  display: none;
}

/* Firefox 不支持上面的写法，用标准属性 */
@supports not selector(::-webkit-scrollbar) {
  .face,
  .sheet-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--label-3) transparent;
  }
}

.front {
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.back {
  transform: rotateY(180deg);
}

.word {
  margin: 0;
  font-size: clamp(2.25rem, 11vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  word-break: break-word;
}

.word.small {
  font-size: 1.75rem;
  text-align: left;
}

.badge {
  position: absolute;
  top: 20px;
  left: 22px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label-3);
}

.badge::after {
  content: "复习";
}

.card[data-status="new"] .badge {
  color: var(--blue);
}

.card[data-status="new"] .badge::after {
  content: "新词";
}

.card[data-status="again"] .badge {
  color: var(--red);
}

.card[data-status="again"] .badge::after {
  content: "再记一次";
}

.speak {
  width: 3rem;
  height: 3rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
}

.back-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.back-head .speak {
  width: 2.25rem;
  height: 2.25rem;
}

.speak svg {
  width: 45%;
  height: 45%;
}

.back-title {
  min-width: 0;
}

/* 音标：紧贴在单词下方，点击朗读 */
.ipa {
  width: fit-content;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  margin: 4px 0 0;
  font-size: 1rem;
  color: var(--label-2);
  font-family: "SF Pro Text", "Lucida Sans Unicode", "Segoe UI", -apple-system, sans-serif;
}

.back-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 0.5px solid var(--separator);
}

.back-body p {
  margin: 0;
}

.meaning {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
}

.meaning-en {
  margin-top: 6px !important;
  font-size: 1.0625rem;
  color: var(--label-2);
}

/* 英语词条：义项 / 提示 / 例句 / 短语 */
.sense {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
}

.sense-block + .sense-block {
  margin-top: 0.625rem;
}

/* 中文释义下方的英文释义 */
.sense-en {
  margin-top: 0.125rem !important;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--label-2);
}

.pos {
  margin-right: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  font-style: italic;
  color: var(--blue);
}

.note {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--fill-2);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--label-2);
}

.sec {
  margin: 22px 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--label-2);
}

.examples {
  margin: 0;
  padding: 0 0 0 22px;
}

.examples li {
  padding-left: 2px;
  color: var(--label-3);
  font-size: 0.875rem;
}

.examples li + li {
  margin-top: 12px;
}

.ex-en {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--label);
}

.ex-zh {
  margin-top: 2px !important;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--label-2);
}

.phrase {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--fill-2);
}

.phrase + .phrase {
  margin-top: 10px;
}

.ph-head {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
}

.ph-zh {
  margin-top: 2px !important;
  font-size: 0.9375rem;
  font-weight: 500;
}

.ph-use {
  margin: 4px 0 6px !important;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.phrase .ex-en {
  margin-top: 6px !important;
  font-size: 0.9375rem;
}

/* 韩语活用表（U-006）：app.js koExtrasHtml 的活用每条是只有 .ph-head（形式）+ .ph-zh（活用名）的 .phrase，
   英文短语一定还带例句，所以用 :has 只选中活用。排成 iOS 分组列表：左边活用名，右边形式，细线分隔 */
.phrase:has(> .ph-head + .ph-zh:last-child) {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 14px;
  border-radius: 0;
}
.phrase:has(> .ph-head + .ph-zh:last-child) + .phrase {
  margin-top: 0;
  box-shadow: inset 0 0.5px 0 var(--separator);
}
:is(.sec, .ph-use) + .phrase:has(> .ph-head + .ph-zh:last-child) { border-radius: 12px 12px 0 0; }
.phrase:has(> .ph-head + .ph-zh:last-child):last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.phrase:has(> .ph-head + .ph-zh:last-child) .ph-zh {
  order: -1;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--label-2);
}
.phrase:has(> .ph-head + .ph-zh:last-child) .ph-head {
  flex: none;
  white-space: nowrap;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: right;
}

/* 例句出处（Tatoeba）的小链接 */
.src-link {
  margin-left: 0.25rem;
  font-size: 0.6875rem;
  color: var(--label-3);
  text-decoration: none;
  vertical-align: 0.15em;
}

.src-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* 例句里可点击的单词 */
.w {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.w:hover {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.w:active {
  background: color-mix(in srgb, var(--blue) 22%, transparent);
}

.w.hl {
  font-weight: 700;
  color: var(--blue);
}

/* 换卡动画：旧卡向一侧轻移淡出，新卡从下方轻轻浮上来 */
.card.enter .card-inner {
  animation: card-in var(--dur-card) var(--ease-out);
}

/* 淡出加在两个面上而不是 .card-inner：容器 opacity < 1 会让 preserve-3d 被压平，
   backface-visibility 失效，翻过来的正面会镜像地透出来 */
.card.out-known .card-inner,
.card.out-unknown .card-inner {
  transition: transform 220ms var(--ease-in);
}

.card.out-known .face,
.card.out-unknown .face {
  transition: opacity 220ms var(--ease-in);
  opacity: 0;
}

.card.out-known .card-inner {
  transform: rotateY(180deg) translateX(-28px) scale(0.97);
}

.card.out-unknown .card-inner {
  transform: rotateY(180deg) translateX(28px) scale(0.97);
}

/* 答题反馈：卡片边缘亮一圈柔和的颜色；「不认识」再加克制的左右轻抖 */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 2px var(--fb-color, transparent), 0 0 0 3px color-mix(in srgb, var(--fb-color, transparent) 18%, transparent);
  opacity: 0;
  pointer-events: none;
}

.card.fb-known {
  --fb-color: var(--green);
}

.card.fb-unknown {
  --fb-color: var(--pink);
  animation: shake 260ms var(--ease-out);
}

.card.fb-known::before,
.card.fb-unknown::before {
  animation: fb-ring 420ms var(--ease-out);
}

@keyframes fb-ring {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: translateX(-5px);
  }
  45% {
    transform: translateX(4px);
  }
  70% {
    transform: translateX(-2px);
  }
  85% {
    transform: translateX(1px);
  }
}

/* 斩杀：两道交叉的刀光先后劈过整张卡片（中间白热、两头收尖、外面一圈红色辉光），
   卡片被劈中时一震、边缘泛红，然后歪着掉下去消失。整段 480ms，和 app.js 的 leave("out-kill", 480) 对齐 */
.card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -22%;
  z-index: 2;
  width: 144%;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%; /* 很扁的椭圆：中间粗、两头尖，像一道刀光 */
  background: linear-gradient(180deg, transparent 0%, var(--red) 28%, #fff 46%, #fff 54%, var(--red) 72%, transparent 100%);
  box-shadow: 0 0 16px 2px color-mix(in srgb, var(--red) 70%, transparent), 0 0 46px 8px color-mix(in srgb, var(--red) 38%, transparent);
  transform: rotate(-24deg) scale(0, 0.4);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
}

.card.out-kill::after {
  animation: slash 0.44s var(--ease-out) forwards;
}

/* 第二刀：反方向，从右上劈到左下，比第一刀晚一点、细一点（借用答题反馈的 ::before，两者不会同时出现） */
.card.out-kill::before {
  inset: auto;
  top: 50%;
  left: -22%;
  z-index: 2;
  width: 144%;
  height: 13px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: linear-gradient(180deg, transparent 0%, var(--red) 28%, #fff 46%, #fff 54%, var(--red) 72%, transparent 100%);
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--red) 65%, transparent), 0 0 36px 6px color-mix(in srgb, var(--red) 32%, transparent);
  transform-origin: right center;
  animation: slash-2 0.38s var(--ease-out) 0.09s both;
}

.card.out-kill .card-inner {
  animation: kill-out 0.48s var(--ease-in-out) forwards;
}

.card.flipped.out-kill .card-inner {
  animation-name: kill-out-flipped;
}

/* 淡出同样放在面上（原因见上面换卡动画的说明） */
.card.out-kill .face {
  animation: kill-flash 0.48s var(--ease-out), kill-fade 0.48s var(--ease-in-out) forwards;
}

@keyframes kill-fade {
  0%,
  36% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes slash {
  0% {
    opacity: 1;
    transform: rotate(-24deg) scale(0, 0.4);
  }
  30% {
    opacity: 1;
    transform: rotate(-24deg) scale(1, 1.3);
  }
  50% {
    opacity: 1;
    transform: rotate(-24deg) scale(1, 0.9);
  }
  100% {
    opacity: 0;
    transform: rotate(-24deg) scale(1.03, 0.06);
  }
}

@keyframes slash-2 {
  0% {
    opacity: 0;
    transform: rotate(19deg) scale(0, 0.4);
  }
  1% {
    opacity: 1;
  }
  34% {
    opacity: 1;
    transform: rotate(19deg) scale(1, 1.3);
  }
  55% {
    opacity: 1;
    transform: rotate(19deg) scale(1, 0.85);
  }
  100% {
    opacity: 0;
    transform: rotate(19deg) scale(1.03, 0.06);
  }
}

@keyframes kill-out {
  0% {
    transform: none;
  }
  18% {
    transform: scale(1.035) rotate(0.8deg);
  }
  36% {
    transform: scale(0.99) rotate(-1.4deg);
  }
  100% {
    transform: translateY(44px) scale(0.84) rotate(-8deg);
  }
}

@keyframes kill-out-flipped {
  0% {
    transform: rotateY(180deg);
  }
  18% {
    transform: rotateY(180deg) scale(1.035) rotate(0.8deg);
  }
  36% {
    transform: rotateY(180deg) scale(0.99) rotate(-1.4deg);
  }
  100% {
    transform: rotateY(180deg) translateY(44px) scale(0.84) rotate(-8deg);
  }
}

@keyframes kill-flash {
  22% {
    box-shadow: var(--card-edge), 0 0 0 2px var(--red), 0 0 44px 4px color-mix(in srgb, var(--red) 50%, transparent);
  }
}

/* 全部斩杀后的空状态 */
.card.empty {
  cursor: default;
}

.card.empty .speak,
.card.empty .badge {
  display: none;
}

.card.empty .word {
  font-size: 1.75rem;
}

/* 词性标注（按雅思词表的写法） */
.pos-tag {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--blue);
}

.front .pos-tag {
  margin: -1rem 0 0;
  font-size: 1rem;
}

.pos-tag:empty {
  display: none;
}

/* 单元内容加载中 / 制作中 */
.loading {
  margin: 1.5rem 0 !important;
  text-align: center;
  color: var(--label-3);
}

.card.empty .pos-tag {
  display: none;
}

/* 一轮结束的总结 / 空状态说明 */
.front-sub {
  margin: -8px 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  text-align: center;
  color: var(--label-2);
}

.front-sub:empty {
  display: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 一轮完成：标题轻轻弹出，总结文字随后淡入 */
.card.empty.celebrate .front .word {
  animation: success-pop 420ms var(--ease-out);
}

.card.empty.celebrate .front-sub {
  animation: rise-in var(--dur-card) var(--ease-out) 140ms backwards;
}

@keyframes success-pop {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  60% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    transform: none;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.hint {
  min-height: 18px;
  margin: 24px 0 0; /* 卡片下面露出两层纸边（约 14px），提示文字让开 */
  text-align: center;
  font-size: 0.8125rem;
  color: var(--label-2); /* label-3 再加呼吸动画的半透明，几乎看不见 */
  transition: opacity var(--dur-state) var(--ease-out), color var(--dur-state);
}

.hint.recorded-known,
.hint.recorded-unknown {
  animation: rise-in var(--dur-state) var(--ease-out);
}

.hint.hide {
  opacity: 0;
}

.hint.recorded-known {
  color: var(--green-text);
  font-weight: 500;
}

.hint.recorded-unknown {
  color: var(--pink-text);
  font-weight: 500;
}

/* ---------- 底部按钮（避开 Home 横条） ---------- */
.actions {
  display: flex;
  gap: 10px;
  padding: 14px var(--gutter-r) calc(var(--safe-bottom) + 16px) var(--gutter-l);
}

.btn {
  flex: 1;
  min-height: var(--btn-h);
  border: 0;
  border-radius: 0.875rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

/* 窄屏（320 宽）英文 Don’t know 不折行：字号略小、按钮内边距收窄 */
@media (max-width: 359px) {
  .actions .btn:not(.btn-kill) {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 1rem;
    white-space: nowrap;
  }
}

.actions.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.actions {
  transition: opacity var(--dur-state) var(--ease-out);
}

/* 斩杀按钮：正方形 */
.btn-kill {
  flex: none;
  width: var(--btn-h);
  height: var(--btn-h);
  padding: 0;
  font-size: 0.9375rem;
  background: var(--fill-kill);
  color: #fff;
  letter-spacing: 0.02em;
}

.btn-unknown {
  background: color-mix(in srgb, var(--pink) 16%, var(--surface));
  color: var(--pink-text);
}

.btn-known {
  background: var(--fill-known);
  color: #fff;
}

.btn-next,
.btn-round {
  display: none;
  background: var(--fill-accent);
  color: #fff;
  animation: btn-in var(--dur-state) var(--ease-out);
}

@keyframes btn-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

/* 一轮结束：只显示「开始下一轮」 */
.actions.finished .btn-kill,
.actions.finished .btn-known,
.actions.finished .btn-unknown {
  display: none;
}

.actions.finished .btn-round {
  display: block;
}

/* 未翻面直接作答后：按钮合并成一个 Next */
.actions.answered .btn-kill,
.actions.answered .btn-known,
.actions.answered .btn-unknown {
  display: none;
}

.actions.answered .btn-next {
  display: block;
  grid-column: 2 / -1; /* 横屏网格布局：第一列留给撤回按钮 */
}

/* Next 左边的撤回小箭头：正方形，撤回刚才的「认识 / 不认识」 */
.btn-undo {
  display: none;
  flex: none;
  width: var(--btn-h);
  height: var(--btn-h);
  padding: 0;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--blue);
  animation: btn-in var(--dur-state) var(--ease-out);
}

.actions.answered .btn-undo {
  display: grid;
  place-items: center;
}

/* ---------- 设置面板（iOS 底部弹出 + 分组列表） ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  /* 遮罩不做淡入，一出现就是最终的暗度：iPhone 会按网页最上缘的固定层给顶部状态栏上色，
     而且是一下子变暗。网页这边如果慢慢变暗，状态栏和页面就会一快一慢，看起来闪一下。
     面板本身的弹出动画不受影响 */
}

.sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  padding: 6px 0 0;
  border-radius: 20px 20px 0 0;
  background: var(--bg);
  animation: slide-up 0.4s var(--ease);
}

.sheet > .sheet-nav {
  flex: none;
  margin-left: var(--gutter-l);
  margin-right: var(--gutter-r);
}

/* 顶部抓手：居中的长条，面板弹出时从中间向两侧伸展 */
.sheet > .grabber {
  flex: none;
  animation: grabber-in 520ms var(--ease-out) 80ms both;
}

@keyframes grabber-in {
  from {
    transform: scaleX(0.3);
    opacity: 0;
  }
}

.sheet-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--gutter-r) calc(var(--safe-bottom) + 24px) var(--gutter-l);
}

/* 单词详情盖在设置面板之上 */
.detail-backdrop {
  z-index: 20;
}

#detail .sheet {
  height: calc(100dvh - var(--safe-top) - 40px);
}

/* 设置面板固定高度：进入「学习语言」这类内容很少的子页面时，面板不会跟着缩小 */
#settings .sheet {
  height: calc(100dvh - var(--safe-top) - 24px);
}

.detail-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
}

.form-note {
  margin-bottom: 10px !important;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px !important;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label-2);
}

.ask {
  margin: 0 4px 10px;
  font-size: 0.9375rem;
  text-align: center;
  color: var(--label-2);
}

#detail-actions:not(:empty) {
  margin-bottom: 16px;
}

.btn-wide {
  display: block;
  width: 100%;
  background: var(--fill-accent);
  color: #fff;
}

.grabber {
  width: 48px;
  height: 5px;
  margin: 2px auto 8px;
  border-radius: 3px;
  background: var(--label-3);
}

.sheet-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
}

.sheet-nav h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.text-btn.back-btn {
  justify-self: start;
  font-weight: 400;
}

/* 隐藏时仍占住左边一格，保证标题居中、「完成」靠右 */
.sheet-nav .back-btn[hidden] {
  display: inline-block !important;
  visibility: hidden;
}

.text-btn {
  justify-self: end;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 1.0625rem;
  font-weight: 600;
}


.text-btn:focus {
  outline: none;
}

.text-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.group {
  margin-bottom: 24px;
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  font-size: 1.0625rem;
  text-align: left;
}

/* 列表行：按下时立即高亮，松开后背景慢慢淡掉（同 iOS 设置） */
.cell {
  transition: background-color var(--dur-card) var(--ease-out);
}

.cell:active {
  background: var(--fill);
  transition-duration: 0s;
}

.cell + .cell {
  box-shadow: inset 0 0.5px 0 var(--separator);
}

.cell-danger,
.cell-link {
  justify-content: flex-start;
}

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

/* 可进入下一级的行：右侧数值 + 箭头 */
.cell-nav {
  gap: 10px;
}

.cell-nav::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-top: 2px solid var(--label-3);
  border-right: 2px solid var(--label-3);
  transform: rotate(45deg);
}

.cell-value {
  margin-left: auto;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}

/* 行内控件（如「学习方式」的分段控件）：标题在左，控件靠右；点控件时不整行高亮 */
.cell-control {
  gap: 10px;
  /* 窄屏（如 320 宽英文界面）放不下时，控件换到标题下一行靠右，不溢出 */
  flex-wrap: wrap;
  row-gap: 6px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.cell-control:active {
  background: none;
}

.cell-control > span:first-child {
  flex: none;
}

.cell-control .segmented {
  margin: 0 0 0 auto;
}

.group-header {
  margin: 0 16px 6px;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.word-row {
  min-height: 58px;
}

.row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.row-word {
  font-weight: 600;
}

.row-zh {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.row-pos {
  font-style: italic;
  color: var(--label-3);
}

.empty-list {
  padding: 40px 0;
  text-align: center;
  color: var(--label-3);
}

.status-new {
  background: var(--label-3);
}

.status-learning {
  background: var(--blue);
}

.status-learned {
  background: var(--green);
}

/* 单词行右侧的累计次数 */
.counts {
  display: flex;
  gap: 8px;
  margin-left: auto;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.counts b {
  font-weight: 600;
}

.c-known {
  color: var(--green-text);
}

.c-unknown {
  color: var(--pink-text);
}

/* 已背诵词的下次复习日期 */
.c-due {
  color: var(--label-2);
  font-weight: 500;
}

/* 设置行右侧的下拉选择 */
/* 单选列表（新词来源、学习语言、学习方式等）：两行文字 + 右侧蓝色对勾 */
.cell-option {
  gap: 10px;
  min-height: 52px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.cell-option .row-word {
  font-weight: 500;
}

/* 单选页的说明可以换行，不截断 */
.cell-option .row-zh {
  margin-top: 2px;
  white-space: normal;
  line-height: 1.4;
}

/* 设置主页：右侧当前值过长时截断，不挤压左侧标题 */
#settings-main .cell-value {
  min-width: 0;
  max-width: 55%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: right;
}

#settings-main .cell > span:first-child {
  flex: none;
}

/* 设置页：分组之间多留一点空，标题和说明行距统一 */
#settings-main .group {
  margin-bottom: 28px;
}

#settings-main .group-header,
#settings-sub .group-header {
  line-height: 1.45;
}

#settings-main .group-footer {
  margin-top: -20px;
  margin-bottom: 28px;
  line-height: 1.45;
}

#settings-sub .group-header {
  margin-bottom: 10px;
}

/* 设置页最下方的说明文字 */
.settings-about {
  margin: 8px 16px 28px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--label-3);
}

.settings-about p {
  margin: 0 0 6px;
}

.cell-option .check {
  flex: none;
  width: 7px;
  height: 13px;
  margin: 0 4px 3px auto;
  border-right: 2.5px solid var(--blue);
  border-bottom: 2.5px solid var(--blue);
  transform: rotate(45deg);
  visibility: hidden;
}

.cell-option.checked .check {
  visibility: visible;
}

.cell-option.checked .row-word {
  color: var(--blue);
}

.cell-option:disabled .row-word,
.cell-option:disabled .row-zh {
  color: var(--label-3);
}

/* iOS 风格的数量调节器 */
.stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  background: var(--fill);
}

.stepper button {
  width: 44px;
  height: 32px;
  border: 0;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--label);
}


.stepper button:disabled {
  color: var(--label-3);
  cursor: default;
}

/* 设置里的拖动条（新词数量 / 复习数量）：细轨道，左边已选的一段是主色（--p 由 app.js 设），圆形滑钮 */
.cell-range .range {
  flex: 1;
  min-width: 0;
  margin: 0 2px 0 8px;
}

.range {
  --p: 0%;
  --thumb: #ffffff;
  height: 32px; /* 触摸区域比看得见的轨道高 */
  padding: 0;
  border: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
  cursor: pointer;
}

[data-theme="eye"] .range {
  --thumb: #f4fbf4;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--blue) var(--p), var(--fill) var(--p));
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--blue) var(--p), var(--fill) var(--p));
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -10px;
  border: 0;
  border-radius: 50%;
  background: var(--thumb);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.22);
}

.range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--thumb);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.22);
}

.range:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 拖动条右边的数字可以直接输入 */
.stepper-input {
  width: 3rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  font: inherit;
  font-size: max(16px, 1rem); /* ≥16px，避免 iPhone 聚焦时页面自动放大 */
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--label);
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 去掉浏览器自带的上下小箭头，用两边的 −/+ */
.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
}

.status-killed {
  background: var(--red);
}

.cell-link {
  color: var(--blue);
}

.cell:disabled {
  color: var(--label-3);
  cursor: default;
}

.cell:disabled:active {
  background: none;
}

.group-footer {
  margin: -16px 16px 24px;
  font-size: 0.8125rem;
  color: var(--label-2);
}

/* iOS 开关 */
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: var(--switch-off);
  cursor: pointer;
  transition: background var(--dur-state) var(--ease-out);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform var(--dur-state) var(--ease-out), width var(--dur-state) var(--ease-out);
}

.switch:checked {
  background: var(--green);
}

.switch:checked::after {
  transform: translateX(20px);
}

.switch:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* 触感用的隐藏开关：保持渲染（iOS 才会触发触感），但看不见、点不到 */
.haptic-proxy {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 轻提示：浮在屏幕中下方，几秒后自动消失 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 96px);
  z-index: 30;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(30, 30, 32, 0.92);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  transform: translateX(-50%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  pointer-events: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
}

/* ---------- 全部单词 / 我的单词包 / 导入 ---------- */
.lib-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* 全部单词的首字母筛选 */
.letter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.letter-chip {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 8px;
  background: var(--fill);
  color: var(--label);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.letter-chip.on {
  background: var(--fill-accent);
  color: #fff;
}

.lib-toolbar .lib-count {
  flex: 1;
  margin: 0 16px;
}

.lib-search {
  flex: 1;
  min-width: 0;
  height: 2.25rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  font: inherit;
  font-size: max(16px, 1rem); /* ≥16px，避免 iPhone 聚焦时自动放大 */
  color: var(--label);
  outline: none;
}

.lib-search:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 50%, transparent);
}

/* 多选勾选框 */
.sel-box {
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 12px;
  border: 2px solid var(--label-3);
  border-radius: 50%;
  transition: background-color var(--dur-state) var(--ease-out), border-color var(--dur-state) var(--ease-out);
}

.sel-box.on {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

/* 多选时底部的操作栏：贴在面板底部 */
.select-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
  padding: 10px var(--gutter-r) calc(10px + var(--safe-bottom)) var(--gutter-l);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 -0.5px 0 var(--separator);
}

.select-count {
  flex: 1;
  font-size: 0.875rem;
  color: var(--label-2);
}

.select-bar .btn {
  flex: none;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
}

.select-bar .btn:disabled {
  opacity: 0.4;
}

/* 自建 / 已修改的小标签 */
.row-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--fill);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--label-2);
  vertical-align: 0.1em;
}

/* 单词包：文件夹样式的一行 */
.pack-row {
  gap: 12px;
}

/* 「我的单词包」列表：一行 = 进入包的按钮 + 右侧删除键（分隔线画在整行上） */
.pack-row-wrap {
  display: flex;
  align-items: stretch;
}

.pack-row-wrap + .pack-row-wrap {
  box-shadow: inset 0 0.5px 0 var(--separator);
}

.pack-row-wrap .pack-row {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.pack-row-wrap .row-word {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-del {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  border: 0;
  background: none;
  color: var(--red);
  transition: background-color var(--dur-card) var(--ease-out);
}

.pack-del:active {
  background: var(--fill);
  transition-duration: 0s;
}

.pack-del svg {
  width: 20px;
  height: 20px;
}

.folder-icon {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--blue);
}

/* 单词详情里的管理按钮 */
.detail-lib-actions {
  display: flex;
  gap: 8px;
}

.detail-lib-actions .btn {
  min-height: 2.75rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
}

.detail-lib-actions .btn-kill {
  flex: 1;
  width: auto;
  height: auto;
}

/* 编辑单词 / 导入预览的表单 */
.edit-form {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.edit-field {
  display: grid;
  gap: 6px;
}

.edit-label {
  margin: 0 4px;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.edit-hint {
  margin: 0 4px;
  font-size: 0.75rem;
  color: var(--label-3);
}

.edit-field input[type="text"],
.edit-field textarea,
.edit-field select {
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.45;
  color: var(--label);
  outline: none;
  resize: vertical;
}

.edit-field input:focus,
.edit-field textarea:focus,
.edit-field select:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 50%, transparent);
}

.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 0.875rem;
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.9375rem;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-box {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 6px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--label-2);
}

.stat-box b {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.stat-box.ok b {
  color: var(--green-text);
}

.stat-box.miss b {
  color: var(--pink-text);
}

.stat-box.dup b {
  color: var(--orange);
}

.import-detail {
  margin-bottom: 12px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--surface);
}

.import-detail summary {
  cursor: pointer;
  font-weight: 600;
}

.import-list {
  margin: 10px 0 0;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
}

.import-zh {
  margin-left: 8px;
  color: var(--label-3);
}

/* 确认框里的输入框（如单词包名称） */
.alert-input {
  display: block;
  width: calc(100% - 2rem);
  margin: 0 1rem 1rem;
  padding: 0.55rem 0.75rem;
  border: 0.5px solid var(--separator);
  border-radius: 8px;
  background: var(--bg);
  font: inherit;
  font-size: max(16px, 0.9375rem);
  color: var(--label);
  outline: none;
}

.alert-input[hidden] {
  display: none;
}

/* ---------- 复习时拼写 ---------- */
/* 拼写卡：正面隐藏单词，显示中文释义、输入框和按钮；底部操作按钮栏隐藏（按钮在卡片里） */
.card.spelling .front .word {
  display: none;
}

.card.spelling .badge::after {
  content: "拼写";
}

.card.spelling .badge {
  color: var(--orange);
}

.actions.spelling {
  display: none !important;
}

.spell {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  cursor: default;
}

.spell-meaning {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  line-height: 1.55;
  text-align: center;
  white-space: pre-line;
  color: var(--label);
}

.spell-input {
  width: 100%;
  height: 3.25rem;
  padding: 0 1rem;
  border: 2px solid var(--fill);
  border-radius: 0.875rem;
  background: var(--bg);
  font: inherit;
  font-size: max(16px, 1.375rem); /* ≥16px，避免 iPhone 聚焦时页面自动放大 */
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--label);
  outline: none;
  transition: border-color var(--dur-state) var(--ease-out), background-color var(--dur-state) var(--ease-out);
}

.spell-input:focus {
  border-color: var(--blue);
}

.spell-input.right {
  border-color: var(--green);
  color: var(--green-text);
}

.spell-input.wrong {
  border-color: var(--pink);
  color: var(--pink-text);
}

.spell-input:disabled {
  opacity: 1;
  -webkit-text-fill-color: currentColor;
}

.shake-x {
  animation: shake 260ms var(--ease-out);
}

.spell-hint {
  margin: -0.25rem 0 0;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--label-3);
}

.spell-result {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.9375rem;
  color: var(--label-2);
  animation: rise-in var(--dur-state) var(--ease-out);
}

.spell-result.is-right {
  color: var(--green-text);
  font-weight: 600;
}

.spell-mark {
  display: inline-block;
  animation: check-pop var(--dur-state) var(--ease-out);
}

@keyframes check-pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
}

.spell-typed {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--label);
}

.spell-wrong {
  color: var(--pink-text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.spell-answer {
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  color: var(--green-text);
}

.spell-actions {
  display: flex;
  gap: 8px;
  margin-top: 0.25rem;
}

.spell .spell-btn {
  flex: 1;
  min-height: 2.75rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
}

.spell .spell-btn[hidden] {
  display: none;
}

.spell .btn-kill {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.8125rem;
}

.btn-spell-next {
  background: var(--fill-accent);
  color: #fff;
}

/* ---------- 滑动模式 ---------- */
/* 禁止双指缩放页面（只允许滚动）；iPhone 上另由 app.js 拦截 gesture 事件 */
html.swipe-mode,
html.swipe-mode body {
  touch-action: pan-x pan-y;
}

/* 所有模式：页面背景不上下滑动——首页本来就是一屏，没有橡皮筋回弹、下拉刷新，
   卡片拖出屏幕时也不会撑出滚动条。卡片背面、设置、查词等自己的内容区照常滚动（见 app.js） */
html,
body {
  overflow: hidden;
  overscroll-behavior: none;
}

/* 学习区域（卡片、下方露出的卡、提示文字）独占触摸手势，浏览器不再把它当成页面滚动；
   iPhone 上另由 app.js 在这里阻止 touchmove */
.swipe-mode .stage {
  touch-action: none;
  overscroll-behavior: none;
}

/* 隐藏操作按钮（一轮结束时仍显示「开始下一轮」），卡片区域往下延伸 */
.swipe-mode .actions:not(.finished) {
  display: none;
}

.swipe-mode .stage {
  position: relative;
  padding-bottom: calc(var(--safe-bottom) + 12px);
}

/* 滑动模式不显示卡片下方的操作说明，卡片区域多出这一行的高度 */
.swipe-mode .hint:empty {
  display: none;
}

.swipe-mode .card {
  z-index: 1;
  touch-action: none; /* 正面：手势全部由应用处理（拖动卡片作答） */
  cursor: grab;
}

/* 翻到背面：不能拖动卡片，手指上下滑动只滚动释义内容 */
.swipe-mode .stage.back-open,
.swipe-mode .stage.back-open .card {
  touch-action: pan-y;
  cursor: auto;
}

.swipe-mode .card.empty {
  cursor: default;
}

.card.dragging {
  cursor: grabbing;
  transition: none;
}

/* 下方提前露出的下一张卡：只是一块底板 */
.card-peek {
  display: none;
  position: absolute;
  border-radius: var(--radius-card);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  opacity: 0.55;
  transform: translateY(12px) scale(0.94);
  transform-origin: 50% 100%;
  pointer-events: none;
}

.swipe-mode .card-peek:not([hidden]) {
  display: block;
}

/* 方向提示：卡片上方居中的小胶囊，随滑动进度逐渐显现 */
.swipe-labels {
  position: absolute;
  top: 1.25rem;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.swipe-label {
  position: absolute;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  opacity: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.sl-know {
  background: var(--fill-known);
}

.sl-unknown {
  background: var(--fill-unknown);
}

.sl-kill {
  background: var(--fill-kill);
}

/* 撤销入口：底部居中的深色胶囊 */
.undo-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 20px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: rgba(30, 30, 32, 0.92);
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
  animation: toast-in var(--dur-state) var(--ease-out);
}

.undo-bar > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.undo-btn {
  flex: none;
  min-height: 2rem;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #64b5ff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform var(--dur-release) var(--ease-out), opacity var(--dur-release) var(--ease-out);
}

.undo-btn:active {
  transform: scale(var(--press-scale));
  opacity: 0.8;
  transition-duration: var(--dur-press);
}

.undo-bar.closing {
  animation: undo-out 200ms var(--ease-in) forwards;
}

@keyframes undo-out {
  to {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* ---------- 统一的按压反馈 ----------
   按下：快速缩小到 --press-scale 并略微变淡；松开：用 ease-out 自然回到原样（没有弹跳）。
   所有可点的按钮共用这一套，不在各个按钮上单独写。 */
.btn,
.icon-btn,
.speak,
.text-btn,
.stepper button,
button.chip,
.history-open,
.history-del,
.cell-option .check {
  transition: transform var(--dur-release) var(--ease-out), opacity var(--dur-release) var(--ease-out),
    background-color var(--dur-state) var(--ease-out);
}

.btn:active,
.icon-btn:active,
.speak:active,
button.chip:active {
  transform: scale(var(--press-scale));
  opacity: 0.85;
  transition-duration: var(--dur-press);
}

/* 文字按钮、调节器的 −/+ 太小，不缩放，只变淡 */
.text-btn:active,
.stepper button:not(:disabled):active,
.history-open:active,
.history-del:active {
  opacity: 0.4;
  transition-duration: var(--dur-press);
}

.speak:active {
  transform: scale(0.9);
}

/* 底部大按钮的按下缩放稍小一点，显得更稳 */
.actions .btn:active {
  transform: scale(0.97);
}

/* iOS 开关：按住时滑块稍微拉长 */
.switch:active::after {
  width: 31px;
}

.switch:checked:active::after {
  transform: translateX(16px);
}

/* 单选列表的对勾：出现时从小到大轻轻弹出 */
.cell-option.checked .check {
  animation: check-in var(--dur-state) var(--ease-out);
}

@keyframes check-in {
  from {
    opacity: 0;
    transform: rotate(45deg) scale(0.5);
  }
}

/* 数字变化：新数字从下方轻移淡入 */
.num-tick {
  animation: num-tick 260ms var(--ease-out);
}

@keyframes num-tick {
  from {
    opacity: 0.2;
    transform: translateY(4px);
  }
}

/* 页面切换：前进时新页面从右侧 16px 处淡入，返回时从左侧，方向一致、幅度很小 */
.page-push {
  animation: page-push var(--dur-card) var(--ease-out);
}

.page-pop {
  animation: page-pop var(--dur-card) var(--ease-out);
}

@keyframes page-push {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes page-pop {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
}

/* 弹出层退出：面板向下滑走（大屏和提醒框是缩小淡出），遮罩保持暗色不淡出，
   等弹出层隐藏时才一下子消失。iPhone 的状态栏要等弹出层隐藏后才恢复原色，
   遮罩提前变亮的话，页面亮了状态栏还暗着，看起来就会闪一下 */
.sheet-backdrop.closing {
  pointer-events: none;
}

.sheet-backdrop.closing .sheet {
  animation: slide-down 200ms var(--ease-in) forwards;
}

.sheet-backdrop.closing .alert {
  animation: pop-out 160ms var(--ease-in) forwards;
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes slide-down {
  to {
    transform: translateY(40%);
    opacity: 0;
  }
}

@keyframes pop-out {
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* 轻提示：从下方轻移淡入 */
.toast {
  animation: toast-in var(--dur-state) var(--ease-out);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* 内容依次浮现：打开面板、进入子页面时，前几组内容间隔 35ms 从下方轻移淡入（Motion.stagger 设 --i） */
.rise-seq {
  animation: rise-seq 380ms var(--ease-out) calc(var(--i, 0) * 35ms + 60ms) both;
}

@keyframes rise-seq {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* 设置按钮：按下时齿轮转一下 */
#settings-btn svg {
  transition: transform 420ms var(--ease-out);
}

#settings-btn:active svg {
  transform: rotate(60deg);
  transition-duration: var(--dur-card);
}

/* 卡片下方的提示文字：轻轻呼吸，提醒可以点卡片 */
.hint:not(.recorded-known):not(.recorded-unknown):not(.hide) {
  animation: hint-breathe 2.6s var(--ease-in-out) 1.5s infinite alternate;
}

@keyframes hint-breathe {
  to {
    opacity: 0.45;
  }
}

/* 减少动态效果：关掉位移、缩放、抖动，只保留瞬时的状态变化 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .btn:active,
  .icon-btn:active,
  .speak:active,
  button.chip:active,
  .card:active:not(.empty) {
    transform: none;
  }
}

/* ---------- 右栏（只在两栏布局中显示） ---------- */
.side {
  display: none;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.side-card {
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.side-progress {
  flex: none;
  max-height: 45%;
  overflow-y: auto;
}

.side-detail {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.side-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-right: -0.75rem;
  padding-right: 0.75rem;
}

.side-detail-body p {
  margin: 0;
}

.side-detail-body > .sec:first-child {
  margin-top: 0;
}

.side-progress::-webkit-scrollbar,
.side-detail-body::-webkit-scrollbar {
  width: 12px;
}

.side-progress::-webkit-scrollbar-thumb,
.side-detail-body::-webkit-scrollbar-thumb {
  border: 4px solid transparent;
  border-radius: 999px;
  background: var(--label-3) padding-box;
}

.side-title {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.bar-big {
  height: 0.5rem;
  border-radius: 0.25rem;
}

.side-counts {
  margin: 0.625rem 0 0;
  font-size: 0.875rem;
  color: var(--label-2);
}

.side-counts b {
  color: var(--label);
}

.side-label {
  margin: 0.875rem 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--label-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--fill-2);
  font-size: 0.8125rem;
}

.chip em {
  margin-left: 0.25rem;
  font-style: normal;
  font-weight: 600;
  color: var(--pink-text);
}

/* 听音认词（2026-11-18）：正面藏起单词、词性和小喇叭，中间一个大的播放按钮 */
.card.listening .front .word,
.card.listening .front .pos-tag,
.card.listening #speak-front {
  display: none;
}

.listen-play {
  width: 6rem;
  height: 6rem;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  cursor: pointer;
  transition: transform var(--dur-release) var(--ease-out);
}

.listen-play:active {
  transform: scale(0.92);
  transition-duration: var(--dur-press);
}

.listen-play[hidden] {
  display: none;
}

.listen-play svg {
  width: 45%;
  height: 45%;
}

/* 印尼语卡的词缀拆分：构词 meN- + [jelas] + -kan，词根是可点的小圆角按钮 */
.id-morph {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--label-2);
}

.id-morph-label {
  margin-right: 0.5rem;
  font-size: 0.75rem;
  color: var(--label-3);
}

.id-morph .chip {
  margin: 0 0.125rem;
}

/* 同根词：词后面的词性小一号、淡一点；词库里没有的词不能点，灰色 */
.fam-pos {
  margin-left: 0.125rem;
  font-size: 0.6875rem;
  font-style: italic;
  color: var(--label-2);
}

.fam-none {
  color: var(--label-2);
}

.chip-killed {
  color: var(--label-3);
  text-decoration: line-through;
}

.side-placeholder {
  margin: 2.5rem 0;
  text-align: center;
  color: var(--label-3);
}

/* =====================================================================
   自适应布局（同一套页面结构，只靠 CSS 切换，旋转时状态不变）
   ① 手机竖屏 / ③ 平板竖屏：上面的默认单列布局（平板上按 rem 等比放大、铺满屏宽）
   ② 手机横屏：高度 ≤ 500px 的横屏
   ④ 平板横屏 / 大屏：宽度 ≥ 900px、高度 > 500px 的横屏
   ===================================================================== */

/* ② 手机横屏（iPhone、安卓手机）：左边卡片；右边一列从上到下是标题和本轮进度、单词详情、按钮，整页不滚动 */
@media (orientation: landscape) and (max-height: 500px) {
  .app {
    display: grid;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "stage top"
      "stage side"
      "stage actions";
    column-gap: 1rem;
    row-gap: 0.625rem;
    /* 刘海 / 灵动岛横屏时在左边或右边，底部仍有横条 */
    padding: calc(var(--safe-top) + 0.75rem) calc(var(--safe-right) + 1rem) calc(var(--safe-bottom) + 0.75rem) calc(var(--safe-left) + 1rem);
  }

  .topbar {
    grid-area: top;
    padding: 0;
  }

  .title-row {
    min-height: 2.25rem;
  }

  h1,
  h1.greeting {
    font-size: 1.375rem;
  }

  h1.greeting.greeting-sm {
    font-size: 1.125rem;
  }

  .segmented {
    margin-top: 0.5rem;
  }

  .segmented > button {
    min-height: 1.75rem;
    font-size: 0.75rem;
  }

  .stats {
    margin-top: 0.75rem;
  }

  .stage {
    grid-area: stage;
    padding: 0;
  }

  .card {
    min-height: 0;
    max-height: none;
  }

  .face {
    padding: 1.25rem 1.5rem;
  }

  .front {
    gap: 1rem;
  }

  /* 卡片只占约三分之一屏宽，单词字号按卡片自身宽度（cqi）算，长单词也尽量不折行 */
  .card {
    container-type: inline-size;
  }

  .word {
    font-size: clamp(2rem, 9vh, 2.75rem);
    font-size: clamp(1.375rem, min(9vh, 12cqi), 2.75rem);
  }

  .card .word.small {
    font-size: min(1.75rem, 10cqi);
  }

  .badge {
    top: 0.875rem;
    left: 1.125rem;
  }

  .hint {
    display: none;
  }

  /* 例句和短语移到右边的单词详情栏，卡片上只留释义 */
  .card .extra {
    display: none;
  }

  /* 单词详情栏：本轮进度在它上方的标题区已经有了，这里只放详情 */
  .side {
    display: flex;
    grid-area: side;
  }

  .side-detail {
    box-shadow: none;
  }

  .side-progress {
    display: none;
  }

  .side-detail {
    padding: 1rem 1.125rem;
  }

  .side-title {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
  }

  .side-placeholder {
    margin: 1.5rem 0;
  }

  /* 按钮排成一行：Kill、不认识、认识（认识在最右，右手拇指最好按），给上面的单词详情留出高度 */
  .actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-content: end;
    gap: 0.625rem;
    padding: 0;
  }

  .actions {
    --btn-h: 2.75rem;
  }

  .btn-next,
  .btn-round {
    grid-column: 1 / -1;
  }

  .toast {
    bottom: calc(var(--safe-bottom) + 1.5rem);
  }
}

/* ④ 平板横屏 / 电脑大屏：左栏卡片和按钮，右栏本轮进度和单词详情 */
@media (orientation: landscape) and (min-width: 900px) and (min-height: 501px) {
  .app {
    display: grid;
    max-width: 90rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "top side"
      "stage side"
      "actions side";
    column-gap: clamp(1.5rem, 3vw, 3rem);
    padding: 0 var(--gutter-r) 0 var(--gutter-l);
  }

  .topbar {
    grid-area: top;
    padding: calc(var(--safe-top) + 1.25rem) 0 0;
  }

  .stage {
    grid-area: stage;
    padding: 1.25rem 0 0;
  }

  .card {
    max-height: none;
  }

  /* 例句和短语移到右栏，卡片上只留释义 */
  .card .extra {
    display: none;
  }

  .actions {
    grid-area: actions;
    padding: 1rem 0 calc(var(--safe-bottom) + 1.5rem);
  }

  .side {
    display: flex;
    grid-area: side;
    padding: calc(var(--safe-top) + 1.25rem) 0 calc(var(--safe-bottom) + 1.5rem);
  }

  .toast {
    left: 35%;
  }
}

/* 大屏上设置和查词改为居中浮层，不再从底部弹出 */
@media (min-width: 900px) and (min-height: 501px) {
  .sheet-backdrop {
    align-items: center;
  }

  .sheet {
    max-width: 34rem;
    max-height: 85vh;
    border-radius: 1rem;
    animation: pop-in var(--dur-card) var(--ease-out);
  }

  .sheet-backdrop.closing .sheet {
    animation: pop-out 180ms var(--ease-in) forwards;
  }

  /* 浮层高度随内容，短词条不会出现大片空白 */
  #detail .sheet {
    height: auto;
  }

  .sheet > .grabber {
    display: none;
  }

  .sheet > .sheet-nav {
    margin-top: 0.5rem;
  }

  .sheet-scroll {
    padding-bottom: 1.5rem;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* iPhone / iPad：英文单词、释义和例句可以长按选中，在系统菜单里点「查询」使用苹果词典。
   卡片本身仍禁止选中（避免点按翻面时误选），只对这些文字放开 */
html.apple-touch .word,
html.apple-touch .ex-en,
html.apple-touch .sense-en,
html.apple-touch .def-en,
html.apple-touch .ph-head,
html.apple-touch .row-word {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.lookup-tip {
  display: none;
  margin: 0 var(--gutter-r) 0.75rem var(--gutter-l);
  font-size: 0.8125rem;
  color: var(--label-2);
}

html.apple-touch .lookup-tip {
  display: block;
}

/* ---------- 确认对话框（iOS 风格提醒框） ---------- */
.confirm-backdrop {
  z-index: 40;
  align-items: center;
}

.alert {
  width: min(18rem, calc(100vw - 3rem));
  overflow: hidden;
  border-radius: 0.875rem;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  animation: pop-in 0.2s var(--ease);
}

.alert-title {
  margin: 1.25rem 1rem 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.alert-text {
  margin: 0 1rem 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--label-2);
}

.alert-actions {
  display: flex;
  border-top: 0.5px solid var(--separator);
}

.alert-actions button {
  flex: 1;
  min-height: 2.75rem;
  border: 0;
  background: none;
  font-size: 1.0625rem;
  color: var(--blue);
}

.alert-actions button + button {
  border-left: 0.5px solid var(--separator);
  font-weight: 600;
}

.alert-actions button.danger {
  color: var(--red);
}

.alert-actions button:active {
  background: var(--fill);
}

/* ---------- 查词 ---------- */
.title-actions {
  display: flex;
  gap: 0.625rem;
}

#search .sheet {
  height: calc(100dvh - var(--safe-top) - 40px);
}

/* 查词面板打开时不滑动（也不缩放），只淡入（只改透明度，不移动位置）：
   搜索框在打开的同一刻聚焦（iPhone 必须在点按当下聚焦才会弹出键盘），
   如果面板这时还在从屏幕下方滑上来，iOS 会按动画途中的位置去滚动、摆放光标，光标竖杠就会跳几下。
   关闭时（.closing）仍沿用原来的退出动画 */
#search:not(.closing) .sheet {
  animation: fade-in 0.25s;
}

.search-form {
  position: relative;
  flex: none;
  margin: 0 var(--gutter-r) 0.75rem var(--gutter-l);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  color: var(--label-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-form input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem 0 2.25rem;
  border: 0;
  border-radius: 0.625rem;
  background: var(--fill);
  font: inherit;
  font-size: 1.0625rem; /* ≥16px，避免 iPhone 聚焦时页面放大 */
  color: var(--label);
  -webkit-appearance: none;
  appearance: none;
}

.search-form input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
}

.search-status {
  flex: none;
  margin: -0.25rem var(--gutter-r) 0.75rem var(--gutter-l);
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  background: color-mix(in srgb, var(--pink) 12%, transparent);
  font-size: 0.8125rem;
  color: var(--pink-text);
}

.search-message {
  margin: 2rem 0;
  text-align: center;
  color: var(--label-2);
}

.tags {
  display: flex;
  gap: 0.375rem;
  margin: 0.375rem 0 0;
}

.tag {
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-local {
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: var(--green-text);
}

.tag-online {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
}

.mt-note {
  margin-top: 0.125rem !important;
  font-size: 0.75rem;
  color: var(--label-3);
}

.sense.muted {
  color: var(--label-3);
  font-weight: 400;
}

.def-en {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--label);
}

.defs .ex-en {
  margin-top: 0.25rem !important;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--label-2);
}

button.chip {
  border: 0;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--blue);
  cursor: pointer;
}


.search-actions {
  margin: 1rem 0 1.5rem;
}

.btn-mine {
  background: var(--fill-accent);
  color: #fff;
}

.btn-mine.in-mine {
  background: color-mix(in srgb, var(--green) 16%, var(--surface));
  color: var(--green-text);
}

.btn-mine:disabled {
  background: var(--fill);
  color: var(--label-3);
  font-weight: 500;
  font-size: 0.875rem;
}

.history-row {
  padding: 0;
}

.history-open {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 3.25rem;
  padding: 0.375rem 0 0.375rem 1rem;
  border: 0;
  background: none;
  text-align: left;
}

.history-open .row-zh {
  max-width: 100%;
}

.history-del {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  font-size: 1.25rem;
  color: var(--label-3);
}


/* 隐藏 Netlify 注入到页面右下角的推广浮窗，避免挡住底部按钮 */
#nl-badge-frame,
#nl-hud-frame {
  display: none !important;
}

/* ---------- 牛津高阶第9版（卡片背面 / 单词详情） ----------
   词条用词典原始数据（不改内容），这里只用 App 自己的字体、颜色、圆角和间距重新排版，
   不再引用词典自带的网页样式。所有颜色用 App 的变量，浅色/深色主题自动跟随。 */
.oald-wrap:empty { display: none; }


/* 词条区域（默认直接展开） */
.oald-box { margin: 4px 0 12px; }
.oald-box > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; border-radius: 14px; background: var(--fill-2);
  cursor: pointer; list-style: none; color: var(--blue); font-size: 0.9375rem; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.oald-box > summary::-webkit-details-marker { display: none; }
.oald-box > summary::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform 0.2s var(--ease); margin-right: 4px; }
.oald-box[open] > summary::before { transform: rotate(45deg); }
.oald-box[open] > summary { margin-bottom: 14px; }
.oald-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); font-size: 0.875rem; line-height: 1.5; color: var(--label-2); }
.oald-retry { margin-left: 8px; padding: 2px 12px; border: 0; border-radius: 999px; background: var(--fill); color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* 基础：继承 App 字体，去掉词典的斜体、链接色、背景 */
.oald { font-size: 0.9375rem; line-height: 1.5; color: var(--label); overflow-wrap: anywhere; }
.oald * { font-style: normal; background: none; }
.oald a, .oald xhtml\:a { color: inherit; text-decoration: none; }
.oald p { margin: 0; }
.oald b, .oald strong { font-weight: 600; }

/* 不需要的词典标记：🔑、项目符号、繁体标记、词性跳转、栏目小图标、变形读音表；
   单词卡不要图片（2026-11-07），词条里的插图已删除，img / ill-g / .pic 再隐藏一次作保险 */
.oald .cixing_tiaozhuan, .oald hkey, .oald symbol, .oald xsymb, .oald sdsymb, .oald fthzmark, .oald fthzindex,
.oald ftindex, .oald chnsep, .oald topic, .oald cset, .oald res-g, .oald drtri, .oald arrow, .oald img,
.oald ill-g, .oald .pic, .oald vp-gs, .oald audio, .oald top-g xhtml\:br, .oald idm-gs-blk > xhtml\:a,
.oald pv-gs-blk > xhtml\:a { display: none !important; }

/* 同形词、词性分组：组与组之间留白 + 细分隔线 */
.oald h-g, .oald .cixing_part { display: block; }
.oald h-g + h-g, .oald .cixing_part + .cixing_part { margin-top: 22px; padding-top: 18px; border-top: 0.5px solid var(--separator); }
.oald subentry-g { display: block; }
.oald subentry-g + subentry-g { margin-top: 20px; padding-top: 16px; border-top: 0.5px solid var(--separator); }

/* 词头：单词 + 英/美音标 + 发音按钮 */
.oald top-g { display: block; }
.oald h { display: block; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--label); }
.oald hm { font-size: 0.75rem; vertical-align: super; color: var(--label-2); }
.oald infl { display: none; }
.oald pron-gs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.oald pron-g-blk { display: inline-flex; align-items: center; gap: 6px; }
.oald pron-g-blk xhtml\:br { display: none; }
/* 变体拼写（如 also toward）：一行灰色小字，不再重复列音标 */
.oald v-gs-blk { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--label-2); }
.oald v-gs-blk pron-gs, .oald v-gs-blk .oald-speak { display: none !important; }
.oald v-gs-blk label-g { margin: 0 0 0 4px; }
.oald brelabel, .oald namelabel {
  display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--fill);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; color: var(--label-2);
}
.oald phon-blk { font-size: 1rem; color: var(--label-2); font-family: "SF Pro Text", "Lucida Sans Unicode", "Segoe UI", -apple-system, sans-serif; }
.oald .oald-speak {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: var(--fill-2); color: var(--blue); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.oald .oald-speak:active { background: var(--fill); }

/* 词性：沿用卡片上的词性样式（蓝色）做成小标签 */
.oald pos-g { display: block; margin: 10px 0 4px; }
.oald pos {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 0.8125rem; font-weight: 600; color: var(--blue);
}
.oald pos xhtml\:a { display: inline; }

/* 义项组标题（如 for trains/buses）：和 App 的小节标题一致 */
.oald shcut-blk { display: block; margin: 18px 0 8px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; color: var(--label-2); }
.oald shcut chn { margin-left: 6px; }

/* 义项：编号圆点 + 中文释义为主、英文释义为辅 */
.oald sn-blk, .oald sn-blk-nolist, .oald licontent { display: block; }
/* 词典给每个义项单独套了一层列表，编号按整个词性组（sn-gs）连续计数 */
.oald sn-gs { display: block; counter-reset: oald-sn; }
.oald xhtml\:ol { display: block; margin: 0; padding: 0; list-style: none; }
.oald xhtml\:li { display: block; position: relative; padding-left: 30px; counter-increment: oald-sn; }
.oald xhtml\:li + xhtml\:li { margin-top: 18px; }
.oald xhtml\:li::before {
  content: counter(oald-sn); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--fill);
  font-size: 0.75rem; font-weight: 600; line-height: 20px; text-align: center; color: var(--label-2);
}
.oald sn-g { display: block; }
.oald sn-blk-nolist + sn-blk-nolist, .oald sn-blk + sn-blk { margin-top: 18px; }
.oald def { display: block; margin-top: 2px; font-size: 0.9375rem; line-height: 1.45; color: var(--label-2); }
.oald def > chn { display: block; margin-top: 2px; font-size: 1.0625rem; font-weight: 600; line-height: 1.45; color: var(--label); }

/* 语法、语域、地区等标签：小灰标签 */
.oald gram-g, .oald label-g, .oald boxtag, .oald hawl, .oald use {
  display: inline-block; margin: 0 4px 4px 0; padding: 1px 7px; border-radius: 6px; background: var(--fill-2);
  font-size: 0.75rem; font-weight: 500; line-height: 1.5; color: var(--label-2); border: 0;
}
.oald label-g brelabel, .oald label-g namelabel { padding: 0; background: none; font-size: inherit; }
.oald q { color: var(--label-2); }

/* 常见搭配句型（如 ~ (of sth)）：和 App 短语标题一致 */
.oald cf-blk { display: block; margin-top: 8px; font-size: 0.9375rem; font-weight: 700; color: var(--blue); }

/* 例句：左侧细线区隔，英文在上、中文在下 */
.oald x-gs { display: block; margin-top: 8px; }
.oald x-g-blk { display: block; margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--separator); }
.oald x { display: block; font-size: 0.9375rem; line-height: 1.5; color: var(--label); }
.oald x chn { display: block; margin-top: 2px; font-size: 0.875rem; color: var(--label-2); }
.oald cl { font-weight: 600; }
.oald x-g-blk label-g-blk { display: inline; }

/* 同义、参见等交叉引用 */
.oald xr-gs { display: block; margin-top: 8px; font-size: 0.8125rem; color: var(--label-2); }
.oald xrlabel { margin-right: 4px; font-weight: 600; }
.oald xh { color: var(--blue); font-weight: 500; }

/* 习语、短语动词、派生词：和 App 的「固定搭配」小卡片一致 */
.oald idm-gs-blk, .oald pv-gs-blk, .oald dr-gs { display: block; margin-top: 24px; }
.oald idm-gs-blk::before, .oald pv-gs-blk::before, .oald dr-gs::before {
  display: block; margin-bottom: 10px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; color: var(--label-2);
}
.oald idm-gs-blk::before { content: "习语"; }
.oald pv-gs-blk::before { content: "短语动词"; }
.oald dr-gs::before { content: "派生词"; }
.oald idm-g, .oald pv-g, .oald dr-g { display: block; padding: 12px 14px; border-radius: 14px; background: var(--fill-2); }
.oald idm-g + idm-g, .oald pv-g-blk + pv-g-blk, .oald pv-g + pv-g, .oald dr-g-blk + dr-g-blk { margin-top: 10px; }
.oald idm-g-blk, .oald pv-g-blk, .oald dr-g-blk { display: block; }
.oald idm, .oald pv, .oald dr { display: block; font-size: 1rem; font-weight: 700; color: var(--blue); }
.oald idm-g xhtml\:li, .oald pv-g xhtml\:li { padding-left: 26px; }
.oald dr-g pron-gs { margin-top: 4px; }

/* 用法说明、词汇扩展等方框：和 App 的提示框一致 */
.oald unbox, .oald un {
  display: block; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2);
  font-size: 0.875rem; line-height: 1.5; color: var(--label-2);
}
.oald oald-title, .oald unbox titled, .oald unbox h2, .oald unbox h3 { display: block; margin: 0 0 6px; font-size: 0.875rem; font-weight: 700; color: var(--label); }
.oald unbox x-g-blk, .oald un x-g-blk { border-left-color: var(--fill); }
.oald unbox ul, .oald unbox xhtml\:ul { margin: 4px 0; padding-left: 18px; }
.oald unbox inlinelist und, .oald und { font-weight: 600; color: var(--label); }

/* 偶见的表格：窄屏可横向滚动，不撑破卡片 */
.oald xhtml\:table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.8125rem; }
.oald xhtml\:td, .oald xhtml\:th { padding: 4px 8px; border-bottom: 0.5px solid var(--separator); }

/* ---------- 英/美音标按钮（卡片背面、单词详情、查词） ---------- */
.ipa:has(.ipa-btn) { display: flex; flex-wrap: wrap; gap: 6px 8px; width: auto; cursor: default; }
.ipa .ipa-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0; padding: 3px 10px 3px 4px; border: 0; border-radius: 999px;
  background: var(--fill-2); color: var(--label-2); font: inherit; line-height: 1.4;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-release, 160ms);
}
.ipa .ipa-btn:active { background: var(--fill); transition-duration: var(--dur-press, 90ms); }
.ipa-tag {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--fill-accent); color: #fff; font-size: 0.6875rem; font-weight: 600;
}
.ipa-btn[data-lang="en-US"] .ipa-tag { background: var(--fill-warm); }
.ipa-ico { flex: none; color: var(--blue); }
.ipa-btn[data-lang="en-US"] .ipa-ico { color: var(--orange); }
/* 单词右边的单词包标签（如「雅思」）：这个词被哪些单词包收录。
   放在背面单词那一行的右端（U-002）：标题区撑满到朗读按钮前，长单词在左侧换行，标签不换行、过长省略 */
.back-title { flex: 1 1 auto; }
#back-word:has(.pack-tags) { display: flex; align-items: baseline; gap: 10px; }
#back-word .word-text { flex: 1 1 auto; min-width: 0; }
.pack-tags {
  flex: 0 1 auto; min-width: 0; max-width: 50%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px;
  font-size: 1rem; letter-spacing: normal;
}
.pack-tag {
  flex: 0 1 auto; min-width: 0; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue);
  font-size: 0.75rem; font-weight: 600; line-height: 1.5;
}
/* 播放中的喇叭：两道声波由内向外依次亮起，喇叭本体轻轻一跳（app.js 的 markPlaying） */
.is-playing svg { animation: spk-pop 0.9s var(--ease-out, ease-out) infinite; transform-origin: 30% 50%; }
.is-playing .spk-w1, .is-playing .spk-w2 { animation: spk-wave 0.9s linear infinite; }
.is-playing .spk-w2 { animation-delay: 0.18s; }
@keyframes spk-wave { 0%, 100% { opacity: 0.2; } 35% { opacity: 1; } }
@keyframes spk-pop { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .is-playing svg { animation: none; }
  .is-playing .spk-w1, .is-playing .spk-w2 { animation-duration: 1.6s; }
}
/* 卡片背面：已有英/美音标按钮时隐藏右上角朗读按钮 */
.speak.is-redundant { display: none !important; }

/* =====================================================================
   磨砂玻璃（iOS 质感）
   做法：半透明底色 + backdrop-filter 模糊后面的内容 + 一圈细亮边 + 顶部一线高光。
   颜色全部来自文件开头的 --glass-* 变量，浅色 / 深色 / 护眼三套主题自动跟随。
   只给浮在内容之上的少数几层加模糊（面板、提醒框、提示条、圆形按钮、右栏卡片），
   面板里的列表分组只用半透明底色、不再单独模糊，长列表滚动不掉帧；
   单词卡要做 3D 翻转，也不加模糊，用半透明渐变表现通透感。
   ===================================================================== */
body {
  background: var(--bg-art), var(--bg);
}

.app {
  background: transparent;
}

/* 模糊层共用 */
.icon-btn,
.sheet,
.alert,
.side-card,
.btn-unknown,
.btn-undo,
.toast,
.undo-bar,
.select-bar {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* 导航栏的圆形按钮 */
.icon-btn {
  border: 0.5px solid var(--glass-border);
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 14px -8px rgba(0, 0, 0, 0.25);
}

/* 首页右上角的查词 / 设置：只留线条图标，不要圆形底、描边、阴影和模糊 */
#search-btn,
#settings-btn {
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* 分段控件：凹下去的槽 + 浮起来的玻璃滑块 */
.segmented {
  box-shadow: inset 0 0.5px 1.5px rgba(0, 0, 0, 0.1);
}

.seg-thumb {
  border: 0.5px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.05);
}

.seg-sm > button {
  padding: 0 10px;
}

/* 进度条的槽 */
.bar {
  box-shadow: inset 0 0.5px 1px rgba(0, 0, 0, 0.08);
}

/* 弹出面板：整块磨砂，透出后面的首页 */
.sheet-backdrop {
  background: var(--scrim);
}

.sheet {
  border-top: 0.5px solid var(--glass-border);
  background: var(--sheet-bg);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16);
}

/* 面板里的分组、表单块：半透明玻璃片 */
.group,
.detail-card,
.radio-line,
.stat-box,
.import-detail,
.edit-field input[type="text"],
.edit-field textarea,
.edit-field select {
  background: var(--group-bg);
  box-shadow: inset 0 0 0 0.5px var(--glass-border);
}

.edit-field input:focus,
.edit-field textarea:focus,
.edit-field select:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 50%, transparent);
}

.stepper-input {
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 0.5px var(--glass-border), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* 提醒框 */
.alert {
  border: 0.5px solid var(--glass-border);
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 18px 50px rgba(0, 0, 0, 0.28);
}

.alert-input {
  background: var(--glass);
}

/* 轻提示、撤销条：深色磨砂胶囊 */
.toast,
.undo-bar {
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  background: var(--toast-bg);
}

/* 右栏卡片（平板横屏 / 大屏） */
.side-card {
  border: 0.5px solid var(--glass-border);
  background: var(--glass);
}

/* 滑动模式下方已经露出下一张卡，不再画那两层纸边 */
.swipe-mode .face {
  box-shadow: var(--card-edge), var(--card-drop);
}

/* 按钮：实色按钮加上下棱边和同色投影，显得鼓起来；浅色按钮做成玻璃 */
.btn {
  box-shadow: var(--btn-hi), 0 8px 16px -8px var(--btn-glow, rgba(0, 0, 0, 0.3));
}

.btn-kill {
  --btn-glow: color-mix(in srgb, var(--fill-kill) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--fill-kill) 90%, #fff), var(--fill-kill));
}

.btn-known {
  --btn-glow: color-mix(in srgb, var(--fill-known) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--fill-known) 90%, #fff), var(--fill-known));
}

.btn-next,
.btn-round,
.btn-wide,
.btn-mine,
.btn-spell-next {
  --btn-glow: color-mix(in srgb, var(--fill-accent) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--fill-accent) 90%, #fff), var(--fill-accent));
}

.btn-unknown {
  --btn-glow: color-mix(in srgb, var(--pink) 45%, transparent);
  border: 0.5px solid var(--glass-border);
  background: color-mix(in srgb, var(--pink) 16%, var(--glass-strong));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 16px -10px var(--btn-glow);
}

.btn-undo {
  --btn-glow: color-mix(in srgb, var(--blue) 45%, transparent);
  border: 0.5px solid var(--glass-border);
  background: color-mix(in srgb, var(--blue) 12%, var(--glass-strong));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 16px -10px var(--btn-glow);
}

.btn-mine.in-mine {
  --btn-glow: transparent;
  background: color-mix(in srgb, var(--green) 16%, var(--glass-strong));
}

.btn-mine:disabled {
  --btn-glow: transparent;
  background: var(--fill);
}

/* 朗读按钮、开关的滑块也带一点高光 */
.speak {
  box-shadow: inset 0 1px 0 var(--glass-hi);
}

.switch {
  box-shadow: inset 0 0.5px 1.5px rgba(0, 0, 0, 0.12);
}

.switch::after {
  transition: transform 320ms var(--ease-spring), width var(--dur-state) var(--ease-out);
}

/* 不支持背景模糊的旧浏览器：底色调得更实，保证文字清楚 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass: color-mix(in srgb, var(--surface) 92%, transparent);
    --glass-strong: var(--surface);
    --sheet-bg: var(--bg);
    --group-bg: var(--surface);
    --toast-bg: rgba(30, 30, 32, 0.94);
  }
}

/* 英文界面（js/i18n.js 设置 html lang="en"）：卡片角标和牛津分区标题换成英文；长标签在窄屏上可换行 */
html[lang="en"] .badge::after { content: "Review"; }
html[lang="en"] .card[data-status="new"] .badge::after { content: "New"; }
html[lang="en"] .card[data-status="again"] .badge::after { content: "Again"; }
html[lang="en"] .card.spelling .badge::after { content: "Spell"; }
html[lang="en"] .oald idm-gs-blk::before { content: "Idioms"; }
html[lang="en"] .oald pv-gs-blk::before { content: "Phrasal verbs"; }
html[lang="en"] .oald dr-gs::before { content: "Derived words"; }
html[lang="en"] .cell-value, html[lang="en"] .alert-title { overflow-wrap: anywhere; }
/* ---------- 学习统计 / 难词本（U-015） ---------- */
/* 主页顶部的进度数字可以点，打开学习统计 */
.stats[role="button"] {
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--dur-release) var(--ease-out);
}
.stats[role="button"]:active {
  opacity: 0.55;
  transition-duration: var(--dur-press);
}
.stats[role="button"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--group-bg);
  box-shadow: inset 0 0 0 0.5px var(--glass-border);
}
.stat-tile b {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}
.stat-tile span {
  font-size: 0.8125rem;
  color: var(--label-2);
}
.stat-tile:first-child b {
  color: var(--orange);
}

.stat-card {
  padding: 14px 16px;
}

/* 热力图：每列一周，周一在上 */
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
}
.heatmap i,
.heat-legend i {
  display: block;
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--fill);
}
.heatmap .hm-1, .heat-legend .hm-1 { background: color-mix(in srgb, var(--green) 30%, var(--fill)); }
.heatmap .hm-2, .heat-legend .hm-2 { background: color-mix(in srgb, var(--green) 55%, var(--fill)); }
.heatmap .hm-3, .heat-legend .hm-3 { background: color-mix(in srgb, var(--green) 80%, var(--fill)); }
.heatmap .hm-4, .heat-legend .hm-4 { background: var(--fill-known); }
.heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 10px;
  font-size: 0.6875rem;
  color: var(--label-2);
}
.heat-legend i {
  width: 10px;
}
.heat-legend span {
  margin: 0 4px;
}

/* 未来 7 天复习量：柱状图，今天（含已过期）用橙色 */
.forecast {
  display: flex;
  align-items: stretch;
  gap: 8px;
  height: 9rem;
}
.fc-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fc-col b {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
.fc-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.fc-track i {
  display: block;
  width: 100%;
  max-width: 28px;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: var(--blue);
}
.fc-col:first-child .fc-track i {
  background: var(--orange);
}
.fc-col span {
  font-size: 0.6875rem;
  color: var(--label-2);
  white-space: nowrap;
}

/* =====================================================================
   界面方案 A「经典磨砂」（2026-11-18，用户在对比页 chat-notes/ui-options.html 里选的 A + 字体②）
   在上面「磨砂玻璃」的基础上：背景的彩色柔光更明显（玻璃后面要有颜色才看得出通透），
   玻璃和面板分组更透、边缘一圈更亮的细白线，单词卡也略微透出背景的颜色。
   只改变量，不动结构；护眼模式保持原样（它的配色按对比度核算过）。
   ===================================================================== */
:root:not([data-theme="dark"]):not([data-theme="eye"]) {
  --bg: #eef1f7;
  --bg-art: radial-gradient(36rem 26rem at 0% 26%, rgba(120, 160, 255, 0.26), transparent 70%),
    radial-gradient(34rem 26rem at 104% 42%, rgba(255, 140, 190, 0.22), transparent 70%),
    radial-gradient(40rem 28rem at 8% 104%, rgba(100, 215, 165, 0.24), transparent 70%),
    radial-gradient(30rem 24rem at 96% 108%, rgba(170, 125, 255, 0.2), transparent 70%);
  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-blur: saturate(190%) blur(26px);
  --group-bg: rgba(255, 255, 255, 0.6);
  --sheet-bg: rgba(242, 244, 250, 0.66);
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 55%, rgba(248, 249, 255, 0.74) 100%);
  --card-edge: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1.5px 0 rgba(20, 30, 60, 0.06), 0 0 0 0.5px rgba(255, 255, 255, 0.8);
}

:root[data-theme="dark"] {
  --bg: #06070b;
  --bg-art: radial-gradient(36rem 26rem at 0% 26%, rgba(40, 90, 220, 0.34), transparent 70%),
    radial-gradient(34rem 26rem at 104% 42%, rgba(190, 60, 140, 0.26), transparent 70%),
    radial-gradient(40rem 28rem at 8% 104%, rgba(30, 160, 110, 0.22), transparent 70%),
    radial-gradient(30rem 24rem at 96% 108%, rgba(120, 80, 230, 0.24), transparent 70%);
  --glass: rgba(58, 58, 66, 0.42);
  --glass-strong: rgba(44, 44, 52, 0.66);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-hi: rgba(255, 255, 255, 0.2);
  --glass-blur: saturate(190%) blur(26px);
  --group-bg: rgba(58, 58, 66, 0.48);
  --sheet-bg: rgba(22, 22, 26, 0.62);
  --card-bg: linear-gradient(160deg, rgba(62, 62, 70, 0.86) 0%, rgba(40, 40, 46, 0.82) 55%, rgba(28, 28, 32, 0.82) 100%);
  --card-edge: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1.5px 0 rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.1);
}

/* 背景的柔光固定在屏幕上，不跟着长页面滚走（iOS Safari 不支持 fixed 时就跟着滚，没有影响）。
   顶部衔接（2026-11-18 用户反馈「背景最上边和 iPhone 状态栏衔接不畅」）：
   状态栏的颜色取 theme-color（= 各主题的 --bg，见 index.html 和 app.js 的 applyTheme），而背景左上角原本有一团蓝色柔光，
   和纯色状态栏之间出现一条接缝。最上面加一层：状态栏高度内是纯 --bg，往下 6rem 渐渐透明，柔光从这里才开始显出来 */
body {
  background: linear-gradient(to bottom, var(--bg) 0, var(--bg) var(--safe-top), transparent calc(var(--safe-top) + 6rem)),
    var(--bg-art), var(--bg);
  background-attachment: fixed;
}

/* ---------- 设置页紧凑一点（2026-11-18 用户要求「设置中的按钮紧凑一点点」） ----------
   行高 48 → 42，分组间距 24 → 18，字号略小；只改设置面板，其他面板（查词、单词详情）不变 */
#settings .cell {
  min-height: 42px;
  font-size: 1rem;
}

#settings .cell-control {
  padding-top: 4px;
  padding-bottom: 4px;
}

#settings .group {
  margin-bottom: 18px;
}

#settings .group-footer {
  margin: -12px 16px 18px;
}

#settings .group-header {
  margin-bottom: 5px;
}

#settings .seg-sm > button {
  min-height: 26px;
  padding: 0 10px;
}

#settings .cell-option {
  min-height: 46px;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ---------- 设置面板下拉收起（2026-11-18） ----------
   内容在最顶上时手指往下拉，面板跟着手指走，松手超过一段距离或甩得够快就收起，否则弹回（app.js 的 sheetPullToClose） */
.sheet.pulling {
  animation: none;
  transition: none;
}

.sheet.pull-back {
  transition: transform 260ms var(--ease-out);
}

/* 要压过 .sheet-backdrop.closing .sheet 的退出动画（收起时面板从手指位置继续往下走，而不是跳回去再播一遍） */
.sheet-backdrop .sheet.pull-away {
  animation: none;
  transition: transform 220ms var(--ease-in);
}

/* 闪屏修复（2026-11-19）
   - 右栏单词详情换内容时轻轻淡入（app.js renderSide 加 .side-swap），不是一下跳变
   - 电脑上（鼠标）：弹出面板背后的遮罩淡入、淡出。以前关面板时遮罩一直全暗，200ms 后突然消失，看起来闪一下。
     手机上不改：iPhone 按网页最上缘的固定层给状态栏上色，遮罩慢慢变暗反而会让状态栏和页面一快一慢（见 .sheet-backdrop 的说明） */
#side-detail.side-swap {
  animation: fade-in 220ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .sheet-backdrop {
    animation: scrim-in 200ms var(--ease-out);
  }
  .sheet-backdrop.closing {
    animation: scrim-out 200ms var(--ease-in) forwards;
  }
}
@keyframes scrim-in {
  from { background-color: transparent; }
}
@keyframes scrim-out {
  to { background-color: transparent; }
}

/* 电脑上安装成应用后去掉标题栏（2026-11-19）：manifest 的 display_override 请求 window-controls-overlay，
   标题栏（左上角图标 + 「WordsApp」）不再显示，只在右上角留最小化 / 最大化 / 关闭按钮，页面画到窗口最顶上。
   顶部留出原标题栏的高度（借用 --safe-top，所有页面顶部都按它留白），这条空白可以拖动窗口。
   手机和普通浏览器里这段不生效。 */
@media (display-mode: window-controls-overlay) {
  :root {
    --safe-top: env(titlebar-area-height, 0px);
  }
  html::before {
    content: "";
    position: fixed;
    top: 0;
    left: env(titlebar-area-x, 0px);
    width: env(titlebar-area-width, 100%);
    height: env(titlebar-area-height, 0px);
    z-index: 2147483647;
    -webkit-app-region: drag;
    app-region: drag;
  }
}
