/* ============================================================
   词浪 · 液态玻璃设计
   ============================================================ */

:root {
  --ink: #1a1d27;
  --ink-2: rgba(26, 29, 39, .64);
  --ink-3: rgba(26, 29, 39, .42);
  --ink-4: rgba(26, 29, 39, .28);
  --hairline: rgba(26, 29, 39, .1);

  --glass: rgba(255, 255, 255, .5);
  --glass-2: rgba(255, 255, 255, .66);
  --glass-3: rgba(255, 255, 255, .84);
  --glass-border: rgba(255, 255, 255, .62);

  --accent: #3049a8;
  --accent-soft: rgba(48, 73, 168, .12);

  --good: #2e7d52;
  --good-bg: rgba(66, 158, 108, .16);
  --warn: #9a6b1f;
  --warn-bg: rgba(212, 164, 74, .2);
  --bad: #b34a4a;
  --bad-bg: rgba(200, 96, 96, .16);

  --shadow-1: 0 1px 2px rgba(22, 27, 44, .06), 0 4px 14px -4px rgba(22, 27, 44, .1);
  --shadow-2: 0 2px 6px rgba(22, 27, 44, .05), 0 18px 40px -14px rgba(22, 27, 44, .2);
  --shadow-float: 0 4px 10px rgba(22, 27, 44, .06), 0 30px 60px -16px rgba(22, 27, 44, .3);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .22);

  --r-1: 12px;
  --r-2: 20px;
  --r-3: 28px;

  --serif: Georgia, "Times New Roman", "Source Han Serif SC", "Noto Serif SC", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;

  --content-w: 640px;
  --dock-h: 74px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: #eef1f8;
  overflow-wrap: break-word;
}

/* ---------- 背景：流动的极光 ---------- */

.aurora {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: linear-gradient(160deg, #f2f4fb 0%, #edf0f9 55%, #f5f1ef 100%);
}
.aurora i {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(64px); opacity: .5; will-change: transform;
}
.aurora i:nth-child(1) { background: #ffd9c4; top: -18%; left: -12%; animation: drift 34s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: #c9d6ff; top: 12%; right: -16%; animation: drift 41s ease-in-out infinite alternate-reverse; }
.aurora i:nth-child(3) { background: #c4ecdd; bottom: -20%; left: 4%; animation: drift 47s ease-in-out infinite alternate; }
.aurora i:nth-child(4) { background: #ffe3ee; bottom: 8%; right: -6%; width: 34vmax; height: 34vmax; animation: drift 28s ease-in-out infinite alternate-reverse; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, -6vmax) scale(1.12); }
}

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 玻璃面板 ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(1.65);
  backdrop-filter: blur(26px) saturate(1.65);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-2), var(--inner-light);
}

.glass-2 {
  background: var(--glass-3);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: var(--shadow-1), var(--inner-light);
}

/* ---------- 布局骨架 ---------- */

.app {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(var(--dock-h) + 34px);
}

.view-head { margin: 6px 2px 18px; }
.view-head h1 {
  font-family: var(--serif);
  font-size: 30px; font-weight: 500; letter-spacing: .01em; line-height: 1.25;
}
.view-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }

/* ---------- 底部导航 Dock ---------- */

.dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(92vw, 440px);
  display: flex; gap: 2px; padding: 7px;
  border-radius: 999px; z-index: 40;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .26) 46%, rgba(255, 255, 255, .36));
  -webkit-backdrop-filter: blur(20px) saturate(1.9);
  backdrop-filter: blur(20px) saturate(1.9);
  border: 1px solid;
  border-color: rgba(255, 255, 255, .8) rgba(255, 255, 255, .32) rgba(255, 255, 255, .5);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .45),
    0 2px 6px rgba(38, 51, 110, .08),
    0 14px 34px rgba(38, 51, 110, .14),
    0 30px 70px rgba(38, 51, 110, .1);
}
.dock button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-3);
  font: inherit; font-size: 11.5px; letter-spacing: .04em;
  cursor: pointer; transition: background .25s, color .25s, box-shadow .25s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.dock button svg {
  width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.dock button:active { transform: scale(.93); }
.dock button.active {
  background: var(--glass-3); color: var(--ink);
  box-shadow: var(--shadow-1), var(--inner-light);
}

/* ---------- 今日：开始页 ---------- */

.plan { border-radius: var(--r-3); padding: 24px 22px; }
.plan .row { display: flex; align-items: baseline; justify-content: space-between; }
.plan .big { font-family: var(--serif); font-size: 54px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.plan .big small { font-size: 17px; font-family: var(--sans); color: var(--ink-2); font-weight: 400; margin-left: 6px; }
.plan .split { display: flex; gap: 0; margin: 20px 0 4px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.plan .split > div { flex: 1; }
.plan .split > div + div { border-left: 1px solid var(--hairline); padding-left: 18px; }
.plan .split .num { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan .split .lbl { font-size: 12.5px; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--glass-border); border-radius: 999px;
  background: var(--glass-3); color: var(--ink);
  box-shadow: var(--shadow-1), var(--inner-light);
  font: inherit; font-weight: 600; letter-spacing: .02em;
  padding: 13px 30px; cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: rgba(255, 255, 255, .25); color: #fff; box-shadow: 0 10px 24px -8px rgba(48, 73, 168, .55), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }

/* ---------- 今日：章节自选（内嵌于计划卡，点击展开） ---------- */

.pick-wrap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.pick-toggle {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--ink); font-weight: 600; font-size: 13.5px; text-align: left;
}
.pick-toggle small { flex: 1; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.pick-toggle .arr { flex: none; color: var(--ink-3); font-size: 12px; transition: transform .25s; align-self: center; }
.pick-wrap.open .pick-toggle .arr { transform: rotate(90deg); }
.pick-body { display: none; }
.pick-wrap.open .pick-body { display: block; }
.lesson-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lpick {
  display: flex; flex-direction: column; align-items: center;
  min-width: 56px; padding: 7px 10px 6px; border-radius: var(--r-1);
  border: 1px solid var(--glass-border); background: var(--glass-2);
  box-shadow: var(--shadow-1), var(--inner-light);
  font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink);
  cursor: pointer; transition: transform .15s;
}
.lpick:active { transform: scale(.94); }
.lpick small { font-weight: 400; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lpick.done, .lpick.done small { color: var(--good); }

/* ---------- 今日：学习进行中 ---------- */

.session-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.session-top .quit {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--glass-border); background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-1);
  color: var(--ink-2); font-size: 16px; cursor: pointer;
}
.session-top .bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(26, 29, 39, .08); box-shadow: inset 0 1px 2px rgba(22, 27, 44, .1); overflow: hidden; }
.session-top .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4a66d6, #3049a8); transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.session-top .count { flex: none; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 翻转卡片 ---------- */

.card-scene { perspective: 1500px; }

.card {
  position: relative; width: 100%;
  height: min(64vh, 540px); min-height: 400px;
  border-radius: var(--r-3);
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.22, .8, .24, 1);
  cursor: pointer;
}
.card.flipped { transform: rotateY(180deg); }

.face {
  position: absolute; inset: 0;
  border-radius: var(--r-3);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column;
  /* 旋转面不要用 backdrop-filter：WebKit 会把该元素提成独立合成层并忽略
     backface-visibility，翻转后正面以镜像重影压在背面释义上（iPad Safari 复现） */
  background: linear-gradient(155deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .68) 55%, rgba(255, 255, 255, .8));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float), var(--inner-light);
  overflow: hidden;
}
.face.face-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .97), rgba(255, 255, 255, .93));
}

/* backface-visibility 之外的双保险：翻到一半（卡片侧对屏幕时）再切换可见性，
   两个面永远不会同时参与绘制 */
.face { visibility: hidden; transition: visibility 0s linear .3s; }
.card:not(.flipped) .face-front { visibility: visible; }
.card.flipped .face-back { visibility: visible; }
.face-back::before { display: none; }

/* 卡片光泽 */
.face::before {
  content: ""; position: absolute; top: -60%; left: -20%; width: 80%; height: 120%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .5) 50%, rgba(255, 255, 255, 0) 80%);
  transform: rotate(8deg); pointer-events: none;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: .05em; color: var(--ink-2);
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 1px 3px rgba(22, 27, 44, .07);
  white-space: nowrap;
}
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.face-front { padding: 20px 22px; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.face-front .chips { position: absolute; top: 18px; left: 18px; right: 118px; display: flex; gap: 8px; }
.face-front .chips .right { margin-left: auto; }

.entry { font-family: var(--serif); font-size: clamp(40px, 10vw, 62px); font-weight: 500; letter-spacing: .005em; line-height: 1.1; }

.hint { position: absolute; bottom: 22px; left: 0; right: 0; font-size: 12.5px; color: var(--ink-4); letter-spacing: .08em; }

.speak {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .6); color: var(--accent);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--shadow-1); transition: transform .15s;
}
.speak:active { transform: scale(.9); }
.speak svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* 卡片背面 */
.face-back { text-align: left; }
.back-scroll { overflow-y: auto; padding: 20px 24px 24px; flex: 1; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(26,29,39,.18) transparent; }
.back-scroll::-webkit-scrollbar { width: 4px; }
.back-scroll::-webkit-scrollbar-thumb { background: rgba(26, 29, 39, .18); border-radius: 99px; }

.back-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.back-head .entry { font-size: clamp(30px, 7vw, 40px); }
.back-head .phon { font-size: 17px; color: var(--accent); font-family: var(--serif); }
.meaning { font-size: 16.5px; line-height: 1.75; margin: 2px 0 4px; }

.sec { margin-top: 16px; }
.sec .lbl { font-size: 11.5px; font-weight: 600; letter-spacing: .18em; color: var(--ink-3); margin-bottom: 7px; }
.sec .lbl::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55; margin-right: 8px; vertical-align: 2px; }
.sec p { font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }
.sec p b, .sec p strong { color: var(--ink); font-weight: 600; }

.pt { display: flex; gap: 8px; font-size: 14px; line-height: 1.75; color: var(--ink-2); padding: 7px 0; border-bottom: 1px dashed var(--hairline); }
.pt:last-child { border-bottom: 0; }
.pt .no { color: var(--accent); flex: none; font-weight: 600; }

.sent { font-size: 14.5px; line-height: 1.8; padding: 8px 14px; border-radius: var(--r-1); background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .6); margin-bottom: 8px; }
.sent .en { font-family: var(--serif); font-size: 15px; }
.sent .zh { display: block; color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }

.mnem { font-size: 14px; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-1); padding: 10px 14px; line-height: 1.7; }

/* 评分区 */
.grade-bar { display: flex; gap: 10px; margin-top: 16px; }
.grade-bar button {
  flex: 1; padding: 14px 0 13px; border-radius: var(--r-2);
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  border: 1px solid var(--glass-border);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow-1), var(--inner-light);
}
.grade-bar button:active { transform: scale(.96); }
.grade-bar button small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: .06em; margin-top: 1px; }
.grade-bar .forgot { color: var(--bad); background: linear-gradient(160deg, rgba(255, 255, 255, .7), var(--bad-bg)); }
.grade-bar .fuzzy { color: var(--warn); background: linear-gradient(160deg, rgba(255, 255, 255, .7), var(--warn-bg)); }
.grade-bar .known { color: var(--good); background: linear-gradient(160deg, rgba(255, 255, 255, .7), var(--good-bg)); }

/* ---------- 完成 ---------- */

.done { border-radius: var(--r-3); padding: 36px 26px; text-align: center; }
.done .mark { font-family: var(--serif); font-size: 44px; }
.done h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 10px 0 4px; }
.done p { color: var(--ink-3); font-size: 13.5px; }
.done .nums { display: flex; justify-content: center; gap: 34px; margin: 22px 0 26px; }
.done .nums .n { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.done .nums .t { font-size: 12px; color: var(--ink-3); }

/* ---------- 词书 ---------- */

.search { display: flex; align-items: center; gap: 10px; border-radius: 999px; padding: 12px 18px; margin-bottom: 14px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
.search input::placeholder { color: var(--ink-4); }
.search svg { width: 17px; height: 17px; stroke: var(--ink-3); stroke-width: 1.8; fill: none; stroke-linecap: round; }

.lesson { border-radius: var(--r-2); margin-bottom: 12px; overflow: hidden; }
.lesson > header {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; user-select: none;
}
.lesson > header .no {
  font-family: var(--serif); font-size: 15px; color: var(--accent);
  width: 44px; flex: none; font-variant-numeric: tabular-nums;
}
.lesson > header .meta { flex: 1; min-width: 0; }
.lesson > header .meta b { font-weight: 600; font-size: 15px; display: block; }
.lesson > header .meta span { font-size: 12px; color: var(--ink-3); }
.lesson > header .prog { width: 54px; height: 5px; flex: none; }
.lesson > header .prog i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.lesson > header .prog-bg { width: 54px; height: 5px; flex: none; border-radius: 99px; background: rgba(26, 29, 39, .1); overflow: hidden; }
.lesson > header .arrow { flex: none; color: var(--ink-4); transition: transform .3s; font-size: 12px; }
.lesson.open > header .arrow { transform: rotate(90deg); }
.lesson .body { display: none; padding: 2px 18px 16px; }
.lesson.open .body { display: block; }

.group-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 4px;
  border-top: 1px solid var(--hairline); cursor: pointer;
}
.group-row:active { background: rgba(255, 255, 255, .4); }
.group-row .g-name { font-family: var(--serif); font-size: 16.5px; flex: none; min-width: 76px; }
.group-row .g-note { flex: 1; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-row .g-count { font-size: 12px; color: var(--ink-4); flex: none; font-variant-numeric: tabular-nums; }

.word-row { display: flex; align-items: baseline; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--hairline); cursor: pointer; }
.word-row:active { background: rgba(255, 255, 255, .4); }
.word-row .w { font-family: var(--serif); font-size: 16.5px; flex: none; min-width: 118px; }
.word-row .m { flex: 1; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-row .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgba(26, 29, 39, .12); align-self: center; }
.word-row .dot.s1 { background: #d4a44a; }
.word-row .dot.s2 { background: #4a66d6; }
.word-row .dot.s3 { background: var(--good); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); background: none; border: 0; cursor: pointer; font-family: inherit; padding: 4px 2px; }

/* ---------- 统计 ---------- */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { border-radius: var(--r-2); padding: 14px 8px 12px; text-align: center; }
.tile .n { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .t { font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; }

.panel { border-radius: var(--r-2); padding: 18px; margin-bottom: 14px; }
.panel h3 { font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 14px; }

.lbar { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.lbar .no { width: 40px; flex: none; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lbar .track { flex: 1; height: 7px; border-radius: 99px; background: rgba(26, 29, 39, .08); overflow: hidden; }
.lbar .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6a83dd, #3049a8); }
.lbar .pct { width: 60px; flex: none; text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(11px, 1fr)); gap: 3.5px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: rgba(26, 29, 39, .07); }
.heat i.l1 { background: #b9c6ef; }
.heat i.l2 { background: #7a90dd; }
.heat i.l3 { background: #4a63c9; }
.heat-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 10px; font-size: 11px; color: var(--ink-4); }
.heat-legend i { width: 9px; height: 9px; border-radius: 2.5px; display: inline-block; }

/* ---------- 设置 ---------- */

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--hairline); }
.set-row:first-child { border-top: 0; padding-top: 2px; }
.set-row .t { font-size: 14.5px; font-weight: 550; }
.set-row .d { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

.seg { display: flex; background: rgba(26, 29, 39, .06); border-radius: 999px; padding: 3px; box-shadow: inset 0 1px 3px rgba(22, 27, 44, .08); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; padding: 6px 13px; border-radius: 999px; cursor: pointer; color: var(--ink-2); transition: all .2s; }
.seg button.on { background: var(--glass-3); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1), var(--inner-light); }

.about { font-size: 12px; color: var(--ink-4); line-height: 1.8; margin-top: 4px; }

/* ---------- 弹层 / 提示 ---------- */

.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(24, 28, 44, .28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .25s; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.modal { width: min(94vw, 520px); max-height: min(84dvh, 720px); display: flex; flex-direction: column; border-radius: var(--r-3); overflow: hidden; animation: pop .3s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.modal .modal-body { overflow-y: auto; flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 36px); transform: translateX(-50%);
  z-index: 70; padding: 10px 20px; border-radius: 999px;
  background: rgba(26, 29, 39, .82); color: #fff; font-size: 13px; letter-spacing: .03em;
  box-shadow: var(--shadow-float); animation: fade .25s;
}
.toast[hidden] { display: none; }

.empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 14px; }

/* ---------- 收藏星标 ---------- */

.fav {
  position: absolute; top: 16px; right: 66px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .6); color: var(--ink-4);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: var(--shadow-1); transition: transform .15s, color .2s, background .2s;
}
.fav:active { transform: scale(.9); }
.fav svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linejoin: round; }
.fav.on { color: #c98a1b; background: rgba(255, 214, 138, .55); }
.fav.on svg { fill: currentColor; }

.mini-star { color: #c98a1b; font-size: 11px; margin-left: 5px; vertical-align: 2px; }

/* ---------- 词根 ---------- */

.root-row { display: flex; align-items: baseline; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--hairline); cursor: pointer; }
.root-row:active { background: rgba(255, 255, 255, .4); }
.root-row .r-name { font-family: var(--serif); font-size: 18px; flex: none; min-width: 88px; }
.root-row .r-meaning { flex: 1; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.root-row .r-count { font-size: 12px; color: var(--ink-4); flex: none; font-variant-numeric: tabular-nums; }

.rt-word { padding: 10px 0; border-top: 1px solid var(--hairline); cursor: pointer; }
.rt-word .word-row { border-top: 0; padding: 4px 0; }
.rt-word .rt-mem { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; padding-left: 2px; }

/* ---------- 阅读 ---------- */

.read-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--hairline); cursor: pointer; }
.read-row:first-child { border-top: 0; }
.read-row:active { background: rgba(255, 255, 255, .4); }
.read-row .no { font-family: var(--serif); font-size: 15px; color: var(--accent); width: 42px; flex: none; font-variant-numeric: tabular-nums; }
.read-row .meta { flex: 1; min-width: 0; }
.read-row .meta b { display: block; font-weight: 600; font-size: 15px; }
.read-row .meta span { font-size: 12.5px; color: var(--ink-3); }
.read-row .arrow { color: var(--ink-4); font-size: 13px; }
.read-row.locked { opacity: .55; }

.article .para { padding: 16px 0; border-top: 1px solid var(--hairline); }
.article .para:first-child { border-top: 0; }
.article .en { font-family: var(--serif); font-size: 16px; line-height: 1.9; }
.article .zh { color: var(--ink-3); font-size: 13.5px; line-height: 1.8; margin-top: 6px; }
.kw-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kw {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
}
.kw.dim { background: rgba(26, 29, 39, .05); color: var(--ink-3); cursor: default; }
.vocab-row { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline); font-size: 13.5px; line-height: 1.7; }
.vocab-row .w { font-family: var(--serif); flex: none; min-width: 110px; color: var(--accent); }
.vocab-row .m { flex: 1; color: var(--ink-2); }

.contact-code {
  font-family: var(--serif); font-size: 22px; letter-spacing: .06em; color: var(--accent);
  background: var(--accent-soft); border-radius: var(--r-1); padding: 10px 22px;
  display: inline-block; margin-top: 8px; user-select: all;
}

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

.wide-seg { width: 100%; margin-bottom: 14px; }
.wide-seg button { flex: 1; }
.export-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.btn.sm { padding: 8px 16px; font-size: 12.5px; }
.row-del {
  flex: none; width: 26px; height: 26px; border-radius: 50%; align-self: center;
  border: 0; background: transparent; color: var(--ink-4); font-size: 12px; cursor: pointer;
}
.row-del:active { background: var(--bad-bg); color: var(--bad); }

/* ---------- 我的 ---------- */

.me-head { display: flex; align-items: center; gap: 16px; padding: 6px 0 16px; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 24px; color: #fff;
  background: linear-gradient(150deg, #4a66d6, #3049a8);
  box-shadow: 0 8px 18px -6px rgba(48, 73, 168, .5), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.who .name { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.who .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.vip-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; padding: 2.5px 8px; border-radius: 999px;
  color: #8a6114; background: linear-gradient(150deg, #ffe9bd, #f5c96a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.vip-badge.admin { color: var(--accent); background: var(--accent-soft); }
.me-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 4px; }
.auth-form input {
  border: 1px solid var(--glass-border); border-radius: var(--r-1);
  background: rgba(255, 255, 255, .55); box-shadow: inset 0 1px 3px rgba(22, 27, 44, .06);
  padding: 12px 16px; font: inherit; font-size: 14.5px; color: var(--ink); outline: none;
}
.auth-form input:focus { border-color: rgba(48, 73, 168, .45); }
.auth-err { color: var(--bad); font-size: 12.5px; min-height: 18px; }

.admin-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hairline); }
.admin-row:first-child { border-top: 0; }
.admin-row .meta { flex: 1; min-width: 0; }
.admin-row .meta b { font-size: 14.5px; display: block; }
.admin-row .meta span { font-size: 12px; color: var(--ink-3); }
.admin-row .chip { cursor: pointer; border: 1px solid var(--glass-border); }

/* ---------- 课程锁定 ---------- */

.lesson.locked { opacity: .6; }
.lesson.locked > header { cursor: pointer; }
.lesson.locked > header:active { background: rgba(255, 255, 255, .4); }
.lpick.locked { opacity: .55; }
.lpick.locked small { font-size: 10px; letter-spacing: .05em; }

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

@media (min-width: 720px) {
  .app { padding-top: 44px; }
  .view-head h1 { font-size: 34px; }
  .card { height: min(62vh, 560px); }
  .tiles { gap: 14px; }
}

/* 手机刷词：压低卡片高度，评分栏完整落在底部导航上方（dvh 优先，vh 兜底） */
@media (max-width: 819px) {
  .card {
    height: min(calc(100vh - 310px), 540px);
    height: min(calc(100dvh - 310px), 540px);
    min-height: 300px;
  }
}

/* ---------- 平板适配（≥820px 竖版 iPad 及以上） ---------- */

@media (min-width: 820px) {
  .app { max-width: 980px; padding-top: 40px; padding-left: 28px; padding-right: 28px; }
  .view-head h1 { font-size: 36px; }

  /* 焦点视图（学习卡 / 今日计划 / 完成页 / 详情面板）保持舒适列宽 */
  .app > .glass, .app > .wide-seg, .app > .export-bar, .app > .btn.wide,
  .app > .panel, .app > .done,
  .session-top, .card-scene, .grade-bar {
    max-width: 760px; margin-left: auto; margin-right: auto;
  }
  .app > .btn.wide { display: flex; }
  .card { height: min(64vh, 620px); min-height: 440px; }
  .modal { width: min(94vw, 560px); }

  /* 词书：课程卡双列网格 */
  .lesson-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .lesson-grid .lesson { margin-bottom: 0; }

  /* 词单 / 词根 / 搜索结果：行双列 */
  .two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }

  /* 阅读：左课程列表 + 右正文 */
  .read-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
  .read-side {
    position: sticky; top: 20px;
    max-height: calc(100dvh - 190px); overflow-y: auto;
    border-radius: var(--r-2); padding: 6px 14px 10px;
    overscroll-behavior: contain; scrollbar-width: thin;
  }
  .read-main { min-width: 0; }
  .read-main .back-link { display: none; }
  .read-main > .glass { max-width: 720px; }
  .read-row.on { background: linear-gradient(90deg, var(--accent-soft), transparent 85%); border-radius: var(--r-1); }
  .read-placeholder {
    border-radius: var(--r-2); padding: 90px 30px; text-align: center;
    color: var(--ink-3); font-size: 14px; line-height: 2.1;
  }

  /* 统计：热力图与课时进度并排 */
  .stats-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
  .stats-grid .panel { margin-bottom: 0; }
}

/* ---------- 平板横版（≥1180px） ---------- */

@media (min-width: 1180px) {
  .app { max-width: 1120px; }
  .lesson-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .lesson-grid .lesson > header { padding: 13px 14px; gap: 9px; }
  .lesson-grid .lesson > header .no { width: 36px; font-size: 14px; }
  .read-split { grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 420px) {
  .dock { gap: 0; padding: 6px; }
  .dock button { font-size: 10.5px; padding: 7px 0 6px; }
  .dock button svg { width: 19px; height: 19px; }
  .face-front .chips { left: 14px; right: 106px; gap: 6px; }
  .face-front .chips .chip { padding: 4px 9px; font-size: 11px; }
}

@media (max-width: 360px) {
  .plan .big { font-size: 46px; }
  .tiles .n { font-size: 20px; }
  .root-row .r-name { min-width: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
  .card, .modal, .overlay { transition: none; animation: none; }
  .dock button { transition: none; }
}

/* ---------- 液态玻璃（liquid-glass.js 注入，仅 Chromium 启用） ---------- */

.lg {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
}
.lg > :not(.lg-warp):not(.lg-ring) { position: relative; z-index: 1; }

/* 折射层：极淡顶光白渐变（不叠实色，保持通透），环境色柔和浸润 */
.lg-warp {
  position: absolute; inset: 0; z-index: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, calc(var(--lg-tint, .14) + .06)),
    rgba(255, 255, 255, var(--lg-tint, .14)) 34%,
    rgba(255, 255, 255, calc(var(--lg-tint, .14) - .04)));
}
.lg-warp::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    rgba(125, 148, 255, .09), rgba(255, 168, 213, .06) 52%, rgba(118, 215, 196, .07));
}

/* 高光描边：半透明白渐变集中在上边缘，不是实心边框 */
.lg-ring {
  position: absolute; inset: 0; z-index: 2;
  border-radius: inherit; pointer-events: none;
  padding: 1.5px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .9), rgba(255, 255, 255, .30) 16%,
    rgba(255, 255, 255, .06) 42%, rgba(255, 255, 255, .03) 68%,
    rgba(255, 255, 255, .22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  mix-blend-mode: screen;
}
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* 玻璃微观颗粒：feTurbulence 噪声，极淡（dock 全路径生效，弹窗仅 LG 路径） */
.dock::after, .modal.lg::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  border-radius: inherit; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.65 0'/%3E%3C/filter%3E%3Crect width='110' height='110' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 110px 110px;
  mix-blend-mode: overlay;
  opacity: .05;
}

/* 分层阴影：内部柔光内发光 + 外部弥散投影 */
.dock.lg {
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, .5),
    inset 0 -1px 1px rgba(255, 255, 255, .14),
    0 2px 6px rgba(38, 51, 110, .08),
    0 14px 34px rgba(38, 51, 110, .13),
    0 30px 70px rgba(38, 51, 110, .1);
  transition: transform .2s ease-out;
}
.modal.lg {
  position: relative;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, .4),
    inset 0 -1px 1px rgba(255, 255, 255, .12),
    0 4px 16px rgba(0, 0, 0, .12),
    0 18px 60px rgba(0, 0, 0, .28);
}

@media (prefers-reduced-motion: reduce) {
  .dock.lg { transition: none; }
}
