/* 易禧樂學活動專區
   設計方向：明亮溫暖的公益風
   - 字體：標題用「粉圓」Huninn（圓潤親切）＋內文 Noto Sans TC
   - 配色：暖白底、暖橘主色；陽光黃、葉子綠用在插圖與「每件捐多少」；淺橘、淺綠、淺藍、奶油黃區塊交替
   - 形狀：大圓角卡片、膠囊按鈕、手繪感插圖
   - 只有亮色版本，不跟著系統切換深色 */
:root {
  color-scheme: light;
  --accent: #c4520e; --accent-600: #a7460c; --accent-50: #fff1e3; --accent-100: #ffe1c2;
  --coral: #f2685a; --sun: #ffc845;
  --green: #1f7a4d; --green-600: #18603d; --green-50: #e6f4ec; --green-100: #cfebd7; --leaf: #2e9b62;
  --sky: #1d5f8c; --sky-50: #edf5fb; --sky-100: #d3e6f5;
  --purple: #6b4fa0; --purple-50: #f1ecf8;
  --amber: #8a5a00; --amber-50: #fff4d6;
  --red: #b23a2e; --red-50: #fdece8;
  --ink: #3b2f2a; --ink-2: #5e524b; --ink-3: #6f625a;
  --line: #efe4d6; --line-2: #f5ede2; --field: #9e8d80;
  --bg: #fffdf8; --card: #fff; --soft: #fff6ec; --cream: #fff3e2; --peach: #ffe9d6; --mint: #eef7f0; --butter: #fff8e6; --sand: #f8efe3;
  --radius: 22px; --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(59, 47, 42, .04), 0 6px 18px -10px rgba(59, 47, 42, .18);
  --shadow-lg: 0 20px 40px -18px rgba(59, 47, 42, .32);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --round: "Huninn", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

/* ---------- 基本 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.75; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--round); font-weight: 400; line-height: 1.4; letter-spacing: .02em; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: 1.9rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.18rem; } h4 { font-size: 1.02rem; }
p { margin: 0 0 .9em; }
small, .muted { color: var(--ink-3); }
strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-100); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
  .grid-cards.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.clamp-1, .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; } .clamp-2 { -webkit-line-clamp: 2; }
[hidden] { display: none !important; }
.ico { flex: none; }

/* 小標、箭頭連結 */
.kicker { display: block; font-size: .88rem; font-weight: 700; letter-spacing: .12em; color: var(--accent-600); }
.eyebrow { color: var(--accent-600); font-size: .82rem; font-weight: 700; letter-spacing: .04em; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--accent-600); white-space: nowrap; }
.link-arrow:hover { text-decoration: none; }
.link-arrow .ico { transition: transform .15s ease; }
.link-arrow:hover .ico, a:hover .link-arrow .ico { transform: translateX(3px); }

/* ---------- 卡片、數字 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h2, .card h3 { margin-top: 0; }
.card-link { color: inherit; display: block; transition: transform .2s ease, box-shadow .2s ease; }
.card-link:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat { font-family: var(--round); font-size: 2rem; line-height: 1.3; color: var(--ink); }
.stat-label { color: var(--ink-3); font-size: .86rem; }

/* ---------- 按鈕 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 700; line-height: 1.3; letter-spacing: .02em; cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.btn:hover { background: var(--accent-600); border-color: var(--accent-600); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(196, 82, 14, .7); }
.btn-outline { background: var(--card); color: var(--accent-600); border-color: var(--accent-600); }
.btn-outline:hover { background: var(--accent-50); color: var(--accent-600); box-shadow: none; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); border-color: #e2d3bf; color: var(--ink); box-shadow: none; }
.btn-soft { background: var(--accent-50); color: var(--accent-600); border-color: transparent; }
.btn-soft:hover { background: var(--accent-100); border-color: transparent; color: var(--accent-600); box-shadow: none; }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: var(--green-600); border-color: var(--green-600); box-shadow: 0 10px 20px -10px rgba(31, 122, 77, .7); }
.btn-purple { background: var(--purple); border-color: var(--purple); }
.btn-purple:hover { background: #5a4189; border-color: #5a4189; box-shadow: none; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #962f25; border-color: #962f25; box-shadow: none; }
.btn-on-dark { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .28); border-color: #fff; box-shadow: none; }
.btn-line { background: #06c755; border-color: #06c755; color: #fff !important; }
.btn-line:hover { background: #05b34c; border-color: #05b34c; box-shadow: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; border-width: 1.5px; }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 1.06rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.inline { display: inline; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.icon-btn.on { color: var(--accent-600); border-color: var(--accent-100); background: var(--accent-50); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--accent-600); }
.linkbtn:hover { text-decoration: underline; }

/* ---------- 表單 ---------- */
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.field small { display: block; font-weight: 400; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--field); border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: var(--card); transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-100); }
textarea { min-height: 100px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { margin-top: 6px; accent-color: var(--accent); }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 140px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-weight: 700; font-size: .8rem; white-space: nowrap; color: var(--ink-3); letter-spacing: .06em; background: var(--soft); border-bottom: 1px solid var(--line); }
tbody tr:hover td { background: #fffaf3; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- 標籤 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-ok { background: var(--green-50); color: var(--green); }
.badge-warn { background: var(--amber-50); color: var(--amber); }
.badge-bad { background: var(--red-50); color: var(--red); }
.badge-muted { background: var(--line-2); color: var(--ink-2); }
.tag, .chip { display: inline-block; padding: 2px 12px; border-radius: 999px; background: #f3ede4; font-size: .8rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .94rem; border: 1px solid transparent; }
.alert-ok { background: var(--green-50); color: var(--green); border-color: #bfe3cc; }
.alert-warn { background: var(--amber-50); color: var(--amber); border-color: #f1dea6; }
.alert-bad { background: var(--red-50); color: var(--red); border-color: #f4c9c1; }
.alert-info { background: var(--sky-50); color: var(--ink-2); border-color: #cfe1f0; }
.note { background: var(--butter); border: 1px dashed #ecd9a9; border-radius: var(--radius-sm); padding: 14px 18px; font-size: .92rem; color: var(--ink-2); }
.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
div.empty, p.empty, a.empty { grid-column: 1 / -1; padding: 44px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card); font-family: var(--round); font-size: 1.05rem; }

/* ---------- 進度條、分潤比例條 ---------- */
.progress { height: 10px; background: #eee6da; border-radius: 999px; overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; }
.p-conf { background: var(--leaf); } .p-pend { background: #a6d8b0; }
.progress-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 8px; font-size: .86rem; color: var(--ink-3); }
.progress-meta .fresh { color: var(--green); font-weight: 700; }
.progress-note { display: block; margin-top: 2px; font-size: .8rem; }
.split-bar { display: flex; height: 48px; border-radius: 14px; overflow: hidden; font-size: .88rem; font-weight: 700; }
.split-bar span { display: flex; align-items: center; justify-content: center; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.s-charity { background: var(--green); color: #fff; } .s-inf { background: #ffc96b; color: var(--ink); } .s-yx { background: #cfe3f3; color: #1d4f73; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 12px; font-size: .88rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* ---------- 品牌 ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-family: var(--round); font-size: 1.35rem; line-height: 1; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .1); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; font-family: var(--round); font-size: 1.2rem; letter-spacing: .03em; }
.brand-text small { font-family: var(--font); font-size: .7rem; font-weight: 500; color: var(--ink-3); letter-spacing: .12em; margin-top: 2px; }

/* ---------- 前台頁首、頁尾、手機底部分頁 ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; }
.top-nav { display: none; gap: 4px; }
.top-nav a { padding: 9px 16px; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .96rem; white-space: nowrap; }
.top-nav a:hover { background: var(--soft); text-decoration: none; }
.top-nav a.on { background: var(--accent-50); color: var(--accent-600); font-weight: 700; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.cart-count { position: absolute; top: -5px; right: -5px; min-width: 21px; height: 21px; line-height: 17px; text-align: center; background: var(--accent); color: #fff; border: 2px solid #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 0 4px; }
.hide-sm { display: none; }
.front-main { min-height: 60vh; padding-bottom: 96px; }
.front-main.full { padding-bottom: 0; }
.flash-slot:not(:empty) { padding-top: 16px; }
.site-footer { background: var(--sand); color: var(--ink-2); padding: 56px 0 120px; font-size: .9rem; }
.foot-grid { display: grid; gap: 32px; }
.foot-grid h4 { font-family: var(--font); font-weight: 700; font-size: .95rem; margin-bottom: 8px; }
.foot-grid a:not(.brand) { display: block; color: var(--ink-2); padding: 5px 0; }
.foot-grid a:not(.brand):hover { color: var(--accent-600); }
.foot-note { margin: 16px 0 0; max-width: 480px; font-size: .84rem; line-height: 1.85; }
.foot-copy { margin: 36px 0 0; padding-top: 20px; border-top: 1px solid #eadbc8; font-size: .82rem; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: .72rem; font-weight: 700; color: var(--ink-3); }
.tabbar a:hover { text-decoration: none; }
.tabbar a.on { color: var(--accent-600); }
@media (min-width: 900px) {
  .top-nav { display: flex; }
  .hide-sm { display: inline-flex; }
  .tabbar { display: none; }
  .front-main { padding-bottom: 48px; }
  .front-main.full { padding-bottom: 0; }
  .site-footer { padding-bottom: 40px; }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------- 首頁主視覺 ---------- */
.hero-sun { background: var(--cream); }
.hero-grid { display: grid; gap: 28px; align-items: center; padding-top: 36px; }
.pill-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--card); color: var(--accent-600); font-size: .88rem; font-weight: 700; line-height: 1.45; }
.pill-badge .ico { color: var(--coral); }
.hero-sun h1 { font-size: 2.7rem; line-height: 1.25; margin: 20px 0 0; }
.hero-sun mark { background: linear-gradient(transparent 60%, #ffd66b 60%); color: inherit; padding: 0 4px; }
.hero-lead { margin: 0; color: var(--ink-2); font-size: 1.04rem; line-height: 1.9; max-width: 34em; }
.hero-sun .hero-lead { margin-top: 20px; }
.hero-cta { margin-top: 28px; gap: 12px; }
.trust { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink-2); font-size: .94rem; }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust .ico { color: var(--leaf); }
.hero-visual { width: 100%; max-width: 560px; margin: 0 auto; }
.hero-art { display: block; width: 100%; height: auto; }
.feature-card { position: relative; display: block; width: 84%; max-width: 360px; margin-top: -20%; padding: 20px 22px 18px; border-radius: 22px; background: var(--card); box-shadow: 0 16px 36px rgba(59, 47, 42, .14); color: var(--ink); transition: transform .2s ease; }
.feature-card:hover { text-decoration: none; transform: translateY(-3px); }
.fc-label { font-size: .82rem; font-weight: 700; color: var(--accent-600); }
.fc-title { margin-top: 6px; font-family: var(--round); font-size: 1.35rem; line-height: 1.4; }
.fc-org { font-size: .82rem; color: var(--ink-3); }
.feature-card .progress { margin-top: 14px; }
.fc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #eadfcf; font-size: .86rem; color: var(--ink-2); }
.fc-foot strong { font-family: var(--round); font-weight: 400; font-size: 1.4rem; color: var(--ink); }
.wave { display: block; width: 100%; height: 40px; margin-top: 28px; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 40px; padding-top: 56px; }
  .hero-sun h1 { font-size: 3.75rem; }
  .hero-lead { font-size: 1.12rem; }
  .wave { height: 52px; }
}

/* ---------- 首頁區塊 ---------- */
.band { padding: 56px 0; }
.band-white { background: var(--card); } .band-mint { background: var(--mint); } .band-butter { background: var(--butter); }
.band-how { padding-top: 16px; }
.band-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 4px 24px; margin-bottom: 28px; }
.band-head h2 { margin: 6px 0 0; font-size: 1.8rem; line-height: 1.35; }
.band-head p { margin: 10px 0 0; color: var(--ink-3); max-width: 40em; }
.band-head.center { flex-direction: column; align-items: center; text-align: center; }
@media (min-width: 900px) { .band { padding: 88px 0; } .band-how { padding-top: 24px; } .band-head { margin-bottom: 36px; } .band-head h2 { font-size: 2.4rem; } }

/* 運作方式三步驟＋舉例 */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.step { padding: 28px 26px; border-radius: 24px; }
.step-top { display: flex; align-items: center; gap: 14px; }
.step-ico { width: 56px; height: 56px; flex: none; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.step-no { font-size: .88rem; font-weight: 700; letter-spacing: .08em; }
.step h3 { margin: 18px 0 0; font-size: 1.35rem; }
.step p { margin: 8px 0 0; color: var(--ink-3); font-size: .95rem; line-height: 1.8; }
.step-1 { background: var(--soft); } .step-1 .step-ico { background: var(--accent-100); color: #b4501a; } .step-1 .step-no { color: #8a5a3c; }
.step-2 { background: var(--mint); } .step-2 .step-ico { background: var(--green-100); color: var(--green); } .step-2 .step-no { color: #2f6b4c; }
.step-3 { background: var(--sky-50); } .step-3 .step-ico { background: var(--sky-100); color: var(--sky); } .step-3 .step-no { color: #2d5e80; }
.example { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 48px; margin-top: 24px; padding: 24px 26px; border: 2px solid var(--line); border-radius: 24px; }
.ex-copy { flex: 1 1 300px; min-width: 0; }
.ex-label { margin: 0; font-size: .88rem; font-weight: 700; color: #8a5a3c; }
.ex-big { margin: 6px 0 0; font-family: var(--round); font-size: 1.4rem; line-height: 1.55; }
.ex-big em { font-style: normal; color: var(--green); }
.ex-note { margin: 10px 0 0; font-size: .88rem; color: var(--ink-3); line-height: 1.8; }
.ex-bar { flex: 1.4 1 340px; min-width: 0; }

/* 公益專案卡片 */
.project-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.project-card { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: var(--card); color: var(--ink); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.project-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pj-cover { height: 200px; background: var(--soft); overflow: hidden; }
.pj-cover img { width: 100%; height: 100%; object-fit: cover; }
.pj-body { display: flex; flex-direction: column; flex: 1; padding: 20px 24px 22px; }
.pj-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: .82rem; color: var(--ink-3); }
.pj-days { font-weight: 700; color: var(--green); white-space: nowrap; }
.pj-days.closed { color: var(--ink-3); }
.project-card h3 { margin: 6px 0 0; font-size: 1.5rem; }
.project-card p { margin: 6px 0 0; color: var(--ink-3); font-size: .95rem; }
.pj-progress { margin-top: auto; padding-top: 18px; }
.pj-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: .9rem; color: var(--ink-2); }

/* 商品／活動卡片 */
.card-item { display: flex; flex-direction: column; border-radius: 24px; border: 2px solid var(--line); background: var(--card); overflow: hidden; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-item:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--soft); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card-item:hover .thumb img, .card-item:hover .ph svg { transform: scale(1.05); }
.thumb-tag { position: absolute; left: 12px; top: 12px; padding: 3px 12px; border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: .78rem; font-weight: 700; }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 18px 20px 20px; }
.card-body .when { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--accent-600); }
.card-body .by { font-size: .8rem; color: var(--ink-3); }
.card-body h3 { margin: 0; font-size: 1.25rem; line-height: 1.4; transition: color .15s ease; }
.card-item:hover h3 { color: var(--accent-600); }
.card-body p { margin: 2px 0 0; color: var(--ink-3); font-size: .88rem; line-height: 1.7; }
.price-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; }
.price { font-family: var(--round); font-size: 1.35rem; color: var(--ink); }
.give { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: var(--green-50); color: var(--green); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.card-body .for { margin-top: 6px; font-size: .8rem; color: var(--ink-3); }
.card-invite { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; padding: 32px 28px; border-radius: 24px; border: 2px dashed #e6d5bf; background: #fffcf6; color: var(--ink); }
.card-invite:hover { text-decoration: none; border-color: var(--accent-100); background: var(--soft); }
.card-invite .step-ico { background: var(--accent-100); color: #b4501a; }
.card-invite h3 { margin: 4px 0 0; font-size: 1.25rem; }
.card-invite p { margin: 0; color: var(--ink-3); font-size: .9rem; }
@media (max-width: 639px) {
  .grid-cards .card-item { border-radius: 18px; }
  .grid-cards .card-body { padding: 12px 14px 14px; }
  .grid-cards .card-body h3 { font-size: 1.04rem; }
  .grid-cards .card-body p, .grid-cards .card-body .for { display: none; }
  .grid-cards .price-row { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 10px; }
  .grid-cards .price { font-size: 1.15rem; }
  .grid-cards .give { font-size: .74rem; padding: 3px 9px; }
  .grid-cards .card-invite { grid-column: 1 / -1; padding: 24px 20px; }
}

/* 沒有圖片時的插圖 */
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ph svg { width: 64%; max-width: 260px; height: auto; transition: transform .5s ease; }
.ph-gift, .ph-ticket { background: #ffebd6; } .ph-tea { background: #fff4d6; } .ph-jar, .ph-trip { background: var(--mint); } .ph-music { background: var(--sky-50); }
.scene { width: 100%; height: 100%; display: flex; overflow: hidden; }
.scene svg { width: 100%; height: 100%; }
.scene-house { background: #ffe9d2; } .scene-meal { background: #fff3c9; } .scene-sprout { background: #eaf5ec; }

/* 首頁活動列 */
.event-list { display: flex; flex-direction: column; gap: 14px; }
.event-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 18px 20px; border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.event-row:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.date-tile { flex: none; display: flex; flex-direction: column; align-items: center; width: 76px; padding: 10px 0; border-radius: 16px; background: var(--accent-50); line-height: 1.25; }
.dt-m { font-size: .8rem; font-weight: 700; color: var(--accent-600); }
.dt-d { font-family: var(--round); font-size: 2rem; line-height: 1.15; }
.dt-w { font-size: .8rem; color: var(--ink-3); }
.er-main { flex: 1 1 180px; min-width: 0; }
.er-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .82rem; color: var(--ink-3); }
.event-row h3 { margin: 6px 0 0; font-size: 1.3rem; }
.event-row p { margin: 2px 0 0; font-size: .9rem; color: var(--ink-3); }
.er-side { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.er-price { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.er-price .price { font-size: 1.25rem; }
@media (max-width: 639px) { .er-side { width: 100%; justify-content: space-between; } }

/* 推廣夥伴卡片 */
.partner-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.partner-card { display: flex; align-items: flex-start; gap: 16px; padding: 24px; border-radius: 22px; color: var(--ink); transition: transform .2s ease; }
.partner-card:hover { text-decoration: none; transform: translateY(-2px); }
.tone-peach { background: var(--soft); } .tone-mint { background: var(--mint); } .tone-sky { background: var(--sky-50); }
.pt-avatar { width: 60px; height: 60px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; object-fit: cover; font-family: var(--round); font-size: 1.6rem; }
.tone-peach .pt-avatar { background: var(--accent-100); color: #a8450b; } .tone-mint .pt-avatar { background: var(--green-100); color: #1f6b44; } .tone-sky .pt-avatar { background: var(--sky-100); color: var(--sky); }
.pt-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.pt-name strong { font-family: var(--round); font-weight: 400; font-size: 1.25rem; }
.pt-name span { font-size: .78rem; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; }
.partner-card p { margin: 6px 0 0; font-size: .9rem; color: var(--ink-3); line-height: 1.75; }
.partner-card .badge { margin-top: 8px; }

/* 邀請合作 */
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding: 32px 24px; border-radius: 32px; background: var(--peach); }
.band.band-cta { padding-top: 24px; }
.band-white + .band.band-cta { padding-top: 0; }
.cta-copy { flex: 1 1 400px; min-width: 0; }
.cta-band h2 { margin: 0; font-size: 1.7rem; }
.cta-band p { margin: 8px 0 0; color: var(--ink-2); }
@media (min-width: 900px) { .band.band-cta { padding-top: 40px; } .band-white + .band.band-cta { padding-top: 0; } .cta-band { padding: 48px 56px; } .cta-band h2 { font-size: 2.1rem; } }

/* ---------- 專案頁主視覺、區塊標題 ---------- */
.hero-x { position: relative; overflow: hidden; display: grid; gap: 28px; margin: 24px 0 48px; padding: 32px 22px; border-radius: 32px; background: var(--cream); }
.hero-x::before { content: ""; position: absolute; right: -80px; top: -100px; width: 280px; height: 280px; border-radius: 50%; background: #ffe4c8; }
.hero-copy, .hero-panel { position: relative; }
.hero-x h1 { font-size: 2rem; line-height: 1.35; margin: 8px 0 14px; }
.hero-by { margin: 18px 0 0; font-size: .88rem; color: var(--ink-3); }
.hero-panel { align-self: center; padding: 24px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-lg); }
.panel-label { font-size: .86rem; font-weight: 700; color: var(--accent-600); }
.panel-num { margin: 2px 0 12px; font-family: var(--round); font-size: 2.1rem; line-height: 1.3; }
.panel-num.fresh { font-size: 1.6rem; color: var(--green); }
.panel-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; padding-top: 16px; border-top: 1px dashed #eadfcf; }
.panel-facts div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.panel-facts dt { font-size: .8rem; color: var(--ink-3); }
.panel-facts dd { margin: 0; font-family: var(--round); font-size: 1.5rem; }
.panel-facts dd small { font-family: var(--font); font-size: .8rem; margin-left: 2px; }
@media (min-width: 900px) { .hero-x { grid-template-columns: 1.3fr 1fr; gap: 48px; padding: 56px; } .hero-x h1 { font-size: 2.6rem; } }
.hero.hero-solo { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin: 24px 0 40px; padding: 32px; border-radius: 32px; background: var(--cream); }
.section { margin-bottom: 64px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 4px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 6px 0 0; font-size: 1.8rem; }
@media (min-width: 900px) { .section-head h2 { font-size: 2.2rem; } }

/* 列表頁標題（公益專案、好物、活動、購物車…） */
.front-main .wrap > h1.mt { font-size: 2rem; margin: 40px 0 8px; }
.front-main .wrap > h1.mt + p.muted { max-width: 680px; margin-bottom: 28px; }
@media (min-width: 900px) { .front-main .wrap > h1.mt { font-size: 2.6rem; margin-top: 56px; } }

/* ---------- 品項頁 ---------- */
.crumbs { font-size: .86rem; color: var(--ink-3); margin: 24px 0 16px; }
.crumbs a { color: var(--ink-2); }
.item-layout { display: grid; gap: 28px; margin-bottom: 48px; }
@media (min-width: 900px) { .item-layout { grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; } .gallery { position: sticky; top: 94px; } }
.g-main { aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden; background: var(--soft); }
.g-main img { width: 100%; height: 100%; object-fit: cover; }
.g-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.g-thumbs img, .g-thumbs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; background: #000; }
.item-title { margin: 0; font-size: 2rem; line-height: 1.35; }
.item-price { font-family: var(--round); font-size: 1.8rem; }
.item-info > p { color: var(--ink-2); }
.give-note { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--green-50); color: var(--ink-2); font-size: .94rem; }
.give-note > .ico { color: var(--coral); margin-top: 4px; }
.give-note strong { color: var(--green); }
@media (min-width: 900px) { .item-title { font-size: 2.5rem; } }

/* ---------- 社群分享 ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { margin-right: 2px; font-size: .86rem; font-weight: 700; color: var(--ink-3); }
.share-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.share-btn:hover { background: var(--soft); border-color: #e2d3bf; color: var(--ink); text-decoration: none; }
.sh-fb .ico { color: #1877f2; } .sh-line .ico { color: #06c755; } .sh-ig .ico { color: #c13584; } .sh-copy .ico, .sh-more .ico { color: var(--ink-2); }
@media (max-width: 639px) {
  .share:not(.share-compact) { gap: 6px; }
  .share:not(.share-compact) .share-label { flex-basis: 100%; }
  .share:not(.share-compact) .share-btn { flex: 1 1 0; min-width: 0; min-height: 62px; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; border-radius: 16px; font-size: .74rem; }
}
.share-compact { gap: 6px; }
.share-compact .share-btn { width: 40px; padding: 0; justify-content: center; }
.share-compact .share-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.share-list { display: flex; flex-direction: column; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.share-row:first-child { padding-top: 0; }
.share-row:last-child { padding-bottom: 0; border-bottom: 0; }
.sr-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; flex: 1 1 200px; min-width: 0; }
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 80; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .9rem; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 32px; } }
.share-dialog { width: min(920px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; padding: 0; border: 0; border-radius: 28px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.share-dialog::backdrop { background: rgba(59, 47, 42, .45); }
.sd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sd-head h2 { margin: 0; font-size: 1.3rem; }
.sd-body { display: grid; gap: 20px; padding: 20px; }
.sd-card { display: flex; align-items: center; justify-content: center; width: min(100%, 300px); margin: 0 auto; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--soft); }
.sd-actions { margin: 0 0 16px; }
.sd-card img { width: 100%; height: 100%; object-fit: contain; }
.share-dialog.loading .sd-card img { display: none; }
.share-dialog.loading .sd-card::after { content: "圖卡產生中…"; color: var(--ink-3); font-weight: 700; }
.sd-tip { margin: 0 0 14px; color: var(--ink-2); font-size: .92rem; }
.sd-side textarea { min-height: 170px; font-size: .9rem; line-height: 1.7; }
.sd-steps { margin: 14px 0 0; padding-left: 1.3em; color: var(--ink-3); font-size: .88rem; }
@media (min-width: 760px) { .sd-body { grid-template-columns: 1fr 1.05fr; align-items: start; padding: 24px; } .sd-card { width: 100%; } }

/* 後台：每日趨勢長條 */
.trend { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-top: 8px; }
.trend-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.trend-bar { width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: var(--accent); opacity: .85; }
.trend-col:hover .trend-bar { opacity: 1; }
.trend-col small { height: 1.2em; font-size: .72rem; white-space: nowrap; }

/* ---------- 本機標記、協助身分 ---------- */
.env-pill { position: fixed; right: 14px; bottom: 14px; z-index: 60; padding: 3px 10px; border-radius: 999px; background: #ffd66b; color: #4a3500; font-size: .72rem; font-weight: 800; letter-spacing: .1em; pointer-events: none; box-shadow: var(--shadow); }
body.is-front .env-pill { bottom: 80px; }
@media (min-width: 900px) { body.is-front .env-pill { bottom: 14px; } }
.imp-bar { position: sticky; top: 0; z-index: 40; background: var(--purple); color: #fff; font-size: .9rem; }
.imp-inner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 20px; }

/* ---------- 後台：白色側欄＋暖白工作區 ---------- */
body.is-back { background: var(--bg); }
.back { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.back-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.side { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; width: 280px; max-width: 86vw; background: var(--card); border-right: 1px solid var(--line); color: var(--ink-2); transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto; }
.side.open { transform: none; box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(59, 47, 42, .35); }
.side-head { padding: 20px 20px 10px; }
.side nav { flex: 1; padding: 4px 12px 16px; }
.side nav a { display: block; padding: 9px 14px; border-radius: 12px; color: var(--ink-2); font-size: .93rem; }
.side nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.side nav a.on { background: var(--accent-50); color: var(--accent-600); font-weight: 700; }
.side .group { margin: 18px 14px 6px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); }
.side-foot { flex: none; padding: 14px 20px 18px; border-top: 1px solid var(--line); font-size: .86rem; }
.side-foot .me { display: flex; flex-direction: column; line-height: 1.4; margin-bottom: 8px; color: var(--ink); }
.side-foot .me small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-links { display: flex; gap: 16px; flex-wrap: wrap; }
.side-links a, .side-links .linkbtn { color: var(--ink-2); font-size: .86rem; }
.side-links a:hover, .side-links .linkbtn:hover { color: var(--accent-600); }
.back-main { min-width: 0; padding: 24px 16px 56px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 1.75rem; margin-bottom: 4px; }
.page-head p { margin: 0; max-width: 760px; color: var(--ink-3); font-size: .94rem; }
.back-main h2 { font-size: 1.3rem; }
.back-main > h2, .back-main section > h2 { margin-top: 28px; }
@media (min-width: 900px) {
  .back-top { display: none; }
  .back { grid-template-columns: 268px 1fr; }
  .side { position: sticky; top: 0; z-index: 1; height: 100vh; width: auto; max-width: none; transform: none; overflow: visible; }
  .side nav { overflow-y: auto; min-height: 0; }
  .scrim { display: none !important; }
  .back-main { max-width: 1280px; padding: 40px 48px 64px; }
  .page-head h1 { font-size: 2.1rem; }
}
.imp-bar ~ .back .side { top: 40px; height: calc(100vh - 40px); }

/* 目前身分卡（側欄頂端） */
.who { position: relative; margin: 8px 14px 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.who > summary, .who-single { display: flex; align-items: center; gap: 10px; padding: 10px 12px; list-style: none; color: var(--ink); }
.who > summary { cursor: pointer; border-radius: 16px; }
.who > summary::-webkit-details-marker { display: none; }
.who > summary:hover { background: var(--accent-50); }
.who-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.who-text strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { font-size: .74rem; color: var(--ink-3); letter-spacing: .04em; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sky); color: #fff; font-family: var(--round); font-size: 1rem; }
.av-admin { background: var(--accent); } .av-partner_admin { background: var(--sky); } .av-charity_admin { background: var(--green); }
.av-influencer, .av-imp { background: var(--purple); }
.caret { width: 7px; height: 7px; margin: -4px 4px 0 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .6; transition: transform .15s ease; }
.who[open] .caret { transform: rotate(-135deg); margin-top: 4px; }
.who-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-lg); color: var(--ink); }
.who-title { padding: 8px 10px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); }
.who-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.who-opt:hover:not([disabled]) { background: var(--soft); }
.who-opt.on { background: var(--accent-50); cursor: default; }
.who-opt .tick { color: var(--accent-600); font-weight: 800; }

/* ---------- 登入頁：左側插畫＋右側表單 ---------- */
body.is-auth { min-height: 100vh; background: var(--bg); }
.auth-split { display: grid; min-height: 100vh; }
.auth-story { display: none; }
.auth-box { width: 100%; max-width: 440px; margin: 0 auto; padding: 40px 16px; align-self: center; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-box > .card { padding: 30px 26px; border-radius: 28px; }
.auth-box h1 { font-size: 1.7rem; }
.auth-back { margin-top: 20px; font-size: .9rem; }
.auth-back a { color: var(--ink-3); }
@media (min-width: 900px) {
  .auth-split { grid-template-columns: 1fr 1fr; }
  .auth-story { display: flex; flex-direction: column; gap: 28px; padding: 44px 56px 0; background: var(--cream); overflow: hidden; }
  .auth-quote { margin: 0 0 14px; font-family: var(--round); font-size: 2rem; line-height: 1.6; }
  .auth-small { margin: 0; color: var(--ink-2); font-size: .95rem; }
  .auth-art { width: 100%; max-width: 520px; margin-top: auto; align-self: center; }
  .auth-brand { display: none; }
  .auth-box > .card { padding: 0; border: 0; background: transparent; box-shadow: none; }
}
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-3); font-size: .86rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.qr { display: inline-block; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.code { font-family: ui-monospace, Consolas, monospace; background: #f3ede4; padding: 2px 7px; border-radius: 6px; word-break: break-all; }

/* ---------- 列印（出貨單） ---------- */
@media print {
  .env-pill, .imp-bar, .side, .back-top, .site-header, .tabbar, .site-footer, .no-print { display: none !important; }
  .back { display: block; } body { background: #fff; }
}
