/* =====================================================
   戒烟打卡 · 样式表
   设计基调：简约干净，浅蓝 + 浅粉柔和配色，移动端优先
   ===================================================== */

/* ---------- 设计变量 ---------- */
:root {
  /* 浅蓝主色 */
  --blue-50:  #EEF6FC;
  --blue-100: #D9ECF8;
  --blue-500: #5FA8D6;
  --blue-600: #4A93C2;
  --blue-700: #3A7CA8;

  /* 浅粉辅色 */
  --pink-50:  #FDF0F4;
  --pink-100: #FADDE7;
  --pink-500: #E88FB1;
  --pink-600: #D977A2;

  /* 中性色 */
  --ink:       #2C3E50;
  --ink-soft:  #5B6B7B;
  --ink-mute:  #93A3B3;
  --bg:        #F7FBFE;
  --card:      #FFFFFF;
  --line:      #E6EEF5;

  /* 警示（本地数据提示） */
  --warn-bg:     #FFF8E6;
  --warn-border: #F0DCA8;
  --warn-ink:    #8A6D2F;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 2px 12px rgba(90, 140, 180, 0.10);
  --tabbar-h:  60px;

  /* iOS 安全区（刘海屏 / 底部小黑条） */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--bg) 40%);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100dvh; /* 移动端视口高度用 dvh，避免地址栏抖动 */
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); }

/* ---------- 整体布局 ---------- */
#app {
  max-width: 480px;         /* H5 移动端优先，桌面居中呈现手机版式 */
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#main {
  flex: 1;
  padding: 12px 14px 16px;
  overflow-y: auto;
}

/* 视图切换 */
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 顶部标题 ---------- */
.app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--pink-500));
}
.app-header h1 { font-size: 1.1rem; font-weight: 700; }
.brand-sub { font-size: 0.75rem; color: var(--ink-mute); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(230, 238, 245, 0.6);
}
.card h2 { font-size: 1rem; margin: 0; }
.card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.card h4 { font-size: 0.85rem; margin: 10px 0 4px; }
.card p { font-size: 0.88rem; }
.muted { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- 本地数据警示横幅 ---------- */
.banner-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.8rem;
}
.banner-warn strong { display: block; margin-bottom: 2px; }
.banner-warn b { color: #B0531F; }
.banner-link { color: var(--blue-700); font-weight: 600; font-size: 0.8rem; padding: 4px 0; }

/* ---------- 首页 Hero（连续天数） ---------- */
.hero-card {
  text-align: center;
  padding: 22px 16px;
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--pink-50) 100%);
  border: 1px solid var(--blue-100);
}
.hero-label { color: var(--ink-soft); font-size: 0.85rem; }
.hero-num { font-size: 3.4rem; font-weight: 800; line-height: 1.15; color: var(--blue-700); }
.hero-num .hero-unit { font-size: 1rem; font-weight: 600; color: var(--ink-soft); margin-left: 4px; }
.hero-since { color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- 今日打卡 ---------- */
.status-pick { display: flex; gap: 10px; margin-bottom: 14px; }
.status-pick button {
  flex: 1;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid var(--line);
  background: #fff;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.status-pick button small { font-weight: 400; font-size: 0.7rem; color: var(--ink-soft); }
.pick-free.sel    { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-700); }
.pick-relapse.sel { border-color: var(--pink-500); background: var(--pink-50); color: var(--pink-600); }

.relapse-hint {
  display: none;
  background: var(--pink-50);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--pink-600);
  margin-bottom: 12px;
}
.relapse-hint.show { display: block; }

/* 触发场景标签（可多选） */
.chip-label { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.8rem;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.chip.on { background: var(--blue-500); border-color: var(--blue-500); color: #fff; }

/* 备注输入 */
.note-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 64px;
  margin-bottom: 14px;
  outline: none;
}
.note-input:focus { border-color: var(--blue-500); }

/* 已打卡状态展示 */
.checked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.checked-badge.free    { background: var(--blue-50);  color: var(--blue-700); }
.checked-badge.relapse { background: var(--pink-50); color: var(--pink-600); }
.checked-meta { font-size: 0.78rem; color: var(--ink-mute); margin-bottom: 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tag {
  background: var(--blue-50);
  color: var(--blue-700);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
}
.tag.relapse { background: var(--pink-50); color: var(--pink-600); }
.note-show {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-blue    { background: var(--blue-500); color: #fff; }
.btn-blue:hover { background: var(--blue-600); }
.btn-pink    { background: var(--pink-500); color: #fff; }
.btn-pink:hover { background: var(--pink-600); }
.btn-ghost   { background: #fff; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-danger  { background: #fff; color: #C0504D; border: 1px solid #EBC7C6; }
.btn-gradient {
  background: linear-gradient(90deg, var(--blue-500), var(--pink-500));
  color: #fff;
}
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }

/* ---------- 急救快捷入口 / 高级版入口 ---------- */
.sos-quick, .pro-teaser {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: left;
}
.sos-quick { border: 1px solid var(--pink-100); }
.pro-teaser { border: 1px solid var(--blue-100); }
.sos-quick-icon { font-size: 1.6rem; }
.sos-quick-text, .pro-teaser-text { flex: 1; display: flex; flex-direction: column; }
.sos-quick-text strong, .pro-teaser-text strong { font-size: 0.9rem; }
.sos-quick-text small, .pro-teaser-text small { font-size: 0.75rem; color: var(--ink-mute); }
.pro-tag {
  display: inline-block;
  background: linear-gradient(90deg, var(--blue-500), var(--pink-500));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 6px;
  padding: 2px 8px;
}
.pro-teaser > span:last-child { color: var(--ink-mute); }
.sos-quick > span:last-child { color: var(--pink-500); font-weight: 700; }

/* ---------- 统计页 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1.3; }
.stat-label { font-size: 0.75rem; color: var(--ink-soft); }
.stat-blue .stat-num { color: var(--blue-600); }
.stat-pink .stat-num { color: var(--pink-600); }
.stat-plain .stat-num { color: var(--ink-soft); }

.money-note {
  font-size: 0.72rem;
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 14px;
}
.gentle-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 4px 12px;
}

/* ---------- 日历视图 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font-size: 0.95rem; }
.cal-nav {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 1.2rem;
  line-height: 1;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: var(--bg);
  position: relative;
}
.cal-day.free    { background: var(--blue-100); color: var(--blue-700); font-weight: 700; }
.cal-day.relapse { background: var(--pink-100); color: var(--pink-600); font-weight: 700; }
.cal-day.today   { box-shadow: 0 0 0 2px var(--blue-500); }
.cal-day.empty   { background: transparent; }
.cal-day.future  { opacity: 0.35; }

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-free    { background: var(--blue-500); }
.dot-relapse { background: var(--pink-500); }
.dot-none    { background: var(--line); }

/* ---------- 急救页 ---------- */
.sos-intro h2 { margin-bottom: 6px; }
.crave-time {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  color: var(--blue-700);
  letter-spacing: 2px;
  margin: 10px 0;
  font-variant-numeric: tabular-nums;
}
.breath-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0 6px;
}
.breath-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-100), var(--pink-100));
  border: 3px solid var(--blue-500);
  transform: scale(0.65);
  transition: transform 4s ease-in-out;
}
.breath-phase { font-size: 1.05rem; font-weight: 700; margin-top: 16px; color: var(--blue-700); min-height: 1.6em; }
.breath-count { font-size: 1.6rem; font-weight: 800; color: var(--pink-600); min-height: 1.4em; font-variant-numeric: tabular-nums; }
.tips { padding-left: 18px; font-size: 0.86rem; color: var(--ink-soft); }
.tips li { margin-bottom: 4px; }

/* ---------- 设置页表单 ---------- */
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row label { font-size: 0.82rem; color: var(--ink-soft); }
.form-row input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  background: #fff;
}
.form-row input:focus { border-color: var(--blue-500); }

.card-pro { border: 1px solid var(--blue-100); background: linear-gradient(160deg, #fff 55%, var(--blue-50)); }
.card-danger { border: 1px solid #EBC7C6; }
.card-danger h3 { color: #C0504D; }
.card-about p { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 4px; }

.pro-list { list-style: none; margin: 10px 0 14px; }
.pro-list li {
  font-size: 0.86rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-soft);
}
.pro-list li:last-child { border-bottom: none; }

/* ---------- 底部免责声明（固定） ---------- */
.disclaimer {
  text-align: center;
  font-size: 0.68rem;
  color: var(--ink-mute);
  padding: 8px 20px calc(8px + var(--safe-bottom) + var(--tabbar-h));
  background: var(--bg);
}

/* ---------- 底部 Tab 导航 ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  color: var(--ink-mute);
  transition: color 0.15s ease;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--blue-600); font-weight: 700; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(44, 62, 80, 0.45); }
.modal-body {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: 0;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.pro-price {
  text-align: center;
  font-size: 0.85rem;
  color: var(--pink-600);
  font-weight: 700;
  margin-bottom: 6px;
}

/* ---------- Toast 轻提示 ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  transform: translateX(-50%) translateY(10px);
  background: rgba(44, 62, 80, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-width: 86%;
  text-align: center;
  z-index: 60;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 戒烟知识库页面 ---------- */
.kb-hero {
  text-align: center;
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--pink-50) 100%);
  border: 1px solid var(--blue-100);
}
.kb-hero h2 { margin-bottom: 4px; }
.kb-hero p { font-size: 0.85rem; color: var(--ink-soft); }

/* 板块 1：危害科普手风琴（details/summary 原生组件，无 JS 也稳定） */
details.kb-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
}
details.kb-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue-50);
  color: var(--ink);
}
details.kb-item summary::-webkit-details-marker { display: none; }
details.kb-item summary::after {
  content: '+';
  flex: none;
  color: var(--blue-600);
  font-weight: 800;
  font-size: 1rem;
}
details.kb-item[open] summary::after { content: '−'; }
details.kb-item[open] summary { color: var(--blue-700); }
details.kb-item .kb-body {
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

/* 板块 2：身体恢复时间线 */
.timeline { list-style: none; margin: 14px 0 8px; }
.timeline li {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 34px;
  top: 26px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--blue-100), var(--pink-100));
}
.timeline li:last-child { padding-bottom: 4px; }
.timeline li:last-child::before { display: none; }
.t-time {
  flex: none;
  width: 68px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 5px 0;
  height: fit-content;
}
.timeline li:nth-child(even) .t-time {
  color: var(--pink-600);
  background: var(--pink-50);
  border-color: var(--pink-100);
}
.t-body b { display: block; font-size: 0.87rem; margin-bottom: 2px; }
.t-body p { font-size: 0.78rem; color: var(--ink-soft); }

/* 板块 3：戒烟方法卡片 */
.method {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg);
}
.method:last-child { margin-bottom: 0; }
.method h4 { margin: 0 0 4px; font-size: 0.9rem; }
.method p { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.7; }

/* 板块 4：自测问卷 */
.q-item { margin-bottom: 16px; }
.q-title {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 26px;
  position: relative;
}
.q-title::before {
  content: attr(data-no);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--blue-500);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.q-opts { display: flex; flex-direction: column; gap: 6px; }
.q-opt { display: block; }
.q-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.q-opt span {
  display: block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: #fff;
  transition: all 0.12s ease;
}
.q-opt input:checked + span {
  background: var(--blue-50);
  border-color: var(--blue-500);
  color: var(--blue-700);
  font-weight: 600;
}
.q-opt input:focus-visible + span { outline: 2px solid var(--blue-500); outline-offset: 2px; }

/* 问卷结果 */
.q-result {
  margin-top: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-100);
  background: linear-gradient(135deg, var(--blue-50), var(--pink-50));
  padding: 14px;
}
.q-result .qr-level { font-size: 1.05rem; font-weight: 800; color: var(--blue-700); margin-bottom: 6px; }
.q-result p { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.7; }
.q-result .qr-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--blue-100);
  font-size: 0.74rem;
  color: var(--ink-mute);
}

/* 知识库页面底部统一提示 */
.kb-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-mute);
  padding: 8px 16px 4px;
}

/* =====================================================
   高级版界面预览（纯 UI 模拟）
   - body.pro-preview 时隐藏免费版 #app，只显示 #proApp
   - 配色延续浅蓝 + 浅粉
   ===================================================== */
body.pro-preview #app { display: none; }

#proApp {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--pink-50) 0%, var(--bg) 26%);
  animation: fadeIn 0.3s ease;
}
#proApp[hidden] { display: none; }

/* 高级版顶栏 */
.pro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.pro-header h1 { font-size: 1.1rem; font-weight: 700; }
.pro-exit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 6px 14px;
}

/* 演示模式横幅 */
.pro-demo-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.6;
  padding: 9px 12px;
  margin: 12px 14px 0;
}

.pro-main { flex: 1; padding: 12px 14px 16px; }

/* ---- 登录卡片 ---- */
.pro-login-card { border: 1px solid var(--blue-100); }
.pro-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  font-size: 0.72rem;
  color: var(--ink-mute);
}
.pro-divider::before, .pro-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.pro-oauth { font-size: 0.8rem; opacity: 0.6; }
.pro-legal { font-size: 0.68rem; text-align: center; margin-top: 10px; color: var(--ink-mute); }

/* ---- 账号与云同步 ---- */
.pro-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.pro-avatar {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-100), var(--pink-100));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.pro-account-info { flex: 1; display: flex; flex-direction: column; }
.pro-account-info b { font-size: 0.9rem; }
.pro-account-info small { font-size: 0.7rem; color: var(--ink-mute); }
.pro-logout { font-size: 0.74rem; color: var(--pink-600); font-weight: 600; }

.pro-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 10px;
}
.pro-device-list { list-style: none; margin: 4px 0 12px; }
.pro-device-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--ink-soft);
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.pro-device-list li:last-child { border-bottom: none; }
.pro-device-list small { font-size: 0.7rem; color: var(--ink-mute); }

/* ---- 深度数据分析图表 ---- */
.chart-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 16px 0 10px;
  padding-left: 8px;
  border-left: 3px solid var(--blue-500);
}

/* 柱状图 */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 110px;
  padding: 4px 2px 20px;
}
.chart-bar {
  flex: 1;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-100));
  position: relative;
  min-height: 5px;
  transition: height 0.4s ease;
}
.chart-bar.relapse { background: linear-gradient(180deg, var(--pink-500), var(--pink-100)); }
.chart-bar span {
  position: absolute;
  bottom: -17px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* 横向条形图 */
.hbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hbar-row .hbar-label { flex: none; width: 62px; font-size: 0.76rem; color: var(--ink-soft); text-align: right; }
.hbar-row .hbar-track { flex: 1; height: 14px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hbar-row .hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-500), var(--pink-500));
  transition: width 0.5s ease;
}
.hbar-row .hbar-val { flex: none; width: 36px; font-size: 0.72rem; color: var(--ink-mute); }

/* 热力图 */
.heat-grid {
  display: grid;
  grid-template-columns: 46px repeat(7, 1fr);
  gap: 4px;
  align-items: center;
}
.heat-grid .heat-rowlabel { font-size: 0.62rem; color: var(--ink-mute); }
.heat-grid .heat-collabel { font-size: 0.62rem; color: var(--ink-mute); text-align: center; }
.heat-cell { width: 100%; aspect-ratio: 1; border-radius: 4px; }
.h0 { background: var(--bg); }
.h1 { background: var(--blue-50); }
.h2 { background: var(--blue-100); }
.h3 { background: var(--blue-500); }
.h4 { background: var(--pink-500); }
.heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 8px;
  font-size: 0.66rem;
  color: var(--ink-mute);
}
.heat-legend .heat-cell { width: 12px; aspect-ratio: 1; }

/* ---- CSV 导出界面 ---- */
#proApp select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
  outline: none;
}
#proApp .chip[disabled] { cursor: default; opacity: 0.75; }

.csv-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 12px;
  background: #fff;
}
.csv-preview table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.csv-preview th, .csv-preview td {
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.csv-preview th { background: var(--blue-50); color: var(--blue-700); font-weight: 700; }
.csv-preview td { color: var(--ink-soft); }
.csv-free    { color: var(--blue-600); font-weight: 700; }
.csv-relapse { color: var(--pink-600); font-weight: 700; }

/* ---- 无限日记 ---- */
.pro-diary-editor { margin-top: 12px; }
.pro-diary-list { margin-top: 6px; }
.diary-entry {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-500);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 10px 12px;
  margin: 10px 0 0;
}
.diary-entry .diary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.diary-entry .diary-mood { font-size: 0.9rem; }
.diary-entry .diary-text { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.7; white-space: pre-wrap; }

/* ---- 高级版多页面视图切换 ---- */
.pro-view { display: none; animation: fadeIn 0.25s ease; }
.pro-view.active { display: block; }
/* 底部导航固定，主内容区预留空间 */
.pro-main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); }

/* ---- 高级版概览 Hero ---- */
.pro-hero {
  text-align: center;
  padding: 22px 16px;
  background: linear-gradient(135deg, var(--pink-50) 0%, var(--blue-50) 100%);
  border: 1px solid var(--pink-100);
}

/* ---- 高级版底部导航（独立于免费版 Tab 栏，粉色高亮区分） ---- */
.pro-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--pink-100);
  z-index: 30;
}
.pro-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  color: var(--ink-mute);
  transition: color 0.15s ease;
}
.pro-tab svg { width: 22px; height: 22px; }
.pro-tab.active { color: var(--pink-600); font-weight: 700; }

/* ---- 登录账号界面（整页覆盖层） ---- */
.pro-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: linear-gradient(180deg, var(--pink-50) 0%, var(--bg) 30%);
  overflow-y: auto;
}
.pro-login-overlay[hidden] { display: none; }
.pro-login-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 14px calc(22px + var(--safe-bottom));
}

/* ---------- 桌面端微调 ---------- */
@media (min-width: 520px) {
  #app { box-shadow: 0 0 40px rgba(90, 140, 180, 0.12); }
  .modal { align-items: center; }
  .modal-body { border-radius: var(--radius); margin: 0 20px; }
}

/* 尊重系统深色模式下的自动对比（保持浅色主题为主） */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
