/* ============================================================
   好普 · PuduMatch — 共用設計系統 base.css
   風格:清透科技底 × 民俗暖點
   簽名:普渡旗（三角旗）狀態標籤 + 數位紅榜感謝牆
   單一真實來源見 design/system/design.md
   ============================================================ */

/* 思源黑體/宋體為線上使用者；本機（Windows）以標楷體 DFKai-SB、
   微軟正黑為主，離線截圖也能正確呈現書法感。字型絕不硬相依。 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&family=Noto+Serif+TC:wght@600;700;900&display=swap');

/* ---------- 1. Design tokens ---------- */
:root {
  /* 清透科技底 —— 暖白紙感，不冷不刺 */
  --paper:      #FBF8F2;   /* 頁面底 */
  --paper-2:    #F4EEE2;   /* 次層底、分隔帶 */
  --card:       #FFFFFF;   /* 卡片 */
  --ink:        #2A2320;   /* 主文字，暖近黑 */
  --ink-soft:   #6E645B;   /* 次文字 */
  --ink-faint:  #A79C90;   /* 說明、placeholder */
  --line:       #E7DECF;   /* 暖色髮絲線 */
  --line-strong:#D8CBB4;

  /* 民俗暖點 —— 全站共用文化色（廟埕硃紅 + 暖金） */
  --vermilion:  #C6402C;   /* 硃紅 */
  --vermilion-d:#A22E1E;
  --gold:       #BE922F;   /* 暖金 */
  --gold-l:     #E9C766;

  /* 普渡旗 / 色卡 —— 全站「物資標籤狀態色」，只用於標籤，不當入口品牌色 */
  --flag-green: #3E8B57;   /* 綠：不指名捐助 */
  --flag-blue:  #2C6DAE;   /* 藍：指名捐助 */
  --flag-amber: #E2A32E;   /* 黃：領回 */

  /* 入口品牌色 —— 由各頁 [data-portal] 覆寫；預設=硃紅（主頁） */
  --brand:      var(--vermilion);
  --brand-d:    var(--vermilion-d);
  --brand-ink:  #FFFFFF;    /* 落在 brand 上的字色 */
  --brand-wash: #FBEEE9;    /* 極淡品牌暈染底 */
  --brand-soft: #E7B7AC;    /* 淡品牌，用於邊框/hover */

  /* 尺度 */
  --maxw: 1140px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --radius: 14px;
  --radius-s: 9px;
  --shadow-s: 0 1px 2px rgba(42,35,32,.06), 0 2px 8px rgba(42,35,32,.05);
  --shadow-m: 0 6px 22px rgba(42,35,32,.10), 0 2px 6px rgba(42,35,32,.06);
  --shadow-l: 0 18px 50px rgba(42,35,32,.16);

  /* 字型 */
  --font-kai:  "DFKai-SB", "BiauKai", "TW-Kai", "KaiTi", "Noto Serif TC", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Consolas", "Courier New", monospace;
}

/* 入口配色 —— 主色與狀態色刻意分離，避免語意打架 */
[data-portal="committee"] {           /* 管委會 / 物業：藏青靛藍，穩重信任 */
  --brand: #294668; --brand-d: #1D324D;
  --brand-wash: #EAEFF5; --brand-soft: #A9BBD1;
}
[data-portal="welfare"] {             /* 社福機構：緋橘珊瑚，溫暖關懷 */
  --brand: #DB6242; --brand-d: #B84A2E;
  --brand-wash: #FCEDE7; --brand-soft: #F0B5A2;
}
[data-portal="retail"] {              /* 量販通路：松青，效率鮮活 */
  --brand: #1F7D6D; --brand-d: #135C50;
  --brand-wash: #E7F3F0; --brand-soft: #9DCCC2;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------- 3. 版面骨架 ---------- */
.wrap { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
.kai  { font-family: var(--font-kai); font-weight: 700; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .22em;
  color: var(--brand-d); text-transform: uppercase;
}

/* ---------- 4. 品牌列 brandbar ---------- */
.brandbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 0; background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brandbar .wrap { display: flex; align-items: center; gap: 1rem; width: min(100% - 2.4rem, var(--maxw)); }
.logo { display: flex; align-items: center; gap: .6rem; }
.logo .seal {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; background: var(--vermilion); color: #fff;
  font-family: var(--font-kai); font-weight: 700; font-size: 1.4rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), var(--shadow-s);
}
.logo .wordmark { font-family: var(--font-kai); font-weight: 700; font-size: 1.35rem; letter-spacing: .04em; }
.logo .tag { font-size: .72rem; color: var(--ink-soft); letter-spacing: .1em; }
.brandbar nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.navlink { padding: .42rem .7rem; border-radius: 8px; font-size: .9rem; color: var(--ink-soft); }
.navlink:hover { background: var(--paper-2); color: var(--ink); }
.navlink[aria-current="page"] { color: var(--brand-d); font-weight: 700; }

/* ---------- 5. 按鈕 ---------- */
.btn {
  --_bg: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: .96rem; cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.btn-brand { background: var(--_bg); color: var(--brand-ink); box-shadow: var(--shadow-s); }
.btn-brand:hover { transform: translateY(-1px); box-shadow: var(--shadow-m); background: var(--brand-d); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-wash); }
.btn-block { width: 100%; }
.btn-lg { padding: .95rem 1.5rem; font-size: 1.02rem; }

/* ---------- 6. 普渡旗 —— 色卡狀態標籤（簽名元件） ---------- */
/* 三角旗造型：右側收成尖角，像插在供品上的普渡旗 */
.flag {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .28rem 1.4rem .28rem .7rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 50%, 100% 100%, 0 100%);
  font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap;
}
.flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.85); }
.flag--green { background: var(--flag-green); }
.flag--blue  { background: var(--flag-blue); }
.flag--amber { background: var(--flag-amber); color: #3a2c05; }
.flag--amber::before { background: rgba(58,44,5,.7); }
/* 旗桿版：左側加一條桿，用在圖例 */
.flagline { display: inline-flex; align-items: center; }
.flagline .pole { width: 3px; height: 22px; background: var(--ink-faint); border-radius: 2px; }

/* ---------- 7. 卡片 / 登入卡 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); }

.auth {
  background: var(--card); border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-l);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  position: relative; overflow: hidden;
}
.auth::before {  /* 頂部品牌色帶 */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}
.auth h2 { font-family: var(--font-kai); font-size: 1.5rem; letter-spacing: .03em; margin-bottom: .25rem; }
.auth .sub { color: var(--ink-soft); font-size: .92rem; margin-bottom: 1.3rem; }
.field { margin-bottom: .95rem; }
.field label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
.field input, .field select {
  width: 100%; padding: .75rem .85rem; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}
.auth .row { display: flex; align-items: center; justify-content: space-between; font-size: .86rem; margin: .2rem 0 1.1rem; }
.auth .row a { color: var(--brand-d); font-weight: 600; }
.auth .foot { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong); font-size: .88rem; color: var(--ink-soft); text-align: center; }
.auth .foot a { color: var(--brand-d); font-weight: 700; }

/* segmented：登入身分切換 */
.seg { display: flex; gap: .3rem; background: var(--paper-2); padding: .3rem; border-radius: 12px; margin-bottom: 1.2rem; }
.seg button {
  flex: 1; padding: .55rem .4rem; border: none; border-radius: 9px; background: transparent;
  font-weight: 600; font-size: .88rem; color: var(--ink-soft); cursor: pointer; transition: all .15s ease;
}
.seg button[aria-selected="true"] { background: #fff; color: var(--brand-d); box-shadow: var(--shadow-s); }

/* ---------- 8. Hero 版型（入口頁共用左右分欄） ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.6rem, 4vw, 3.4rem); align-items: center; padding: clamp(2rem, 6vw, 4.6rem) 0; }
.hero h1 { font-family: var(--font-kai); font-weight: 700; font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.18; letter-spacing: .02em; }
.hero h1 em { font-style: normal; color: var(--brand-d); }
.hero .lead { font-size: clamp(1rem, 1.4vw, 1.12rem); color: var(--ink-soft); margin-top: 1rem; max-width: 30em; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; background: var(--brand-wash); color: var(--brand-d); font-size: .82rem; font-weight: 700; border: 1px solid var(--brand-soft); }

/* 賣點清單 */
.sells { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .75rem; }
.sells li { display: grid; grid-template-columns: 26px 1fr; gap: .7rem; align-items: start; }
.sells .k { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-wash); color: var(--brand-d); font-weight: 800; font-size: .9rem; margin-top: .15rem; }
.sells .t b { font-weight: 700; }
.sells .t span { display: block; color: var(--ink-soft); font-size: .9rem; }

/* ---------- 9. 統計 / 責信數字 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--card); padding: 1.2rem 1.1rem; }
.stat .n { font-family: var(--font-mono); font-weight: 700; font-size: 1.9rem; color: var(--brand-d); line-height: 1; }
.stat .l { font-size: .82rem; color: var(--ink-soft); margin-top: .45rem; }

/* ---------- 10. Doorway 入口門 ---------- */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.door {
  position: relative; display: block; padding: 1.4rem 1.3rem 1.3rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-s);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; overflow: hidden;
}
.door::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--_c, var(--brand)); }
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: var(--_c, var(--brand)); }
.door[data-c="committee"] { --_c: #294668; }
.door[data-c="welfare"]   { --_c: #DB6242; }
.door[data-c="retail"]    { --_c: #1F7D6D; }
.door .role { font-family: var(--font-kai); font-size: 1.28rem; margin: .2rem 0 .3rem; }
.door .desc { font-size: .9rem; color: var(--ink-soft); min-height: 3.2em; }
.door .go { margin-top: .8rem; display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .9rem; color: var(--_c, var(--brand)); }
.door .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--_c, var(--brand)) 12%, #fff); color: var(--_c, var(--brand)); font-size: 1.2rem; }

/* ---------- 11. 區塊 / 頁尾 ---------- */
.section { padding: clamp(2.4rem, 6vw, 4.4rem) 0; }
.section-head { max-width: 42rem; margin-bottom: 2rem; }
.section-head h2 { font-family: var(--font-kai); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: .02em; }
.section-head p { color: var(--ink-soft); margin-top: .6rem; }

.band { background: var(--paper-2); border-block: 1px solid var(--line); }

.footer { background: #201B18; color: #D9CFC2; padding: 2.6rem 0 1.8rem; }
.footer a { color: #EBD9A8; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-family: var(--font-kai); color: #fff; font-size: 1.05rem; margin-bottom: .7rem; }
.footer .muted { color: #A79B8B; font-size: .86rem; line-height: 1.9; }
.footer .legend { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .6rem; }
.footer .legend .flag { font-size: .78rem; }
.footer .base { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; font-size: .82rem; color: #A79B8B; }

/* 「不過金流」信任徽章 */
.trust { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border-radius: 999px; background: #fff; border: 1px solid var(--line-strong); font-size: .84rem; color: var(--ink-soft); box-shadow: var(--shadow-s); }
.trust b { color: var(--ink); }

/* ---------- 12. 動效 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s cubic-bezier(.2,.7,.3,1) both; }
.rise-2 { animation-delay: .08s; }
.rise-3 { animation-delay: .16s; }

/* ---------- 13. RWD ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero .authcol { order: -1; }
  .doors { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; gap: 1.4rem; }
  /* nav 是 flex-wrap:wrap，連結一多就換行把 logo 擠成多行 */
  .brandbar .wrap { gap: .6rem; }
  .brandbar nav { gap: .2rem; }
  .navlink { padding: .38rem .5rem; font-size: .84rem; }
}

/* 窄螢幕收起次要導覽，只留 CTA——landing 頁靠捲動，不做漢堡選單 */
@media (max-width: 680px) {
  .brandbar .navlink { display: none; }
  .logo .seal { width: 34px; height: 34px; font-size: 1.2rem; }
  .logo .wordmark { font-size: 1.18rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .rise { animation: none; }
  .roll-track { animation: none !important; }
}

/* ============================================================
   14. App shell（登入後頁）
   ============================================================ */
.demo-banner { background: #2A2320; color: #F1E4C8; font-size: .84rem; text-align: center; padding: .5rem 1rem; letter-spacing: .02em; }
.appbar { position: sticky; top: 0; z-index: 40; background: var(--brand); color: #fff; box-shadow: var(--shadow-s); }
.appbar .wrap { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; }
.appbar .logo .seal { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.appbar .wordmark, .appbar .tag { color: #fff; }
.appbar .tag { opacity: .8; }
.appbar .spacer { margin-left: auto; }
.uidchip { display: inline-flex; align-items: center; gap: .45rem; padding: .38rem .75rem; border-radius: 999px; background: rgba(255,255,255,.15); color: #fff; font-size: .82rem; font-family: var(--font-mono); }
.uidchip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7FE0A6; box-shadow: 0 0 0 3px rgba(127,224,166,.25); }
.appbar .signout { color: #fff; font-size: .86rem; padding: .4rem .7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); }
.appbar .signout:hover { background: rgba(255,255,255,.12); }
.app-main { padding: clamp(1.6rem, 4vw, 2.8rem) 0; }
.app-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.app-head h1 { font-family: var(--font-kai); font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.app-head p { color: var(--ink-soft); font-size: .92rem; margin-top: .2rem; }

/* ============================================================
   15. 下單頁（普渡包分級）
   ============================================================ */
.order-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.4rem; align-items: start; }
.buyer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 1.1rem 1.2rem; margin-bottom: 1.2rem; }
.buyer h3 { font-family: var(--font-kai); font-size: 1.1rem; margin-bottom: .8rem; }
.buyer .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tier { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 1.1rem 1.2rem 1.2rem; transition: border-color .18s ease, box-shadow .18s ease; }
.tier.has { border-color: var(--brand); box-shadow: var(--shadow-m); }
.tier .thead { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.tier .name { font-family: var(--font-kai); font-size: 1.24rem; }
.tier .price { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--brand-d); white-space: nowrap; }
.tier .price small { font-size: .7rem; color: var(--ink-faint); font-weight: 400; }
.tier .contents { font-size: .86rem; color: var(--ink-soft); margin: .5rem 0 .9rem; min-height: 3.2em; }
.tier .modes { display: flex; gap: .4rem; margin-bottom: .8rem; }
.tier .modes label { flex: 1; text-align: center; cursor: pointer; }
.tier .modes input { position: absolute; opacity: 0; pointer-events: none; }
.tier .modes .m { display: block; padding: .45rem .3rem; border-radius: 9px; border: 1.5px solid var(--line-strong); font-size: .82rem; font-weight: 700; color: var(--ink-soft); transition: all .14s ease; }
.tier .modes .m.g { --mc: var(--flag-green); } .tier .modes .m.b { --mc: var(--flag-blue); } .tier .modes .m.y { --mc: var(--flag-amber); }
.tier .modes input:checked + .m { border-color: var(--mc); color: #fff; background: var(--mc); }
.tier .modes input:focus-visible + .m { outline: 3px solid var(--brand); outline-offset: 2px; }
.tier .orgline { margin-bottom: .8rem; }
.tier .orgline select { width: 100%; padding: .55rem .7rem; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; }
.tier .orgline[hidden] { display: none; }
.tier .qtyline { display: flex; align-items: center; justify-content: space-between; }
.tier .qtyline .lab { font-size: .84rem; color: var(--ink-soft); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: none; background: var(--paper-2); font-size: 1.1rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--brand-wash); color: var(--brand-d); }
.stepper input { width: 44px; height: 34px; text-align: center; border: none; border-inline: 1px solid var(--line-strong); font-family: var(--font-mono); font-weight: 700; }

/* 訂單摘要 sticky */
.summary { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-m); overflow: hidden; }
.summary .shead { padding: .9rem 1.1rem; background: var(--brand); color: #fff; font-family: var(--font-kai); font-size: 1.12rem; }
.summary .sbody { padding: .6rem 1.1rem 1.1rem; max-height: 46vh; overflow: auto; }
.summary .empty { color: var(--ink-faint); font-size: .88rem; text-align: center; padding: 1.4rem 0; }
.sumrow { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.sumrow .sm-name { font-weight: 700; font-size: .9rem; }
.sumrow .sm-amt { font-family: var(--font-mono); font-weight: 700; }
.sumrow .sm-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: .4rem; }
.sumrow .sm-meta small { color: var(--ink-soft); font-size: .78rem; }
.sfoot { padding: 1rem 1.1rem; border-top: 1px solid var(--line); background: var(--brand-wash); }
.sfoot .tot { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .3rem; }
.sfoot .tot .n { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; color: var(--brand-d); }
.sfoot .tags { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 .8rem; }
.sfoot .note { font-size: .76rem; color: var(--ink-soft); margin-top: .6rem; text-align: center; }

/* 送出成功 */
.done-card { max-width: 520px; margin: 2rem auto; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-l); padding: 2.2rem 1.6rem; }
.done-card .big { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--flag-green); color: #fff; font-size: 2rem; }
.done-card h2 { font-family: var(--font-kai); font-size: 1.7rem; margin-bottom: .5rem; }
.done-card p { color: var(--ink-soft); }
.done-card .oid { font-family: var(--font-mono); background: var(--paper-2); padding: .3rem .6rem; border-radius: 8px; }
.done-card .btns { display: flex; gap: .7rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }

@media (max-width: 860px) {
  .order-grid { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .buyer .g2 { grid-template-columns: 1fr; }
  .summary { position: static; }
}

/* ============================================================
   16. Landing page 區塊（三入口一頁式共用）
   ============================================================ */
.navcta { background: var(--brand); color: #fff !important; padding: .45rem .9rem; border-radius: 8px; font-weight: 700; }
.navcta:hover { background: var(--brand-d); }

/* 社會證明條 */
.proofbar { background: var(--paper-2); border-block: 1px solid var(--line); }
.proofbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1rem 0; }
.proofbar .pstats { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; }
.proofbar .pstat { display: flex; align-items: baseline; gap: .5rem; }
.proofbar .pstat .n { font-family: var(--font-mono); font-weight: 700; font-size: 1.35rem; color: var(--brand-d); }
.proofbar .pstat .l { font-size: .82rem; color: var(--ink-soft); }
.proofbar .plogos { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.proofbar .plogos small { color: var(--ink-faint); font-size: .78rem; }
.proofbar .lg { padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: .84rem; font-weight: 600; color: var(--ink-soft); }

/* 痛點 / agitation */
.pain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.pain { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--vermilion); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-s); }
.pain .x { color: var(--vermilion); font-weight: 800; margin-right: .3rem; }
.pain h3 { font-size: 1.02rem; margin: .1rem 0 .35rem; }
.pain p { font-size: .88rem; color: var(--ink-soft); }

/* 效益 / benefits（結果導向） */
.benefit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.benefit { display: grid; grid-template-columns: auto 1fr; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-s); transition: border-color .18s ease, box-shadow .18s ease; }
.benefit:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-m); }
.benefit .bi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-wash); color: var(--brand-d); font-size: 1.4rem; }
.benefit h3 { font-family: var(--font-kai); font-size: 1.18rem; margin-bottom: .25rem; }
.benefit p { font-size: .9rem; color: var(--ink-soft); }
.benefit .eff { display: inline-block; margin-top: .5rem; font-size: .77rem; font-weight: 700; color: var(--brand-d); background: var(--brand-wash); padding: .16rem .55rem; border-radius: 999px; }

/* 見證 */
.quote { background: var(--brand); color: #fff; border-radius: 18px; padding: clamp(1.6rem,3.4vw,2.4rem); box-shadow: var(--shadow-m); position: relative; overflow: hidden; }
.quote::before { content: "\201C"; font-family: var(--font-kai); position: absolute; top: -.35em; left: .15em; font-size: 8rem; color: rgba(255,255,255,.13); line-height: 1; }
.quote p { font-family: var(--font-kai); font-size: clamp(1.15rem,2.2vw,1.5rem); line-height: 1.6; position: relative; }
.quote .who { margin-top: 1rem; font-size: .9rem; opacity: .88; position: relative; }

/* 疑慮化解 */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow-s); }
.tcard .q { font-weight: 700; margin-bottom: .45rem; display: flex; gap: .5rem; align-items: flex-start; }
.tcard .q .qm { color: var(--brand-d); flex: none; }
.tcard p { font-size: .88rem; color: var(--ink-soft); }

/* FAQ */
.faq { max-width: 780px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; margin-bottom: .7rem; box-shadow: var(--shadow-s); }
.faq summary { cursor: pointer; padding: 1rem 1.1rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-d); font-size: 1.3rem; font-weight: 700; }
.faq details[open] summary::after { content: "\2013"; }
.faq details .a { padding: 0 1.1rem 1.1rem; color: var(--ink-soft); font-size: .9rem; }

/* 結尾 CTA */
.cta-band { background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; border-radius: 20px; padding: clamp(2rem,5vw,3.4rem); text-align: center; box-shadow: var(--shadow-l); }
.cta-band h2 { font-family: var(--font-kai); font-size: clamp(1.6rem,3.4vw,2.4rem); }
.cta-band p { opacity: .92; margin: .6rem auto 1.4rem; max-width: 34em; }
.cta-band .btn-brand { background: #fff; color: var(--brand-d); }
.cta-band .btn-brand:hover { background: #fff; transform: translateY(-1px); }
.cta-band .btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.14); border-color: #fff; color: #fff; }

@media (max-width: 860px) {
  .pain-grid, .trust-grid, .benefit-grid { grid-template-columns: 1fr; }
  .proofbar .wrap { justify-content: flex-start; }
}

/* ============================================================
   17. 公益榜（.honor）—— 物管招募的核心誘因
   刻意走「清透科技側」：白卡、mono 數字、金銀銅名次徽章。
   與主頁紅榜（民俗側、硃紅金字、捲動）互補，同頁不搶戲。
   ============================================================ */
.honor { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-m); overflow: hidden; }
.honor .hhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem 1.2rem; background: linear-gradient(100deg, var(--brand), var(--brand-d)); color: #fff; }
.honor .hhead .kai { font-family: var(--font-kai); font-size: 1.24rem; letter-spacing: .04em; }
.honor .hlive { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; background: rgba(255,255,255,.16); padding: .3rem .65rem; border-radius: 999px; }
.honor .hlive::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #FFD98A; box-shadow: 0 0 0 3px rgba(255,217,138,.28); }

/* 雙榜切換：複用 .seg 樣式，只調間距 */
.honor .htabs { margin: 1rem 1.2rem .4rem; }

.hlist { list-style: none; margin: 0; padding: 0 0 .4rem; }
.hrow { display: grid; grid-template-columns: 44px 1fr auto; gap: .9rem; align-items: center; padding: .72rem 1.2rem; border-top: 1px solid var(--line); }
.hrow:first-child { border-top: 1px solid var(--line); }
.hrow .rk { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-family: var(--font-mono); font-weight: 700; font-size: .96rem; background: var(--paper-2); color: var(--ink-soft); }
.hrow .rk-1 { background: var(--gold); color: #fff; box-shadow: 0 0 0 3px rgba(190,146,47,.18); }
.hrow .rk-2 { background: #9AA3A8; color: #fff; }
.hrow .rk-3 { background: #B4794A; color: #fff; }
.hrow .co { font-weight: 700; line-height: 1.35; }
.hrow .co .crown { font-family: var(--font-kai); font-weight: 700; font-size: .78rem; color: var(--gold); margin-left: .4rem; }
.hrow .co small { display: block; font-weight: 500; color: var(--ink-soft); font-size: .8rem; margin-top: .12rem; }
.hrow .vl { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.02rem; color: var(--brand-d); white-space: nowrap; text-align: right; }
.hrow .vl small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: .76rem; color: var(--ink-faint); }
.hrow.me { background: var(--brand-wash); }
.hrow.me .co::after { content: "貴公司"; font-size: .72rem; font-weight: 700; color: var(--brand-d); background: #fff; border: 1px solid var(--brand-soft); padding: .1rem .45rem; border-radius: 999px; margin-left: .5rem; }
.honor .hnote { padding: .9rem 1.2rem 1.1rem; margin: 0; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-soft); font-size: .8rem; line-height: 1.7; }

/* ============================================================
   18. 夥伴 Logo 牆（.logowall）—— Logo + 100 字介紹
   <details> 展開，零 JS。
   ============================================================ */
.logowall { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 1rem; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); overflow: hidden; transition: border-color .18s ease, box-shadow .18s ease; }
.pcard:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-m); }
.pcard summary { list-style: none; cursor: pointer; padding: 1.05rem 1.15rem; display: grid; gap: .5rem; }
.pcard summary::-webkit-details-marker { display: none; }
/* Logo 佔位：實際 Logo 換成 <img class="plogo">，尺寸沿用 */
.pcard .plogo { display: grid; place-items: center; height: 52px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); font-family: var(--font-kai); font-weight: 700; font-size: 1.1rem; color: var(--ink-soft); letter-spacing: .06em; }
.pcard img.plogo { object-fit: contain; padding: .4rem; background: #fff; }
.pcard .pname { font-weight: 700; font-size: .94rem; line-height: 1.45; }
.pcard .pmeta { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-faint); }
.pcard .pmore { font-size: .8rem; font-weight: 700; color: var(--brand-d); }
.pcard .pmore::after { content: " ▾"; }
.pcard[open] .pmore::after { content: " ▴"; }
.pcard .pbody { margin: 0; padding: 0 1.15rem 1.15rem; color: var(--ink-soft); font-size: .87rem; line-height: 1.85; border-top: 1px dashed var(--line); padding-top: .9rem; }
.pcard .pbody .byline { display: block; margin-top: .6rem; font-size: .74rem; color: var(--ink-faint); }

/* 招募空位卡：把「還沒加入」做成可點的邀請 */
.pcard--open { border-style: dashed; box-shadow: none; }
.pcard--open summary { text-align: center; color: var(--brand-d); font-weight: 700; }
.pcard--open .plogo { background: transparent; border-style: dashed; color: var(--brand-soft); font-size: 1.6rem; }

/* ============================================================
   19. 感謝狀（.cert）—— 社福機構具名開立，可列印
   ============================================================ */
.cert { background: #FFFDF8; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-m); padding: clamp(1.4rem, 3vw, 2.2rem); position: relative; max-width: 560px; }
.cert::before { content: ""; position: absolute; inset: 9px; border: 2px solid var(--gold); border-radius: 6px; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(190,146,47,.45); border-radius: 4px; pointer-events: none; }
.cert > * { position: relative; }
.cert .ctitle { font-family: var(--font-kai); font-size: clamp(1.5rem, 3.6vw, 2rem); text-align: center; color: var(--vermilion); letter-spacing: .22em; margin: .4rem 0 1.1rem; }
.cert .cto { font-family: var(--font-kai); font-size: 1.16rem; font-weight: 700; margin-bottom: .7rem; }
.cert .cbody { font-size: .9rem; line-height: 2.05; color: var(--ink); }
.cert .cbody b { color: var(--vermilion); }
.cert .cfoot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px dashed var(--line-strong); }
.cert .corg { font-family: var(--font-kai); font-weight: 700; font-size: 1rem; line-height: 1.6; }
.cert .corg small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: .76rem; color: var(--ink-faint); margin-top: .2rem; }
.cert .cseal { flex: none; display: grid; place-items: center; width: 74px; height: 74px; border: 2px solid var(--vermilion); border-radius: 8px; color: var(--vermilion); font-family: var(--font-kai); font-weight: 700; font-size: .82rem; line-height: 1.35; text-align: center; transform: rotate(-7deg); opacity: .88; }
.cert .cno { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-faint); text-align: center; margin-top: 1rem; }

/* 只印感謝狀：用 visibility 保留祖先佈局，display:none 會連帶讓巢狀的 .cert 消失 */
@media print {
  body * { visibility: hidden; }
  .print-only, .print-only * { visibility: visible; }
  .print-only { position: absolute; left: 0; top: 0; width: 100%; max-width: none; }
  .cert { box-shadow: none; border-color: #999; margin: 0 auto; }
}

/* ============================================================
   20. 環境效益估算（.ecobox）—— 訂購摘要內
   刻意不使用綠色：綠色已被「綠旗＝不指名」佔用，混用會破壞色卡語意
   ============================================================ */
.ecobox { margin: .8rem 0 1rem; padding: .8rem .9rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; }
.ecorow { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; font-size: .84rem; color: var(--ink-soft); }
.ecorow + .ecorow { margin-top: .3rem; }
.ecorow b { font-family: var(--font-mono); font-size: .95rem; color: var(--ink); }
.econote { margin-top: .55rem; padding-top: .5rem; border-top: 1px dashed var(--line); font-size: .72rem; line-height: 1.7; color: var(--ink-faint); }

/* ============================================================
   21. 表單輔助與註冊流程（join.html / 各後台共用）
   ============================================================ */
.req { display: inline-block; margin-left: .35rem; padding: .06rem .38rem; border-radius: 999px; background: var(--vermilion); color: #fff; font-size: .66rem; font-weight: 700; vertical-align: middle; }
.hint { display: block; margin-top: .35rem; font-size: .77rem; line-height: 1.65; color: var(--ink-faint); }
.fineprint { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--line); font-size: .76rem; line-height: 1.75; color: var(--ink-faint); }
.field input[readonly] { background: var(--paper-2); color: var(--ink-soft); cursor: default; }
.joinwrap { max-width: 520px; margin: 0 auto; }
.sent { text-align: center; padding: 1rem 0 .4rem; }
.sent .big { font-size: 2.6rem; line-height: 1; margin-bottom: .6rem; }
.sent h3 { font-family: var(--font-kai); font-size: 1.3rem; margin-bottom: .5rem; }
.sent p { font-size: .89rem; line-height: 1.85; color: var(--ink-soft); }

/* 訂購頁：社區帶入卡 + 個資同意 */
.commbox { padding: .8rem .95rem; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--paper-2); }
.commbox.ok { border-style: solid; border-color: var(--brand-soft); background: var(--brand-wash); }
.commbox .cbname { font-family: var(--font-kai); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.commbox.ok .cbname { color: var(--brand-d); }
.commbox .cbaddr { margin-top: .25rem; font-size: .83rem; line-height: 1.7; color: var(--ink-soft); }
.consent { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; margin-top: 1rem; padding: .8rem .95rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: .8rem; line-height: 1.8; color: var(--ink-soft); cursor: pointer; }
.consent input { width: auto; margin-top: .25rem; }
.consent b { color: var(--ink); }

@media (max-width: 860px) {
  .hrow { grid-template-columns: 36px 1fr; }
  .hrow .vl { grid-column: 2; text-align: left; margin-top: .2rem; }
  .honor .hhead .kai { font-size: 1.1rem; }
  .logowall { grid-template-columns: 1fr; }
}

