/* =========================================================================
 * 研彩社 · 数据观势  ——  移动端 H5 样式
 * 设计取向：墨玉底色 + 翠玉高光 + 鎏金点缀，深色玻璃卡片，单列触控优先
 * ========================================================================= */

:root {
  --bg: #07110d;
  --bg-deep: #040b08;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(160, 214, 187, 0.16);
  --line-soft: rgba(160, 214, 187, 0.09);
  --text: #e9f2ec;
  --text-dim: #93a79c;
  --text-faint: #6d8279;
  --jade: #3ddc97;
  --jade-deep: #1c9c6a;
  --jade-glow: rgba(61, 220, 151, 0.22);
  --gold: #e9c98a;
  --gold-deep: #b9903f;
  --danger: #ff7a6b;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --tabbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(61, 220, 151, 0.14), transparent 62%),
    radial-gradient(90% 50% at 100% 8%, rgba(233, 201, 138, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overscroll-behavior-y: none;
}

[hidden] { display: none !important; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─────────────────────────────── 顶栏 ─────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: linear-gradient(180deg, rgba(7, 17, 13, 0.96), rgba(7, 17, 13, 0.82));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 17px;
  font-weight: 700;
  color: #06140e;
  background: linear-gradient(140deg, #7bf0bc, #27b077 62%, #146e4a);
  box-shadow: 0 6px 18px -6px var(--jade-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15.5px; letter-spacing: 0.3px; white-space: nowrap; }
.brand-sub { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }

.led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 0 transparent;
  transition: background 0.3s, box-shadow 0.3s;
  flex: none;
}
.led.is-live { background: var(--jade); box-shadow: 0 0 9px 1px var(--jade-glow); }
.led.is-demo { background: var(--gold); box-shadow: 0 0 9px 1px rgba(233, 201, 138, 0.35); }
.led.is-loading { background: #6fb7ff; box-shadow: 0 0 9px 1px rgba(111, 183, 255, 0.4); }

.topbar-actions { display: flex; gap: 8px; flex: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { transform: scale(0.92); background: var(--surface-strong); color: var(--jade); }

/* ─────────────────────────────── 彩种条 ─────────────────────────────── */

.lottery-strip {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 61px);
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(7, 17, 13, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.lottery-strip::-webkit-scrollbar { display: none; }

.lottery-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lottery-chip b {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}
.lottery-chip span { white-space: nowrap; }
.lottery-chip.is-active {
  border-color: rgba(61, 220, 151, 0.5);
  background: linear-gradient(150deg, rgba(61, 220, 151, 0.2), rgba(61, 220, 151, 0.06));
  color: #d9fff0;
  box-shadow: 0 8px 22px -14px var(--jade);
}
.lottery-chip.is-active b { color: #05170f; background: var(--jade); }

/* ─────────────────────────────── 视图 ─────────────────────────────── */

.views {
  flex: 1;
  padding: 14px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 22px);
}

.view { animation: viewIn 0.32s cubic-bezier(0.2, 0.7, 0.3, 1); }
.view.is-active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ─────────────────────────────── 主卡 ─────────────────────────────── */

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--radius-l);
  border: 1px solid rgba(61, 220, 151, 0.22);
  background:
    linear-gradient(160deg, rgba(28, 156, 106, 0.2), rgba(9, 22, 17, 0.86) 58%),
    var(--surface);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.9);
}

.hero-glow {
  position: absolute;
  inset: -60% 40% 40% -20%;
  background: radial-gradient(circle at 30% 30%, rgba(61, 220, 151, 0.24), transparent 65%);
  pointer-events: none;
}

.hero-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-heading { min-width: 0; }
.hero-kicker { margin: 0 0 4px; font-size: 11.5px; letter-spacing: 1.2px; color: var(--jade); text-transform: uppercase; }
.hero-title { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: 0.2px; }

.source-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}
.source-pill[data-tone="live"] { color: #a8f5d1; border-color: rgba(61, 220, 151, 0.42); }
.source-pill[data-tone="demo"] { color: var(--gold); border-color: rgba(233, 201, 138, 0.38); }
.source-pill[data-tone="load"] { color: #9ecbff; border-color: rgba(111, 183, 255, 0.35); }
.source-pill[data-tone="error"] { color: var(--danger); border-color: rgba(255, 122, 107, 0.36); }

.hero-draw {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}
.hero-draw small { display: block; font-size: 11px; letter-spacing: 0.8px; color: var(--text-faint); margin-bottom: 7px; }
.hero-draw-right { text-align: right; flex: none; }
.hero-draw-right strong { font-family: var(--mono); font-size: 20px; color: var(--gold); }

.balls { display: flex; gap: 7px; flex-wrap: wrap; }
.ball {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: #eafff5;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.ball.is-hot {
  color: #05170f;
  background: linear-gradient(160deg, #8cf4c4, #2cc286);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 20px -10px var(--jade);
}
.ball.is-empty { color: var(--text-faint); font-weight: 400; }

.hero-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.hero-metrics > div { display: flex; flex-direction: column; gap: 3px; }
.hero-metrics span { font-size: 11px; color: var(--text-faint); letter-spacing: 0.5px; }
.hero-metrics b { font-family: var(--mono); font-size: 16px; font-weight: 600; color: #d7f6e7; }

/* ─────────────────────────────── 筛选 ─────────────────────────────── */

.filter-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: none;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.filter-chip.is-active {
  color: #05170f;
  border-color: transparent;
  background: linear-gradient(150deg, #8cf4c4, #2cc286);
  font-weight: 600;
}

/* ─────────────────────────────── 方案卡 ─────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 13px 12px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  animation: cardIn 0.34s backwards cubic-bezier(0.2, 0.7, 0.3, 1);
}
.feature-card:active { transform: scale(0.975); border-color: rgba(61, 220, 151, 0.42); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.feature-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.type-badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  color: var(--jade);
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.24);
  white-space: nowrap;
}
.type-badge[data-kind="kill"] { color: #9ecbff; background: rgba(111, 183, 255, 0.1); border-color: rgba(111, 183, 255, 0.26); }
.type-badge[data-kind="group"] { color: var(--gold); background: rgba(233, 201, 138, 0.1); border-color: rgba(233, 201, 138, 0.26); }
.feature-code { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.feature-name { margin: 0; font-size: 13.5px; font-weight: 550; color: #dbeade; line-height: 1.35; }

.feature-pred {
  margin: 0;
  padding: 8px 9px;
  border-radius: var(--radius-s);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffe9bd;
  background: rgba(233, 201, 138, 0.07);
  border: 1px solid rgba(233, 201, 138, 0.18);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 54px;
}

.feature-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.feature-cover { font-size: 11px; color: var(--text-faint); }
.feature-cover b { color: var(--jade); font-family: var(--mono); }
.feature-arrow { font-size: 12px; color: var(--text-faint); }

.skeleton-card {
  height: 148px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.045) 30%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.045) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer {
  from { background-position: 140% 0; }
  to { background-position: -40% 0; }
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px 18px;
  border-radius: var(--radius-m);
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.cross-note {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  padding: 9px 13px;
  border-radius: var(--radius-s, 8px);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold, #c9a227);
  background: rgba(201, 162, 39, 0.06);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.65;
}

.cross-note b {
  color: var(--text, #e8e8e8);
}

/* ─────────────────────────────── 通用面板头 ─────────────────────────────── */

.panel-head { padding: 4px 2px 16px; }
.panel-kicker { margin: 0 0 5px; font-size: 11px; letter-spacing: 1.4px; color: var(--gold); }
.panel-head h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.panel-note { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--text-dim); }

/* ─────────────────────────────── 回测 ─────────────────────────────── */

.backtest-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.field-inline { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.field-inline span { font-size: 11.5px; color: var(--text-faint); }
select, .text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  appearance: none;
  outline: none;
  transition: border-color 0.18s ease;
}
select:focus, .text-input:focus { border-color: rgba(61, 220, 151, 0.5); }
.text-input::placeholder { color: var(--text-faint); }

.primary-btn {
  padding: 11px 18px;
  border-radius: var(--radius-s);
  border: none;
  background: linear-gradient(150deg, #7bf0bc, #23b47c);
  color: #04170f;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, filter 0.16s ease;
}
.primary-btn:active { transform: scale(0.96); filter: brightness(0.94); }
.primary-btn:disabled { filter: grayscale(0.5) brightness(0.7); cursor: default; }
.primary-btn.small { padding: 10px 14px; font-size: 13px; }
.primary-btn.full { width: 100%; }

.ghost-btn {
  padding: 10px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.ghost-btn:active { border-color: rgba(61, 220, 151, 0.45); color: var(--jade); }
.ghost-btn.full { width: 100%; }

.progress { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.progress-track { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #23b47c, #8cf4c4);
  transition: width 0.25s ease;
}
.progress span { font-size: 11.5px; color: var(--text-faint); }

.backtest-summary:empty { display: none; }
.backtest-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.bt-stat {
  padding: 12px 11px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.bt-stat span { display: block; font-size: 11px; color: var(--text-faint); }
.bt-stat b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 17px; color: #d7f6e7; }

.backtest-list { display: flex; flex-direction: column; gap: 8px; }

.bt-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.bt-row.is-hot { border-color: rgba(61, 220, 151, 0.34); background: linear-gradient(150deg, rgba(61, 220, 151, 0.13), rgba(255, 255, 255, 0.02)); }
.bt-index { flex: none; width: 22px; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.bt-main { flex: 1; min-width: 0; }
.bt-main strong { display: block; font-size: 13.5px; font-weight: 550; color: #dbeade; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-bar { margin-top: 6px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bt-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #23b47c, #8cf4c4); }
.bt-value { flex: none; text-align: right; }
.bt-value b { display: block; font-family: var(--mono); font-size: 14px; color: var(--jade); }
.bt-value small { font-size: 10.5px; color: var(--text-faint); }

/* ─────────────────────────────── 开奖列表 ─────────────────────────────── */

.draw-list { display: flex; flex-direction: column; gap: 8px; }

.draw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.draw-row .draw-issue { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.draw-row .balls { gap: 5px; }
.draw-row .ball { width: 28px; height: 28px; border-radius: 9px; font-size: 14px; }
.draw-row.is-latest { border-color: rgba(61, 220, 151, 0.32); background: linear-gradient(150deg, rgba(61, 220, 151, 0.12), rgba(255, 255, 255, 0.02)); }

/* ─────────────────────────────── 手风琴说明 ─────────────────────────────── */

.accordion { display: flex; flex-direction: column; gap: 8px; }

.acc-item {
  border-radius: var(--radius-m);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  overflow: hidden;
}
.acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.acc-trigger b { font-weight: 550; }
.acc-trigger i { font-style: normal; color: var(--text-faint); font-size: 16px; transition: transform 0.2s ease; }
.acc-item.is-open .acc-trigger i { transform: rotate(45deg); color: var(--jade); }
.acc-body { padding: 0 14px 14px; font-size: 13px; line-height: 1.75; color: var(--text-dim); display: none; }
.acc-item.is-open .acc-body { display: block; }
.acc-body ol, .acc-body ul { margin: 0; padding-left: 18px; }
.acc-body li { margin-bottom: 5px; }
.acc-body code { font-family: var(--mono); font-size: 12px; color: var(--gold); }

.notice {
  margin-top: 16px;
  padding: 14px 15px;
  border-radius: var(--radius-m);
  border: 1px solid rgba(233, 201, 138, 0.26);
  background: rgba(233, 201, 138, 0.06);
}
.notice strong { display: block; font-size: 12.5px; letter-spacing: 0.5px; color: var(--gold); margin-bottom: 6px; }
.notice p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }

/* ─────────────────────────────── 底部导航 ─────────────────────────────── */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(6, 14, 11, 0.9);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line-soft);
}
.tab {
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: color 0.18s ease;
}
.tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--jade); }
.tab.is-active span { font-weight: 600; }

/* ─────────────────────────────── 抽屉 ─────────────────────────────── */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 8, 5, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  background: linear-gradient(180deg, #0d1a15, #081220 140%);
  box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, 0.9);
  transform: translateY(102%);
  transition: transform 0.34s cubic-bezier(0.22, 0.9, 0.28, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.is-open { transform: translateY(0); }

.sheet-grip { width: 38px; height: 4px; margin: 9px auto 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); flex: none; }

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.sheet-kicker { margin: 0 0 3px; font-size: 10.5px; letter-spacing: 1.2px; color: var(--gold); }
.sheet-head h3 { margin: 0; font-size: 17px; }

.sheet-body { padding: 16px 18px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.detail-value {
  padding: 14px;
  border-radius: var(--radius-m);
  border: 1px solid rgba(233, 201, 138, 0.24);
  background: rgba(233, 201, 138, 0.07);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  color: #ffe9bd;
  word-break: break-all;
  max-height: 34vh;
  overflow-y: auto;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.detail-stats > div {
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.detail-stats span { display: block; font-size: 11px; color: var(--text-faint); }
.detail-stats b { display: block; margin-top: 3px; font-family: var(--mono); font-size: 14px; color: #d7f6e7; }

.detail-block { margin-bottom: 14px; }
.detail-block h4 { margin: 0 0 6px; font-size: 12.5px; letter-spacing: 0.5px; color: var(--jade); font-weight: 600; }
.detail-block p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-dim); }
.hint { font-size: 12px !important; color: var(--text-faint) !important; margin-bottom: 8px !important; }

.option-list { display: flex; flex-direction: column; gap: 7px; }
.option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}
.option b { font-size: 13.5px; font-weight: 550; }
.option span { font-size: 11.5px; color: var(--text-faint); }
.option.is-active { border-color: rgba(61, 220, 151, 0.46); background: rgba(61, 220, 151, 0.1); }
.option.is-active b { color: var(--jade); }

.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }
.inline-form .text-input { padding: 9px 10px; font-size: 13px; }

.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 6px; }

/* ─────────────────────────────── Toast ─────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 120;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 26, 20, 0.96);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  max-width: 88vw;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.9);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* ─────────────────────────────── 断点 ─────────────────────────────── */

@media (max-width: 360px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-metrics { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

@media (min-width: 620px) {
  .views { max-width: 760px; margin: 0 auto; width: 100%; padding-left: 22px; padding-right: 22px; }
  .topbar, .lottery-strip { padding-left: max(22px, calc((100vw - 760px) / 2 + 22px)); padding-right: max(22px, calc((100vw - 760px) / 2 + 22px)); }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { left: 50%; right: auto; width: min(560px, 92vw); transform: translate(-50%, 102%); border-radius: 22px 22px 0 0; }
  .sheet.is-open { transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, .view, .feature-card, .skeleton-card { animation: none !important; transition: none !important; }
}
