/* ============================================================
   轻停时刻 · 视觉基调：柔和、极简、不刺眼
   ============================================================ */

:root {
  --bg: #F4F1EA;
  --ink: #4A4A52;
  --ink-soft: #94949E;
  --ink-faint: #B9B9C2;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(150, 150, 175, 0.14);
  --shadow: 0 12px 36px rgba(90, 90, 120, 0.10);
  --radius: 28px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 视图切换 ---------- */

.view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease);
}

.view.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   首页
   ============================================================ */

#view-home { background: var(--bg); }

.home-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  position: relative;
}

.home-head { text-align: center; animation: rise 0.9s var(--ease) both; }

.logo {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 12px;
  margin-left: 12px; /* 视觉居中补偿字间距 */
  color: var(--ink);
}

.tagline {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-soft);
}

/* ---------- 状态选择器 ---------- */

.chooser {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: flex-end;
  margin-top: 56px;
  animation: rise 0.9s 0.12s var(--ease) both;
}

.choice {
  width: 106px;
  padding: 24px 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.choice:nth-child(2) { transform: translateY(-14px); }
.choice:nth-child(2):active { transform: translateY(-14px) scale(0.94); }

.choice:hover { box-shadow: 0 16px 44px rgba(90, 90, 120, 0.16); }
.choice:active { transform: scale(0.94); }

.choice-icon svg { width: 58px; height: 58px; display: block; }
.choice-icon svg g { transition: transform 0.4s var(--ease); }
.choice:hover .choice-icon svg g { transform: translateY(-3px); }

.choice-name { font-size: 16px; font-weight: 600; letter-spacing: 4px; margin-left: 4px; }
.choice-sub { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }

/* ---------- 首页底部 ---------- */

.home-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  animation: rise 0.9s 0.24s var(--ease) both;
}

.home-stat {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  min-height: 16px;
}

.home-version {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-faint);
  opacity: 0.45;
}

.link-report {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  transition: color 0.3s, background 0.3s;
}

.link-report:active { background: rgba(255, 255, 255, 0.9); color: var(--ink); }

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

/* ============================================================
   发呆模式
   ============================================================ */

.scene {
  touch-action: none;          /* 划走退出手势需要连续 pointer 事件 */
  overflow: hidden;
}

#scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-ui {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(16px, env(safe-area-inset-top)) 22px 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.42;
}

.scene-name { font-size: 13px; letter-spacing: 3px; }
.scene-timer { font-size: 12px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }

/* ---------- 漂流瓶任务卡 ---------- */

.task-card {
  position: absolute;
  z-index: 5;
  width: min(302px, 84vw);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  padding: 20px 24px 16px;
  box-shadow: 0 20px 54px rgba(50, 50, 80, 0.18);
  cursor: grab;
  opacity: 0;
  animation: drift 10s ease-in-out 0.8s infinite alternate;
}

.task-card.show { animation: appear 0.7s var(--ease) both, drift 10s ease-in-out 0.9s infinite alternate; }

.task-card.leaving { animation: leave 0.45s ease forwards; }

.task-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  color: #7C8FD8;
  background: rgba(124, 143, 216, 0.10);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.task-text { font-size: 17px; line-height: 1.75; letter-spacing: 0.5px; }

.task-hint { margin-top: 12px; font-size: 11px; color: var(--ink-soft); letter-spacing: 0.5px; }

@keyframes appear {
  from { opacity: 0; transform: translate(-50%, -46%) rotate(-9deg) scale(0.82); }
  to   { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg) scale(1); }
}

@keyframes drift {
  from { transform: translate(-50%, -50%) rotate(-3.5deg) translateY(-4px); }
  to   { transform: translate(-50%, -50%) rotate(-1.5deg) translateY(6px); }
}

@keyframes leave {
  from { opacity: 1; transform: translate(-50%, -50%) rotate(-3deg) scale(1); }
  to   { opacity: 0; transform: translate(-28%, -72%) rotate(-16deg) scale(0.78); }
}

/* ---------- 首屏提示 ---------- */

.scene-hint {
  position: absolute;
  left: 0; right: 0; bottom: max(64px, calc(env(safe-area-inset-bottom) + 44px));
  text-align: center;
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
  z-index: 4;
}

.scene-hint.show { opacity: 1; }

/* ============================================================
   今日无事报告
   ============================================================ */

#view-report { background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }

.report-inner {
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  padding: max(24px, env(safe-area-inset-top)) 22px max(40px, env(safe-area-inset-bottom));
  position: relative;
}

.btn-back {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, color 0.3s;
}

.btn-back:active { background: #fff; color: var(--ink); }

.report-title {
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 6px;
  margin-left: 6px;
  padding-top: 6px;
}

.report-date {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 2px;
  margin-top: 8px;
}

.report-body { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }

.report-hero {
  background: linear-gradient(165deg, #FFFFFF 0%, #F3EFFB 100%);
  border-radius: var(--radius);
  padding: 34px 26px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}

.report-hero .hero-label { font-size: 12px; letter-spacing: 3px; color: var(--ink-soft); }

.report-hero .hero-big {
  margin-top: 14px;
  font-size: 52px;
  font-weight: 200;
  letter-spacing: 2px;
  line-height: 1.1;
}

.report-hero .hero-big small { font-size: 15px; font-weight: 300; color: var(--ink-soft); margin-left: 4px; }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.stat-chip b { color: var(--ink); font-weight: 600; }

.report-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.report-card h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.sentence { font-size: 15px; line-height: 2; letter-spacing: 0.5px; }

/* 一周条状图 */

.week { display: flex; justify-content: space-between; align-items: flex-end; height: 96px; gap: 8px; }

.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }

.week-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.week-bar {
  width: 60%;
  min-width: 8px;
  border-radius: 6px;
  background: #D9DCE8;
  transition: height 0.6s var(--ease);
}

.week-col.today .week-bar { background: #A9B8D8; }
.week-col.today .week-label { color: var(--ink); font-weight: 600; }

.week-label { font-size: 11px; color: var(--ink-faint); letter-spacing: 1px; }

.report-empty { text-align: center; padding: 40px 20px; }

.report-empty p { font-size: 15px; line-height: 2; color: var(--ink-soft); letter-spacing: 1px; }

.btn-go-daze {
  margin-top: 22px;
  display: inline-block;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 30px;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease);
}

.btn-go-daze:active { transform: scale(0.95); }

.report-foot {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  padding-top: 6px;
}

@media (max-width: 380px) {
  .chooser { gap: 14px; }
  .choice { width: 96px; }
  .choice-icon svg { width: 50px; height: 50px; }
}
