/* 哥不淋 — 地城殼皮膚。色票與 token 取自 app 的 DesignSystem（docs/design-tokens.md）。 */

/* ---------- tokens ---------- */
:root {
  /* 善良哥布林（Light） */
  --bg: #F4F6F8;
  --card: #FFFFFF;
  --text: #0F1F33;
  --muted: #5C6B7F;
  --accent: #0F1F33;
  --accent-ink: #FFFFFF;
  --dry: #147A45;
  --wet: #1B57C4;
  --unsure: #55647A;
  --skin: #6DAE3F;
  --raincoat: #F2B01E;
  --stroke: rgba(15, 31, 51, 0.10);
  --stroke-strong: rgba(15, 31, 51, 0.16);
  --radius-card: 20px;
  --radius-btn: 16px;
  --radius-chip: 22px;
  --shadow: 0 1px 2px rgba(15, 31, 51, .06), 0 8px 24px rgba(15, 31, 51, .06);
  --rune: var(--muted);
  --wall: rgba(15, 31, 51, 0.025);
  --glow: rgba(109, 174, 63, 0.16);
  --display: "Noto Serif TC", "PingFang TC", serif;
}

:root[data-skin="dark"] {
  /* 暗黑哥布林（Dark） */
  --bg: #14110C;
  --card: #221B12;
  --text: #F5ECD9;
  --muted: #B7A98C;
  --accent: #FFC53D;
  --accent-ink: #14110C;
  --dry: #4ADE80;
  --wet: #4FB8F5;
  --unsure: #FFC53D;
  --skin: #9AB86B;
  --raincoat: #E2603A;
  --stroke: rgba(245, 236, 217, 0.12);
  --stroke-strong: rgba(255, 197, 61, 0.26);
  --radius-card: 14px;
  --radius-btn: 16px;
  --radius-chip: 10px;
  --shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
  --rune: var(--accent);
  --wall: rgba(245, 236, 217, 0.028);
  --glow: rgba(255, 197, 61, 0.19);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

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

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

/* 地城石牆：極低對比的橫向石板線，Dark 才明顯 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 42% at 50% -6%, var(--glow), transparent 70%),
    repeating-linear-gradient(0deg, var(--wall) 0 1px, transparent 1px 68px),
    repeating-linear-gradient(90deg, var(--wall) 0 1px, transparent 1px 132px);
}

body > * { position: relative; z-index: 1; }

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding-inline: 20px;
}

section { padding-block: 62px; }

/* ---------- 符文小標 ---------- */
.rune {
  font-family: "Cinzel", var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--rune);
  margin: 0 0 14px;
}

h1, h2, h3 { font-family: var(--display); line-height: 1.22; margin: 0; }

h2 {
  font-size: clamp(26px, 4.4vw, 34px);
  font-weight: 900;
  letter-spacing: .01em;
  margin-bottom: 14px;
}

.lede { color: var(--muted); max-width: 40em; margin: 0 0 34px; }

/* ---------- 頂列 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 20px;
}

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

.brand img { width: 34px; height: 34px; border-radius: 9px; }

.topnav { display: flex; align-items: center; gap: 6px; }

.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 11px;
  border-radius: var(--radius-chip);
}

.topnav a:hover { color: var(--text); background: var(--card); }

.skin-toggle {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-chip);
  padding: 7px 13px;
  cursor: pointer;
  white-space: nowrap;
}

.skin-toggle:hover { border-color: var(--stroke-strong); }

/* ---------- hero ---------- */
.hero { padding-block: 40px 70px; text-align: center; }

.hero-icon {
  width: 108px;
  height: 108px;
  border-radius: 26px;
  margin: 0 auto 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
}

.hero h1 {
  font-size: clamp(40px, 8.4vw, 68px);
  font-weight: 900;
  letter-spacing: .02em;
  margin-bottom: 18px;
}

.hero p {
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 19px);
  max-width: 30em;
  margin: 0 auto 32px;
}

/* ---------- App Store 按鈕 ---------- */
.store-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  padding: 15px 30px 15px 25px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform .12s ease, filter .12s ease;
}

.store-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }

.store-btn svg { width: 29px; height: 29px; fill: currentColor; flex: none; }

.store-btn .label { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }

.store-btn .label small { font-size: 11px; font-weight: 500; opacity: .8; }

.store-btn .label strong { font-size: 20px; font-family: var(--display); font-weight: 900; }

.store-note { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- 三態 ---------- */
.verdicts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.verdict {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 34px 20px 30px;
  text-align: center;
  box-shadow: var(--shadow);
}

.verdict .word {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(38px, 6.2vw, 54px);
  letter-spacing: .06em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.verdict.dry .word { color: var(--dry); }
.verdict.wet .word { color: var(--wet); }
.verdict.unsure .word { color: var(--unsure); }

.verdict p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* ---------- 功能格 ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  box-shadow: var(--shadow);
}

.feature .num {
  font-family: "Cinzel", var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--rune);
  display: block;
  margin-bottom: 8px;
}

.feature h3 { font-size: 18px; font-weight: 900; margin-bottom: 6px; }

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

/* ---------- 承諾 ---------- */
.vows { display: grid; gap: 10px; }

.vow {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--skin);
  border-radius: var(--radius-card);
  padding: 20px 22px;
}

.vow h3 { font-size: 17px; font-weight: 900; margin-bottom: 5px; }

.vow p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- 兩張臉 ---------- */
.faces { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.face {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}

.face img { width: 62px; height: 62px; border-radius: 15px; flex: none; border: 1px solid var(--stroke); }

.face h3 { font-size: 17px; font-weight: 900; margin-bottom: 4px; }

.face p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* 兩張臉各自穿自己的皮：圓角、框線、色票都照 app 的 DS.Skin 差異 */
.face--light {
  background: #FFFFFF;
  color: #0F1F33;
  border: 1px solid rgba(15, 31, 51, .10);
  border-radius: 20px;
}

.face--light p { color: #5C6B7F; }
.face--light img { border-radius: 15px; border-color: rgba(15, 31, 51, .10); }

.face--dark {
  background: #221B12;
  color: #F5ECD9;
  border: 1px solid rgba(255, 197, 61, .26);
  border-radius: 10px;
}

.face--dark p { color: #B7A98C; }
.face--dark h3 { font-family: "Cinzel", var(--display); letter-spacing: .04em; }
.face--dark img { border-radius: 9px; border-color: rgba(255, 197, 61, .2); }

.face .skin-tag {
  display: inline-block;
  font-family: "Cinzel", var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: 4px;
}

/* ---------- FAQ / 支援 ---------- */
.faq { display: grid; gap: 10px; }

.faq details {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 4px 22px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding-block: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.faq summary::after { content: "＋"; color: var(--rune); font-weight: 400; }

.faq details[open] summary::after { content: "－"; }

.faq details p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }

.contact-card {
  background: var(--card);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-card);
  padding: 26px 24px;
  margin-top: 12px;
}

.contact-card p { margin: 0 0 6px; }

.contact-card a { color: var(--text); font-weight: 700; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--stroke);
  padding-block: 34px 48px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: space-between; }

.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

.footer-links a { text-decoration: none; }

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

/* ---------- 法務頁排版 ---------- */
.doc { padding-block: 40px 72px; }

.doc h1 { font-size: clamp(30px, 6vw, 42px); font-weight: 900; margin-bottom: 10px; }

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

.doc h2 {
  font-size: 22px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--stroke);
}

.doc h3 { font-size: 17px; font-weight: 900; margin-top: 26px; margin-bottom: 4px; }

.doc p, .doc li { color: var(--text); font-size: 16px; }

.doc ul { padding-left: 1.3em; }

.doc li { margin-bottom: 8px; }

.doc strong { font-weight: 700; }

.doc .callout {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--raincoat);
  border-radius: var(--radius-card);
  padding: 18px 22px;
  margin: 24px 0;
}

.doc .callout p { margin: 0; font-size: 15.5px; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 15px;
}

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

.doc th { color: var(--rune); font-weight: 700; font-size: 13px; letter-spacing: .04em; }

.doc .table-scroll { overflow-x: auto; }

.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 26px; }

.back-link:hover { color: var(--text); }

/* ---------- RWD ---------- */
@media (max-width: 760px) {
  section { padding-block: 56px; }
  .verdicts, .features, .faces { grid-template-columns: 1fr; }
  .topnav a { padding: 6px 8px; }
  .brand span { display: none; }
}

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

/* ---------- 聯絡表單 ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 7px;
}

.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea { min-height: 148px; resize: vertical; line-height: 1.65; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--skin);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--skin) 22%, transparent);
}

.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }

.honey { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.submit-btn {
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 30px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.submit-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }

.submit-btn:disabled { opacity: .55; cursor: progress; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.form-foot .note { color: var(--muted); font-size: 13px; margin: 0; }

.form-status {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  line-height: 1.6;
  border: 1px solid var(--stroke-strong);
}

.form-status[data-state="ok"] { border-left: 4px solid var(--dry); color: var(--text); }
.form-status[data-state="err"] { border-left: 4px solid var(--raincoat); color: var(--text); }
.form-status[hidden] { display: none; }

/* ---------- 微互動 ---------- */
.verdict, .feature, .face { transition: transform .16s ease, border-color .16s ease; }

.verdict:hover, .feature:hover { transform: translateY(-2px); border-color: var(--stroke-strong); }
