/*
 * 官網樣式。色票沿用賣家工作台（DESIGN.md 與
 * apps/webhook-edge/src/seller-dashboard.ts 的 :root），讓送審網站與實際後台
 * 是同一個產品的臉。不引入任何外部字體、CDN 或追蹤 script——
 * 歐付寶審核會實際打開這個站，載入失敗的外部資源只會製造問題。
 *
 * 版面語彙參考 linktr.ee：滿版交替色帶、浮在色帶上的膠囊導覽、
 * 超大負字距標題、大圓角卡與粗膠囊按鈕。只借版面與字級，不借顏色。
 */

:root {
  --ink: #1d2326;
  --paper: #e3e2e3;
  --surface: #f9f9f7;
  --primary: #3a64a5;
  --primary-hover: #34495e;
  --blue: #6597e1;
  --blue-soft: #cae4fa;
  --yellow: #e6cc49;
  --green: #408b41;
  --red: #d95536;
  --muted: #73706e;
  --line: #dbdbdb;

  /* 內容欄最大寬度與左右安全邊距。色帶滿版，只有內容被這個寬度收住。 */
  --shell: 1180px;
  --gut: clamp(18px, 4.5vw, 56px);

  /* 圓角層級：卡片 / 中型元件。按鈕一律膠囊。 */
  --r-lg: 30px;
  --r-md: 20px;

  --band-y: clamp(60px, 8.5vw, 118px);

  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 頁首：浮在色帶上的膠囊 ---------- */

.site-header {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - var(--gut) * 2);
  max-width: var(--shell);
  /* 負的下邊距把後面的 hero 拉上來，讓導覽膠囊浮在色帶上。 */
  margin: 12px auto -76px;
  padding: 9px 10px 9px 22px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(29, 35, 38, 0.13);
}

.brand {
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand strong {
  display: block;
  font-weight: 920;
  font-size: 19px;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 1px;
  color: var(--primary-hover);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 17px;
  border-radius: 999px;
  color: var(--primary-hover);
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--blue-soft);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--primary);
  color: var(--surface);
}

/* ---------- 滿版色帶版面 ----------
 * main 是一個三欄 grid：兩側留白 + 中間內容欄。
 * 一般子元素落在中間欄；色帶（.hero / .panel）跨滿版，
 * 再由色帶自己的 padding 與子元素 max-width 把內容收回中間。
 */

main {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gut), 1fr)
    [inner-start] min(var(--shell), 100% - var(--gut) * 2) [inner-end]
    minmax(var(--gut), 1fr) [full-end];
}

main > * {
  grid-column: inner;
}

/*
 * 色帶跨滿版，內容欄靠色帶自己的左右 padding 收住——不要改用子元素的
 * `margin-inline: auto`：像 `.subtitle { margin: 26px 0 0 }` 這種簡寫會把
 * auto 重設成 0，而 inline-block 的 .eyebrow 根本吃不到 auto，
 * 結果同一個 hero 裡會出現兩條不同的左邊界。
 */
.hero,
.panel {
  grid-column: full;
  padding-block: var(--band-y);
  padding-inline: max(var(--gut), (100% - var(--shell)) / 2);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--blue);
  padding-top: clamp(104px, 13vw, 176px);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 22px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

h1 {
  font-size: clamp(40px, 7.4vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  margin: 0;
  font-weight: 920;
  text-wrap: balance;
}

.subtitle {
  margin: 26px 0 0;
  max-width: 46em;
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 550;
  color: var(--primary-hover);
}

.hero .subtitle {
  /* 不加 opacity：ink 半透明疊在 --blue 上只剩 4.2:1，不透明才有 5.4:1。 */
  color: var(--ink);
}

/* ---------- 行動呼籲 ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/*
 * 每頁結尾那組按鈕是 <main> 的直接子元素，不在任何色帶裡。原本它只有
 * margin-top：上面疊著前一個色帶整段的 padding，下面卻什麼都沒有，
 * 於是按鈕的下緣直接撞上頁尾，看起來像黏在頁尾上。
 * 改成讓它自己也是一個收尾色帶；前一個色帶的下緣同時收掉，
 * 否則兩段留白會疊成將近 200px。
 */
.panel:has(+ .cta-row) {
  padding-bottom: 0;
}

main > .cta-row {
  grid-column: full;
  margin-top: 0;
  padding-block: clamp(44px, 5vw, 76px);
  padding-inline: max(var(--gut), (100% - var(--shell)) / 2);
  background: var(--paper);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 16px 34px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 880;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.primary-action {
  background: var(--ink);
  color: var(--surface);
}

.secondary-action {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

/* ---------- 重點數字 ---------- */

/*
 * 用 flex 而不是 auto-fit 的 grid：目前只剩一張卡，grid 的 1fr 會把它
 * 拉滿整個內容欄寬。flex-basis 讓卡片維持自己的寬度並靠左，之後不管
 * 加回幾張都成立。
 */
.overview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 46px;
}

.overview-item {
  display: flex;
  flex: 0 1 262px;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 168px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.overview-item strong {
  display: block;
  font-size: clamp(38px, 4.4vw, 56px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  margin-bottom: 12px;
  font-weight: 920;
  font-variant-numeric: tabular-nums;
}

.overview-item span {
  display: block;
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

/* ---------- 色帶 ---------- */

.panel {
  background: var(--surface);
}

.panel.alt {
  background: var(--paper);
}

.panel.soft {
  background: var(--blue-soft);
}

.panel.accent {
  background: var(--yellow);
}

.panel.deep {
  background: var(--primary);
  color: var(--surface);
}

/* 連續兩個同色的預設色帶之間補一條髮絲線，避免變成一片白牆。 */
.panel + .panel:not(.alt):not(.soft):not(.accent):not(.deep) {
  border-top: 1px solid var(--line);
}

.panel h2 {
  font-size: clamp(28px, 3.9vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 920;
  margin: 0 0 14px;
  text-wrap: balance;
}

.panel h3 {
  font-size: clamp(18px, 1.9vw, 22px);
  letter-spacing: -0.03em;
  font-weight: 900;
  margin: 40px 0 10px;
}

.panel p {
  margin: 0 0 14px;
  max-width: 62em;
}

.hint {
  color: var(--primary-hover);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 26px !important;
}

.panel.deep .hint {
  color: var(--blue-soft);
}

.panel.deep a {
  color: var(--surface);
}

.panel ul,
.panel ol {
  margin: 0 0 14px;
  padding-left: 1.3em;
  max-width: 62em;
}

.panel li {
  margin-bottom: 9px;
}

a {
  color: var(--primary);
}

/* ---------- 流程步驟 ---------- */

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.flow > div {
  display: flex;
  flex-direction: column;
  padding: 26px 24px 28px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.panel.soft .flow > div,
.panel.accent .flow > div {
  background: var(--surface);
}

.flow b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--ink);
  font-size: 17px;
  font-weight: 920;
  font-variant-numeric: tabular-nums;
}

.flow strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.flow span {
  font-size: 14.5px;
  color: var(--primary-hover);
  line-height: 1.6;
}

/* ---------- 功能格 ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.feature {
  display: flex;
  flex-direction: column;
  padding: 28px 26px 30px;
  border-radius: var(--r-lg);
  background: var(--paper);
}

.panel.alt .feature,
.panel.soft .feature,
.panel.accent .feature,
.panel.deep .feature {
  background: var(--surface);
  color: var(--ink);
}

.feature strong {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.035em;
  margin-bottom: 10px;
}

.feature span {
  font-size: 14.5px;
  color: var(--primary-hover);
  line-height: 1.62;
}

/* ---------- 方案卡 ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 30px;
  /* 目前只有單一方案，不讓那張卡被拉滿整個版面寬。 */
  max-width: 480px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 32px 30px 30px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
}

.plan-name {
  font-size: 12px;
  font-weight: 880;
  letter-spacing: 0.08em;
  color: var(--primary-hover);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 14px 0 6px;
}

.plan-price b {
  font-size: clamp(52px, 6.4vw, 74px);
  line-height: 0.86;
  letter-spacing: -0.065em;
  font-weight: 920;
  font-variant-numeric: tabular-nums;
}

.plan-price em {
  font-style: normal;
  font-size: 16px;
  font-weight: 850;
  color: var(--primary-hover);
}

.plan-note {
  margin: 0 0 20px !important;
  font-size: 14.5px;
  color: var(--primary-hover);
}

.plan ul {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 11px;
}

.plan li {
  position: relative;
  margin: 0;
  padding-left: 27px;
  font-size: 15px;
  font-weight: 600;
}

.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 15px;
  height: 8px;
  border-left: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: rotate(-45deg);
}

.plan .primary-action,
.plan .secondary-action {
  margin-top: auto;
}

/* ---------- 常見問題 ---------- */

.faq-item {
  margin-top: 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.panel:not(.alt):not(.soft):not(.accent):not(.deep) .faq-item {
  background: var(--paper);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 24px;
  cursor: pointer;
  list-style: none;
  font-size: 16.5px;
  font-weight: 880;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  margin-right: 4px;
  border-right: 3px solid var(--primary);
  border-bottom: 3px solid var(--primary);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.15s ease;
}

.faq-item[open] summary::after {
  transform: rotate(225deg) translate(-3px, -3px);
}

.faq-item[open] summary {
  padding-bottom: 6px;
}

.faq-item div {
  padding: 0 24px 22px;
}

.faq-item p {
  margin: 0;
  font-size: 15px;
  color: var(--primary-hover);
  line-height: 1.68;
}

.faq-item p + p {
  margin-top: 11px;
}

/* ---------- 表格 ---------- */

.table-wrap {
  margin: 26px 0 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
}

.panel:not(.alt):not(.soft):not(.accent):not(.deep) .table-wrap {
  background: var(--paper);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  color: var(--ink);
}

th {
  text-align: left;
  padding: 17px 22px;
  font-size: 12px;
  font-weight: 880;
  letter-spacing: 0.06em;
  color: var(--primary-hover);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* ---------- 提示框 ---------- */

.callout {
  margin-top: 26px;
  padding: 24px 26px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
}

.callout strong {
  display: block;
  margin-bottom: 7px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.callout p {
  margin: 0 !important;
  font-size: 15px;
  color: var(--primary-hover);
  line-height: 1.65;
}

.callout-blue {
  background: var(--blue-soft);
}

.callout-yellow {
  background: var(--yellow);
}

.callout-yellow p {
  color: var(--primary-hover);
}

/*
 * 綠色不做滿底：--green (#408b41) 配白字只有 3.99:1，而它是 DESIGN.md 的
 * 鎖定色票、不能為了對比調深。改成白底 + 綠色標示邊，語意一樣是「安全／已完成」，
 * 文字則保持 ink 的高對比。
 */
.callout-green {
  background: var(--surface);
  color: var(--ink);
  border-left: 7px solid var(--green);
}

.callout-green p {
  color: var(--primary-hover);
}

/* ---------- 聯絡卡 ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
}

.panel:not(.alt):not(.soft):not(.accent):not(.deep) .contact-card {
  background: var(--paper);
}

.contact-card span {
  font-size: 12px;
  font-weight: 880;
  letter-spacing: 0.07em;
  color: var(--primary-hover);
}

.contact-card strong {
  margin: 12px 0 8px;
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 900;
  letter-spacing: -0.04em;
  word-break: break-word;
}

.contact-card strong a {
  color: inherit;
}

.contact-card small {
  font-size: 13.5px;
  color: var(--primary-hover);
}

/* ---------- 條款頁 ---------- */

/*
 * 條款與隱私權各有十個章節。行銷頁那種 118px 的色帶留白套在這裡，
 * 會把一份要連續閱讀的文件拉成無止盡的捲動。這兩頁要的是密度。
 */
.legal .panel {
  padding-block: clamp(34px, 3.6vw, 54px);
}

.legal .panel h2 {
  font-size: clamp(23px, 2.5vw, 31px);
  margin-bottom: 18px;
}

.legal-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 24px 0 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 820;
  letter-spacing: 0.04em;
}

/*
 * 條號清單。原本寫成 `.legal > ol > li`，但 ol 實際上包在 .panel 裡面，
 * 不是 main.legal 的直接子元素——那個選擇器從來沒有生效，條號圓圈一直沒出現，
 * 而 `.legal ol { list-style: none }` 又把預設編號拿掉了，等於整份條款沒有編號。
 */
.legal .panel > ol {
  counter-reset: clause;
  list-style: none;
  padding-left: 0;
  max-width: 74ch;
}

.legal .panel > ol > li {
  counter-increment: clause;
  position: relative;
  padding-left: 44px;
  margin-bottom: 16px;
}

.legal .panel > ol > li::before {
  content: counter(clause);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 880;
  line-height: 1;
}

.legal .panel > ol > li ul {
  margin-top: 9px;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--primary-hover);
}

/* ---------- 頁尾 ---------- */

.site-footer {
  padding: clamp(48px, 6vw, 80px) var(--gut) clamp(36px, 4vw, 54px);
  background: var(--ink);
  color: var(--paper);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: var(--shell);
  margin-inline: auto;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.footer-links h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 880;
  letter-spacing: 0.08em;
  /* 頁尾是 ink 深底，這裡要往亮的方向走，不能沿用其他區塊的深色次要字。 */
  color: var(--blue-soft);
}

.footer-links a {
  padding: 7px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--yellow);
}

.footer-note {
  margin: 0;
  align-self: end;
  font-size: 13px;
  line-height: 1.72;
  color: var(--paper);
  opacity: 0.72;
}

/* ---------- 響應式 ---------- */

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  /* 導覽在窄螢幕會換行或需要橫向捲動，負邊距的浮動疊放不再成立，
     改回一般的流式頁首。 */
  .site-header {
    position: static;
    width: auto;
    margin: 0;
    padding: 12px var(--gut);
    border-radius: 0;
    background: var(--blue);
    box-shadow: none;
    gap: 10px;
  }

  .site-nav a {
    font-size: 13px;
    padding: 9px 13px;
  }

  .hero {
    padding-top: clamp(40px, 9vw, 64px);
  }
}

@media (max-width: 560px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    gap: 2px;
  }

  .cta-row .primary-action,
  .cta-row .secondary-action {
    width: 100%;
  }

  .overview-item {
    flex-basis: 100%;
    min-height: 138px;
    padding: 22px;
  }

  .faq-item summary {
    padding: 18px 20px;
  }

  .faq-item div {
    padding: 0 20px 20px;
  }

  th,
  td {
    padding: 14px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
