/* =============================================================
 * 人生余额计算器 · 视觉样式
 * =============================================================
 * 颜色和字体在 :root 里，方便统一调整。
 * 调整某个 step 的样式：找到对应的 #step1 ~ #step6 区块即可。
 * =============================================================
 */

:root {
  /* ---------- 色彩方案（暖米 + 沉思青 + 暖橘） ---------- */
  --bg-primary: #faf6f0;
  --bg-secondary: #ffffff;
  --text-primary: #2d2d2d;
  --text-secondary: #6b6b6b;
  --accent: #e76f51;
  --accent-soft: #f4a261;
  --highlight: #e9c46a;
  --reflection: #264653;
  --border: #ede4d3;

  /* ---------- 字体 ---------- */
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "FangSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  position: relative;
}

/* ---------- 通用 step 容器 ---------- */
.step {
  display: none;
  min-height: 100vh;
  padding: 60px 24px 60px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.step.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 通用按钮 ---------- */
.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 16px 48px;
  font-size: 1rem;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(231, 111, 81, 0.3);
}

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

.btn:hover {
  box-shadow: 0 6px 24px rgba(231, 111, 81, 0.4);
}

/* ===========================================================
 * Step 1: 日期输入
 * =========================================================== */
#step1 .step1-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--reflection);
  line-height: 1.4;
}

#step1 .step1-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.date-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
  width: 100%;
  max-width: 360px;
}

.date-picker select {
  flex: 1;
  padding: 14px 8px;
  font-size: 1rem;
  border: 2px solid var(--border);
  background: white;
  border-radius: 12px;
  font-family: inherit;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color: var(--text-primary);
}

.date-picker select:focus {
  outline: none;
  border-color: var(--accent);
}

.subtle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================================================
 * Step 2: 人生账单
 * =========================================================== */
#step2 .step2-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat-value.large {
  font-size: 3.2rem;
}

.stat-unit {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ----- Stat 4: AI 时代「稳定」问号卡 ----- */
.stat-card-stability {
  background: #fdf6f3;
  border: 1px dashed rgba(231, 111, 81, 0.35);
  position: relative;
}

.stat-card-stability .stat-unit {
  color: var(--accent);
  font-size: 0.82rem;
  margin-top: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.stat-value-question {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  min-height: 1.1em;
  transition: opacity 0.3s;
}

.stat-value-question.pulsing {
  animation: questionPulse 2.6s ease-in-out infinite;
}

@keyframes questionPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.04); }
}

/* ===========================================================
 * Step 3: 脑洞清单
 * =========================================================== */
#step3 {
  padding-top: 50px;
  padding-bottom: 50px;
}

#step3 .step3-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--reflection);
}

#step3 .step3-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

#step3-list {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bucket-card {
  border-radius: 16px;
  padding: 18px;
  display: flex;
  gap: 14px;
  text-align: left;
  animation: slideUp 0.6s ease-out backwards;
  align-items: flex-start;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.bucket-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
}

.bucket-image {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.bucket-content {
  flex: 1;
  min-width: 0;
}

.bucket-title {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.bucket-value {
  font-family: var(--font-serif);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.bucket-number {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--reflection);
  line-height: 1.1;
}

.bucket-unit {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.bucket-insight {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ===========================================================
 * Step 4: 扎心弹幕
 * =========================================================== */
#step4 {
  background: var(--reflection);
  color: white;
  position: relative;
  overflow: hidden;
}

#step4 .step4-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--highlight);
  z-index: 10;
  margin-bottom: 12px;
  position: relative;
}

#step4 .step4-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  z-index: 10;
  margin-bottom: 24px;
  position: relative;
}

#danmu-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.danmu-item {
  position: absolute;
  white-space: nowrap;
  font-size: 0.88rem;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.92);
  left: 100%;
  animation: scrollDanmu linear infinite;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes scrollDanmu {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 100%)); }
}

#step4 .step4-cta {
  margin-top: auto;
  z-index: 10;
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  color: var(--reflection);
}

/* ===========================================================
 * Step 5: 哲学点睛
 * =========================================================== */
#step5 {
  background: linear-gradient(180deg, #fff7ed 0%, #faf6f0 100%);
}

#philosophy-container {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 2.2;
  color: var(--reflection);
  max-width: 480px;
  margin-bottom: 32px;
  min-height: 360px;
}

.philosophy-line {
  margin-bottom: 4px;
  min-height: 1.5em;
}

#step5-next {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s;
}

#step5-next.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===========================================================
 * Step 6: 变现页
 * =========================================================== */
#step6 {
  background: linear-gradient(180deg, #faf6f0 0%, #fff7ed 100%);
}

#monetize-headline {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--reflection);
  margin-bottom: 12px;
  max-width: 360px;
  line-height: 1.4;
}

#monetize-subheadline {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 320px;
}

#monetize-cta {
  background: var(--accent);
  color: white;
  border: none;
  padding: 22px 32px;
  font-size: 1rem;
  border-radius: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(231, 111, 81, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  transition: transform 0.2s;
}

#monetize-cta:active {
  transform: scale(0.98);
}

#monetize-cta-text {
  font-size: 1.1rem;
  font-weight: 700;
}

#monetize-cta-subtext {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.92;
}

#monetize-bottom-note {
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

#share-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-top: 16px;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

#share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===========================================================
 * Toast 提示
 * =========================================================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.82);
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ===========================================================
 * 响应式调整（小屏幕）
 * =========================================================== */
@media (max-width: 380px) {
  .step { padding: 40px 20px; }
  #step1 .step1-title { font-size: 1.7rem; }
  .stat-value.large { font-size: 2.6rem; }
  .bucket-number { font-size: 1.5rem; }
  #philosophy-container { font-size: 1.25rem; }
  #monetize-headline { font-size: 1.4rem; }
}
