/* ==========================================================================
   Habit Spark - style.css
   黑金 / 火焰主题，全部颜色与尺寸通过 CSS 变量驱动，便于 config.js 主题扩展
   ========================================================================== */

:root {
  /* ---- 品牌色（默认：黑金火焰） ---- */
  --primary-color: #ffd700;      /* 主资源 / 金色强调色 */
  --flame-orange: #ff8a3d;
  --flame-red: #ff3d3d;
  --currency-color: #5ec8ff;     /* 高级货币 / 钻石 */
  --shield-color: #38e8d0;       /* 保护卡 */
  --danger-color: #ff4d4f;
  --success-color: #34d399;

  /* ---- 背景层级 ---- */
  --bg-base: #0f0f12;
  --bg-elevated: #17171d;
  --bg-elevated-2: #1f1f28;
  --bg-elevated-3: #292933;

  /* ---- 文本 ---- */
  --text-primary: #f5efe0;
  --text-secondary: #a8a2b3;
  --text-muted: #6b6675;

  /* ---- 边框 / 分割线 ---- */
  --border-subtle: rgba(255, 215, 0, 0.10);
  --border-strong: rgba(255, 215, 0, 0.24);

  /* ---- 圆角 / 间距 ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* ---- 阴影 / 光晕 ---- */
  --shadow-panel: 0 -12px 40px rgba(0, 0, 0, 0.5);
  --glow-gold: 0 0 40px rgba(255, 215, 0, 0.35);
  --glow-gold-soft: 0 0 24px rgba(255, 215, 0, 0.18);

  /* ---- 字体 ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", "Segoe UI", sans-serif;

  /* ---- 布局尺寸 ---- */
  --topbar-height: 56px;
  --bottom-nav-height: 64px;
  --sidebar-width: 104px;

  /* ---- 动效时长 ---- */
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-charge: 1000ms;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

input {
  font-family: inherit;
  color: var(--text-primary);
}

ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   App shell
   ========================================================================== */

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 138, 61, 0.06), transparent 60%),
    var(--bg-base);
}

/* ==========================================================================
   顶部资源栏
   ========================================================================== */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: env(safe-area-inset-top) var(--space-4) 0;
  padding-top: calc(env(safe-area-inset-top) + var(--space-2));
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-base));
  z-index: 10;
}

.res-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.res-pill .res-icon { font-size: 15px; line-height: 1; }
.res-pill .res-value { color: var(--text-primary); min-width: 1ch; }

#resPrimary { box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.12); }
#resCurrency { box-shadow: inset 0 0 0 1px rgba(94, 200, 255, 0.14); }
#resShield { box-shadow: inset 0 0 0 1px rgba(56, 232, 208, 0.14); }

/* ==========================================================================
   主舞台：侧边任务列表 + 中央火苗
   ========================================================================== */

.stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.task-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* ← 新增这一行，优化移动端惯性滑动 */
    padding: calc(var(--topbar-height) + var(--space-3)) var(--space-2) var(--space-3);
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  transform: translateX(-100%);
  transition: transform 0.28s var(--ease-standard);
  z-index: 9;
}

.task-sidebar.open {
  transform: translateX(0);
}
.sidebar-toggle {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-3));
  left: 0;
  width: 30px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  border-left: none;
  color: var(--text-secondary);
  font-size: 16px;
  z-index: 11;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-standard);
  z-index: 8;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
/* ---- 右侧"今日任务奖励"面板（镜像左侧侧边栏的开合方式） ---- */

.quota-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--topbar-height) + var(--space-3)) var(--space-3) var(--bottom-nav-height);
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease-standard);
  z-index: 9;
}

.quota-sidebar.open {
  transform: translateX(0);
}

.quota-toggle {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-3));
  right: 0;
  width: 30px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  border-right: none;
  color: var(--text-secondary);
  font-size: 16px;
  z-index: 11;
}

.quota-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-standard);
  z-index: 8;
}

.quota-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.quota-sidebar__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quota-sidebar__count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.quota-tier-item {
  margin-bottom: var(--space-3);
}

.quota-tier-item__label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.quota-tier-item__label--claimed { color: var(--success-color); }

.quota-tier-item__track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-3);
  overflow: hidden;
}

.quota-tier-item__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary-color), var(--flame-orange));
  transition: width 0.3s var(--ease-standard);
}

/* ---- 打卡完成后的进度条弹窗（2秒后自动消失） ---- */

.quota-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 45;
  opacity: 1;
  transition: opacity 0.3s var(--ease-standard);
  pointer-events: none;
}

.quota-popup.hidden {
  opacity: 0;
  display: none;
}

.quota-popup__box {
  width: 260px;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.quota-popup__count {
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-3);
}
.task-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--bottom-nav-height);   /* ← 新增，避免最后一项被底部导航遮挡 */
}

/* 任务项（由 JS 渲染）参考结构，供后续批次复用类名：
   .task-item > .task-item__label / .task-ring (svg 长按环) */
.task-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) 4px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s var(--ease-standard), background 0.2s var(--ease-standard);
}

.task-item--done {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.task-item__label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 88px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* 长按环形按钮 */
.task-ring {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.task-ring__svg { position: absolute; inset: 0; transform: rotate(-90deg); }

.task-ring__track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 5;
}

.task-ring__progress {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: var(--ring-circumference, 150.8);
  stroke-dashoffset: var(--ring-circumference, 150.8);
  transition: stroke-dashoffset 0ms linear;
}

.task-ring.charging .task-ring__progress {
  transition: stroke-dashoffset var(--duration-charge) linear;
  stroke-dashoffset: 0;
}

.task-ring__icon {
  position: relative;
  font-size: 20px;
  pointer-events: none;
}

.task-ring--complete .task-ring__progress { stroke: var(--success-color); }

/* 侧边栏空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  text-align: center;
  color: var(--text-muted);
}

.empty-state__icon { font-size: 26px; opacity: 0.7; }
.empty-state__text { font-size: 12.5px; line-height: 1.6; }

.task-sidebar .empty-state { padding-top: var(--space-6); }

/* ---- 中央火苗展示区 ---- */

.flame-stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-1);  /* ← 改大这个值（比如 var(--space-6)），四周留白变多，图片相应变小 */
}

.flame-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  height: 100%;    /* 【改动】撑满 .flame-stage 除 padding 外的可用空间 */
  min-height: 0;   /* 【改动】flex 纵向布局下，子元素能正常收缩，避免撑破容器 */
}

.flame-glow {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 138, 61, 0.35), transparent 65%);
  filter: blur(6px);
  animation: flame-flicker 3.2s ease-in-out infinite;
  pointer-events: none;
}

.flame-svg {
  width: 150px;
  height: 180px;
  filter: drop-shadow(0 6px 18px rgba(255, 61, 61, 0.25));
  animation: flame-flicker 3.2s ease-in-out infinite;
  transform-origin: 50% 90%;
}

.flame-path { transition: fill 0.3s var(--ease-standard); }

.flame-count-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: -8px;
}

.flame-count {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.flame-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.streak-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--danger-color);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--bg-base);
  z-index: 2;
}

.streak-badge.hidden { display: none; }

/* 达标 / 未达标状态 */
.flame-stage.is-inactive .flame-svg { filter: grayscale(0.85) brightness(0.6); }
.flame-stage.is-inactive .flame-glow { opacity: 0.15; }
.flame-stage.is-inactive .flame-count { color: var(--text-muted); }

.flame-stage.is-achieved .flame-svg {
  filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.55));
  animation: flame-flicker 2.4s ease-in-out infinite, flame-pulse 1.8s ease-in-out infinite;
}
.flame-stage.is-achieved .flame-count { color: var(--primary-color); }

@keyframes flame-flicker {
  0%, 100% { transform: scaleY(1) scaleX(1) skewX(0deg); }
  25%      { transform: scaleY(1.03) scaleX(0.98) skewX(0.6deg); }
  50%      { transform: scaleY(0.97) scaleX(1.02) skewX(-0.6deg); }
  75%      { transform: scaleY(1.02) scaleX(0.99) skewX(0.3deg); }
}

@keyframes flame-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 火焰粒子由 ui.js 动态注入 .particle 元素 */
}

.particle {
  position: absolute;
  bottom: 30%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--flame-orange);
  animation: particle-rise 1.6s ease-out forwards;
}

@keyframes particle-rise {
  0%   { opacity: 0.9; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.3); }
}

/* ==========================================================================
   底部 Tab 导航
   ========================================================================== */

.bottom-nav {
  flex: 0 0 auto;
  display: flex;
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(0deg, var(--bg-elevated), var(--bg-base));
  z-index: 10;
}

.nav-btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  transition: color 0.2s var(--ease-standard);
}

.nav-btn__icon { font-size: 20px; line-height: 1; }
.nav-btn__label { font-size: 11px; letter-spacing: 0.02em; }

.nav-btn:active { transform: scale(0.94); }

.nav-btn.active { color: var(--primary-color); }
.nav-btn.active .nav-btn__icon { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5)); }

/* ==========================================================================
   底部弹出面板（商店 / 统计 / 任务管理 / 设置）
   ========================================================================== */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-standard);
  z-index: 20;
}

.sheet-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.tab-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: none;                 /* 【改动】关闭状态不带阴影，避免透到底部导航栏 */
  transform: translateY(100%);
  transition: transform 0.32s var(--ease-standard),
              box-shadow 0.32s var(--ease-standard); /* 【改动】阴影跟随开合过渡，避免突兀 */
  z-index: 21;
  padding-bottom: env(safe-area-inset-bottom);
  pointer-events: none;             /* 【改动】关闭状态整体不响应点击，双重保险 */
}

.tab-panel.open {
  transform: translateY(0);
  box-shadow: var(--shadow-panel);  /* 【改动】只有打开时才应用阴影 */
  pointer-events: auto;             /* 【改动】打开时恢复可点击 */
}

.panel-handle {
  width: 36px;
  height: 4px;
  margin: 10px auto 2px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  flex: 0 0 auto;
}

.panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5) var(--space-2);
}

.panel-title { font-size: 18px; font-weight: 700; }

.panel-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--text-secondary);
  border-radius: 50%;
  background: var(--bg-elevated-2);
}

.panel-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 var(--space-5) var(--space-6);
}

.section-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin: var(--space-5) 0 var(--space-3);
}

.section-subtitle:first-child { margin-top: var(--space-2); }

/* ---- 商店 / 兑换 ---- */

.exchange-card {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
}

.exchange-card__title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.exchange-card__rate { font-size: 13px; color: var(--text-secondary); margin-bottom: var(--space-3); }
.exchange-card__row { display: flex; gap: var(--space-2); }
.exchange-card__hint { margin-top: var(--space-2); font-size: 12.5px; color: var(--text-muted); min-height: 1em; }

.exchange-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-3);
  border: 1px solid var(--border-subtle);
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
}

.stat-card__value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

.stat-card__label { font-size: 12px; color: var(--text-secondary); }

.freeze-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---- 任务管理 ---- */

.rescue-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  border-radius: var(--radius-md);
  background: rgba(255, 77, 79, 0.10);
  border: 1px solid rgba(255, 77, 79, 0.3);
}

.rescue-banner.hidden { display: none; }

.rescue-banner__icon { font-size: 20px; }
.rescue-banner__body { flex: 1 1 auto; min-width: 0; }
.rescue-banner__title { font-size: 13.5px; font-weight: 700; }
.rescue-banner__date { font-size: 12px; color: var(--text-secondary); }

.task-manager-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: 72px;
}

.fab {
  position: absolute;
  right: var(--space-5);
  bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 600;
  display: grid;
  place-items: center;
  color: var(--bg-base);
  background: linear-gradient(145deg, var(--primary-color), var(--flame-orange));
  box-shadow: var(--glow-gold);
}

.fab:active { transform: scale(0.94); }

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

.settings-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-2);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.settings-row--col { flex-direction: column; align-items: stretch; gap: 6px; }

.settings-row__label { font-size: 13.5px; color: var(--text-primary); }

.text-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-3);
  border: 1px solid var(--border-subtle);
  font-size: 13.5px;
  width: 100%;
}

.text-input--time { width: auto; }

.settings-card__hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.version-label {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: var(--space-5);
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-3);
  border: 1px solid var(--border-subtle);
  transition: background 0.2s var(--ease-standard);
}
.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform 0.2s var(--ease-standard), background 0.2s var(--ease-standard);
}
.switch input:checked + .switch__track { background: rgba(255, 215, 0, 0.25); border-color: var(--border-strong); }
.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(18px);
  background: var(--primary-color);
}

/* ==========================================================================
   通用按钮
   ========================================================================== */

.btn {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: transform 0.15s var(--ease-standard), opacity 0.15s var(--ease-standard);
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  color: var(--bg-base);
  background: linear-gradient(145deg, var(--primary-color), var(--flame-orange));
  box-shadow: var(--glow-gold-soft);
}

.btn--ghost {
  color: var(--text-primary);
  background: var(--bg-elevated-3);
  border: 1px solid var(--border-subtle);
}

.btn--block { display: block; width: 100%; }

/* ==========================================================================
   通用确认弹窗
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
}

.modal-overlay.hidden { display: none; }

.modal {
  width: 100%;
  max-width: 340px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal__title { font-size: 16px; font-weight: 700; margin-bottom: var(--space-2); }
.modal__message { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.modal__actions .btn { padding: 9px 16px; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-container {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--space-4));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  z-index: 50;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-3);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.25s var(--ease-standard);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   小屏幕适配
   ========================================================================== */

@media (max-width: 360px) {
  :root { --sidebar-width: 88px; }
  .flame-svg { width: 128px; height: 154px; }
  .flame-count { font-size: 34px; }
}

@media (min-width: 720px) {
  .tab-panel { left: 50%; right: auto; width: 480px; transform: translate(-50%, 100%); }
  .tab-panel.open { transform: translate(-50%, 0); }
}
/* ==========================================================================
   视频火焰/皮肤 样式适配
   ========================================================================== */

/* ==========================================================================
   巧虎视频/火苗皮肤 尺寸与居中优化
   ========================================================================== */

/* 视频容器：增大宽高并居中 */
/* 巧虎专属：放大尺寸 + 混色滤掉视频黑底 */
.flame-video-container {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 600px;   /* ← 改这个数字，调宽度上限，比如改成 320px 会明显变小 */
  max-height: 800px;  /* ← 【新增这一行】限制高度上限，是当前"太大"的关键，建议先加上再调数值 */
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  z-index: 2;
}

.flame-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse at center, black 46%, transparent 100%); /* 【新增】边缘羽化，彻底消除矩形轮廓 */
  mask-image: radial-gradient(ellipse at center, black 46%, transparent 100%);
}
/* 备案号：字要小但必须清晰可见、可点击，不要用透明或隐藏的方式 */
.icp-footer {
  flex: 0 0 auto;
  text-align: center;
  font-size: 11px;
  padding: 2px 0 4px;
  background: var(--bg-base);
}
.icp-footer a { color: var(--text-muted); text-decoration: none; }