/* 點點任務 會員站「主角」方向 第二版。規則見 ../DESIGN.md。
   一屏一個主角：深紫主視覺 + 一個巨大的 3D 物件 + 一個巨大的數字；其餘白卡片、淺灰底、一個紫色。
   動效：只動 transform / opacity；進出場用強 ease-out、底部彈層用抽屜曲線；介面動畫不超過 300ms（彈層、提示除外）；
   進場動畫只在第一次看到那一頁時播一次（#view.fresh），之後更新資料不重播；hover 只給滑鼠。 */
:root {
  --ink: #14121f;
  --ink-2: #6f6c7d;
  --ink-3: #b3b0c0;
  --page: #f4f4f7;
  --wash: #ecebf3;
  --card: #ffffff;
  --violet: #5b3df5;
  --violet-soft: #efeaff;
  --night: #1c1447;
  --glow: #6a4dff;
  --red: #ff4d4f;
  --green: #12a05c;
  --amber: #b86a00;
  --amber-soft: #fff2d9;
  --lift: 0 1px 2px rgba(20, 18, 31, 0.04), 0 0 0 0.5px rgba(20, 18, 31, 0.05); /* 白卡片放在淺灰底上的一點點厚度 */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --cjk: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --round: ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', var(--cjk);
  color-scheme: light;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: #0f0a2b; /* 彈層打開、頁面往後退時露出來的底色 */
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--cjk);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
/* 段落最後一行不要只剩一兩個字；標題拆成兩行時盡量一樣長 */
p,
li {
  text-wrap: pretty;
}
h1,
h2,
h3,
.m-title,
.good-name {
  text-wrap: balance;
}
.nb {
  white-space: nowrap;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: inherit;
  user-select: none;
  -webkit-user-select: none;
}
input {
  font-size: 16px;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-radius: 10px;
}
.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
.num {
  font-variant-numeric: tabular-nums;
}
.clip1 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.clamp2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 整個 App 是一欄，寬螢幕置中 */
#root {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: var(--page);
  transition:
    transform 500ms var(--ease-drawer),
    border-radius 500ms var(--ease-drawer);
}
/* 底部彈層打開時，後面的頁面往後退一點（跟彈層同一條曲線、同一個時長，看起來是一個整體） */
html.sheet-open #root {
  transform: scale(0.94);
  border-radius: 28px;
  overflow: hidden;
}
html.sheet-drag #root,
html.sheet-drag .scrim,
html.sheet-drag .sheet {
  transition: none;
}

/* ---------- 分頁列 ---------- */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
}
.tabs > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 -1px 0 rgba(20, 18, 31, 0.06);
  pointer-events: auto;
}
.tabs a {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 0;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  transition:
    transform 140ms var(--ease-out),
    color 160ms ease;
}
.tabs a:active {
  transform: scale(0.97);
}
.tabs a[aria-current='page'] {
  color: var(--violet);
}
.tabs a[aria-current='page'] .icon {
  stroke-width: 2.6;
}

/* ---------- 深紫主視覺（每一頁共用骨架） ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 84px;
  border-radius: 0 0 34px 34px;
  background:
    radial-gradient(64% 58% at 104% 106%, rgba(255, 146, 92, 0.3) 0%, rgba(255, 146, 92, 0) 64%),
    radial-gradient(120% 90% at 86% 78%, var(--glow) 0%, rgba(106, 77, 255, 0) 58%),
    var(--night);
  color: #fff;
}
.hero.flat {
  padding-bottom: 30px;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 22px;
}
.brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.who {
  position: relative;
  max-width: 50%;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 700;
  transition: transform 140ms var(--ease-out);
}
.who::before {
  content: '';
  position: absolute;
  inset: -6px;
}
.who:active {
  transform: scale(0.97);
}
.hero-label {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.72;
}
.hero-amount {
  position: relative;
  z-index: 1;
  font: 800 72px/1.02 var(--round);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hero-amount.long {
  font-size: 46px;
}
.hero-amount small {
  margin-left: 4px;
  font: 800 22px var(--cjk);
  letter-spacing: 0;
}
.hero-note {
  position: relative;
  z-index: 1;
  max-width: 62%;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.86;
}
.hero-note b {
  font-weight: 800;
}
.hero-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 12px 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 15px;
  font-weight: 700;
  transition: transform 140ms var(--ease-out);
}
.hero-pill:active {
  transform: scale(0.97);
}
.hero-pill .icon {
  width: 18px;
  height: 18px;
}
/* 主角：一個巨大的 3D 物件，半露在右下角 */
.hero-object {
  position: absolute;
  right: -34px;
  bottom: -26px;
  width: 214px;
  height: 214px;
  transform: rotate(-14deg);
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.4));
}
.hero.flat .hero-object {
  right: -16px;
  bottom: -30px;
  width: 170px;
  height: 170px;
}
.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 70%;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
}

/* 進場：只在第一次看到這一頁時播一次。主角先到，小卡和任務卡跟著錯開（間隔不等距，全部在 300ms 內出發） */
.fresh .hero-object {
  animation: object-in 520ms var(--ease-out) both;
}
@keyframes object-in {
  from {
    opacity: 0;
    transform: rotate(-4deg) translate(24px, 30px) scale(0.92);
  }
}
.fresh .tiles > *,
.fresh .grid > li,
.fresh .goods > li {
  animation: rise 300ms var(--ease-out) both;
}
.fresh .tiles > :nth-child(2),
.fresh .goods > :nth-child(2) {
  animation-delay: 40ms;
}
.fresh .tiles > :nth-child(3),
.fresh .goods > :nth-child(3) {
  animation-delay: 70ms;
}
.fresh .grid > li {
  animation-delay: 90ms;
}
.fresh .grid > :nth-child(2) {
  animation-delay: 120ms;
}
.fresh .grid > :nth-child(n + 3) {
  animation-delay: 150ms;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ---------- 壓在主視覺下緣的三張小卡 ---------- */
.tiles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -56px 16px 0;
}
.tile {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 2px;
  min-height: 136px;
  padding: 14px 12px 12px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(20, 18, 31, 0.07);
  transition: transform 140ms var(--ease-out);
}
.tile:active {
  transform: scale(0.97);
}
.tile b {
  max-width: 100%;
  margin-top: 6px;
  font: 800 21px/1.2 var(--round);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile b.long {
  font-size: 16px;
}
.tile b small {
  margin-left: 2px;
  font: 800 13px var(--cjk);
}
.tile b small.pre {
  margin: 0 2px 0 0;
  color: var(--ink-2);
}
.tile span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.tile em {
  align-self: end;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  white-space: nowrap;
}
.ring {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}
.ring .bg {
  stroke: var(--wash);
}
.ring .fg {
  stroke: var(--violet);
}
.fresh .ring .fg {
  transition: stroke-dashoffset 700ms var(--ease-out);
}

.notice {
  margin: 14px 16px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffe9e9;
  color: #c62a2c;
  font-size: 14px;
  font-weight: 700;
}
.notice.calm {
  background: var(--amber-soft);
  color: var(--amber);
}
.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 20px 12px;
}
.head h2 {
  font-size: 22px;
  font-weight: 800;
}
.head span {
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- 任務：兩欄圖卡 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px;
}
.grid > li {
  min-width: 0;
}
.m-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* 內容再長也不能把卡片撐寬 */
  align-content: start;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 10px 10px 14px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--lift);
  transition:
    transform 140ms var(--ease-out),
    box-shadow 200ms ease;
}
.m-card:active {
  transform: scale(0.97);
}
.m-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.8;
  border-radius: 18px;
}
/* 物件底下一點點影子，像放在色塊上，不是貼上去的 */
.m-art .art {
  filter: drop-shadow(0 8px 10px rgba(54, 31, 130, 0.16));
}
/* 有封面圖（真的貼文圖、品牌圖）：照片填滿原本放 3D 圖的那一塊，多的裁掉。任務卡、彈層裡的小圖、已完成清單的小圓圈共用。 */
.photo {
  position: relative;
  overflow: hidden;
  background: var(--wash);
}
.photo .cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 淺色的照片跟白卡片之間要有一條很淡的邊，不然邊緣會糊在一起 */
.photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(20, 18, 31, 0.06);
  pointer-events: none;
}
/* 照片右下角的小 3D 圖：這個任務要做什麼 */
.m-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(20, 18, 31, 0.2);
}
.m-badge .art {
  filter: none;
}
.t0 {
  background: #efeaff;
}
.t1 {
  background: #e4f1ff;
}
.t2 {
  background: #fff0d9;
}
.t3 {
  background: #e3f6ea;
}
.t4 {
  background: #ffe7ec;
}
.m-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.m-tag.dark {
  background: var(--ink);
}
.m-tag.go {
  background: var(--violet);
}
.m-title {
  padding: 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  min-height: 2.8em;
  overflow-wrap: anywhere;
}
.m-pts {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  color: var(--violet);
  font: 800 17px/1 var(--round);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.m-pts small {
  min-width: 0;
  margin-left: auto;
  padding-left: 6px;
  color: var(--ink-3);
  font: 600 12px var(--cjk);
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 做過的任務縮成一行，放在還能做的下面 */
.head.minor {
  padding-top: 22px;
}
.head.minor h2 {
  color: var(--ink-2);
  font-size: 16px;
}
#closed .row-title {
  color: var(--ink-2);
  font-weight: 600;
}
.more {
  display: block;
  width: 100%;
  min-height: 44px;
  color: var(--violet);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.panel > .more {
  box-shadow: 0 -1px 0 var(--wash);
}
.card > .more {
  margin-top: 4px;
}
.fine.none {
  margin-top: 12px;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0 16px;
  padding: 34px 20px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--lift);
  color: var(--ink-2);
  font-weight: 600;
  text-align: center;
}
.empty .cta {
  width: auto;
  margin-top: 4px;
}

/* 還沒拿到資料時的佔位（形狀跟真的版面一樣，資料到了不會跳動） */
.sk {
  border-radius: 22px;
  background: var(--wash);
}
.sk-hero {
  height: 268px;
  border-radius: 0 0 34px 34px;
  background: var(--night);
}
.sk-hero.flat {
  height: 214px;
}
.sk-tile {
  height: 136px;
  background: var(--card);
}
.sk-card {
  aspect-ratio: 1 / 1.24;
  background: var(--card);
  border-radius: 24px;
}
.sk-row {
  height: 108px;
  margin: 0 16px 12px;
  background: var(--card);
  border-radius: 24px;
}

/* ---------- 兌換：像真禮券的卡面 + 有刻度的進度尺 ---------- */
.goods {
  display: grid;
  gap: 12px;
  padding: 0 16px;
}
.good {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--lift);
}
.face {
  position: relative;
  display: grid;
  align-content: space-between;
  aspect-ratio: 124 / 84;
  padding: 9px 10px 7px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--violet);
  color: #fff;
  box-shadow: 0 6px 14px rgba(20, 18, 31, 0.14);
}
.face.line {
  background: #06c755;
}
.face.store {
  background: #ff7a1a;
}
.face.fami {
  background: #0c8ce9;
}
.face::before {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  right: -40px;
  top: -52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.face small {
  position: relative;
  max-width: 100%;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.94;
}
.face b {
  position: relative;
  font: 800 26px/1 var(--round);
  letter-spacing: -0.02em;
}
.face b.long {
  font-size: 18px;
}
.face b i {
  margin-left: 3px;
  font: 700 0.42em/1 var(--cjk);
  font-style: normal;
  letter-spacing: 0;
  opacity: 0.9;
}
.face::after {
  content: '';
  position: absolute;
  width: 64px;
  height: 64px;
  right: -18px;
  bottom: -26px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.14);
}
.good-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.good-cost {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--violet);
  font: 800 18px/1 var(--round);
  font-variant-numeric: tabular-nums;
}
.good-cost small {
  margin-left: 6px;
  color: var(--ink-3);
  font: 600 12px var(--cjk);
}
.ruler {
  position: relative;
  height: 10px;
  margin: 12px 0 6px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 2px), rgba(20, 18, 31, 0.16) calc(25% - 2px) 25%),
    var(--wash);
  overflow: hidden;
}
.ruler i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--violet);
  transform-origin: left;
  transform: scaleX(0);
}
.fresh .ruler i {
  transition: transform 700ms var(--ease-out);
}
.fine {
  color: var(--ink-2);
  font-size: 13px;
}
.fine b {
  color: var(--ink);
  font-weight: 800;
}
.foot {
  padding: 16px 20px 0;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------- 按鈕 ---------- */
.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  transition:
    transform 140ms var(--ease-out),
    background-color 200ms ease,
    color 200ms ease;
}
.cta:active {
  transform: scale(0.97);
}
.cta.small {
  width: auto;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 20px;
  font-size: 15px;
}
.cta.ghost {
  background: var(--wash);
  color: var(--ink);
}
.cta.white {
  background: #fff;
  color: var(--ink);
}
.cta.line {
  background: #06c755;
}
.cta.danger {
  background: #d92d32;
  color: #fff;
}
/* 還不能按：比灰色的次要按鈕（.ghost）更淡，字也淡，兩個放在一起分得出來 */
.cta:disabled {
  background: var(--page);
  color: var(--ink-3);
  cursor: default;
  transform: none;
}
/* 送出中：文字讓位給一個轉得快的小圈（轉得快，感覺上就等得短） */
.cta[aria-busy='true'] {
  pointer-events: none;
}
.cta[aria-busy='true'] > * {
  visibility: hidden;
}
.cta[aria-busy='true'] {
  color: transparent;
}
.cta[aria-busy='true']::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 600ms linear infinite;
}
.cta.ghost[aria-busy='true']::after,
.cta.white[aria-busy='true']::after {
  border-color: rgba(20, 18, 31, 0.18);
  border-top-color: var(--ink);
}
/* 要等比較久的（AI 審核）：小圈放在字的左邊，字留著，會員知道現在在做什麼 */
.cta.talk[aria-busy='true'] {
  gap: 10px;
  color: #fff;
}
.cta.talk[aria-busy='true'] > * {
  visibility: visible;
}
.cta.talk[aria-busy='true']::after {
  position: static;
  order: -1;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-width: 2.5px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* 等待作答：按鈕底色像進度條一樣等速填滿，時間到就能按 */
.cta .fill {
  position: absolute;
  inset: 0;
  background: rgba(91, 61, 245, 0.2);
  transform-origin: left;
  transform: scaleX(0);
  animation: fill linear both;
}
.cta .fill + span {
  position: relative;
}
@keyframes fill {
  to {
    transform: scaleX(1);
  }
}
/* 複製、送出這類按鈕換字時，用一點模糊蓋住交接 */
.swap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    filter 200ms ease,
    opacity 200ms ease;
}
.swap.changing {
  filter: blur(2px);
  opacity: 0.6;
}

/* ---------- 一般列表（紀錄、我的兌換、邀請說明） ---------- */
.panel {
  margin: 0 16px;
  padding: 6px 16px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--lift);
}
.day {
  padding: 18px 22px 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.head + .day {
  padding-top: 0;
}
.rows > li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 0;
}
.rows > li + li {
  box-shadow: 0 -1px 0 var(--wash);
}
.row-ico {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--page);
}
.row-title {
  font-weight: 700;
}
.row-sub {
  grid-column: 2;
  color: var(--ink-2);
  font-size: 13px;
}
.row-side {
  grid-row: 1 / span 2;
  grid-column: 3;
  text-align: right;
  font: 800 18px/1.2 var(--round);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row-side.plus {
  color: var(--green);
}
.row-side.minus {
  color: var(--ink-2);
}
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font: 800 12px var(--cjk);
}
.tag.pending {
  background: var(--amber-soft);
  color: var(--amber);
}
.tag.fulfilled {
  background: #dff5e8;
  color: var(--green);
}
.tag.rejected {
  background: #ffe9e9;
  color: #c62a2c;
}
.code-note {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--page);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
/* 兌換進度：申請 → 審核 → 發送，三個點連成一條 */
.steps3 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
}
.steps3 li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}
.steps3 li::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  width: 100%;
  height: 3px;
  background: var(--wash);
}
.steps3 li:last-child::before {
  display: none;
}
.steps3 i {
  position: relative;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--wash);
}
.steps3 li.done {
  color: var(--ink);
}
.steps3 li.done i,
.steps3 li.done::before {
  background: var(--violet);
}
.steps3 li.now {
  color: var(--ink);
}
.steps3 li.now i {
  background: #fff;
  box-shadow: inset 0 0 0 4px var(--violet);
}
.steps3 li.bad {
  color: #c62a2c;
}
.steps3 li.bad i {
  background: var(--red);
}
#sheetBody .steps3 {
  padding: 14px 4px;
  border-radius: 16px;
  background: var(--page);
}

/* ---------- 邀請 ---------- */
.card {
  margin: 14px 16px 0;
  padding: 18px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--lift);
}
.card h2 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 800;
}
.invite-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.invite-link input {
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--page);
  color: var(--ink);
  font: 600 14px var(--cjk);
  text-overflow: ellipsis;
}
.invite-link .cta {
  min-height: 52px;
  padding: 0 18px;
  font-size: 15px;
}
.card > .cta {
  margin-bottom: 10px;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.stat {
  padding: 14px;
  border-radius: 16px;
  background: var(--page);
}
.stat b {
  display: block;
  font: 800 30px/1.1 var(--round);
  font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.steps {
  display: grid;
  gap: 12px;
  counter-reset: s;
  font-size: 15px;
}
.steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  counter-increment: s;
}
.steps li::before {
  content: counter(s);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font: 800 13px var(--round);
}

/* ---------- 登入頁 ---------- */
.welcome .hero {
  padding-bottom: 150px;
}
.welcome .hero h1 {
  max-width: none;
  font-size: 34px;
}
.welcome .hero h1 b {
  color: #ffd45e;
}
.welcome .hero-object {
  right: 50%;
  margin-right: -110px;
  bottom: -64px;
  width: 220px;
  height: 220px;
  transform: rotate(-10deg);
}
.features {
  display: grid;
  gap: 4px;
  margin: 20px 16px 0;
  padding: 8px 16px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--lift);
}
.feature {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}
.feature b {
  display: block;
  font-size: 16px;
}
.feature span {
  color: var(--ink-2);
  font-size: 14px;
}
.actions {
  display: grid;
  gap: 10px;
  padding: 18px 16px 0;
}

/* ---------- 往下捲之後，頂端滑出一條細列：這一頁的名稱 + 目前的點數 ----------
   有自己的半透明底，所以不會像一顆藥丸浮在內容上面擋住字。 */
.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 480px);
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px 20px;
  background: rgba(244, 244, 247, 0.86);
  -webkit-backdrop-filter: saturate(1.8) blur(16px);
  backdrop-filter: saturate(1.8) blur(16px);
  box-shadow: 0 1px 0 rgba(20, 18, 31, 0.06);
  visibility: hidden;
  transform: translate(-50%, -100%);
  transition:
    transform 240ms var(--ease-out),
    opacity 160ms var(--ease-out),
    visibility 0s linear 240ms;
}
.topbar.show {
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
#topTitle {
  font-size: 17px;
  font-weight: 800;
}
.float-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 9px;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font: 800 16px var(--round);
  font-variant-numeric: tabular-nums;
  transition: transform 140ms var(--ease-out);
}
.float-pill::before {
  content: '';
  position: absolute;
  inset: -6px;
}
.float-pill:active {
  transform: scale(0.97);
}
html.sheet-open .topbar {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 底部彈出層：進出都走同一條路（從下面上來、回下面去），可以往下拖著關 ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 8, 24, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms var(--ease-drawer);
}
html.sheet-open .scrim {
  opacity: 1;
}
.sheet {
  width: min(100%, 480px);
  max-width: 100%;
  max-height: 90dvh;
  margin: auto auto 0;
  padding: 0 20px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 28px 28px 0 0;
  background: #fff;
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 500ms var(--ease-drawer);
}
.sheet::backdrop {
  background: transparent;
}
.sheet:focus {
  outline: none;
}
.sheet.in {
  transform: translateY(0);
}
.sheet-handle {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -20px;
  padding: 0 20px;
  background: #fff;
  touch-action: none;
  cursor: grab;
}
.sheet-grip {
  width: 40px;
  height: 5px;
  margin: 0 auto;
  border-radius: 999px;
  background: #e2e1ea;
  transform: translateY(10px);
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 0 12px;
}
.sheet-head h2 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  padding-top: 7px;
  overflow-wrap: anywhere;
}
.sheet-x {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-right: -4px;
  border-radius: 50%;
  background: var(--page);
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
.sheet-x:active {
  transform: scale(0.97);
}
#sheetBody {
  display: grid;
  gap: 16px;
}
/* 彈層裡換內容（說明 → 題目 → 結果）：新的內容稍微上浮淡入 */
#sheetBody.swap-in > * {
  animation: rise 260ms var(--ease-out) both;
}
#sheetBody.swap-in > :nth-child(2) {
  animation-delay: 30ms;
}
#sheetBody.swap-in > :nth-child(n + 3) {
  animation-delay: 60ms;
}
.s-lead {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.s-art {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
}
.s-lead p {
  color: var(--ink-2);
  font-size: 15px;
}
.s-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.s-facts div {
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--page);
  text-align: center;
}
.s-facts b {
  display: block;
  font: 800 21px/1.3 var(--round);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.s-facts b.long {
  font-size: 15px;
  line-height: 1.8;
}
.s-facts span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.s-fine {
  color: var(--ink-3);
  font-size: 13px;
}
.s-kicker {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.s-q {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.s-options {
  display: grid;
  gap: 10px;
}
.s-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--page);
  font-size: 17px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px transparent;
  transition:
    transform 140ms var(--ease-out),
    box-shadow 140ms ease,
    background-color 140ms ease;
}
.s-option:active {
  transform: scale(0.97);
}
.s-option i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font: 800 15px var(--round);
  font-style: normal;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}
.s-option[aria-pressed='true'] {
  background: var(--violet-soft);
  box-shadow: inset 0 0 0 2px var(--violet);
}
.s-option[aria-pressed='true'] i {
  background: var(--violet);
  color: #fff;
}
.s-link {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  min-height: 44px;
  margin: -6px 0; /* 字小、但要好按：可以按的範圍有 44 高，上下各往外借 6，看起來的間距不變 */
  padding: 0 14px;
  color: var(--violet);
  font-size: 15px;
  font-weight: 700;
}
.s-result {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 0 4px;
  text-align: center;
}
.s-result h3 {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
}
.s-result h3 b {
  display: block;
  color: var(--violet);
  font: 800 64px/1.05 var(--round);
  font-variant-numeric: tabular-nums;
}
.s-result p {
  color: var(--ink-2);
  font-size: 15px;
}
.s-timer {
  font: 800 48px/1.1 var(--round);
  font-variant-numeric: tabular-nums;
}
/* 簽到彈層：超大的連續天數 + 一條連起來的七天 */
.streak {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 8px;
}
.streak b {
  display: block;
  color: #ff7a00;
  font: 800 96px/1 var(--round);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.streak b.long {
  font-size: 68px;
}
.streak span {
  color: #ff7a00;
  font-size: 20px;
  font-weight: 800;
}
.track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 16px 6px 14px;
  border-radius: 20px;
  background: var(--page);
}
.track li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink-3);
  font: 800 12px/1 var(--round);
  font-variant-numeric: tabular-nums;
}
.track li::before {
  content: '';
  position: absolute;
  top: 11px;
  left: 50%;
  width: 100%;
  height: 4px;
  background: #dfdde8;
}
.track li:last-child::before {
  display: none;
}
.track li.done::before {
  background: #ff9a2e;
}
.track li.done.last::before {
  background: #dfdde8;
}
.track i {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dfdde8;
  color: #fff;
}
.track i .icon {
  width: 15px;
  height: 15px;
  stroke-width: 3.6;
}
.track li.done i {
  background: #ff9a2e;
}
.track li.done {
  color: #ff7a00;
}
.track li.today i {
  background: #fff;
  box-shadow: inset 0 0 0 4px #ff9a2e;
}
.track li.today {
  color: var(--ink);
}
.track li.gift i {
  background: none;
  width: 30px;
  height: 30px;
  margin: -2px 0;
}
/* 剛簽到的那一格：打勾的圓彈一下（只在簽到成功那一刻） */
.track li.just i {
  animation: stamp 420ms var(--ease-out) both;
}
@keyframes stamp {
  from {
    transform: scale(0.6);
    opacity: 0.4;
  }
  60% {
    transform: scale(1.14);
  }
}
.profile {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.profile b {
  font-size: 20px;
  overflow-wrap: anywhere;
}
.profile p {
  color: var(--ink-2);
  font-size: 14px;
}

/* 撒金幣和提示都是 popover（放進最上層才蓋得過彈層）。先把瀏覽器給 popover 的預設外觀（置中、白底、邊框）全部拿掉。 */
.burst,
.toasts {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
  max-width: none;
  max-height: none;
}
.burst {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- 提示：從下面上來、往下滑掉；連續出現時疊在一起，舊的往後退 ---------- */
.toasts {
  position: fixed;
  inset: auto 0 calc(96px + env(safe-area-inset-bottom, 0px)) 0;
  width: auto;
  height: auto;
  z-index: 70;
  display: grid;
  justify-items: center;
  pointer-events: none;
}
/* 彈層開著時，下半部是彈層的按鈕，提示改出現在上方，不擋住「送出答案」這類按鈕 */
html.sheet-open .toasts {
  inset: calc(40px + env(safe-area-inset-top, 0px)) 0 auto 0;
}
.toast {
  grid-area: 1 / 1;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(20, 18, 31, 0.2);
  pointer-events: auto;
  touch-action: none;
  opacity: 0;
  transform: translateY(120%);
  transition:
    transform 400ms ease,
    opacity 400ms ease;
}
.toast.in {
  opacity: 1;
  transform: translateY(0);
}
.toast.in.back1 {
  opacity: 0.9;
  transform: translateY(-12px) scale(0.95);
}
.toast.in.back2 {
  opacity: 0.6;
  transform: translateY(-24px) scale(0.9);
}
.toast.error {
  background: #c62a2c;
}
.toast.dragging {
  transition: none;
}

@media (hover: hover) and (pointer: fine) {
  .tabs a:hover {
    color: var(--ink);
  }
  .m-card:hover {
    box-shadow:
      0 10px 26px rgba(20, 18, 31, 0.08),
      0 0 0 0.5px rgba(20, 18, 31, 0.05);
  }
  .s-option:hover:not([aria-pressed='true']) {
    box-shadow: inset 0 0 0 2px #dcdae6;
  }
}
@media (min-width: 520px) {
  body {
    background: #e7e6ee;
  }
}
/* ---------- 截圖任務：選截圖、填名稱 ----------
   每一塊之間的距離交給 #sheetBody 的 gap（16），這裡不各自加外距，跟答題、兌換的彈層同一個節奏。 */
.s-hint {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--violet-soft);
  font-size: 14px;
  font-weight: 600;
}
.s-hint b {
  display: block;
  margin-bottom: 2px;
  color: var(--violet);
  font-size: 13px;
  font-weight: 800;
}
.upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 156px;
  border: 1.5px dashed #c8c3de;
  border-radius: 20px;
  background: #f8f7fc;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 140ms var(--ease-out);
}
.upload:active {
  transform: scale(0.98);
}
.upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload:has(input:focus-visible) {
  border: 2px solid var(--violet);
}
.upload-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 18px;
  text-align: center;
  pointer-events: none;
}
.upload-empty b {
  font-size: 16px;
}
.upload-empty small {
  color: var(--ink-2);
  font-size: 13px;
}
/* 選好之後：截圖像一張照片放在淺灰的底上，右下角一顆「換一張」 */
.upload.has {
  border: 1.5px solid transparent;
  background: var(--page);
}
.upload-img {
  display: block;
  max-width: calc(100% - 28px);
  max-height: 240px;
  margin: 14px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(20, 18, 31, 0.16);
  pointer-events: none;
}
.upload-swap {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 18, 31, 0.8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.s-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.s-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--page);
  color: var(--ink);
  font: 600 16px var(--cjk);
}
.s-input::placeholder {
  color: var(--ink-3);
}
.s-input:focus {
  outline: none;
  border-color: var(--violet);
  background: #fff;
}
#sheetBody .notice {
  margin: 0;
}

/* ---------- 電腦版（寬 960 以上）：上方導覽列、寬版主視覺、多欄卡片、置中彈層 ----------
   同一套「主角」：深紫主視覺 + 一個巨大的 3D 物件 + 一個巨大的數字，只是攤開來排。 */
@media (min-width: 960px) {
  body {
    background: var(--page);
  }
  #root {
    width: min(100% - 64px, 1180px);
    padding: 92px 0 64px;
    background: transparent;
  }
  /* 頁面不跟著彈層往後退（大螢幕整頁縮放很怪），拖曳也關掉了 */
  html.sheet-open #root,
  #root {
    transform: none !important;
    border-radius: 0;
    overflow: visible;
  }

  /* 分頁列 → 上方導覽列：左邊品牌，中間四個分頁 */
  .tabs {
    top: 0;
    bottom: auto;
  }
  .tabs > div {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 68px;
    padding: 0 max(32px, calc((100% - 1180px) / 2));
    box-shadow: 0 1px 0 rgba(20, 18, 31, 0.06);
  }
  .tabs > div::before {
    content: '點點任務';
    display: flex;
    align-items: center;
    height: 36px;
    margin-right: 28px;
    padding-left: 44px;
    background: url('/art/coin.webp') left center / 34px no-repeat;
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.02em;
  }
  .tabs a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 15px;
  }
  .tabs a .icon {
    width: 20px;
    height: 20px;
  }
  .tabs a[aria-current='page'] {
    background: var(--violet-soft);
    color: var(--violet);
  }
  /* 往下捲之後出現的點數：電腦版已經有導覽列，只留右邊那顆點數，放在導覽列右邊 */
  .topbar {
    top: 14px;
    left: auto;
    right: max(32px, calc((100% - 1180px) / 2));
    z-index: 11;
    width: auto;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    transition:
      transform 200ms var(--ease-out),
      opacity 200ms var(--ease-out),
      visibility 0s linear 200ms;
  }
  .topbar.show {
    opacity: 1;
    transform: none;
  }
  #topTitle {
    display: none;
  }

  /* 主視覺：圓角卡片，數字、物件都放大 */
  .hero {
    padding: 36px 48px 128px;
    border-radius: 36px;
  }
  .hero.flat {
    padding-bottom: 44px;
  }
  .hero-top {
    margin-bottom: 28px;
  }
  .brand {
    font-size: 20px;
  }
  /* 導覽列上已經有「點點任務」了，首頁主視覺裡那個就不重複 */
  .brand.app {
    display: none;
  }
  .who {
    margin-left: auto;
    max-width: 320px;
    padding: 9px 16px;
    font-size: 14px;
  }
  .hero-label {
    font-size: 16px;
  }
  .hero-amount {
    font-size: 108px;
  }
  .hero-amount.long {
    font-size: 76px;
  }
  .hero-amount small {
    font-size: 28px;
  }
  .hero-note {
    max-width: 560px;
    font-size: 16px;
  }
  .hero h1 {
    max-width: 640px;
    font-size: 40px;
  }
  .hero-object {
    right: 72px;
    bottom: 40px;
    width: 300px;
    height: 300px;
  }
  .hero.flat .hero-object {
    right: 64px;
    bottom: -40px;
    width: 230px;
    height: 230px;
  }
  /* 壓在主視覺下緣的小卡：寬螢幕一排三張，比較高 */
  .tiles {
    gap: 16px;
    margin: -80px 48px 0; /* 左右跟主視覺裡的字對齊（主視覺內距 48） */
  }
  .tile {
    min-height: 168px;
    padding: 22px 22px 18px;
    border-radius: 26px;
  }
  .tile .art {
    width: 52px;
    height: 52px;
  }
  .tile b {
    font-size: 30px;
  }
  .tile b small {
    font-size: 15px;
  }
  .tile span {
    font-size: 14px;
  }
  .tile em {
    padding: 7px 14px;
    font-size: 14px;
  }
  .ring {
    width: 52px;
    height: 52px;
  }
  .head {
    padding: 40px 4px 16px;
  }
  .head h2 {
    font-size: 26px;
  }
  .head span {
    font-size: 15px;
  }
  .notice {
    margin: 20px 0 0;
  }

  /* 任務：四欄 */
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding: 0;
  }
  .m-card {
    padding: 12px 12px 18px;
    border-radius: 26px;
  }
  .m-title {
    font-size: 16px;
  }
  .panel,
  .empty,
  .sk-row {
    margin: 0;
  }
  .panel {
    padding: 6px 24px;
  }
  .day {
    padding: 22px 8px 10px;
  }
  .more {
    min-height: 48px;
  }

  /* 兌換：兩欄禮券 */
  .goods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
  }
  .good {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 20px;
    padding: 16px 20px 16px 16px;
    border-radius: 26px;
  }
  .good-name {
    font-size: 17px;
  }

  /* 邀請：兩張卡並排 */
  .hero.flat ~ .card {
    margin: 0;
  }
  #view:has(.invite-link) {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 20px;
    align-content: start;
  }
  #view:has(.invite-link) > .hero,
  #view:has(.invite-link) > .foot {
    grid-column: 1 / -1;
  }
  #view:has(.invite-link) > .card {
    margin: 0;
    padding: 26px;
  }
  .card h2 {
    font-size: 20px;
  }
  .foot {
    padding: 20px 4px 0;
  }

  /* 登入頁：左邊大主視覺，右邊說明和按鈕 */
  /* 右欄（說明、按鈕）在畫面中間上下置中；左邊主視覺撐滿高度，金幣在右上、大標題在左下 */
  .welcome {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 32px;
    min-height: calc(100dvh - 104px);
    margin-top: -60px; /* 登入頁沒有導覽列，往上收 */
  }
  .welcome .hero {
    grid-row: 1 / -1;
    grid-column: 1;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    padding: 44px 52px 52px;
  }
  .welcome .hero h1 {
    max-width: 560px;
    margin-top: auto;
    font-size: 54px;
    line-height: 1.2;
  }
  .welcome .hero .hero-note {
    font-size: 18px;
  }
  .welcome .hero-object {
    top: 56px;
    right: 48px;
    bottom: auto;
    left: auto;
    margin-right: 0;
    width: 260px;
    height: 260px;
    transform: rotate(-12deg);
  }
  .welcome > .notice,
  .welcome > .features,
  .welcome > .actions,
  .welcome > .foot {
    grid-column: 2;
    margin-left: 0;
    margin-right: 0;
  }
  .welcome > .notice {
    grid-row: 1;
    align-self: end;
    margin: 0 0 16px;
  }
  .welcome > .features {
    grid-row: 2;
    margin-top: 0;
    padding: 14px 24px;
  }
  .welcome > .actions {
    grid-row: 3;
  }
  .welcome > .foot {
    grid-row: 4;
  }
  .feature {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 14px 0;
  }
  .feature .art {
    width: 56px;
    height: 56px;
  }
  .welcome > .actions {
    padding: 22px 0 0;
  }

  /* 彈層 → 置中的視窗：淡入加一點點上浮，不從螢幕底部滑上來 */
  .sheet {
    width: min(100% - 48px, 560px);
    max-height: min(86dvh, 820px);
    margin: auto;
    padding: 0 28px 28px;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(10, 8, 24, 0.35);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition:
      transform 300ms var(--ease-out),
      opacity 200ms var(--ease-out);
  }
  .sheet.in {
    opacity: 1;
    transform: none;
  }
  /* 內容比視窗高時的捲軸：細一點、上下讓開圓角，不要貼在圓角外面 */
  .sheet::-webkit-scrollbar {
    width: 12px;
  }
  .sheet::-webkit-scrollbar-track {
    margin: 22px 0;
    background: transparent;
  }
  .sheet::-webkit-scrollbar-thumb {
    border: 4px solid #fff;
    border-radius: 999px;
    background: #d5d2e0;
  }
  .sheet-handle {
    margin: 0 -28px;
    padding: 0 28px;
    touch-action: auto;
  }
  .sheet-grip {
    visibility: hidden;
    height: 8px;
  }
  .scrim {
    transition-duration: 300ms;
  }

  /* 提示：沒有底部分頁列了，往下放 */
  .toasts {
    inset: auto 0 calc(32px + env(safe-area-inset-bottom, 0px)) 0;
  }
  html.sheet-open .toasts {
    inset: 24px 0 auto 0;
  }

  /* 還沒拿到資料時的佔位，形狀跟著電腦版 */
  .sk-hero {
    height: 340px;
    border-radius: 36px;
  }
  .sk-hero.flat {
    height: 250px;
  }
  .sk-tile {
    height: 168px;
  }
  .sk-row {
    height: 96px;
    margin-bottom: 12px;
  }
}

/* 減少動態效果：位移類的動畫拿掉，只留很短的淡入；拖曳是使用者自己在動，照常 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
  html.sheet-open #root {
    transform: none;
    border-radius: 0;
  }
  .cta[aria-busy='true']::after {
    animation-duration: 600ms !important;
  }
}
