:root {
  --paper: #f4f0e7;
  --paper-soft: #fbf8f1;
  --ink: #213c37;
  --ink-soft: #5d746d;
  --line: rgba(33, 60, 55, 0.14);
  --mint: #a6c5b4;
  --mint-deep: #6f9b83;
  --coral: #e69577;
  --coral-deep: #b9684f;
  --saffron: #eec76b;
  --lavender: #b5a7c8;
  --white: #fffdf7;
  --shadow: 0 18px 48px rgba(45, 64, 55, 0.11);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--paper);
}

button, textarea, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid rgba(182, 118, 85, 0.6);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: max(16px, env(safe-area-inset-top)) 24px 12px;
}

.brand-lockup {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-lockup span {
  display: inline-block;
  margin-left: 2px;
  color: var(--coral-deep);
  font-family: "Avenir Next", sans-serif;
  font-size: 13px;
  transform: translateY(-8px);
}

.today-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(230, 149, 119, 0.16);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.icon-button:hover { background: rgba(33, 60, 55, 0.08); }
.icon-button:active { transform: scale(0.94); }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.back-button[hidden] { display: none; }

.screen-stack {
  min-height: calc(100dvh - 142px);
  padding: 8px 24px 124px;
}

.screen {
  animation: screen-in 420ms var(--ease) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.eyebrow-mark { font-size: 15px; line-height: 1; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 360px;
  margin: 18px 0 12px;
  color: var(--ink);
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(38px, 10vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

h1 em { color: var(--coral-deep); font-style: normal; }

h2 {
  margin: 16px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

h3 { margin-bottom: 8px; font-size: 17px; }

.lead {
  max-width: 300px;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.hero-art {
  position: relative;
  height: 250px;
  margin: 22px -4px 24px;
  overflow: hidden;
  border-radius: 32px 32px 76px 32px;
  background: #dce7db;
  box-shadow: var(--shadow);
}

.hero-art::before {
  position: absolute;
  width: 230px;
  height: 230px;
  top: -78px;
  right: -38px;
  border-radius: 50%;
  background: var(--saffron);
  content: "";
}

.hero-art::after {
  position: absolute;
  width: 260px;
  height: 150px;
  right: -46px;
  bottom: -56px;
  border-radius: 52% 48% 0 0;
  background: var(--mint-deep);
  content: "";
  transform: rotate(-9deg);
}

.art-moon {
  position: absolute;
  z-index: 2;
  width: 98px;
  height: 98px;
  left: 48px;
  top: 58px;
  border-radius: 50%;
  background: var(--paper-soft);
  box-shadow: 0 14px 32px rgba(33, 60, 55, 0.13);
}

.art-moon::after {
  position: absolute;
  width: 98px;
  height: 98px;
  left: 23px;
  top: -10px;
  border-radius: 50%;
  background: #dce7db;
  content: "";
}

.art-stem {
  position: absolute;
  z-index: 3;
  width: 2px;
  height: 154px;
  left: 144px;
  bottom: 0;
  background: var(--ink);
  transform: rotate(9deg);
  transform-origin: bottom;
}

.art-stem::before, .art-stem::after {
  position: absolute;
  width: 54px;
  height: 26px;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 100% 0 100% 0;
  content: "";
}

.art-stem::before { top: 68px; left: -48px; transform: rotate(-28deg); }
.art-stem::after { top: 103px; left: 2px; transform: rotate(25deg) scaleX(-1); }

.art-star { position: absolute; z-index: 3; color: var(--coral-deep); font-size: 18px; }
.art-star.one { left: 26px; top: 32px; }
.art-star.two { right: 72px; top: 96px; color: var(--ink); font-size: 12px; }
.art-star.three { left: 104px; top: 34px; color: var(--lavender); font-size: 11px; }

.primary-action, .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 18px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-action {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-soft);
  box-shadow: 0 12px 22px rgba(33, 60, 55, 0.18);
}

.primary-action:hover { box-shadow: 0 16px 28px rgba(33, 60, 55, 0.24); }
.primary-action:active, .secondary-action:active { transform: scale(0.98); }
.primary-action:disabled { cursor: not-allowed; opacity: 0.45; box-shadow: none; }
.primary-action svg { width: 19px; height: 19px; margin-left: 9px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.secondary-action {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink);
}

.home-insight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.home-insight p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.home-insight strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 15px; }
.insight-mark { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 16px 16px 16px 4px; background: var(--lavender); }

.section-header { margin: 8px 0 26px; }
.section-header p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }

.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.mood-option {
  min-height: 112px;
  padding: 15px 11px 13px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--paper-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.mood-option:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(45, 64, 55, 0.08); }
.mood-option.is-selected { border-color: var(--mood); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mood) 23%, transparent); }
.mood-icon { display: grid; width: 34px; height: 34px; margin-bottom: 12px; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--mood) 28%, white); color: var(--ink); }
.mood-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.mood-name { display: block; font-size: 14px; font-weight: 700; }
.mood-caption { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }

.field-block { margin-bottom: 26px; }
.field-label { display: flex; justify-content: space-between; margin-bottom: 11px; font-size: 14px; font-weight: 700; }
.field-hint { color: var(--ink-soft); font-size: 12px; font-weight: 400; }

.range-wrap { padding: 9px 1px 0; }
input[type="range"] { width: 100%; height: 5px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--mint-deep), var(--coral)); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { width: 25px; height: 25px; appearance: none; border: 5px solid var(--paper-soft); border-radius: 50%; background: var(--ink); box-shadow: 0 2px 8px rgba(33, 60, 55, 0.25); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 5px solid var(--paper-soft); border-radius: 50%; background: var(--ink); box-shadow: 0 2px 8px rgba(33, 60, 55, 0.25); }
.range-labels { display: flex; justify-content: space-between; margin-top: 9px; color: var(--ink-soft); font-size: 11px; }

.note-input { width: 100%; min-height: 112px; resize: vertical; padding: 14px 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-soft); color: var(--ink); font-size: 15px; line-height: 1.65; transition: border-color 180ms ease, box-shadow 180ms ease; }
.note-input::placeholder { color: #9ba9a0; }
.note-input:focus { border-color: var(--mint-deep); box-shadow: 0 0 0 4px rgba(111, 155, 131, 0.14); outline: 0; }

.screen-footer { margin-top: 34px; }
.privacy-note { margin: 13px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; text-align: center; }

.generating-screen { display: grid; min-height: 64vh; place-items: center; text-align: center; }
.generating-art { position: relative; width: 170px; height: 170px; margin: 0 auto 30px; }
.generating-art::before, .generating-art::after { position: absolute; inset: 0; border: 1px solid rgba(111, 155, 131, 0.45); border-radius: 50%; content: ""; animation: pulse 2.2s ease-in-out infinite; }
.generating-art::after { inset: 24px; border-color: rgba(230, 149, 119, 0.55); animation-delay: 300ms; }
.generating-core { position: absolute; inset: 55px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 13px rgba(238, 199, 107, 0.2); }
@keyframes pulse { 0%, 100% { transform: scale(0.92); opacity: 0.35; } 50% { transform: scale(1.05); opacity: 1; } }
.generating-screen h2 { margin-bottom: 9px; }
.generating-screen p { color: var(--ink-soft); font-size: 14px; }
.loading-dots::after { content: ""; animation: dots 1.25s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }

.result-kicker { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 15px; color: var(--ink-soft); font-size: 12px; }
.result-kicker strong { color: var(--coral-deep); font-size: 13px; }
.result-art { position: relative; min-height: 240px; margin-bottom: 22px; overflow: hidden; border-radius: 32px 32px 60px 32px; background: #e1ddd8; }
.result-art::before { position: absolute; width: 180px; height: 180px; top: -58px; left: -30px; border-radius: 50%; background: var(--lavender); content: ""; }
.result-art::after { position: absolute; width: 320px; height: 120px; right: -55px; bottom: -42px; border-radius: 50% 50% 0 0; background: var(--mint-deep); content: ""; transform: rotate(-7deg); }
.result-window { position: absolute; z-index: 2; inset: 48px 42px 44px; border: 1px solid rgba(33, 60, 55, 0.35); border-radius: 80px 80px 18px 18px; background: rgba(255, 253, 247, 0.68); }
.result-window::before { position: absolute; width: 58px; height: 58px; right: 22px; top: 23px; border-radius: 50%; background: var(--saffron); content: ""; }
.result-window::after { position: absolute; width: 2px; height: 130px; left: 52px; bottom: -30px; background: var(--ink); content: ""; transform: rotate(7deg); }
.result-quote { position: absolute; z-index: 4; left: 22px; right: 22px; bottom: 18px; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: 19px; line-height: 1.35; }
.result-copy { margin-bottom: 22px; padding: 0 3px; }
.result-copy p { color: var(--ink); font-size: 16px; line-height: 1.8; }
.result-tip { display: flex; gap: 11px; margin-top: 15px; padding: 14px; border-radius: 17px; background: rgba(166, 197, 180, 0.25); color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.result-tip svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--mint-deep); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-actions .primary-action, .result-actions .secondary-action { width: 100%; min-height: 50px; }

.calendar-top { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.calendar-top h2 { margin-bottom: 0; }
.month-label { color: var(--ink-soft); font-size: 13px; }
.calendar-card { padding: 18px 15px 15px; border-radius: 26px; background: var(--paper-soft); box-shadow: 0 10px 28px rgba(45, 64, 55, 0.07); }
.week-row, .days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-row { margin-bottom: 10px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.day-cell { display: grid; min-height: 47px; place-items: start center; padding-top: 3px; border-radius: 14px; color: var(--ink); font-size: 12px; }
.day-cell.is-muted { color: #b8c0ba; }
.day-cell.is-today { background: rgba(230, 149, 119, 0.14); font-weight: 700; }
.day-number { line-height: 22px; }
.mood-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: var(--dot, var(--mint-deep)); }
.calendar-summary { display: flex; align-items: center; gap: 13px; margin: 18px 2px 25px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.summary-ring { display: grid; width: 52px; height: 52px; place-items: center; border: 8px solid rgba(111, 155, 131, 0.25); border-top-color: var(--mint-deep); border-right-color: var(--coral); border-radius: 50%; color: var(--ink); font-size: 12px; font-weight: 700; }
.summary-copy strong { display: block; margin-bottom: 3px; font-size: 15px; }
.summary-copy span { color: var(--ink-soft); font-size: 12px; }
.empty-state { padding: 8px 2px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.entry-list { display: grid; gap: 10px; }
.entry-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-date { display: flex; align-items: center; gap: 10px; }
.entry-date-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); }
.entry-date strong { display: block; font-size: 14px; }
.entry-date span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.entry-tag { color: var(--ink-soft); font-size: 12px; }

.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; padding: 10px 24px max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.bottom-nav::before { position: absolute; right: 14px; bottom: 9px; left: 14px; height: 67px; border: 1px solid rgba(33, 60, 55, 0.08); border-radius: 24px; background: rgba(251, 248, 241, 0.92); box-shadow: 0 12px 30px rgba(33, 60, 55, 0.14); content: ""; backdrop-filter: blur(15px); }
.nav-item { position: relative; z-index: 1; display: grid; min-width: 100px; min-height: 54px; place-items: center; gap: 3px; border: 0; background: transparent; color: #91a19a; font-size: 11px; cursor: pointer; pointer-events: auto; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.nav-item.is-active { color: var(--ink); font-weight: 700; }
.nav-item.is-active::before { position: absolute; z-index: -1; top: 2px; width: 43px; height: 25px; border-radius: 12px; background: rgba(166, 197, 180, 0.36); content: ""; }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 98px; left: 24px; max-width: 472px; margin: auto; padding: 12px 15px; border-radius: 14px; background: var(--ink); color: var(--paper-soft); font-size: 13px; line-height: 1.4; text-align: center; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (min-width: 620px) {
  body { padding: 18px 0; }
  .app-shell { min-height: calc(100dvh - 36px); border-radius: 34px; box-shadow: 0 24px 70px rgba(33, 60, 55, 0.16); }
  .screen-stack { min-height: calc(100dvh - 178px); }
  .bottom-nav { position: absolute; }
  .toast { bottom: 102px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
