/* ============================================================
   艾宾浩斯单词 · 移动端样式（手机优先，适配 iOS / Android）
   ============================================================ */
:root {
  --bg: #eef1f9;
  --bg-soft: #f7f9ff;
  --card: #ffffff;
  --text: #1a1f33;
  --muted: #6d7690;
  --line: #e6e9f3;
  --primary: #4c6ef5;
  --primary-weak: #e8edff;
  --ok: #12b886;
  --warn: #f59f00;
  --danger: #e8503a;
  --info: #2b8aef;
  --accent: #7048e8;
  --shadow: 0 6px 24px rgba(26, 32, 74, 0.07);
  --radius: 18px;
  --tabbar: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1320;
    --bg-soft: #151a28;
    --card: #1a2030;
    --text: #e9edf8;
    --muted: #9aa4bb;
    --line: #262d3f;
    --primary: #7c93ff;
    --primary-weak: #232c4d;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  }
}

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

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

body {
  background: radial-gradient(120% 60% at 50% 0%, var(--bg-soft) 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12.5px; }
.text { color: var(--text); font-size: 13.5px; opacity: 0.9; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6a7bff 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(76, 110, 245, 0.28);
}
.btn.ghost {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--line);
}
.btn.danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

/* ---------------- 登录页 ---------------- */
.auth {
  min-height: 100dvh;
  padding: max(36px, env(safe-area-inset-top)) 22px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  max-width: 520px;
  margin: 0 auto;
}
.auth-head { text-align: center; }
.auth-head .logo {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 10px 24px rgba(76, 110, 245, 0.32);
}
.auth-head h1 { font-size: 23px; letter-spacing: 0.5px; }
.auth-head p { color: var(--muted); font-size: 13px; margin-top: 6px; }

.auth-card {
  background: var(--card);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-soft);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 18px;
}
.auth-tabs button {
  height: 38px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.16s;
}
.auth-tabs button.on {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 32, 74, 0.08);
}
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  outline: none;
  transition: 0.16s;
}
.field input:focus { border-color: var(--primary); background: var(--card); }
.auth-error { min-height: 18px; color: var(--danger); font-size: 12.5px; margin-bottom: 8px; }
.auth-note { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; line-height: 1.6; }
.auth-accounts { text-align: center; }
.auth-accounts-title { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.account-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.account-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(26, 32, 74, 0.05);
}

/* ---------------- 顶栏 ---------------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.brand-text { font-weight: 700; font-size: 16px; letter-spacing: 0.3px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(26, 32, 74, 0.05);
  max-width: 55%;
}
.user-chip .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--info), var(--primary));
  flex: none;
}
.user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.seg-btn {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.16s;
  white-space: nowrap;
}
.seg-btn.on {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 32, 74, 0.08);
}
.seg.small .seg-btn { padding: 6px 12px; font-size: 12.5px; }

.due-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--warn), #ff922b);
  box-shadow: 0 6px 16px rgba(245, 159, 0, 0.32);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ---------------- 视图 ---------------- */
.views { flex: 1; padding: 16px 16px calc(var(--tabbar) + 26px + env(safe-area-inset-bottom)); }
.view { display: none; max-width: 560px; margin: 0 auto; animation: fade 0.22s ease; }
.view.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hello { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.hello-sub { color: var(--muted); font-size: 12.5px; }
.hello h2 { font-size: 22px; margin-top: 2px; letter-spacing: 0.3px; }
.tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-weak);
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { display: block; font-size: 26px; font-weight: 700; letter-spacing: 0.5px; margin: 2px 0 1px; }
.stat-foot { color: var(--muted); font-size: 11.5px; }
.stat-card.warn { color: var(--warn); }
.stat-card.ok { color: var(--ok); }
.stat-card.info { color: var(--info); }
.stat-card.accent { color: var(--accent); }
.stat-card .stat-label, .stat-card .stat-foot { color: var(--muted); }
.stat-card .stat-value { color: var(--text); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h3 { font-size: 14.5px; margin-bottom: 10px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-row h3 { margin-bottom: 0; }

.meter { height: 9px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.4s ease; }
.meter.thin { height: 5px; }

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.mini-curve { width: 100%; height: 110px; display: block; margin: 4px 0 6px; }
.nodes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nodes li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  color: var(--text);
}
.nodes li b { display: block; font-size: 15px; color: var(--primary); margin-bottom: 1px; }

/* ---------------- 单词本 ---------------- */
.bank-head { position: sticky; top: 0; z-index: 5; padding-bottom: 8px; background: linear-gradient(var(--bg) 70%, transparent); }
.search {
  width: 100%;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 14px;
  outline: none;
  margin-bottom: 10px;
}
.search:focus { border-color: var(--primary); }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.count { color: var(--muted); font-size: 12px; margin: 8px 2px; }

.bank-list { display: flex; flex-direction: column; gap: 8px; }
.word-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  width: 100%;
}
.word-row:active { background: var(--bg-soft); }
.word-row .wr-main { flex: 1; min-width: 0; }
.word-row .wr-word { font-weight: 700; font-size: 15.5px; }
.word-row .wr-word em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.word-row .wr-meaning { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-state { font-size: 11.5px; color: var(--muted); text-align: right; flex: none; line-height: 1.45; }
.wr-state .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot.new { background: #adb5c9; }
.dot.learning { background: var(--info); }
.dot.due { background: var(--warn); }
.dot.mastered { background: var(--ok); }
.list-more { text-align: center; color: var(--muted); font-size: 12px; padding: 14px 0; }

/* ---------------- 曲线 / 图表 ---------------- */
.filters { display: flex; gap: 10px; margin-bottom: 12px; }
.select {
  flex: 1;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 12px;
  outline: none;
  min-width: 0;
}
.select.small { height: 38px; flex: none; width: auto; font-size: 13px; }
.curve { width: 100%; height: 220px; display: block; }
.legend { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.line { display: inline-block; width: 18px; height: 2px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.line.dashed { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.line.solid { background: var(--primary); }

.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 130px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #fff));
  min-height: 4px;
  transition: height 0.35s ease;
}
.bar-col .bar.zero { background: var(--line); }
.bar-col .bar-label { font-size: 11px; color: var(--muted); }
.bar-col .bar-value { font-size: 11px; font-weight: 700; color: var(--text); }

.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.rating-row .rt-label { width: 40px; color: var(--muted); flex: none; }
.rating-row .rt-track { flex: 1; height: 8px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); overflow: hidden; }
.rating-row .rt-fill { display: block; height: 100%; border-radius: 999px; }
.rating-row .rt-value { width: 34px; text-align: right; color: var(--muted); flex: none; }

/* ---------------- 我的 ---------------- */
.me-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(76, 110, 245, 0.28);
  margin-bottom: 14px;
}
.avatar.big { width: 54px; height: 54px; border-radius: 18px; font-size: 22px; background: rgba(255, 255, 255, 0.22); }
.me-info h2 { font-size: 19px; }
.me-info .muted { color: rgba(255, 255, 255, 0.78); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row b { display: block; font-size: 13.5px; font-weight: 600; }
.setting-row .muted { display: block; margin-top: 2px; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line);
  transition: 0.2s;
}
.switch i::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ---------------- 底部标签栏 ---------------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
}
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--primary); font-weight: 600; }

/* ---------------- 学习会话 ---------------- */
.session {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 60% at 50% 0%, var(--bg-soft) 0%, var(--bg) 60%);
  padding: max(10px, env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  animation: slideUp 0.24s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.session-head { display: flex; align-items: center; gap: 12px; padding: 6px 0 10px; }
.session-progress { flex: 1; }
.session-progress span { font-size: 12px; color: var(--muted); font-weight: 600; }
.session-mode { font-size: 11.5px; color: var(--primary); background: var(--primary-weak); padding: 5px 10px; border-radius: 999px; font-weight: 600; }

.session-body { flex: 1; display: flex; flex-direction: column; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; overflow-y: auto; }

.word-card {
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px 18px 18px;
  text-align: center;
  margin-top: 6px;
}
.word-card-top { display: flex; align-items: center; justify-content: space-between; }
.badge { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--primary-weak); color: var(--primary); }
.badge.review { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.word { font-size: 38px; letter-spacing: 0.5px; margin: 14px 0 4px; word-break: break-word; }
.word-tools { display: flex; gap: 8px; justify-content: center; margin: 10px 0 6px; }
.pill {
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.pill:active { background: var(--primary-weak); }
.word-meta { color: var(--muted); font-size: 12.5px; min-height: 18px; }

.verify { display: flex; flex-direction: column; gap: 10px; }
.verify input {
  height: 52px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 16px;
  outline: none;
  font-size: 16px;
  text-align: center;
}
.verify input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.verify-btns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }

.result { min-height: 20px; text-align: center; font-size: 13px; font-weight: 600; }
.result.ok { color: var(--ok); }
.result.bad { color: var(--danger); }
.result.info { color: var(--muted); font-weight: 400; }

.answer-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.meaning { font-size: 15px; line-height: 1.6; }
.example { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; }

.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rate button {
  padding: 12px 4px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.rate button small { font-weight: 400; font-size: 10.5px; opacity: 0.85; }
.rate .forgot { background: linear-gradient(135deg, #f06595, #e8503a); }
.rate .vague { background: linear-gradient(135deg, #ffa94d, #f59f00); }
.rate .good { background: linear-gradient(135deg, #38d9a9, #12b886); }
.rate .easy { background: linear-gradient(135deg, #4dabf7, #2b8aef); }
.rate button:active { transform: scale(0.96); }
.tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 8px; }

.session-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.done-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: #fff;
  background: linear-gradient(135deg, var(--ok), #38d9a9);
  box-shadow: 0 12px 26px rgba(18, 184, 134, 0.32);
}
.session-done h2 { font-size: 20px; }
.session-done p { color: var(--muted); font-size: 13px; }
.session-done .btn { margin-top: 8px; min-width: 160px; }

/* ---------------- 详情面板 ---------------- */
.sheet-mask { position: fixed; inset: 0; background: rgba(12, 16, 30, 0.45); z-index: 40; animation: fade 0.2s ease; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(12, 16, 30, 0.22);
  animation: sheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 84dvh;
  overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-size: 24px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 4px;
}
.detail-grid div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.detail-grid dt { color: var(--muted); font-size: 11.5px; }
.detail-grid dd { font-size: 13.5px; font-weight: 600; margin-top: 2px; }

/* ---------------- 弹窗 / Toast ---------------- */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 16, 30, 0.45);
  animation: fade 0.18s ease;
}
.dialog-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(12, 16, 30, 0.3);
  animation: pop 0.2s ease;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0.6; } to { transform: none; opacity: 1; } }
.dialog-card h2 { font-size: 17px; margin-bottom: 10px; }
.dialog-body { color: var(--text); font-size: 13.5px; line-height: 1.6; max-height: 46dvh; overflow-y: auto; }
.dialog-body .field { margin-bottom: 10px; }
.dialog-body textarea {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
  resize: none;
}
.dialog-actions { display: flex; gap: 10px; margin-top: 16px; }
.dialog-actions .btn { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  max-width: 86vw;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(24, 28, 44, 0.92);
  color: #fff;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 10px 26px rgba(12, 16, 30, 0.28);
  animation: toastIn 0.24s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 700px) {
  .views { padding-top: 22px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .tabbar { max-width: 620px; left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; }
}
