/*
 * 官網樣式。色票與版面語彙直接沿用賣家工作台（DESIGN.md 與
 * apps/webhook-edge/src/seller-dashboard.ts 的 :root），讓送審網站與實際後台
 * 是同一個產品的臉。不引入任何外部字體、CDN 或追蹤script——
 * 歐付寶審核會實際打開這個站，載入失敗的外部資源只會製造問題。
 */

:root {
  --ink: #1d2326;
  --paper: #e3e2e3;
  --surface: #f9f9f7;
  --primary: #3a64a5;
  --primary-hover: #34495e;
  --blue: #6597e1;
  --blue-soft: #cae4fa;
  --yellow: #e6cc49;
  --green: #408b41;
  --red: #d95536;
  --gray: #e0e0de;
  --muted: #73706e;
  --line: #dbdbdb;
  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.6;
}

/* ---------- 頁首 ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  min-height: 82px;
  padding: 17px clamp(18px, 4vw, 48px);
  background: var(--blue);
  color: var(--ink);
}

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

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

.brand span {
  display: block;
  margin-top: 5px;
  color: var(--primary-hover);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 750;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
  outline: none;
}

/* ---------- 版面 ---------- */

main {
  padding: 40px;
  max-width: 1280px;
  width: 100%;
  margin: auto;
}

h1 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  margin: 0;
  font-weight: 920;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 12px 0 26px;
  max-width: 62ch;
  line-height: 1.75;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  margin-top: 18px;
  overflow: hidden;
}

.panel[id] {
  scroll-margin-top: 24px;
}

.panel h2 {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 6px;
  font-weight: 900;
}

.panel h3 {
  font-size: 16px;
  letter-spacing: -0.02em;
  margin: 22px 0 6px;
  font-weight: 850;
}

.panel h3:first-of-type {
  margin-top: 14px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.65;
  max-width: 68ch;
}

.panel p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.8;
  max-width: 74ch;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel ul,
.panel ol {
  margin: 0 0 12px;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.85;
  max-width: 74ch;
}

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

.panel li:last-child {
  margin-bottom: 0;
}

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

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

strong {
  font-weight: 850;
}

code {
  background: var(--gray);
  padding: 2px 5px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

/* ---------- 數字總覽：四張同色藍卡 ---------- */

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 26px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--blue);
  color: var(--ink);
}

.overview-item {
  display: flex;
  min-width: 0;
  min-height: 138px;
  padding: 22px 24px;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--blue);
}

.overview-item strong {
  display: block;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 0.92;
  letter-spacing: -0.06em;
  margin-bottom: 11px;
  font-weight: 920;
  font-variant-numeric: tabular-nums;
}

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

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

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--primary);
  color: var(--surface);
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--primary-hover);
  color: var(--surface);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 13px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-hover);
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.secondary-action:hover,
.secondary-action:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--primary-hover);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

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

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

.flow > div {
  min-width: 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--blue-soft);
}

.flow b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface);
  font-size: 12px;
}

.flow strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.flow span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- 功能卡 ---------- */

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

.feature {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.feature strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.feature span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.plan.featured {
  border-color: var(--primary);
  background: var(--blue-soft);
}

.plan-name {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.04em;
  color: var(--primary-hover);
}

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

.plan-price b {
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 920;
  font-variant-numeric: tabular-nums;
}

.plan-price em {
  font-style: normal;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

.plan-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 16px;
  line-height: 1.6;
}

.plan ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: 14px;
}

.plan li {
  padding: 7px 0 7px 22px;
  position: relative;
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
}

.plan li:last-child {
  border-bottom: 0;
}

.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

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

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

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

th {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.7;
}

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

td strong {
  white-space: nowrap;
}

/* ---------- 訊號色：黃＝要處理、綠＝已完成、紅＝錯誤 ---------- */

.callout {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 14px;
  margin: 16px 0;
  border: 1px solid;
}

.callout strong {
  font-size: 15px;
}

.callout p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

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

.callout-green {
  background: var(--surface);
  border-color: var(--green);
  color: var(--green);
}

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

.callout-blue {
  background: var(--blue-soft);
  border-color: var(--blue-soft);
  color: var(--primary-hover);
}

.callout-blue p {
  color: var(--ink);
}

/* 尚未填入的營業人資料。用工作台「需要你處理」的黃色，避免不小心就這樣送審。 */
.todo {
  background: var(--yellow);
  color: var(--ink);
  padding: 1px 7px;
  border-radius: 5px;
  font-weight: 850;
  font-size: 0.94em;
  white-space: nowrap;
}

/* ---------- FAQ ---------- */

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 2px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.02em;
  min-height: 44px;
}

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

.faq-item > summary::after {
  content: "＋";
  color: var(--primary);
  font-weight: 900;
  flex: 0 0 auto;
}

.faq-item[open] > summary::after {
  content: "－";
}

.faq-item[open] > summary {
  color: var(--primary-hover);
}

.faq-item div {
  padding: 0 2px 18px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.85;
  max-width: 74ch;
}

.faq-item div p {
  margin: 0 0 10px;
  font-size: 14px;
}

.faq-item div p:last-child {
  margin-bottom: 0;
}

/* ---------- 聯絡資訊 ---------- */

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

.contact-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.contact-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}

.contact-card strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.02em;
  word-break: break-all;
}

.contact-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 34px clamp(18px, 4vw, 48px) 40px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1280px;
  margin: auto;
  display: grid;
  gap: 22px;
}

.footer-inner h2 {
  font-size: 15px;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 850;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 13px;
}

.footer-links h2 {
  flex: 0 0 100%;
}

.footer-links a {
  color: var(--primary-hover);
  text-decoration: none;
  font-weight: 750;
  min-height: 24px;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.footer-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

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

.legal-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.legal ol {
  counter-reset: clause;
  list-style: none;
  padding-left: 0;
  max-width: 74ch;
}

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

.legal > ol > li::before {
  content: counter(clause);
  position: absolute;
  left: 0;
  top: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray);
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.legal > ol > li ul {
  margin-top: 8px;
  padding-left: 20px;
  font-size: 14px;
}

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

@media (max-width: 950px) {
  .site-header {
    min-height: 72px;
    padding: 14px 18px;
  }

  .brand strong {
    font-size: 20px;
  }

  .site-nav a {
    min-height: 38px;
    padding: 9px 13px;
    font-size: 12px;
  }

  main {
    padding: 26px 18px;
  }

  .overview {
    grid-template-columns: 1fr 1fr;
    border-radius: 15px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 14px;
  }

  .panel {
    padding: 20px;
  }

  .panel h2 {
    font-size: 22px;
  }

  .overview-item {
    min-height: 120px;
    padding: 18px;
  }

  .overview-item strong {
    font-size: 32px;
  }

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

  .footer-legal dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .footer-legal dd {
    margin-bottom: 10px;
  }
}
