/* AnyBooking 網站共用樣式（docs/02 §10）。主色與 App 一致：#2F6F73 */
:root {
  --brand: #2f6f73;
  --brand-strong: #235558;
  --brand-soft: #e3f0f0;
  --bg: #ffffff;
  --surface: #f5f8f8;
  --text: #1b2526;
  --muted: #56666a;
  --line: #dbe4e5;
  --radius: 14px;
  --max: 960px;
  --max-text: 720px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7cc3c7;
    --brand-strong: #a6dadd;
    --brand-soft: #1d3436;
    --bg: #101718;
    --surface: #172122;
    --text: #e4eced;
    --muted: #9fb0b2;
    --line: #2a3839;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── 頁首 ─────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 15px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* ── 首頁 ─────────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hero p {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 18px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.store-badge[aria-disabled="true"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
  cursor: default;
}

.store-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.section .lead {
  margin: 0 0 28px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.steps strong {
  display: block;
  margin-bottom: 4px;
}

.steps span {
  color: var(--muted);
  font-size: 15px;
}

/* ── 條款類文件 ─────────────────────────────────── */
.doc {
  max-width: var(--max-text);
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.doc h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.35;
}

.doc .updated {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 15px;
}

.doc h2 {
  margin: 40px 0 12px;
  padding-top: 8px;
  font-size: 22px;
  line-height: 1.45;
}

.doc h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

.doc ul,
.doc ol {
  padding-left: 1.4em;
}

.doc li + li {
  margin-top: 6px;
}

.doc .summary {
  margin: 0 0 32px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--brand-soft);
}

.doc .summary ul {
  margin: 8px 0 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 12px 0;
}

.doc table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.doc th,
.doc td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc th {
  background: var(--surface);
  font-weight: 600;
}

.toc {
  margin: 0 0 8px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
}

.toc ol {
  margin: 6px 0 0;
}

/* ── 404 ─────────────────────────────────────── */
.not-found {
  padding: 96px 0;
  text-align: center;
}

.not-found h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.not-found p {
  margin: 0 0 24px;
  color: var(--muted);
}

/* ── 頁尾 ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.site-footer a {
  color: var(--muted);
}

/* 窄螢幕：表格每一列變成一張卡片，欄位名稱顯示在內容前 */
@media (max-width: 600px) {
  .doc table.stack {
    min-width: 0;
  }

  .doc table.stack thead {
    display: none;
  }

  .doc table.stack,
  .doc table.stack tbody,
  .doc table.stack tr,
  .doc table.stack td {
    display: block;
  }

  .doc table.stack tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .doc table.stack td {
    border: 0;
    border-top: 1px solid var(--line);
  }

  .doc table.stack td:first-child {
    border-top: 0;
    background: var(--surface);
    font-weight: 600;
  }

  .doc table.stack td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .site-nav {
    gap: 14px;
    font-size: 14px;
  }
}
