:root {
  --bg: #f5f2ec;
  --bg2: #ebe6dc;
  --card: #ffffff;
  --ink: #1d2430;
  --ink2: #586170;
  --ink3: #8a919c;
  --line: #e4ded3;
  --teal: #0e7469;
  --teal-soft: #e3f2ef;
  --money: #d9480f;
  --money-soft: #fff0e6;
  --gold: #b7791f;
  --gold-soft: #fbf1dc;
  --danger: #c92a2a;
  --line-green: #06c755;
  --shadow: 0 1px 2px rgba(29, 36, 48, .05), 0 8px 24px rgba(29, 36, 48, .06);
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c; --bg2: #1b1f26; --card: #1f242c; --ink: #eef0f3; --ink2: #b3bac4; --ink3: #7d8592;
    --line: #2e343e; --teal: #3cc2b0; --teal-soft: #173a36; --money: #ff8a4c; --money-soft: #3a2418;
    --gold: #f0b54a; --gold-soft: #3a2f17; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171c; --bg2: #1b1f26; --card: #1f242c; --ink: #eef0f3; --ink2: #b3bac4; --ink3: #7d8592;
  --line: #2e343e; --teal: #3cc2b0; --teal-soft: #173a36; --money: #ff8a4c; --money-soft: #3a2418;
  --gold: #f0b54a; --gold-soft: #3a2f17; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--teal); }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 64px; }
.wrap.wide { max-width: 1080px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
h1, h2, h3 { line-height: 1.3; margin: 0 0 8px; text-wrap: balance; }
h1 { font-size: 26px; letter-spacing: .01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.muted { color: var(--ink2); }
.tiny { font-size: 13px; color: var(--ink3); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hide { display: none !important; }

label { display: block; font-size: 14px; color: var(--ink2); margin: 12px 0 6px; }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
textarea { min-height: 96px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600;
  border: 0; border-radius: 12px; padding: 13px 18px;
  background: var(--teal); color: #fff; cursor: pointer; text-decoration: none;
  min-height: 48px; transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.05); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.line { background: var(--line-green); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.money { background: var(--money); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
  background: var(--bg2); color: var(--ink2); white-space: nowrap;
}
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.chip.money { background: var(--money-soft); color: var(--money); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.red { background: #fde8e8; color: var(--danger); }

.avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-size: 15px;
  opacity: 0; transition: all .25s ease; pointer-events: none; z-index: 99; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
/* 分享到哪裡(share-kit.js,2026-10-03 T1003-03) */
.sk-list { display: grid; gap: 8px; }
.sk { border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); }
.sk summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 48px; font-weight: 700; }
.sk summary::-webkit-details-marker { display: none; }
.sk-ic { font-size: 20px; width: 28px; text-align: center; flex: none; }
.sk-nm { flex: 1; min-width: 0; }
.sk-go { font-size: 13px; color: var(--teal); font-weight: 700; flex: none; }
.sk[open] { border-color: var(--teal); }
.sk-body { padding: 0 14px 14px; }
.sk-when { margin: 0 0 8px; }
.sk-steps { margin: 0 0 10px; padding-left: 20px; font-size: 15px; line-height: 1.6; }
.sk-text { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; line-height: 1.6; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; background: var(--bg); }
.sk-btns { margin-top: 10px; }
/* 朋友進度四格(2026-10-03 T1003-03) */
.list li .steps { flex: 0 0 100%; display: flex; gap: 4px; margin-top: 2px; }
.list li .steps span { flex: 1 1 0; min-width: 0; width: auto; font-size: 11px; line-height: 1.2; text-align: center; padding: 6px 2px 0; border-top: 4px solid var(--line); color: var(--ink3, #999); white-space: nowrap; }
.list li .steps span.on { border-top-color: var(--teal); color: var(--teal); font-weight: 700; }
.empty { color: var(--ink3); text-align: center; padding: 20px 0; font-size: 14px; }

details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details[open] summary { margin-bottom: 8px; }

/* 2026-10-03 奢侈品風迷你禮品卡(領取頁券面、會員中心「收到的禮」共用;與分享圖卡 gift-card.js 同款) */
.luxe { position: relative; overflow: hidden; border-radius: 14px; padding: 20px 34% 20px 22px; margin: 16px 0;
  background: #0f3a33 url(/assets/card/bg-wide.jpg) 82% 50% / cover no-repeat; color: #f6f1e6; text-align: left;
  box-shadow: 0 14px 30px -14px rgba(10,41,37,.55); }
.luxe::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(216,191,134,.55); border-radius: 9px; pointer-events: none; }
.luxe .gc { display: block; font-family: "Cormorant Garamond", "Noto Serif TC", serif; font-weight: 600; font-size: 12px; letter-spacing: .32em; color: #d8bf86; }
.luxe .from { display: block; margin-top: 8px; font-size: 13px; color: rgba(246,241,230,.8); }
.luxe .amt { display: block; margin: 2px 0 6px; font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif; font-weight: 700; font-size: 26px; line-height: 1.25; letter-spacing: .06em;
  background: linear-gradient(160deg, #f3e4bd, #cdab6a 45%, #ecd79f 70%, #a9864a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.luxe .note { display: block; font-size: 12.5px; line-height: 1.6; color: rgba(246,241,230,.72); }
@media (max-width: 360px) { .luxe { padding-right: 30%; } .luxe .amt { font-size: 21px; } }

/* 2026-10-05 T1004-71 推薦機制 v4:推薦紀錄漏斗、不算原因、填頻道、申訴 */
.v4-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.v4-funnel > div { background: var(--teal-soft); border-radius: 12px; padding: 10px 4px; text-align: center; position: relative; }
.v4-funnel > div:not(:last-child)::after { content: "›"; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); color: var(--ink3, #8a919c); font-size: 16px; }
.v4-funnel b { display: block; font-size: 22px; line-height: 1.15; color: var(--teal); word-break: break-all; }
.v4-funnel > div:last-child { background: var(--money-soft); }
.v4-funnel > div:last-child b { color: var(--money); font-size: 18px; }
.v4-funnel span { display: block; font-size: 13px; color: var(--ink); margin-top: 2px; }
.v4-funnel i { display: block; font-style: normal; font-size: 11px; color: var(--ink3, #8a919c); margin-top: 2px; }
.v4-why { flex-basis: 100%; margin: 6px 0 0 46px; color: var(--gold); }
.v4-reply { color: var(--teal); margin-top: 4px; }
.v4-chask { margin-top: 12px; background: var(--gold-soft); border: 1px solid rgba(183, 121, 31, .35); border-radius: 12px; padding: 12px; }
.v4-chask .row input { min-width: 0; }
.v4-appeal { margin-top: 10px; }
.v4-appeal select, .v4-appeal textarea { width: 100%; margin-top: 6px; }
.v4-appeal textarea { min-height: 84px; }
@media (max-width: 360px) { .v4-funnel b { font-size: 18px; } .v4-funnel span { font-size: 12px; } }
.v4-chask .row { flex-wrap: nowrap; }
.v4-chask .row .btn { white-space: nowrap; flex: none; }
