/* ============================================================
   宇宙银行 · 显化日记 —— 样式
   设计语言：玻璃拟态卡片
   主题：星空夜（默认）+ 4 套亮色主题，可一键切换
   ============================================================ */

:root {
  /* ---------- 基础色（默认主题：星空夜） ---------- */
  --bg:            #0d0b18;   /* 深空背景 */
  --surface:       rgba(255, 255, 255, 0.05);
  --surface-solid: #171430;
  --surface-2:     rgba(255, 255, 255, 0.08);
  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text:          #f4f2ff;
  --text-dim:      #b6b1d4;
  --text-muted:    #7d779f;

  --accent:        #9d7bff;   /* 星紫 */
  --accent-2:      #6fb1ff;   /* 星蓝 */
  --gold:          #f2c879;   /* 丰盛金 */
  --good:          #7fe3b0;   /* 感恩绿 */
  --warn:          #f2a65a;
  --danger:        #ff7d7d;

  --radius:        18px;
  --radius-sm:     12px;
  --shadow:        0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow:   0 0 40px rgba(157, 123, 255, 0.25);

  --tabbar-h:      64px;
  --topbar-h:      56px;

  /* ---------- 语义变量（各主题覆盖这些即可） ---------- */
  --header-bg:       rgba(13, 11, 24, 0.75);   /* 顶栏半透明底 */
  --header-bg-2:     rgba(13, 11, 24, 0.85);   /* 底栏半透明底 */
  --mask-bg:         rgba(5, 4, 12, 0.7);      /* 弹层遮罩 */

  --star:            rgba(255, 255, 255, 0.70); /* 星空亮点 */
  --star-dim:        rgba(255, 255, 255, 0.50);
  --star-faint:      rgba(255, 255, 255, 0.35);
  --glow-1:          rgba(157, 123, 255, 0.18); /* 星空顶部光晕 */
  --glow-2:          rgba(111, 177, 255, 0.12); /* 星空底部光晕 */
  --glow-3:          rgba(111, 177, 255, 0.10); /* aurora 左 */
  --glow-4:          rgba(157, 123, 255, 0.10); /* aurora 右 */

  --hero-glow-1:     rgba(157, 123, 255, 0.25); /* hero 卡片光晕 */
  --hero-glow-2:     rgba(242, 200, 121, 0.12);
  --hero-num-a:      #ffffff;                   /* 大数字渐变起色 */
  --hero-num-b:      var(--gold);
  --hero-num-c:      var(--accent-2);

  --meter-track:     rgba(157, 123, 255, 0.18); /* 等级进度条轨道 */
  --btn-shadow:      rgba(157, 123, 255, 0.35); /* 主按钮光晕 */

  --stat-c:          var(--accent-2);           /* 统计数字色 */
  --tab-active:      var(--accent-2);           /* 底部导航激活色 */

  --tag-bg:          rgba(157, 123, 255, 0.16); /* 分类标签底 */
  --tag-c:           var(--accent-2);           /* 分类标签字 */
  --sel-bg:          rgba(157, 123, 255, 0.22); /* 选中态底 */
  --hover-bg:        rgba(157, 123, 255, 0.12); /* 悬停态底 */

  /* 订单状态徽章 */
  --status-0-bg: rgba(111, 177, 255, 0.16);  --status-0-c: var(--accent-2);
  --status-1-bg: rgba(157, 123, 255, 0.18);  --status-1-c: #c9b0ff;
  --status-2-bg: rgba(242, 200, 121, 0.16);  --status-2-c: var(--gold);
  --status-3-bg: rgba(127, 227, 176, 0.16);  --status-3-c: var(--good);

  /* 成长曲线图表 */
  --chart-grid:      rgba(255, 255, 255, 0.07);
  --chart-area:      #9d7bff;                   /* 面积渐变 */
  --chart-line:      #f2c879;                   /* 折线 */
  --chart-dot:       #f2c879;                   /* 数据点 */
  --chart-dot-stroke:#171430;                   /* 数据点描边 */
  --chart-label:     #b6b1d4;                   /* 终点值标注 */
  --chart-date:      #7d779f;                   /* 底部日期 */
}

/* ============================================================
   亮色主题 · 薄荷绿 / 晴空蓝 / 暖阳奶油 / 蜜桃
   通过 <html data-theme="…"> 切换，变量覆盖即可换肤
   ============================================================ */
[data-theme="mint"] {
  --bg:            #f1faf6;
  --surface:       rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2:     rgba(30, 120, 80, 0.07);
  --border:        rgba(30, 110, 75, 0.14);
  --border-strong: rgba(30, 110, 75, 0.30);

  --text:          #1b3429;
  --text-dim:      #466454;
  --text-muted:    #7f998d;

  --accent:        #1fa87c;
  --accent-2:      #2ec9a0;
  --gold:          #c98a2a;
  --good:          #2ec07f;
  --danger:        #e26060;

  --shadow:        0 10px 30px rgba(40, 90, 70, 0.16);
  --shadow-glow:   0 0 40px rgba(31, 168, 124, 0.20);

  --header-bg:     rgba(246, 252, 248, 0.85);
  --header-bg-2:   rgba(246, 252, 248, 0.92);
  --mask-bg:       rgba(235, 246, 240, 0.78);

  --star:          rgba(45, 110, 80, 0.28);
  --star-dim:      rgba(45, 110, 80, 0.18);
  --star-faint:    rgba(45, 110, 80, 0.10);
  --glow-1:        rgba(31, 168, 124, 0.10);
  --glow-2:        rgba(46, 201, 160, 0.08);
  --glow-3:        rgba(31, 168, 124, 0.06);
  --glow-4:        rgba(46, 201, 160, 0.05);

  --hero-glow-1:   rgba(31, 168, 124, 0.14);
  --hero-glow-2:   rgba(201, 138, 42, 0.10);
  --hero-num-a:    #1b3429;
  --hero-num-b:    #1fa87c;
  --hero-num-c:    #2ec9a0;

  --meter-track:   rgba(31, 168, 124, 0.16);
  --btn-shadow:    rgba(31, 168, 124, 0.28);
  --stat-c:        #178d6e;
  --tab-active:    #178d6e;

  --tag-bg:        rgba(31, 168, 124, 0.12);
  --tag-c:         #178d6e;
  --sel-bg:        rgba(31, 168, 124, 0.16);
  --hover-bg:      rgba(31, 168, 124, 0.08);

  --status-0-bg: rgba(46, 201, 160, 0.16);  --status-0-c: #178d6e;
  --status-1-bg: rgba(31, 168, 124, 0.18);  --status-1-c: #157a5c;
  --status-2-bg: rgba(201, 138, 42, 0.16);  --status-2-c: #b8821f;
  --status-3-bg: rgba(46, 192, 127, 0.18);  --status-3-c: #1d9d66;

  --chart-grid:      rgba(27, 52, 41, 0.10);
  --chart-area:      #1fa87c;
  --chart-line:      #1fa87c;
  --chart-dot:       #1fa87c;
  --chart-dot-stroke:#ffffff;
  --chart-label:     #466454;
  --chart-date:      #7f998d;
}

[data-theme="sky"] {
  --bg:            #f0f7fc;
  --surface:       rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2:     rgba(30, 110, 190, 0.07);
  --border:        rgba(30, 110, 180, 0.14);
  --border-strong: rgba(30, 110, 180, 0.30);

  --text:          #1c2f3d;
  --text-dim:      #486074;
  --text-muted:    #82a0b4;

  --accent:        #2e88cf;
  --accent-2:      #4aa8e8;
  --gold:          #c98a2a;
  --good:          #34c47f;
  --danger:        #e26060;

  --shadow:        0 10px 30px rgba(40, 90, 140, 0.16);
  --shadow-glow:   0 0 40px rgba(46, 136, 207, 0.20);

  --header-bg:     rgba(240, 248, 253, 0.85);
  --header-bg-2:   rgba(240, 248, 253, 0.92);
  --mask-bg:       rgba(230, 242, 250, 0.78);

  --star:          rgba(40, 90, 130, 0.28);
  --star-dim:      rgba(40, 90, 130, 0.18);
  --star-faint:    rgba(40, 90, 130, 0.10);
  --glow-1:        rgba(46, 136, 207, 0.10);
  --glow-2:        rgba(74, 168, 232, 0.08);
  --glow-3:        rgba(46, 136, 207, 0.06);
  --glow-4:        rgba(74, 168, 232, 0.05);

  --hero-glow-1:   rgba(46, 136, 207, 0.14);
  --hero-glow-2:   rgba(201, 138, 42, 0.10);
  --hero-num-a:    #1c2f3d;
  --hero-num-b:    #2e88cf;
  --hero-num-c:    #4aa8e8;

  --meter-track:   rgba(46, 136, 207, 0.16);
  --btn-shadow:    rgba(46, 136, 207, 0.28);
  --stat-c:        #2e88cf;
  --tab-active:    #2e88cf;

  --tag-bg:        rgba(46, 136, 207, 0.12);
  --tag-c:         #2e88cf;
  --sel-bg:        rgba(46, 136, 207, 0.16);
  --hover-bg:      rgba(46, 136, 207, 0.08);

  --status-0-bg: rgba(74, 168, 232, 0.18);  --status-0-c: #1f74b8;
  --status-1-bg: rgba(46, 136, 207, 0.18);  --status-1-c: #1f5f92;
  --status-2-bg: rgba(201, 138, 42, 0.16);  --status-2-c: #b8821f;
  --status-3-bg: rgba(52, 196, 127, 0.18);  --status-3-c: #1d9d66;

  --chart-grid:      rgba(28, 47, 61, 0.10);
  --chart-area:      #2e88cf;
  --chart-line:      #2e88cf;
  --chart-dot:       #2e88cf;
  --chart-dot-stroke:#ffffff;
  --chart-label:     #486074;
  --chart-date:      #82a0b4;
}

[data-theme="cream"] {
  --bg:            #fdf8ef;
  --surface:       rgba(255, 255, 255, 0.75);
  --surface-solid: #fffdf8;
  --surface-2:     rgba(180, 130, 60, 0.08);
  --border:        rgba(180, 140, 70, 0.16);
  --border-strong: rgba(180, 140, 70, 0.32);

  --text:          #3a3022;
  --text-dim:      #6a5d47;
  --text-muted:    #a39377;

  --accent:        #e0a542;
  --accent-2:      #f2bd5f;
  --gold:          #c98a2a;
  --good:          #4db87a;
  --danger:        #df6b5a;

  --shadow:        0 10px 30px rgba(120, 90, 40, 0.16);
  --shadow-glow:   0 0 40px rgba(224, 165, 66, 0.22);

  --header-bg:     rgba(253, 248, 239, 0.85);
  --header-bg-2:   rgba(253, 248, 239, 0.92);
  --mask-bg:       rgba(246, 238, 224, 0.78);

  --star:          rgba(150, 110, 55, 0.28);
  --star-dim:      rgba(150, 110, 55, 0.18);
  --star-faint:    rgba(150, 110, 55, 0.10);
  --glow-1:        rgba(224, 165, 66, 0.12);
  --glow-2:        rgba(242, 189, 95, 0.10);
  --glow-3:        rgba(224, 165, 66, 0.07);
  --glow-4:        rgba(242, 189, 95, 0.06);

  --hero-glow-1:   rgba(224, 165, 66, 0.16);
  --hero-glow-2:   rgba(224, 165, 66, 0.10);
  --hero-num-a:    #3a3022;
  --hero-num-b:    #c98a2a;
  --hero-num-c:    #e0a542;

  --meter-track:   rgba(224, 165, 66, 0.18);
  --btn-shadow:    rgba(224, 165, 66, 0.32);
  --stat-c:        #b8821f;
  --tab-active:    #b8821f;

  --tag-bg:        rgba(224, 165, 66, 0.14);
  --tag-c:         #a06f14;
  --sel-bg:        rgba(224, 165, 66, 0.18);
  --hover-bg:      rgba(224, 165, 66, 0.10);

  --status-0-bg: rgba(242, 189, 95, 0.18);  --status-0-c: #a06f14;
  --status-1-bg: rgba(224, 165, 66, 0.18);  --status-1-c: #8f5f10;
  --status-2-bg: rgba(201, 138, 42, 0.18);  --status-2-c: #8f5f10;
  --status-3-bg: rgba(77, 184, 122, 0.18);  --status-3-c: #2e8f5e;

  --chart-grid:      rgba(58, 48, 34, 0.10);
  --chart-area:      #e0a542;
  --chart-line:      #c98a2a;
  --chart-dot:       #c98a2a;
  --chart-dot-stroke:#fffdf8;
  --chart-label:     #6a5d47;
  --chart-date:      #a39377;
}

[data-theme="peach"] {
  --bg:            #fdf3f1;
  --surface:       rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --surface-2:     rgba(220, 110, 130, 0.08);
  --border:        rgba(210, 110, 130, 0.15);
  --border-strong: rgba(210, 110, 130, 0.32);

  --text:          #3a2326;
  --text-dim:      #6d4a50;
  --text-muted:    #a88a8f;

  --accent:        #e97a8a;
  --accent-2:      #f0a0b0;
  --gold:          #c98a2a;
  --good:          #4db87a;
  --danger:        #df5b63;

  --shadow:        0 10px 30px rgba(160, 80, 90, 0.16);
  --shadow-glow:   0 0 40px rgba(233, 122, 138, 0.22);

  --header-bg:     rgba(253, 243, 241, 0.85);
  --header-bg-2:   rgba(253, 243, 241, 0.92);
  --mask-bg:       rgba(247, 232, 229, 0.78);

  --star:          rgba(170, 90, 100, 0.28);
  --star-dim:      rgba(170, 90, 100, 0.18);
  --star-faint:    rgba(170, 90, 100, 0.10);
  --glow-1:        rgba(233, 122, 138, 0.12);
  --glow-2:        rgba(240, 160, 176, 0.10);
  --glow-3:        rgba(233, 122, 138, 0.07);
  --glow-4:        rgba(240, 160, 176, 0.06);

  --hero-glow-1:   rgba(233, 122, 138, 0.16);
  --hero-glow-2:   rgba(201, 138, 42, 0.08);
  --hero-num-a:    #3a2326;
  --hero-num-b:    #e97a8a;
  --hero-num-c:    #f0a0b0;

  --meter-track:   rgba(233, 122, 138, 0.18);
  --btn-shadow:    rgba(233, 122, 138, 0.30);
  --stat-c:        #d65a6a;
  --tab-active:    #d65a6a;

  --tag-bg:        rgba(233, 122, 138, 0.12);
  --tag-c:         #d65a6a;
  --sel-bg:        rgba(233, 122, 138, 0.16);
  --hover-bg:      rgba(233, 122, 138, 0.08);

  --status-0-bg: rgba(240, 160, 176, 0.20);  --status-0-c: #d65a6a;
  --status-1-bg: rgba(233, 122, 138, 0.18);  --status-1-c: #c14a58;
  --status-2-bg: rgba(201, 138, 42, 0.16);  --status-2-c: #b8821f;
  --status-3-bg: rgba(77, 184, 122, 0.18);  --status-3-c: #2e8f5e;

  --chart-grid:      rgba(58, 35, 38, 0.10);
  --chart-area:      #e97a8a;
  --chart-line:      #e97a8a;
  --chart-dot:       #e97a8a;
  --chart-dot-stroke:#ffffff;
  --chart-label:     #6d4a50;
  --chart-date:      #a88a8f;
}

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

html { height: 100%; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

/* ---------- 星空背景 ---------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1px 1px at 20% 30%, var(--star), transparent),
    radial-gradient(1px 1px at 40% 70%, var(--star-dim), transparent),
    radial-gradient(2px 2px at 60% 20%, var(--star-faint), transparent),
    radial-gradient(1px 1px at 80% 50%, var(--star-dim), transparent),
    radial-gradient(1px 1px at 90% 80%, var(--star), transparent),
    radial-gradient(2px 2px at 10% 85%, var(--star-dim), transparent),
    radial-gradient(1px 1px at 30% 55%, var(--star-faint), transparent),
    radial-gradient(1px 1px at 70% 90%, var(--star-dim), transparent),
    radial-gradient(1px 1px at 50% 40%, var(--star), transparent),
    radial-gradient(1200px 600px at 50% -10%, var(--glow-1), transparent 60%),
    radial-gradient(800px 400px at 90% 110%, var(--glow-2), transparent 60%),
    var(--bg);
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% 20%, var(--glow-3), transparent 60%),
    radial-gradient(500px 380px at 85% 40%, var(--glow-4), transparent 60%);
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.app-name {
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-date { font-size: 13px; color: var(--text-dim); }

.icon-btn {
  border: none;
  background: var(--surface);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  transition: background .2s;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- 主视图 ---------- */
main { max-width: 520px; margin: 0 auto; padding: 16px 16px 8px; }
.view { display: none; animation: fade .35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.greeting { font-size: 17px; margin-bottom: 14px; color: var(--text-dim); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* ---------- Hero 丰盛值 ---------- */
.hero-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(300px 200px at 90% -10%, var(--hero-glow-1), transparent 60%),
    radial-gradient(240px 180px at -10% 110%, var(--hero-glow-2), transparent 60%),
    var(--surface);
}
.hero-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.hero-label { font-size: 14px; color: var(--text-dim); letter-spacing: 1px; }
.ghost-chip {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}
.hero-num {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--hero-num-a), var(--hero-num-b) 60%, var(--hero-num-c));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* 进度条：填充用渐变，轨道用同色系浅阶 */
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--meter-track);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--gold));
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}
.hero-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.cash-in { color: var(--good); font-weight: 600; }

/* ---------- 统计磁贴 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { text-align: center; padding: 14px 8px; margin-bottom: 0; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--stat-c); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- 图表卡片 ---------- */
.chart-card { padding: 16px 16px 10px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.card-head h2 { font-size: 15px; }
.muted { color: var(--text-muted); font-size: 12px; }
.chart { width: 100%; height: 120px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart-tip {
  position: fixed;
  z-index: 60;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: var(--shadow);
}
.chart-tip.show { opacity: 1; }

/* ---------- 快捷入口 ---------- */
.quick-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 6px;
  margin-bottom: 0;
  text-align: center;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: transform .15s, border-color .15s;
}
.quick:active { transform: scale(0.97); }
.quick-emoji { font-size: 24px; }
.quick-title { font-size: 13px; font-weight: 600; }
.quick-sub { font-size: 11px; color: var(--text-muted); }

/* ---------- 今日仪式 ---------- */
.ritual-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ritual-head h2 { font-size: 15px; }
.ritual-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ritual-list li { display: flex; gap: 10px; align-items: flex-start; }
.ritual-check {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--bg);
  transition: all .2s;
}
.ritual-check.done {
  background: var(--good);
  border-color: var(--good);
}
.ritual-list p { font-size: 13px; color: var(--text-dim); }
.ritual-list b { color: var(--text); }

/* ---------- 区块标题 ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.section-head h1 { font-size: 24px; }
.section-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--btn-shadow);
  transition: transform .15s, box-shadow .15s;
  font-family: inherit;
}
.primary-btn:active { transform: scale(0.96); }
.primary-btn.block { display: block; width: 100%; }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; }

.ghost-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.ghost-btn.danger { color: var(--danger); border-color: rgba(255, 125, 125, 0.4); }

/* ---------- 订单看板 ---------- */
.board { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  position: relative;
}
.order-card:active { transform: scale(0.98); }
.order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.order-del {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s, background .2s;
  flex: 0 0 auto;
}
.order-del:hover { color: var(--danger); background: rgba(255, 125, 125, 0.12); }
.tag-pill {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 10px;
  background: var(--tag-bg);
  color: var(--tag-c);
}
.status-pill {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}
.status-0 { background: var(--status-0-bg); color: var(--status-0-c); }   /* 已下单 */
.status-1 { background: var(--status-1-bg); color: var(--status-1-c); }   /* 显化中 */
.status-2 { background: var(--status-2-bg); color: var(--status-2-c); }   /* 已收货 */
.status-3 { background: var(--status-3-bg); color: var(--status-3-c); }   /* 已完成 */
.order-text { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.order-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.order-action {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}
.order-progress { margin-top: 10px; display: flex; gap: 4px; }
.prog-dot { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.prog-dot.on { background: linear-gradient(90deg, var(--accent), var(--gold)); }

.board-hint { text-align: center; margin-top: 4px; }

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.empty-emoji { font-size: 44px; margin-bottom: 10px; }
.empty p { margin-bottom: 14px; }

/* ---------- 释放室 ---------- */
.release-wizard { padding: 0; overflow: hidden; }
.wizard-progress { height: 4px; background: var(--border); }
.wizard-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--gold));
  transition: width .3s ease;
}
.wizard-body { padding: 18px 16px; min-height: 230px; display: flex; flex-direction: column; justify-content: center; }
.wizard-q { font-size: 15px; font-weight: 600; margin-bottom: 6px; text-align: center; }
.wizard-sub { font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 16px; }
.wizard-options { display: flex; flex-direction: column; gap: 10px; }
.wizard-opt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.wizard-opt:hover, .wizard-opt:focus { border-color: var(--accent); background: var(--hover-bg); }
.wizard-opt small { display: block; color: var(--text-muted); margin-top: 2px; }
.wizard-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: center; }

.emotion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.emotion-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.emotion-chip.selected {
  background: var(--sel-bg);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.emotion-note { display: flex; gap: 10px; }
.emotion-note input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.emotion-note input::placeholder { color: var(--text-muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

.release-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.release-bar-row { display: grid; grid-template-columns: 56px 1fr 30px; align-items: center; gap: 10px; font-size: 12px; }
.release-bar-row .name { color: var(--text-dim); }
.release-bar-track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.release-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); width: 0%; transition: width .6s ease; }
.release-bar-row .count { text-align: right; color: var(--text-muted); }
.release-empty { text-align: center; color: var(--text-muted); padding: 16px 0; font-size: 13px; }

/* ---------- 感恩日志 ---------- */
.gratitude-form h2 { font-size: 15px; margin-bottom: 10px; }
.gratitude-form textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  line-height: 1.6;
}
.gratitude-form textarea::placeholder { color: var(--text-muted); }
.grat-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.list-title { font-size: 14px; margin: 18px 0 10px; color: var(--text-dim); }
.grat-list { display: flex; flex-direction: column; gap: 10px; }
.grat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.grat-item .date { font-size: 11px; color: var(--gold); display: flex; justify-content: space-between; }
.grat-item .txt { font-size: 13px; color: var(--text-dim); margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 丰盛商城 ---------- */
.shop-head { margin-bottom: 10px; }
.shop-motto {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 4px;
}
.shop-rate { font-size: 12px; }

.shop-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.shop-balance {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
}
.shop-search {
  flex: 1;
  display: flex;
}
.shop-search input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  min-width: 0;
}
.shop-search input::placeholder { color: var(--text-muted); }

.shop-cat {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.shop-cat::-webkit-scrollbar { display: none; }
.shop-chip {
  flex: 0 0 auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.shop-chip.active {
  background: var(--sel-bg);
  border-color: var(--accent);
  color: var(--text);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.shop-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: transform .15s, border-color .15s;
}
.shop-item:active { transform: scale(0.97); }
.shop-item:hover { border-color: var(--border-strong); }
.shop-name { font-size: 14px; font-weight: 600; }
.shop-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 30px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 4px;
}
.shop-buy {
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent-2);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 12px;
}

/* 购买确认弹层 */
.shop-confirm { text-align: center; padding: 8px 0 16px; }
.shop-confirm-name { font-size: 18px; font-weight: 700; }
.shop-confirm-cat { margin-top: 2px; }
.shop-confirm-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold);
  margin: 10px 0 14px;
}
.shop-confirm-balance { font-size: 13px; color: var(--text-dim); }
.shop-confirm-remain { font-size: 13px; color: var(--good); margin-top: 4px; }
.shop-confirm-note { margin: 4px 0 14px; }

.shop-error {
  color: var(--danger);
  font-size: 13px;
  padding: 10px 0;
}

/* 已购买记录 */
.shop-purchases { margin-top: 16px; }
.purchase-list { display: flex; flex-direction: column; margin-top: 6px; }
.purchase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.purchase-row:last-child { border-bottom: none; }
.purchase-name { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-price { color: var(--gold); font-weight: 600; flex: 0 0 auto; }
.shop-purchases .empty { padding: 24px 8px; }

/* ---------- 设置页 ---------- */
.about-card p, .about-card li, .data-card p, .install-card p { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.about-card h2, .data-card h2, .install-card h2 { font-size: 15px; margin-bottom: 10px; }
.about-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.about-list b { color: var(--text); }
.about-list { padding-left: 0; }
.small { font-size: 12px; }
.data-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- 主题选择器 ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.theme-opt {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.theme-opt:active { transform: scale(0.96); }
.theme-opt.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--sel-bg);
}
.theme-opt .swatch {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  display: block;
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--mask-bg);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* hidden 属性优先于上面的 display:flex —— 否则弹层关不掉 */
.modal-mask[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 22px 22px 0 0;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  animation: sheetUp .3s ease;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 17px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.field select { appearance: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
}
.tag-chip.active { background: var(--sel-bg); border-color: var(--accent); color: var(--text); }
.center { text-align: center; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  background: var(--header-bg-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: color .2s;
}
.tab.active { color: var(--tab-active); }
.tab-ico { font-size: 19px; filter: grayscale(.4); transition: filter .2s, transform .2s; }
.tab.active .tab-ico { filter: none; transform: translateY(-1px); }
.tab-big { font-size: 24px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 90;
  box-shadow: var(--shadow-glow);
  animation: fade .3s ease;
  white-space: nowrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 360px) {
  .hero-num { font-size: 44px; }
  .stat-value { font-size: 22px; }
}

/* ============ 丰盛日记 · 消费丰盛 ============ */
.abund-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.abund-bless {
  font-size: 15px; line-height: 1.9; text-align: center;
  color: var(--gold); margin: 4px 0 14px;
}
.abund-preview {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 14px; margin-bottom: 14px; text-align: center;
}
.abund-preview-name { font-size: 15px; font-weight: 600; color: var(--text); word-break: break-word; }
.abund-preview-meta { font-size: 12px; margin-top: 4px; }
.abund-preview-gain { font-size: 24px; font-weight: 700; color: var(--gold); margin-top: 8px; }
.abund-amount { font-size: 12px; color: var(--gold); margin-left: 6px; }
@media (max-width: 420px) { .abund-row { grid-template-columns: 1fr; } }

/* ============ 账号 · 云端同步 ============ */
.account-btns { display: flex; gap: 10px; }
.account-btns .primary-btn, .account-btns .ghost-btn { flex: 1; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.account-email { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.sync-chip {
  font-size: 11px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.06); color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.sync-chip.bad { color: #e66767; border-color: rgba(230, 103, 103, 0.35); }
#account-user .ghost-btn { width: 100%; }

/* ============ 登录引导页 ============ */
/* 卡片为固定深色底，文字颜色在卡片内本地定义，不跟随主题（避免浅色主题下深色字看不清） */
.ghost-btn.block { display: block; width: 100%; }
.onboard {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 4, 12, 0.82);
  backdrop-filter: blur(10px);
  padding: 20px;
}
.onboard[hidden] { display: none; }
.onboard-card {
  --otext: #f4f2ff;
  --odim: #b6b1d4;
  --omuted: #8d87b8;
  --oborder: rgba(255, 255, 255, 0.12);
  --osurface: rgba(255, 255, 255, 0.06);
  width: min(360px, 100%);
  background: rgba(20, 17, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 30px 24px 22px;
  text-align: center;
  color: var(--otext);
}
.onboard-logo { font-size: 42px; }
.onboard-card h1 { font-size: 19px; margin: 12px 0 6px; color: var(--otext); }
.onboard-sub { font-size: 12px; color: var(--odim); margin-bottom: 24px; }
.onboard-card .primary-btn, .onboard-card .ghost-btn { margin-bottom: 12px; }
.onboard-card .ghost-btn {
  background: var(--osurface);
  border-color: var(--oborder);
  color: var(--otext);
}
.onboard-card .field > span { color: var(--odim); }
.onboard-card .field input {
  background: var(--osurface);
  border-color: var(--oborder);
  color: var(--otext);
}
.onboard-card .field input::placeholder { color: var(--omuted); }
.onboard-guest {
  background: none; border: none; cursor: pointer; width: 100%;
  color: var(--odim); font-size: 13px; padding: 8px 0;
}
.onboard-guest:hover { color: #f2c879; }
.onboard-foot { font-size: 11px; color: var(--omuted); margin-top: 16px; }
#onboard-form { text-align: left; margin-top: 4px; }
#onboard-form .field { margin-bottom: 12px; }
