/* 好事餵多肉：順心堂系列的剪紙拼貼風（平貼＋淡墨線，不用錯位陰影） */

:root {
  color-scheme: light;
  --bg: #F4EFE6;
  --surface: #FFFCF6;
  --ink: #161616;
  --ink-soft: #5E5850;
  --pro: #F0643F;
  --pro-soft: #FBD8CB;
  --con: #3A5BD9;
  --con-soft: #D8DFFA;
  --sun: #F4C23C;
  --sun-soft: #FBEBB8;
  --sun-ink: #8A6400;
  --mint: #2E9E5E;
  --lilac: #A64CA6;
  --accent: #161616;
  --on-accent: #F4EFE6;
  --accent-soft: #E8E0D2;
  --hairline: rgba(22, 22, 22, 0.14);
  --hairline-strong: rgba(22, 22, 22, 0.32);
  --leaf: #2E9E5E;
  --leaf-2: #6CC48A;
  --danger: #C9402A;
  --fixed-ink: #161616;
  --fixed-paper: #FFFCF6;
  --page-max: 520px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141414;
    --surface: #232220;
    --ink: #F4EFE6;
    --ink-soft: #A9A39A;
    --pro: #FF7650;
    --pro-soft: #4A2418;
    --con: #6F8BFF;
    --con-soft: #1F2750;
    --sun: #FFD04F;
    --sun-soft: #3D3214;
    --sun-ink: #FFD04F;
    --mint: #45C27B;
    --lilac: #C76BC7;
    --accent: #F4EFE6;
    --on-accent: #161616;
    --accent-soft: #302E2A;
    --hairline: rgba(244, 239, 230, 0.14);
    --hairline-strong: rgba(244, 239, 230, 0.3);
    --leaf: #45C27B;
    --leaf-2: #8ED6A6;
    --danger: #FF7A63;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --surface: #232220;
  --ink: #F4EFE6;
  --ink-soft: #A9A39A;
  --pro: #FF7650;
  --pro-soft: #4A2418;
  --con: #6F8BFF;
  --con-soft: #1F2750;
  --sun: #FFD04F;
  --sun-soft: #3D3214;
  --sun-ink: #FFD04F;
  --mint: #45C27B;
  --lilac: #C76BC7;
  --accent: #F4EFE6;
  --on-accent: #161616;
  --accent-soft: #302E2A;
  --hairline: rgba(244, 239, 230, 0.14);
  --hairline-strong: rgba(244, 239, 230, 0.3);
  --leaf: #45C27B;
  --leaf-2: #8ED6A6;
  --danger: #FF7A63;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.has-sheet { overflow: hidden; }

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

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--con); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

/* ---------- 背景剪紙碎片（邊緣，中間保持乾淨） ---------- */

.scraps { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.5; overflow: hidden; }
.scraps span { position: absolute; display: block; }
.scraps span:nth-child(1) { left: -14px; top: 30%; width: 40px; height: 26px; transform: rotate(-14deg); --fill: var(--sun); }
.scraps span:nth-child(2) { right: -16px; top: 20%; width: 40px; height: 58px; transform: rotate(9deg); --fill: var(--con); }
.scraps span:nth-child(3) { right: -10px; top: 62%; width: 30px; height: 30px; transform: rotate(24deg); --fill: var(--mint); }
.scraps span:nth-child(4) { left: -10px; top: 72%; width: 26px; height: 44px; transform: rotate(-8deg); --fill: var(--pro); }
.scraps span:nth-child(5) { left: 58%; bottom: -10px; width: 60px; height: 24px; transform: rotate(5deg); --fill: var(--lilac); }
.scraps i { position: absolute; width: 4px; height: 3px; background: var(--ink); opacity: 0.25; }

#app { position: relative; z-index: 1; }

/* ---------- 剪紙片：::before 是淡墨線，::after 是紙 ---------- */

.paper {
  position: relative;
  isolation: isolate;
  --fill: var(--surface);
  --line: var(--hairline);
  background: none;
  border: 0;
}
.paper::before,
.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.paper::before { background: var(--line); }
.paper::after { background: var(--fill); }

.card { display: block; padding: 18px; text-decoration: none; }

.paper-tag {
  display: inline-block;
  padding: 3px 9px 4px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  --line: var(--fill);
}
.paper-tag.small { font-size: 11px; padding: 2px 7px 3px; }
.paper-tag.member { --line: var(--hairline); font-size: 13px; padding: 5px 11px; }

/* ---------- 按鈕 ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; }
.btn.primary { --fill: var(--accent); --line: var(--accent); color: var(--on-accent); }
.btn.secondary { --fill: var(--surface); --line: var(--hairline-strong); color: var(--ink); }
.btn.quiet { background: none; border: 0; color: var(--ink-soft); font-weight: 700; font-size: 15px; min-height: 44px; }
.btn.danger { --fill: var(--danger); --line: var(--danger); color: #fff; }
.danger-text { color: var(--danger) !important; }

.icon { display: inline-flex; width: 22px; height: 22px; flex: none; }
.icon svg { width: 100%; height: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: -8px;
  border: 0;
  background: none;
  color: var(--ink);
}
.icon-btn .icon { width: 30px; height: 30px; }
.icon-btn.plain { margin-left: 0; margin-right: -8px; }
.icon-btn.plain .icon { width: 24px; height: 24px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin-left: -6px;
  padding: 0 6px 0 0;
  border: 0;
  background: none;
  font-size: 16px;
  font-weight: 800;
}
.back-btn .icon { width: 20px; height: 20px; }

/* ---------- 版面 ---------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter) calc(120px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  margin: 0 calc(-1 * var(--gutter));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--bg);
}
.topbar-left { justify-self: start; display: flex; align-items: center; }
.topbar-right { justify-self: end; display: flex; align-items: center; }
.topbar-title {
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}
.topbar-action { width: auto; min-height: 44px; padding: 0 0 0 8px; color: var(--ink); font-weight: 800; font-size: 15px; }

.greeting { margin: 6px 0 18px; font-size: 22px; font-weight: 900; line-height: 1.35; }

.section-heading { margin: 28px 0 12px; font-size: 18px; font-weight: 900; }
.section-label { margin: 0 0 10px; font-size: 15px; font-weight: 900; }
.meta-note { font-size: 14px; color: var(--ink-soft); }

.link-quiet {
  display: block;
  margin: 22px auto 0;
  padding: 10px;
  text-align: center;
  font-weight: 800;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 5px;
}

.feed-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}
.feed-bar .btn { max-width: calc(var(--page-max) - 2 * var(--gutter)); margin: 0 auto; min-height: 58px; font-size: 18px; }

/* ---------- 角色與多肉 ---------- */

.art-box { display: inline-block; line-height: 0; }
.art-box svg, svg.art { width: 100%; height: auto; display: block; overflow: visible; }

.boil > .frame { animation: boil 0.84s steps(1, end) infinite; }
.boil > .frame:nth-child(2) { animation-delay: -0.56s; }
.boil > .frame:nth-child(3) { animation-delay: -0.28s; }
@keyframes boil {
  0% { opacity: 1; }
  33.333% { opacity: 0; }
  100% { opacity: 0; }
}

.critter { animation: bob 1.4s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.critter.mood-celebrate { animation: hop 0.4s ease-in-out infinite alternate; }
.critter.mood-sleepy { animation-duration: 2.4s; }
.plant { transform-origin: 50% 100%; }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -2.2%; } }
@keyframes hop { from { translate: 0 0; rotate: 0deg; } to { translate: 0 -6%; rotate: -4deg; } }

.gang { display: flex; align-items: flex-end; justify-content: center; }
.gang-member { display: block; width: 32%; }
.gang-member.he { width: 27%; margin: 0 -4%; transform: translateY(-18%); }

/* ---------- 對話泡泡（角色說話）：圓角淡底＋尾巴，跟白色剪紙的好事卡片分開 ---------- */

.bubble { display: flex; align-items: flex-end; gap: 10px; text-align: left; }
.bubble-critter { width: 52px; flex: none; }
.bubble-body {
  position: relative;
  flex: 1;
  padding: 9px 15px 11px;
  border-radius: 20px 20px 20px 6px;
  background: var(--tint);
  color: var(--ink);
}
.bubble-body::before {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 8px;
  border-width: 7px 9px 7px 0;
  border-style: solid;
  border-color: transparent var(--tint) transparent transparent;
}
.bubble-zheng { --tint: var(--pro-soft); --name: var(--pro); }
.bubble-kakutou { --tint: var(--con-soft); --name: var(--con); }
.bubble-he { --tint: var(--sun-soft); --name: var(--sun-ink); }
.bubble-name { display: block; font-size: 12px; font-weight: 900; color: var(--name); letter-spacing: 0.04em; }
.bubble-text { margin-top: 1px; font-size: 15px; font-weight: 700; line-height: 1.5; white-space: pre-line; }
.empty-bubble, .end-bubble { margin: 18px 0 8px; }

/* ---------- 開場 ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg);
  transition: opacity 0.4s ease;
}
.splash.out { opacity: 0; }
.splash-gang { width: min(78vw, 340px); }
.splash-gang .gang-member { animation: pop 0.5s cubic-bezier(.3, 1.6, .5, 1) both, jump 0.42s ease-in-out 1.15s 2 alternate; }
.splash-gang .gang-member.kakutou { animation-delay: 0s, 1.15s; }
.splash-gang .gang-member.he { animation-delay: 0.18s, 1.15s; }
.splash-gang .gang-member.zheng { animation-delay: 0.36s, 1.15s; }
.splash-name { margin-top: 12px; font-size: 28px; font-weight: 900; animation: fade 0.5s ease 0.6s both; }
.splash-studio { font-size: 14px; font-weight: 900; padding: 3px 12px; background: var(--accent); color: var(--on-accent); animation: fade 0.5s ease 0.8s both; }
@keyframes pop { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes jump { from { translate: 0 0; } to { translate: 0 -10%; } }
@keyframes fade { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 開箱介紹 ---------- */

.welcome { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.welcome-top { display: flex; justify-content: flex-end; min-height: 56px; padding-top: env(safe-area-inset-top); }
.welcome-top .btn { width: auto; }
.intro-pages { flex: 1; display: flex; align-items: center; }
.intro-page { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.intro-page.enter { animation: fade 0.35s ease both; }
.intro-critter { width: min(52vw, 220px); }
.intro-name { display: flex; align-items: center; gap: 10px; }
.intro-name h2 { font-size: 30px; font-weight: 900; }
.intro-text { font-size: 17px; color: var(--ink-soft); white-space: pre-line; line-height: 1.7; }
.intro-gang { width: min(70vw, 300px); }
.intro-motto { font-size: 24px; font-weight: 900; line-height: 1.35; }
.intro-page.final { gap: 12px; }
.intro-page.final .field-label { width: 100%; text-align: left; margin-top: 6px; }
.welcome-bottom { display: grid; gap: 16px; padding-top: 16px; }
.intro-dots { display: flex; justify-content: center; gap: 8px; }
.intro-dots span { width: 8px; height: 8px; background: var(--hairline-strong); transform: rotate(8deg); }
.intro-dots span.on { background: var(--ink); width: 20px; }
.intro-sheet .sheet-body { display: flex; flex-direction: column; gap: 20px; min-height: 70dvh; justify-content: center; }

/* ---------- 花園：窗台上的一排盆栽 ---------- */

.windowsill { display: grid; gap: 30px; margin-top: 4px; }
.shelf { position: relative; padding-top: 18px; }
.shelf.first { padding-top: 34px; }
.window {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  bottom: 30px;
  background: var(--con-soft);
  border: 6px solid var(--surface);
  outline: 1.5px solid var(--hairline-strong);
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}
.window::before, .window::after { content: ""; position: absolute; background: var(--surface); }
.window::before { left: calc(50% - 3px); top: 0; bottom: 0; width: 6px; }
.window::after { left: 0; right: 0; top: 46%; height: 6px; }
.window-cloud {
  position: absolute; left: 14%; top: 16%;
  width: 54px; height: 18px; border-radius: 12px;
  background: var(--surface); opacity: 0.9;
  box-shadow: 18px -8px 0 2px var(--surface);
}
.shelf-row { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 4px; padding: 0 2px; }
.plank {
  position: relative;
  height: 16px;
  margin: -2px -6px 0;
  background: #C9935E;
  border-radius: 3px;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.12);
}
:root[data-theme="dark"] .plank { background: #8A6440; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plank { background: #8A6440; } }

.shelf-pot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease;
}
.shelf-pot:active { transform: translateY(2px); }
.n1 .shelf-pot { width: 58%; }
.n2 .shelf-pot { width: 42%; }
.shelf-art { width: 100%; margin-bottom: -4px; }
.shelf-label {
  position: absolute;
  bottom: -48px;
  max-width: 100%;
  padding: 3px 10px 4px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  --line: var(--hairline-strong);
  z-index: 1;
}
.shelf-sub { position: absolute; bottom: -70px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.shelf { margin-bottom: 64px; }
.ghost-pot {
  display: flex; align-items: center; justify-content: center;
  width: 62%; aspect-ratio: 1.6; margin: 0 auto 6px;
  border: 2.5px dashed var(--hairline-strong); border-radius: 4px 4px 14px 14px;
  font-size: 30px; font-weight: 300; color: var(--ink-soft);
}
.shelf-label.ghost { background: none; color: var(--ink-soft); }

.nudge { margin-bottom: 18px; --fill: var(--con-soft); --line: transparent; }
.nudge p { font-weight: 800; }
.nudge-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; align-items: center; }
.nudge-actions .btn { min-height: 46px; font-size: 15px; }
.nudge-actions .btn.quiet { width: auto; }

/* ---------- 一盆多肉：主角是多肉長得怎樣 ---------- */

.plant-body { display: grid; gap: 16px; }
.plant-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.plant-big { width: min(70vw, 290px); padding: 0; border: 0; background: none; transform-origin: 50% 100%; }
.plant-big.wiggle { animation: wiggle 0.6s ease; }
@keyframes wiggle {
  0%, 100% { rotate: 0deg; }
  20% { rotate: -5deg; }
  45% { rotate: 4deg; }
  70% { rotate: -2deg; }
}
.center { text-align: center; }
.talk-slot { width: 100%; display: grid; gap: 8px; }
.talk-slot:empty { display: none; }
.tap-bubble { animation: fade 0.25s ease both; }
.join-tip { display: grid; gap: 4px; animation: fade 0.3s ease both; }
.tip-close { justify-self: end; padding: 6px 4px; border: 0; background: none; font-size: 14px; font-weight: 800; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; }

.growth { display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.growth-step { position: relative; display: block; width: 50px; }
.growth-step + .growth-step::before {
  content: ""; position: absolute; left: -6px; bottom: 22px; width: 10px; height: 2px; background: var(--hairline-strong);
}
.growth-step.future { opacity: 0.28; filter: grayscale(1); }
.growth-step.now { width: 64px; }
.growth-step.now::after {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 8px; height: 8px; margin-left: -4px;
  background: var(--ink); transform: rotate(45deg);
}

.card-title { font-size: 16px; font-weight: 900; margin-bottom: 10px; }
.together-card { display: grid; gap: 14px; }
.together-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fed-count { font-size: 17px; font-weight: 900; }
.fed-count strong { font-size: 40px; line-height: 1; margin-right: 2px; }
.together-sub { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.mix { display: grid; gap: 10px; }
.mix-bar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; gap: 3px; }
.mix-bar span { display: block; min-width: 10px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.mix-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mix-dot { width: 10px; height: 10px; transform: rotate(-6deg); }
.members-row { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 12px; border-top: 1px dashed var(--hairline-strong); }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; padding: 0; border: 0; background: none; }
.avatar {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 46% 54% 50% 48%;
  font-size: 18px; font-weight: 900;
}
.avatar.ghost { border: 2px dashed var(--hairline-strong); color: var(--ink-soft); font-weight: 400; font-size: 22px; }
.member-name { max-width: 100%; font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stickers-card .meta-note { margin-top: 6px; }
.sticker-list { display: flex; flex-wrap: wrap; gap: 12px 8px; }
.sticker-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; text-align: center; }
.sticker-art { width: 58px; }
.sticker-item:nth-child(odd) .sticker-art { rotate: -5deg; }
.sticker-item:nth-child(even) .sticker-art { rotate: 4deg; }
.sticker-title { font-size: 12px; font-weight: 800; line-height: 1.35; }
.sticker-item.next .sticker-title { color: var(--ink-soft); }
.sticker.dim { opacity: 0.22; filter: grayscale(1); }
.sticker-plant { font-size: 11px; color: var(--ink-soft); }

.plant-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plant-links .btn { min-height: 50px; font-size: 16px; }

/* ---------- 好事卡片 ---------- */

.note-list { display: grid; gap: 12px; }
.note { padding: 14px 16px 12px; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-when { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.note-text { margin-top: 10px; font-size: 16px; font-weight: 600; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.note-photo { display: block; width: 100%; max-height: 320px; object-fit: cover; margin-top: 10px; border-radius: 3px; background: var(--accent-soft); }
.note-plants { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.note-foot { margin-top: 8px; }
.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-author { font-size: 13px; font-weight: 800; margin-right: auto; }
.note-share { margin-left: auto; padding: 8px 2px 4px 10px; border: 0; background: none; font-size: 13px; font-weight: 800; color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 4px; }
.note-author + .note-share { margin-left: 0; }
.note-share + .note-delete { margin-left: 0; }
.note-delete { margin-left: auto; padding: 8px 2px 4px 10px; border: 0; background: none; font-size: 13px; color: var(--ink-soft); }
.note-author + .note-delete { margin-left: 0; }
.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 12px 4px 9px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
}
.react-btn .icon { width: 17px; height: 17px; color: var(--ink-soft); }
.react-btn.water.on { background: var(--con-soft); border-color: var(--con); }
.react-btn.water.on .icon { color: var(--con); }
.react-btn.pat.on { background: var(--pro-soft); border-color: var(--pro); }
.react-btn.pat.on .icon { color: var(--pro); }
.reaction-line { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.more-btn { margin-top: 6px; }
.week-label { margin: 14px 0 0; font-size: 15px; font-weight: 900; color: var(--ink-soft); }
.week-label:first-child { margin-top: 0; }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 4px calc(-1 * var(--gutter)) 16px; padding: 2px var(--gutter) 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  min-height: 38px;
  padding: 6px 14px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 800;
}
.filter.on { background: var(--tag, var(--accent)); border-color: var(--tag, var(--accent)); color: var(--on-accent); }
.filter.on[style*="--tag"] { color: var(--fixed-paper); }
.filter.on[style*="--sun"] { color: var(--fixed-ink); }

/* ---------- 表單 ---------- */

.field {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px 14px;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 4px 6px 5px 3px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}
.field::placeholder { color: var(--ink-soft); opacity: 0.75; font-weight: 500; }
.field:focus { outline: none; border-color: var(--ink); }
textarea.field { resize: none; min-height: 96px; }
.field-label { display: block; font-size: 14px; font-weight: 900; }
.pass-input, .passphrase { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.06em; }
.passphrase { padding: 16px 12px; font-size: 22px; font-weight: 800; text-align: center; background: var(--accent-soft); border-radius: 4px; word-break: break-all; }
.link-field { font-size: 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- 記一件好事 ---------- */

.feed-section { margin-bottom: 24px; }
.tag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tag-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 74px;
  padding: 12px 12px 12px 14px;
  text-align: left;
  --line: var(--hairline-strong);
  transition: transform 0.15s ease;
}
.tag-choice:active { transform: scale(0.97); }
.tag-choice strong { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 900; }
.tag-choice strong::before { content: ""; width: 11px; height: 11px; background: var(--tag); transform: rotate(-6deg); flex: none; }
.tag-choice small { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.tag-choice.on { --fill: var(--tag); --line: var(--tag); color: var(--tag-ink); }
.tag-choice.on small { color: inherit; opacity: 0.85; }
.tag-choice.on strong::before { background: var(--tag-ink); }

.note-field { position: relative; }
.counter { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: var(--ink-soft); }
.photo-slot { margin-top: 10px; }
.photo-btn { min-height: 46px; font-size: 15px; }
.photo-btn .icon { width: 20px; height: 20px; }
.photo-preview { position: relative; display: inline-block; }
.photo-preview img { display: block; max-width: 100%; max-height: 200px; border-radius: 3px; }
.photo-remove {
  position: absolute; top: -10px; right: -10px;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-size: 20px; font-weight: 800; line-height: 1;
}

.targets { display: grid; gap: 8px; }
.single-target { font-weight: 800; }
.target {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 6px 14px 6px 8px;
  text-align: left;
  --line: var(--hairline-strong);
}
.target.on { --line: var(--ink); --fill: var(--accent-soft); }
.target-art { width: 46px; flex: none; }
.target-name { flex: 1; font-weight: 800; overflow-wrap: anywhere; }
.target-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  border: 2px solid var(--hairline-strong); border-radius: 4px;
  font-weight: 900; font-size: 16px;
}
.target.on .target-check { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Sheet ---------- */

.sheet { position: fixed; inset: 0; z-index: 40; } /* 跟儀式同一層，後開的在上面 */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 10, 0.42); opacity: 0; transition: opacity 0.25s ease; }
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: var(--page-max);
  max-height: 92dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 14px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.sheet-panel.full { top: 0; max-height: none; border-radius: 0; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--hairline);
}
.sheet-panel:not(.full) .sheet-header { padding-top: 4px; }
.sheet-cancel, .sheet-action { min-height: 44px; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 700; }
.sheet-cancel { justify-self: start; color: var(--ink-soft); }
.sheet-action { justify-self: end; font-weight: 900; }
.sheet-action:disabled { opacity: 0.35; }
.sheet-title { font-size: 17px; font-weight: 900; text-align: center; }
.sheet-body {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.feed-sheet .sheet-body { display: block; padding-bottom: 0; }
.sheet-footer {
  position: sticky;
  bottom: 0;
  margin: 0 calc(-1 * var(--gutter));
  padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.sheet-footer .btn { min-height: 58px; font-size: 18px; }
.sheet-message { font-size: 15px; color: var(--ink-soft); line-height: 1.7; }
.sheet-message.center { text-align: center; }

.invite-art { display: flex; justify-content: center; }
.invite-plant { width: 120px; }

.pot-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pot-swatch { padding: 6px 4px 4px; border: 2px solid transparent; border-radius: 8px; background: none; }
.pot-swatch.on { border-color: var(--ink); background: var(--accent-soft); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--accent-soft); border-radius: 8px; }
.segmented button { min-height: 40px; border: 0; border-radius: 6px; background: none; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--hairline); }

.menu-list { display: grid; margin-top: 6px; }
.menu-list hr { width: 100%; border: 0; border-top: 1px solid var(--hairline); margin: 6px 0; }
.menu-row {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 2px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- 餵完的小儀式 ---------- */

.ceremony {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ceremony.open { opacity: 1; }
.ceremony-inner {
  max-width: var(--page-max);
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: calc(24px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
}
.ceremony-step { opacity: 0; }
.ceremony.open .ceremony-step { animation: fade 0.4s ease both; }
.ceremony.open .s1 { animation-delay: 0.1s; }
.ceremony.open .s2 { animation-delay: 0.75s; }
.ceremony.open .s3 { animation-delay: 1.45s; }
.ceremony.open .s4 { animation-delay: 2.05s; }
.ceremony.open .s5 { animation-delay: 2.5s; }

.runner { padding-top: 12px; }
.runner .bubble-critter { width: 64px; }
.ceremony.open .runner .bubble-critter { animation: run-in 0.7s cubic-bezier(.3, 1.3, .6, 1) both; }
@keyframes run-in { from { translate: -120px 0; } to { translate: 0 0; } }

.ceremony-plants { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ceremony-plant { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 46%; max-width: 200px; text-align: center; }
.count-3 .ceremony-plant, .count-4 .ceremony-plant { width: 30%; }
.ceremony-art { width: 100%; }
.ceremony.open .ceremony-art { animation: grow 0.55s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(0.85s + var(--i) * 0.12s); }
@keyframes grow { 0% { scale: 0.85; } 60% { scale: 1.08; } 100% { scale: 1; } }
.ceremony-name { font-size: 14px; font-weight: 900; overflow-wrap: anywhere; }
.ceremony-actions { display: grid; gap: 10px; margin-top: 8px; }
.ceremony-stickers { position: relative; display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; }
.ceremony-stickers .sticker-item { width: 96px; }
.ceremony-stickers .sticker-art { width: 80px; }
.ceremony.open .sticker-item.new .sticker-art { animation: sticker-in 0.6s cubic-bezier(.3, 1.7, .5, 1) 1.5s both; }
@keyframes sticker-in { from { scale: 0; rotate: -30deg; } to { scale: 1; } }

/* ---------- 分享圖卡 ---------- */

.share-sheet .sheet-body { gap: 12px; }
.share-frame { position: relative; display: flex; justify-content: center; min-height: 200px; }
.share-preview { display: block; max-width: 100%; max-height: 46dvh; border: 1px solid var(--hairline); border-radius: 4px; background: var(--accent-soft); transition: opacity 0.2s ease; }
.share-frame[data-format="story"] .share-preview { max-height: 52dvh; }
.share-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-weight: 800; color: var(--ink-soft); }
.share-frame.loading .share-preview { opacity: 0.35; }
.share-frame.loading .share-loading { display: flex; }
.share-preview:not([src]) { width: 60%; aspect-ratio: 4 / 5; }
.share-note { font-size: 13px; text-align: center; margin-top: -4px; }
.segmented.two { grid-template-columns: repeat(2, 1fr); }

/* ---------- 加入共養：給第一次來的人 ---------- */

.join-body { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding-top: 6px; }
.join-step { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.join-step.enter { animation: fade 0.3s ease both; }
.join-art { width: min(50vw, 200px); align-self: center; }
.join-name { font-size: 24px; font-weight: 900; text-align: center; line-height: 1.35; overflow-wrap: anywhere; }
.join-name.small { font-size: 22px; }
.join-sub { text-align: center; color: var(--ink-soft); font-weight: 700; margin-top: -6px; }
.how { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.how-step {
  counter-increment: how;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--hairline);
}
.how-art { width: 58px; flex: none; }
.how-step strong { display: block; font-size: 16px; font-weight: 900; }
.how-step strong::before { content: counter(how) "．"; color: var(--ink-soft); }
.how-step p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.join-promise { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; font-weight: 700; line-height: 1.6; text-align: center; }
.join-body .intro-dots { margin-top: 4px; }

/* ---------- 關於 ---------- */

.about-page { display: grid; gap: 16px; }
.about-page .topbar { margin-bottom: -16px; }
.about-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0 4px; text-align: center; }
.about-gang { width: min(64vw, 280px); }
.about-name { font-size: 32px; font-weight: 900; line-height: 1.2; }
.studio-tag { font-size: 18px; padding: 4px 14px; }
.about-motto { font-weight: 800; color: var(--ink-soft); }
.about-card { display: grid; gap: 12px; }
.about-card h2 { font-size: 17px; font-weight: 900; }
.about-card p { font-size: 15px; color: var(--ink-soft); line-height: 1.75; }
.about-card .mission { color: var(--ink); font-weight: 900; }
.member-row { display: flex; gap: 12px; align-items: flex-start; }
.member-art { width: 58px; flex: none; }
.member-title { display: flex; align-items: center; gap: 8px; }
.member-row p { white-space: pre-line; font-size: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-dot { width: 16px; height: 16px; flex: none; margin-top: 4px; --line: var(--fill); }
.step p { font-size: 14px; }
.credit { padding: 12px 0 24px; text-align: center; font-weight: 800; font-size: 14px; }
.credit .slogan { font-style: italic; }
.credit .version { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

/* ---------- Toast 與彩紙 ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 60;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 11px 16px 12px;
  --fill: var(--accent);
  --line: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; }
.burst-piece {
  position: absolute;
  left: 0; top: 0;
  --line: var(--fill);
  animation: burst 0.9s ease-out forwards;
}
@keyframes burst {
  from { transform: translate(-50%, -50%) scale(0.2) rotate(0); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--spin)); opacity: 0; }
}

/* ---------- 減少動態 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .boil > .frame { animation: none !important; opacity: 0; }
  .boil > .frame:first-child { opacity: 1; }
  .ceremony-step { opacity: 1; }
}

@media (min-width: 640px) {
  .greeting { font-size: 24px; }
}
