/* ============ 道坐 · 形神兼养（3D 粒子星云布局） ============ */
:root {
  --bg: #12100b;             /* 深空 */
  --bg-deep: #0f0d0a;
  --panel: rgba(26, 23, 17, 0.72);
  --card: rgba(30, 27, 20, 0.66);
  --ink: #e6dfcc;            /* 暖白墨 */
  --ink-soft: #a39a86;
  --ink-faint: #756e5e;
  --line: #3a3628;
  --line-soft: #2c291e;
  --cinnabar: #c05a3c;       /* 朱砂（暗底提亮） */
  --cinnabar-deep: #a34a30;
  --teal: #6d8f80;           /* 黛青 */
  --gold: #c9b98a;           /* 金 */
  --danger: #c25a40;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============ 全屏 3D 粒子背景 ============ */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ============ 顶部条 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(18, 16, 11, 0.6);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--ink);
}
.brand-sub {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-faint);
  margin-left: 6px;
}

.streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 17px;
  padding: 5px 12px;
  border: 1px solid #4a4232;
  border-radius: 999px;
  background: rgba(40, 35, 24, 0.6);
}
.streak-label { font-size: 13px; color: var(--ink-soft); }

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 92px 24px 70px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  /* 极淡中心光晕，给粒子一个「丹田」锚点 */
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 185, 138, 0.10) 0%, rgba(201, 185, 138, 0) 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-title {
  font-family: var(--serif);
  font-size: 52px;
  letter-spacing: 18px;
  text-indent: 18px;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 0 30px rgba(201, 185, 138, 0.18);
}
.hero-sub {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 6px;
  color: var(--gold);
}
.hero-tip {
  margin-top: 18px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ============ Section 通用 ============ */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
}
.section-title {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 4px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.sec-no {
  font-size: 15px;
  color: var(--cinnabar);
  border: 1px solid #5a3a2a;
  border-radius: 4px;
  padding: 1px 8px;
}
.section-desc {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ============ 三件事卡片 ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(8px);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.card:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4), 0 0 20px rgba(201, 185, 138, 0.06);
  transform: translateY(-2px);
  border-color: #4a4232;
}
.card.done { border-color: var(--teal); background: rgba(52, 66, 58, 0.55); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-head h3 { font-family: var(--serif); font-size: 20px; letter-spacing: 2px; color: var(--ink); }
.badge {
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}
.card-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.7; }
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.card-note { font-size: 13px; color: var(--ink-faint); }

.btn {
  font-family: var(--sans);
  font-size: 15px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--cinnabar);
  color: #fff3e6;
  font-family: var(--serif);
  letter-spacing: 2px;
}
.btn-primary:hover { background: var(--cinnabar-deep); }

.btn-check {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.btn-check:hover { border-color: var(--teal); color: var(--teal); }
.card.done .btn-check {
  background: var(--teal);
  border-color: var(--teal);
  color: #eaf3ef;
}

/* ============ 本周进度 ============ */
.week {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.week-label { font-size: 13px; color: var(--ink-soft); }
.week-dots { display: flex; gap: 8px; }
.week-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.04);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-faint);
}
.week-dot.on { background: var(--teal); border-color: var(--teal); color: #eaf3ef; }
.week-dot.today { box-shadow: 0 0 0 2px var(--cinnabar); }
.week-today { margin-left: auto; font-family: var(--serif); font-size: 15px; color: var(--gold); }

/* ============ 心法阶梯 ============ */
.steps { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.step {
  display: flex;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  backdrop-filter: blur(8px);
}
.step-no {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.04);
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body h3 { font-family: var(--serif); font-size: 18px; letter-spacing: 1px; margin-bottom: 8px; color: var(--ink); }
.step-body ul { padding-left: 20px; }
.step-body li { font-size: 15px; color: var(--ink-soft); margin-bottom: 4px; }
.step-quote { border-color: #4a4232; background: rgba(40, 35, 24, 0.5); }
.quote {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2;
  color: var(--ink);
}
.quote-src { font-size: 13px; color: var(--ink-faint); margin-left: 8px; }
.quote-plain { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

/* ============ 食疗阶梯 ============ */
.tiers { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.tier {
  border-radius: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(8px);
}
.tier-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tier-head h3 { font-family: var(--serif); font-size: 18px; letter-spacing: 1px; color: var(--ink); }
.tier-tag {
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 12px;
  color: #fff;
}
.tier-safe .tier-tag { background: var(--teal); }
.tier-caution .tier-tag { background: var(--gold); }
.tier-danger .tier-tag { background: var(--danger); }
.tier p { font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.tier ul { padding-left: 20px; }
.tier li { font-size: 14px; color: var(--ink-soft); margin-bottom: 3px; }

.disclaimer {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.7;
  padding: 12px 16px;
  border-left: 3px solid var(--line);
  background: var(--panel);
  border-radius: 0 10px 10px 0;
}

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 40px 24px 50px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.footer p { font-family: var(--serif); letter-spacing: 2px; }
.footer-small { margin-top: 8px; font-size: 13px; color: var(--ink-faint); font-family: var(--sans); letter-spacing: 0; }

/* ============ 打坐 Overlay ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: #1f1d18;
  color: #e8e0cc;
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.overlay-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 26px;
}
.overlay-timer {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 2px;
  color: #c9b98a;
  font-variant-numeric: tabular-nums;
}
.btn-ghost {
  background: transparent;
  color: #8d8778;
  border: 1px solid #45402f;
}
.btn-ghost:hover { color: #e8e0cc; border-color: #6a6350; }

.overlay-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 20px;
}
.breath-stage {
  position: relative;
  width: min(64vw, 340px);
  height: min(64vw, 340px);
  aspect-ratio: 1 / 1;
  overflow: visible;
}
#breathCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}
.breath-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,185,138,.14) 0%, rgba(201,185,138,0) 70%);
  pointer-events: none;
}
.breath-word {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 10px;
  text-indent: 10px;
  color: #e8e0cc;
  min-height: 52px;
}
.overlay-guide {
  font-size: 16px;
  color: #9a9384;
  max-width: 440px;
  text-align: center;
  line-height: 1.8;
  min-height: 58px;
}
.overlay-count {
  font-family: var(--serif);
  font-size: 20px;
  color: #c9b98a;
  letter-spacing: 3px;
}

/* 时长选择 */
.duration-pick { display: flex; gap: 12px; }
.duration-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid #45402f;
  background: transparent;
  color: #e8e0cc;
  font-family: var(--serif);
  font-size: 17px;
  cursor: pointer;
  transition: all .2s;
}
.duration-btn:hover, .duration-btn.active { border-color: var(--cinnabar); color: #f0b9a0; }

/* 完成界面 */
.overlay-done {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  text-align: center;
}
.done-mark {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  color: #7fa89b;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop .5s ease;
}
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.overlay-done h2 { font-family: var(--serif); font-size: 26px; letter-spacing: 6px; }
.overlay-done p { color: #9a9384; }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .hero { padding: 64px 20px 50px; }
  .hero-title { font-size: 38px; letter-spacing: 12px; text-indent: 12px; }
  .cards { grid-template-columns: 1fr; }
  .week { flex-wrap: wrap; }
  .week-today { margin-left: 0; }
  .step { flex-direction: column; gap: 10px; }
  .breath-word { font-size: 26px; }
  .topbar { padding: 14px 18px; }
  .brand-sub { display: none; }
}
