/* 知命八字 — 單人深度命書（solo）樣式
   亮色、莊重、好讀、適合列印。標題 Noto Serif TC、內文 Noto Sans TC。
   本檔為新增檔，不覆蓋 css/style.css（深色排盤頁）。 */

:root {
  --paper: #f6f1e7;      /* 頁面：暖米白 */
  --card: #fffdf8;       /* 卡片：更亮的紙面 */
  --card-soft: #f3ecdd;  /* 次級底（藏干、時間軸格） */
  --ink: #2b2620;        /* 主文字：暖黑 */
  --ink-soft: #6b6252;   /* 次要文字 */
  --ink-faint: #9c927f;  /* 更淡 */
  --gold: #a6842c;       /* 金：亮底可讀 */
  --gold-deep: #856820;
  --line: #e3d9c4;       /* 邊線 / 分隔 */
  --line-soft: #efe8d8;
  --seal: #b1362f;       /* 印泥紅，點綴用 */
  --radius: 14px;
  --wx-jin: #b8912a;
  --wx-mu: #4b8b3b;
  --wx-shui: #3a6ea5;
  --wx-huo: #c0492f;
  --wx-tu: #9c7b3a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  line-height: 1.85;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .report-title,
.pillar-gan, .pillar-zhi, .aspect-heading, .yun-step-gz, .ln-gz {
  font-family: 'Noto Serif TC', 'Noto Sans TC', serif;
}

main { max-width: 760px; margin: 0 auto; padding: 0 18px 56px; }

a { color: var(--gold-deep); }

/* ---------- Header ---------- */
.site-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.brand { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.2em; color: var(--ink); }
.brand span { color: var(--gold); }

/* 語言切換器（三語）：沿用專案 .lang-chip 慣例，套亮色命書主題 */
.lang-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-chip {
  font: inherit; font-size: 0.82rem; line-height: 1;
  padding: 8px 12px; min-height: 34px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-soft);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.lang-chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.lang-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 520px) { .site-header { justify-content: center; } }

/* ---------- 產品開場 ---------- */
.product-intro { text-align: center; padding: 44px 0 26px; }
.product-intro h1 {
  font-size: 2.15rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--ink); margin-bottom: 14px;
}
.product-intro h1 b { color: var(--gold); font-weight: 700; }
.intro-sub { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 10px; }
.intro-privacy { font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  margin-bottom: 20px;
  text-align: left;
  box-shadow: 0 1px 3px rgba(80, 66, 40, 0.05);
}
.card > h2 {
  font-size: 1.2rem; color: var(--gold-deep); margin-bottom: 16px;
  letter-spacing: 0.06em; font-weight: 700;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 10px;
}

/* ---------- 表單 ---------- */
.form-card { max-width: 560px; margin: 0 auto; }
.form-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.form-label {
  flex: 0 0 3.2em; font-weight: 500; color: var(--gold-deep);
  letter-spacing: 0.15em; font-size: 0.95rem;
}
input[type="text"], input[type="number"], input[type="time"], select {
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 12px; font-size: 1rem; font-family: inherit;  /* 16px：手機不觸發自動放大 */
  flex: 1; min-width: 90px; min-height: 46px;                 /* 觸控目標 ≥44px */
}
input[type="text"]:focus, input[type="number"]:focus, input[type="time"]:focus, select:focus {
  outline: 2px solid var(--gold); border-color: transparent;
}
.inp-year { flex: 0 1 7.5em; min-width: 6em; text-align: center; }
/* 年份用純數字鍵盤、不顯示上下微調鈕（避免誤觸、視覺乾淨） */
.inp-year::-webkit-outer-spin-button, .inp-year::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inp-year { -moz-appearance: textfield; appearance: textfield; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 1rem; }
.radio input { accent-color: var(--gold); width: 17px; height: 17px; }
.check-line { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 0.92rem; color: var(--ink-soft); }
.check-line input { accent-color: var(--gold); width: 17px; height: 17px; margin-top: 4px; }
.form-hint { font-size: 0.8rem; color: var(--ink-faint); }
.form-error { color: var(--seal); font-size: 0.92rem; margin-bottom: 12px; font-weight: 500; }

#precise-fields { width: 100%; margin: 4px 0 4px; padding: 14px; background: var(--card-soft); border-radius: 10px; }
#precise-fields .form-row:last-child { margin-bottom: 0; }
#precise-fields .form-hint { margin-top: 4px; }

.btn-primary {
  display: block; width: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fffdf5; font-weight: 700; font-size: 1.1rem;
  border: none; border-radius: 10px; padding: 14px;
  cursor: pointer; letter-spacing: 0.12em;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(166, 132, 44, 0.28); }
.btn-primary:disabled { opacity: 0.7; cursor: default; transform: none; box-shadow: none; }

.btn-ghost {
  background: #fff; color: var(--gold-deep);
  border: 1px solid var(--gold); border-radius: 10px;
  padding: 12px 20px; font-size: 1rem; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.btn-ghost:hover { background: var(--card-soft); transform: translateY(-1px); }

/* ---------- 命書標題 ---------- */
.report-head { text-align: center; padding: 8px 0 4px; }
.report-title {
  font-size: 1.9rem; font-weight: 700; color: var(--ink);
  letter-spacing: 0.05em; margin-bottom: 6px;
}
.report-sub { color: var(--ink-soft); font-size: 0.9rem; }
.report-sub b { color: var(--gold-deep); }
.solar-note {
  margin-top: 10px; font-size: 0.85rem; color: var(--ink-soft);
  background: var(--card-soft); border-radius: 8px; padding: 8px 12px;
  display: inline-block;
}

/* ---------- 命盤 ---------- */
.basic-info { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 18px; }
.basic-info b { color: var(--gold-deep); }
.pillars { display: grid; gap: 10px; margin-bottom: 10px; }
.pillars.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pillars.cols-4 { grid-template-columns: repeat(4, 1fr); }
.pillar {
  background: var(--card-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 6px; text-align: center;
}
.pillar-label { font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 4px; }
.pillar-shishen { font-size: 0.78rem; color: var(--seal); margin-bottom: 8px; }
.pillar-gan, .pillar-zhi { font-size: 1.9rem; font-weight: 700; line-height: 1.3; }
.pillar-gan { color: var(--gold-deep); }
.pillar-zhi { color: var(--ink); }
.pillar-hide { font-size: 0.75rem; color: var(--ink-faint); margin-top: 8px; }
.hour-note { font-size: 0.82rem; color: var(--ink-faint); margin-top: 4px; }

/* ---------- 五行 ---------- */
.wuxing-bars { margin-bottom: 6px; }
.wx-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.wx-name { flex: 0 0 1.2em; font-weight: 700; font-size: 1.1rem; }
.wx-track { flex: 1; height: 12px; background: var(--card-soft); border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; }
.wx-bar { height: 100%; border-radius: 6px; transition: width 0.6s ease; }
.wx-count { flex: 0 0 1.5em; text-align: right; color: var(--ink-soft); font-size: 0.9rem; }
.wx-summary { color: var(--ink-soft); font-size: 0.9rem; margin-top: 10px; }
.wx-summary b { color: var(--gold-deep); }

/* ---------- 大運／流年 ---------- */
.yun-steps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; -webkit-overflow-scrolling: touch; }
.yun-step {
  flex: 0 0 auto; min-width: 66px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--card-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 8px; cursor: pointer;
  color: var(--ink); font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.yun-step:hover { transform: translateY(-1px); border-color: var(--gold); }
.yun-step-shishen { font-size: 0.72rem; color: var(--seal); }
.yun-step-gz { font-size: 1.35rem; line-height: 1.2; }
.yun-step-gz b { color: var(--gold-deep); font-weight: 700; }
.yun-step-age { font-size: 0.72rem; color: var(--ink-soft); }
.yun-step-year { font-size: 0.68rem; color: var(--ink-faint); }
.yun-step.is-now { border-color: var(--gold); }
.yun-step.is-selected { background: rgba(166, 132, 44, 0.14); border-color: var(--gold-deep); box-shadow: 0 0 0 1px var(--gold) inset; }

.liunian-title { color: var(--gold-deep); font-size: 0.95rem; margin-bottom: 12px; letter-spacing: 0.03em; }
.liunian-title b { font-size: 1.1em; }
.liunian-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ln-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--card-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 4px; text-align: center;
}
.ln-year { font-size: 0.78rem; color: var(--ink-soft); }
.ln-gz { font-size: 1.05rem; line-height: 1.2; }
.ln-gz b { color: var(--gold-deep); font-weight: 700; }
.ln-shishen { font-size: 0.7rem; color: var(--seal); }
.ln-age { font-size: 0.68rem; color: var(--ink-faint); }
.ln-cell.is-now { border-color: var(--gold-deep); background: rgba(166, 132, 44, 0.14); }

/* ---------- 命書面向 ---------- */
.aspect {
  position: relative;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 26px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(80, 66, 40, 0.05);
}
.aspect-heading {
  font-size: 1.22rem; color: var(--gold-deep); font-weight: 700;
  letter-spacing: 0.05em; margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 10px;
}
.aspect-body p {
  color: var(--ink); font-size: 1.02rem; line-height: 1.95;
  text-indent: 2em; margin-bottom: 10px;
}
.aspect-body p:last-child { margin-bottom: 0; }

.aspect-free .free-tag {
  display: inline-block; font-size: 0.7rem; color: var(--gold-deep);
  border: 1px solid var(--gold); border-radius: 999px; padding: 1px 10px;
  margin-left: 8px; vertical-align: middle; letter-spacing: 0.08em; font-family: 'Noto Sans TC', sans-serif;
}

/* 上鎖面向：標題可見、內文模糊佔位 */
.aspect--locked .aspect-body { position: relative; min-height: 96px; }
.lock-faux { filter: blur(5px); user-select: none; pointer-events: none; opacity: 0.85; }
.lock-faux .bar { height: 13px; border-radius: 6px; background: var(--card-soft); margin-bottom: 12px; }
.lock-faux .bar.w1 { width: 96%; } .lock-faux .bar.w2 { width: 88%; } .lock-faux .bar.w3 { width: 92%; } .lock-faux .bar.w4 { width: 70%; }
.lock-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 253, 248, 0.85); border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 999px; padding: 6px 16px; font-size: 0.85rem;
  backdrop-filter: blur(1px);
}

/* 解鎖 CTA 帶 */
.unlock-cta {
  text-align: center; border: 1px solid var(--gold);
  background: linear-gradient(160deg, #fbf4e2, var(--card));
  border-radius: var(--radius); padding: 28px 24px; margin-bottom: 18px;
}
.unlock-cta .lock-icon { font-size: 2rem; margin-bottom: 6px; }
.unlock-cta h3 { font-size: 1.2rem; color: var(--ink); margin-bottom: 8px; letter-spacing: 0.04em; }
.unlock-cta p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 8px; }
.unlock-cta .price { color: var(--ink); margin-bottom: 16px; }
.unlock-cta .price b { color: var(--seal); font-size: 1.3em; }
.unlock-cta .price .strike { color: var(--ink-faint); text-decoration: line-through; margin-right: 8px; font-size: 0.9em; }
.unlock-cta .btn-primary { max-width: 360px; margin: 0 auto; }
.unlock-cta .cta-note { font-size: 0.78rem; color: var(--ink-faint); margin-top: 12px; margin-bottom: 0; }

/* ---------- 匯出列 ---------- */
.export-bar {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  padding: 8px 0 4px; margin-bottom: 8px;
}

/* ---------- 免責 ---------- */
.disclaimer { color: var(--ink-faint); font-size: 0.8rem; text-align: center; margin-top: 8px; line-height: 1.7; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 24px 16px 40px;
  text-align: center; color: var(--ink-faint); font-size: 0.8rem;
}
.site-footer p { margin-bottom: 4px; }

/* ---------- 流程指示（① 填資料 → ② 生成 → ③ 看報告） ---------- */
.step-flow {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  list-style: none; margin: 0 auto 16px; padding: 0; max-width: 560px;
  color: var(--ink-faint); font-size: 0.9rem; flex-wrap: wrap;
}
.step-flow li { display: flex; align-items: center; gap: 6px; }
.step-flow li:not(:last-child)::after { content: '›'; margin: 0 4px; color: var(--ink-faint); font-size: 1.2em; }
.step-flow .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--card-soft); border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 700; color: var(--ink-soft);
}
.step-flow li.is-active { color: var(--gold-deep); font-weight: 600; }
.step-flow li.is-active .step-num { background: var(--gold); border-color: var(--gold-deep); color: #fffdf5; }

/* ---------- 表單輔助 ---------- */
.field-hint { font-size: 0.8rem; color: var(--ink-faint); margin: -8px 0 14px; }

/* 性別／曆別＝好按的片狀選項（觸控目標大、選中有底色，一眼看出目前選了誰） */
.radio {
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; transition: border-color 0.15s, background 0.15s;
}
.radio:hover { border-color: var(--gold); }
.radio:has(input:checked) { border-color: var(--gold-deep); background: rgba(166, 132, 44, 0.12); }
.check-line { min-height: 44px; padding: 8px 0; }

/* 生成鈕：更大更醒目 */
.form-actions { margin-top: 8px; }
.btn-generate { min-height: 52px; font-size: 1.15rem; box-shadow: 0 4px 14px rgba(166, 132, 44, 0.22); }

/* 匯出鈕：桌機並排、手機直向滿寬 */
.export-bar .btn-primary { display: inline-block; width: auto; max-width: none; min-height: 46px; padding: 12px 22px; }
.export-bar .btn-ghost { min-height: 46px; }

/* 四柱：minmax(0,1fr) 防止長藏干撐爆版面（＝任何寬度都不產生橫向捲動） */
.pillars.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pillars.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pillar { min-width: 0; }
.pillar-hide { overflow-wrap: anywhere; }

/* ======== RWD：320 / 375 / 768 / 1024 / 1440 全順、無橫向捲動 ======== */

/* 手機（≤768）：標籤獨佔一行、生成鈕 sticky 於底方便單手按 */
@media (max-width: 768px) {
  .form-label { flex-basis: 100%; margin-bottom: 2px; }
  .form-actions {
    position: sticky; bottom: 8px; z-index: 20; padding-top: 10px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0) 0%, var(--card) 26%);
  }
  .export-bar { flex-direction: column; align-items: stretch; }
  .export-bar .btn-primary, .export-bar .btn-ghost { width: 100%; }
}

/* 一般手機（≤480） */
@media (max-width: 480px) {
  .product-intro { padding: 30px 0 18px; }
  .product-intro h1 { font-size: 1.7rem; }
  .card, .aspect { padding: 20px 16px; }
  .pillar-gan, .pillar-zhi { font-size: 1.5rem; }
  .liunian-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .ln-gz { font-size: 0.95rem; }
  .report-title { font-size: 1.5rem; }
  .aspect-body p { font-size: 0.98rem; }
  .pay-switch { max-width: none; }
  .unlock-cta { padding: 24px 16px; }
}

/* 小手機（≤380，如 iPhone SE／320 裝置）：四柱縮字保持一行可讀、不擠爆 */
@media (max-width: 380px) {
  main { padding-left: 14px; padding-right: 14px; }
  .pillars { gap: 6px; }
  .pillar { padding: 12px 3px; }
  .pillar-gan, .pillar-zhi { font-size: 1.32rem; }
  .pillar-shishen { font-size: 0.7rem; }
  .pillar-hide { font-size: 0.62rem; letter-spacing: -0.02em; }
  .pillar-label { font-size: 0.72rem; }
  .liunian-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 平板（768–1024）：維持單欄閱讀寬度，確保無橫向捲動 */
@media (min-width: 768px) and (max-width: 1024px) {
  main { max-width: 700px; }
}

/* 桌機大屏（≥1024）：略放寬但仍守長文可讀行寬 */
@media (min-width: 1024px) {
  main { max-width: 780px; }
  .product-intro { padding-top: 52px; }
}

/* ---------- 列印 / 存 PDF ----------
   目標：乾淨命書。表單/導覽/按鈕/未解鎖面向全部隱藏（無鎖圖殘留）；
   面向與命盤不被分頁切斷。 */
@media print {
  body { background: #fff; color: #000; }
  .no-print,
  .site-header, .product-intro, .form-card, #form-error,
  .unlock-cta, .export-bar, .site-footer, .faq { display: none !important; }

  /* 未解鎖（仍上鎖）的面向：付費內容不列印，避免殘留模糊圖 */
  .aspect--locked { display: none !important; }

  main { max-width: 100%; padding: 0; }
  .card, .aspect {
    box-shadow: none; border: 1px solid #d8d8d8;
    break-inside: avoid; page-break-inside: avoid;
  }
  .pillar, .ln-cell, .yun-step { break-inside: avoid; page-break-inside: avoid; }
  .lock-faux, .lock-badge { display: none !important; }
  .yun-steps { overflow: visible; flex-wrap: wrap; }
  .report-title, .aspect-heading, .card > h2 { color: #000; }
  .aspect-body p { color: #000; }
  a { color: #000; text-decoration: none; }
}

/* ---------- 付款分流（綠界 / PayPal）---------- */
.pay-switch { display: flex; gap: 10px; margin: 6px auto 16px; max-width: 360px; }
.pay-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 8px; cursor: pointer; font-family: inherit; font-size: 0.98rem;
  color: var(--ink); font-weight: 600; transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.pay-tab small { font-weight: 400; font-size: 0.72rem; color: var(--ink-faint); letter-spacing: 0; }
.pay-tab:hover { border-color: var(--gold); transform: translateY(-1px); }
.pay-tab.active { border-color: var(--gold-deep); background: rgba(166, 132, 44, 0.12); box-shadow: 0 0 0 1px var(--gold) inset; }
.unlock-cta .unlock-btn { display: inline-block; margin-top: 14px; }
.unlock-cta .pay-warn { color: var(--seal); font-size: 0.8rem; margin: 8px auto 0; max-width: 420px; }
.unlock-cta .pay-warn code { background: var(--card-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
