/* ============================================================
   幸運之星 · 內頁（免費四種命盤、會員）
   沿用 styles.css 的色票、字體、雙框金線卡片；本檔只補內頁元件。
   ============================================================ */
:root {
  --ink: #1c275b;
  --ink-soft: #3a4370;
  --line: #e4d6b6;
  --line-soft: #efe6d2;
  --field: #fffefb;
  --field-line: #d9c9a5;
  --danger: #a3413a;
  --danger-bg: #fbeeec;
  --ok: #3d7358;
  --ok-bg: #edf5f0;
  --notice-bg: #fbf4e3;
  --lu: #3d7358;
  --quan: #5a4591;
  --ke: #2d6490;
  --ji: #a3413a;
  --wood: #3d7358;
  --fire: #b0503f;
  --earth: #9a7432;
  --metal: #7d8290;
  --water: #2f5a8c;
}

/* 元件自己的 display 會蓋過 hidden 屬性，統一在這裡補回來 */
[hidden] { display: none !important; }

/* 內容較少的頁面，頁尾也要貼齊視窗底部 */
body[data-subpage] .page-frame { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.subpage { position: relative; flex: 1 0 auto; padding: 42px 0 72px; }
.subpage .content-width { width: 88.6%; max-width: 1180px; }
.narrow { width: 88.6%; max-width: 760px; margin-inline: auto; }

/* ---------- 頁首標題 ---------- */
.page-intro { width: 88.6%; max-width: 820px; margin: 0 auto 34px; text-align: center; }
.page-intro .eyebrow-line { font-size: 13px; font-weight: 700; letter-spacing: .28em; color: var(--gold); }
.page-intro h1 { margin-top: 8px; font-size: clamp(28px, 3vw, 40px); line-height: 1.35; font-weight: 700; text-wrap: balance; }
.page-intro .lead { margin-top: 12px; font-size: 18px; line-height: 1.75; color: var(--muted); text-wrap: pretty; }
.page-intro .rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px auto 0; width: min(320px, 70%); }
.page-intro .rule::before, .page-intro .rule::after { content: ''; flex: 1; height: 1px; background: var(--gold-light); }
.page-intro .rule i { width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }

/* ---------- 步驟 ---------- */
.steps { display: flex; justify-content: center; gap: 0; list-style: none; margin: 0 auto 28px; padding: 0; width: 88.6%; max-width: 760px; }
.steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--muted); text-align: center; }
.steps li + li::before { content: ''; position: absolute; top: 16px; right: 50%; width: 100%; height: 1px; background: var(--line); z-index: 0; }
.steps b { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--field-line); border-radius: 50%; background: #fff; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps li.is-done b, .steps li.is-now b { border-color: var(--gold); background: var(--gold); color: #fff; }
.steps li.is-now, .steps li.is-done { color: var(--ink); }

/* ---------- 卡片、表單 ---------- */
.form-card { padding: 34px 40px 32px; background: #fffdf9f7; }
.form-card > * { position: relative; z-index: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 22px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label, .field .label { font-size: 16px; font-weight: 700; color: var(--ink); }
.field .optional { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--muted); }
.input {
  width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid var(--field-line); border-radius: 12px;
  background: var(--field); color: var(--ink); font: inherit; font-size: 17px; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #9a9db0; }
.input:hover { border-color: #c9b27e; }
.input:focus { outline: none; border-color: #7560ac; box-shadow: 0 0 0 3px #7560ac2e; }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px #a3413a1f; }
input[type="date"].input, input[type="time"].input { appearance: none; -webkit-appearance: none; }
.hint { font-size: 14px; line-height: 1.65; color: var(--muted); }
.error-text { font-size: 14px; line-height: 1.5; color: var(--danger); }
.error-text:empty { display: none; }

fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.field > legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; }
fieldset.field > legend + * { clear: both; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #9c7a3a 50%), linear-gradient(135deg, #9c7a3a 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.date-selects { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.time-selects { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.time-selects .input { width: 108px; }
.time-selects .colon { font-size: 20px; font-weight: 700; color: var(--muted); }
.shichen { font-size: 16px; font-weight: 700; color: var(--purple); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; }
.pw-rules li::before { content: ''; width: 7px; height: 7px; border: 1px solid #b9ae95; transform: rotate(45deg); }
.pw-rules li.is-met { color: var(--ok); font-weight: 700; }
.pw-rules li.is-met::before { background: var(--ok); border-color: var(--ok); }
.member-banner { margin-bottom: 20px; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.segmented label { position: relative; display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-height: 50px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--field); font-size: 17px; font-weight: 700; color: var(--ink-soft); transition: background .15s, border-color .15s, color .15s; }
.segmented input:checked + span { border-color: var(--gold); background: #f8ecd0; color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.segmented input:focus-visible + span { outline: 3px solid #7560ac; outline-offset: 2px; }
.segmented.is-invalid span { border-color: var(--danger); }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 84px; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 700; color: var(--purple); }
.password-toggle:hover { background: #f3eefb; }

.combo { position: relative; }
.combo-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 16px 34px #1c275b1f; }
.combo-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; font-size: 16px; cursor: pointer; }
.combo-list li small { font-size: 13px; color: var(--muted); white-space: nowrap; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: #f8f0dd; }
.combo-list .combo-empty { cursor: default; color: var(--muted); font-size: 14px; }
.combo-list .combo-empty:hover { background: none; }
.place-meta { font-size: 14px; line-height: 1.65; color: var(--muted); }
.place-meta b { color: var(--ink); }

.form-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 30px; text-align: center; }
.form-actions .cta-button { min-width: min(100%, 320px); }
.privacy-line { max-width: 34em; font-size: 14px; line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.form-footnote { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: 15px; line-height: 1.7; color: var(--muted); text-align: center; }
.form-footnote a { color: var(--purple); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

button.cta-button { cursor: pointer; }
.cta-button[disabled], .ghost-button[disabled] { opacity: .6; cursor: progress; transform: none; }
.ghost-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  border: 1px solid #d3b574; border-radius: 999px; background: #fffaf0; color: var(--ink);
  font-size: 16px; font-weight: 700; letter-spacing: .04em; transition: background .15s, transform .15s;
}
.ghost-button:hover { background: #f8ecd2; }
.text-link { color: var(--purple); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.notice { position: relative; display: block; padding: 14px 18px 14px 40px; border-radius: 14px; background: var(--notice-bg); border: 1px solid #ecd9ab; font-size: 15px; line-height: 1.7; color: var(--ink-soft); overflow-wrap: anywhere; }
.notice::before { content: ''; position: absolute; left: 19px; top: 23px; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.notice.is-error { background: var(--danger-bg); border-color: #efc9c3; color: #7e2f29; }
.notice.is-error::before { background: var(--danger); }
.notice.is-ok { background: var(--ok-bg); border-color: #c7dfd0; color: #2c5a44; }
.notice.is-ok::before { background: var(--ok); }
.notice a, .notice button.text-link { color: inherit; }
.notice button.text-link { padding: 0; background: none; font-size: inherit; }

.status-card { padding: 40px 40px 36px; text-align: center; background: #fffdf9f7; }
.status-card > * { position: relative; z-index: 1; }
.status-card h2 { font-size: 26px; line-height: 1.4; }
.status-card p { margin-top: 12px; font-size: 17px; line-height: 1.8; color: var(--muted); text-wrap: pretty; }
.status-card .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.status-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: #f8ecd0; border: 1px solid var(--gold-light); }
.status-mark::before { content: ''; width: 16px; height: 16px; background: var(--gold); transform: rotate(45deg); }
.status-mark.is-ok { background: var(--ok-bg); border-color: #c7dfd0; }
.status-mark.is-ok::before { width: 12px; height: 22px; background: none; border: solid var(--ok); border-width: 0 4px 4px 0; transform: translateY(-3px) rotate(45deg); }
.status-mark.is-error { background: var(--danger-bg); border-color: #efc9c3; }
.status-mark.is-error::before { background: var(--danger); }
.dev-link { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--field-line); border-radius: 12px; font-size: 13px; line-height: 1.6; color: var(--muted); word-break: break-all; text-align: left; }

/* ---------- 內頁頁尾 ---------- */
.site-footer { position: relative; padding: 30px 7.3% 36px; border-top: 1px solid #ecddb7; background: linear-gradient(#faf8fd, #f4f1f9); text-align: center; }
.site-footer p { font-size: 14px; line-height: 1.8; color: var(--muted); }
.site-footer .footer-brand { font-size: 16px; font-weight: 700; letter-spacing: .12em; color: var(--ink); }

/* ============================================================
   命盤結果
   ============================================================ */
.results { margin-top: 44px; scroll-margin-top: 20px; }
.result-head { padding: 28px 34px; background: #fffdf9f7; }
.result-head > * { position: relative; z-index: 1; }
.result-head-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.result-head h2 { font-size: 28px; line-height: 1.35; }
.result-head .eyebrow-line { font-size: 13px; font-weight: 700; letter-spacing: .24em; color: var(--gold); }
.birth-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 22px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line-soft); }
.birth-facts div { min-width: 0; }
.birth-facts dt { font-size: 13px; letter-spacing: .08em; color: var(--muted); }
.birth-facts dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-notes { display: grid; gap: 8px; margin-top: 16px; }

.system-nav { position: sticky; top: 0; z-index: 15; display: flex; justify-content: center; gap: 8px; margin: 22px auto 0; padding: 10px 12px; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; background: #fffdf9eb; backdrop-filter: blur(6px); box-shadow: 0 8px 20px #1c275b12; }
.system-nav a { flex-shrink: 0; padding: 8px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.system-nav a:hover, .system-nav a:focus-visible { background: #f8ecd0; color: var(--ink); }

.system { margin-top: 26px; padding: 30px 34px 34px; background: #fffdf9f7; scroll-margin-top: 80px; }
.system > * { position: relative; z-index: 1; }
.system-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.system-head h2 { font-size: 28px; line-height: 1.3; }
.system-head .en { font-size: 12px; font-weight: 700; letter-spacing: .24em; color: var(--gold); }
.system-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 30px; margin-top: 24px; align-items: start; }
.system-body.is-stacked { grid-template-columns: minmax(0, 1fr); }
.subhead { margin: 24px 0 10px; font-size: 17px; font-weight: 700; color: var(--ink); }
.subhead:first-child { margin-top: 0; }
.subnote { font-size: 13px; line-height: 1.6; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line-soft); }
.facts div { padding: 11px 4px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.facts dt { font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-size: 17px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.facts dd small { font-size: 14px; font-weight: 400; color: var(--muted); }
.facts .wide { grid-column: 1 / -1; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid #e2cda2; border-radius: 999px; background: #f8f0e1; font-size: 14px; font-weight: 700; color: var(--ink-soft); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.data-table th { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.data-table td.num { text-align: right; }
.data-table .retro { color: var(--ji); font-weight: 700; }

/* 長條：五行、元素、三態 */
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) 2.4em; align-items: center; gap: 10px; font-size: 15px; }
.bar-row .bar-label { font-weight: 700; }
.bar-track { position: relative; height: 10px; border-radius: 999px; background: #f1ead9; overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #d8b366, #bd9147); }
.bar-row .bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 紫微十二宮 ---------- */
.ziwei-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.ziwei-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(132px, auto)); min-width: 560px; border: 1px solid var(--field-line); border-radius: 14px; overflow: hidden; background: #fff; }
.zw-cell { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 8px 8px 6px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.zw-cell.is-ming { background: #fbf2dc; }
.zw-cell.col-4 { border-right: 0; }
.zw-cell.row-4 { border-bottom: 0; }
.zw-main { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 16px; font-weight: 700; line-height: 1.45; color: var(--ink); }
.zw-main .none { font-weight: 400; font-size: 13px; color: #a3a6b6; }
.zw-hua { display: inline-block; margin-left: 2px; padding: 0 4px; border-radius: 4px; font-size: 11px; line-height: 17px; color: #fff; vertical-align: 2px; }
.zw-hua.lu { background: var(--lu); }
.zw-hua.quan { background: var(--quan); }
.zw-hua.ke { background: var(--ke); }
.zw-hua.ji { background: var(--ji); }
.zw-minor { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.zw-minor .sha { color: #8f4a52; }
.zw-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; margin-top: auto; padding-top: 6px; }
.zw-name { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.zw-name .shen { display: block; font-size: 11px; font-weight: 700; color: var(--purple); }
.zw-cell.is-ming .zw-name { color: #8a6424; }
.zw-meta { text-align: right; font-size: 12px; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; }
.zw-meta span { display: block; white-space: nowrap; }
.zw-center { grid-column: 2 / 4; grid-row: 2 / 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: radial-gradient(circle at 50% 40%, #fdf8ec, #fbf6ea 60%, #f6efdf); text-align: center; }
.zw-center strong { font-size: 20px; line-height: 1.4; }
.zw-center p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.zw-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.zw-legend span { display: inline-flex; align-items: center; gap: 5px; }
.zw-legend .sha-sample { font-weight: 700; color: #8f4a52; }

/* ---------- 八字四柱 ---------- */
.pillars { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: center; }
.pillars th { padding: 8px 4px; font-size: 14px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.pillars th[scope="row"] { width: 4.4em; text-align: left; font-size: 13px; }
.pillars td { padding: 8px 4px; border-bottom: 1px solid var(--line-soft); font-size: 14px; line-height: 1.5; vertical-align: middle; }
.pillars .is-day { background: #fbf2dc; }
.pillars .gz { display: block; font-size: 34px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.el { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 18px; font-weight: 700; color: #fff; }
.el.木 { background: var(--wood); }
.el.火 { background: var(--fire); }
.el.土 { background: var(--earth); }
.el.金 { background: var(--metal); }
.el.水 { background: var(--water); }
.hidden-stems { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.hidden-stems span b { font-size: 15px; color: var(--ink); }
.hidden-stems span { color: var(--muted); }
.luck-list { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.luck-list li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 1px solid var(--line-soft); border-radius: 10px; background: #fff; }
.luck-list b { font-size: 17px; letter-spacing: .02em; writing-mode: horizontal-tb; }
.luck-list span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 星盤與人類圖 SVG ---------- */
.chart-figure { margin: 0; }
.chart-figure svg { display: block; width: 100%; height: auto; max-width: 520px; margin: 0 auto; }
.chart-figure figcaption { margin-top: 10px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted); }
.svg-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.svg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.svg-legend i { display: inline-block; width: 22px; height: 0; border-top: 2px solid; }
.svg-legend i.harmony { border-color: #4f78b0; }
.svg-legend i.tension { border-color: #b35a4c; border-top-style: dashed; }
.svg-legend i.conj { border-color: #ba8f41; }
.svg-legend i.defined { border-top-width: 5px; border-color: #c99b46; }
.svg-legend i.open { border-top-width: 3px; border-color: #e3dccd; }

.aspect-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; padding: 0; list-style: none; }
.aspect-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.aspect-list li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.gate-table td:nth-child(2), .gate-table td:nth-child(3), .gate-table th:nth-child(2), .gate-table th:nth-child(3) { text-align: center; }
.gate-table .p { color: var(--ink); font-weight: 700; }
.gate-table .d { color: #a3413a; font-weight: 700; }

/* ---------- 是否儲存 ---------- */
.save-bar { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; align-items: center; gap: 18px; width: min(760px, calc(100% - 32px)); padding: 14px 16px 14px 24px; transform: translateX(-50%); border: 1px solid #d3b574; border-radius: 22px; background: #fffdf8f5; backdrop-filter: blur(8px); box-shadow: 0 18px 40px #1c275b2b; }
.save-bar .save-copy { flex: 1; min-width: 0; }
.save-bar strong { display: block; font-size: 18px; line-height: 1.4; }
.save-bar p { font-size: 14px; line-height: 1.55; color: var(--muted); }
.save-bar .save-actions { display: flex; gap: 10px; flex-shrink: 0; }
.save-bar .cta-button { min-height: 48px; padding: 0 22px; font-size: 16px; letter-spacing: .04em; }
.save-bar .cta-button::before, .save-bar .cta-button::after { display: none; }
.save-bar .ghost-button { min-height: 48px; padding: 0 20px; }
.save-bar-spacer { height: 110px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 我的命盤 ---------- */
.member-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 26px 30px; background: #fffdf9f7; }
.member-head > * { position: relative; z-index: 1; }
.member-head h2 { font-size: 24px; line-height: 1.4; }
.member-head p { font-size: 15px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.chart-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 22px 0 0; padding: 0; list-style: none; }
.chart-item { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; background: #fffdf9f7; }
.chart-item > * { position: relative; z-index: 1; }
.chart-item h3 { font-size: 19px; line-height: 1.45; overflow-wrap: anywhere; }
.chart-item dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 15px; line-height: 1.6; }
.chart-item dt { color: var(--muted); }
.chart-item dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.chart-item .ghost-button { align-self: flex-start; margin-top: 4px; }
.empty-state { margin-top: 22px; padding: 34px 24px; text-align: center; background: #fffdf9f7; }
.empty-state > * { position: relative; z-index: 1; }
.empty-state p { font-size: 16px; line-height: 1.8; color: var(--muted); margin-bottom: 18px; }

.loading-line { padding: 40px 0; text-align: center; font-size: 16px; color: var(--muted); }

/* ============================================================
   響應式
   ============================================================ */
@media (max-width: 1199px) {
  .system-body { grid-template-columns: minmax(0, 1fr); }
  .chart-figure svg { max-width: 480px; }
}
@media (max-width: 900px) {
  .birth-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .luck-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .subpage { padding: 30px 0 56px; }
  .page-intro { margin-bottom: 24px; }
  .page-intro .lead { font-size: 16px; }
  .steps li { font-size: 13px; }
  .form-card { padding: 24px 18px 24px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .status-card { padding: 30px 20px; }
  .result-head { padding: 22px 18px; }
  .result-head h2 { font-size: 23px; }
  .birth-facts dd { font-size: 16px; }
  .system { padding: 22px 16px 24px; margin-top: 20px; }
  .system-head h2 { font-size: 23px; }
  .system-nav { top: 0; border-radius: 16px; width: 100%; justify-content: flex-start; }
  .system-nav a { padding: 7px 12px; font-size: 14px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .aspect-list { grid-template-columns: minmax(0, 1fr); }
  .pillars .gz { font-size: 27px; }
  .pillars th[scope="row"] { width: 3.6em; }
  /* 紫微盤在手機上直接塞進螢幕寬度，不需要左右滑動 */
  .ziwei-board { min-width: 0; grid-template-rows: repeat(4, minmax(112px, auto)); border-radius: 10px; }
  .zw-cell { padding: 5px 4px 4px; }
  .zw-main { gap: 0 3px; font-size: 13px; line-height: 1.35; }
  .zw-main .none { font-size: 10.5px; }
  .zw-hua { margin-left: 1px; padding: 0 2px; font-size: 9.5px; line-height: 14px; vertical-align: 1px; }
  .zw-minor { gap: 0 3px; margin-top: 2px; font-size: 10.5px; line-height: 1.45; }
  .zw-foot { flex-direction: column; align-items: flex-start; gap: 1px; padding-top: 4px; }
  .zw-name { font-size: 11.5px; }
  .zw-name .shen { display: inline; margin-left: 2px; font-size: 10px; }
  .zw-meta { text-align: left; font-size: 10px; }
  .zw-meta span { display: inline; }
  .zw-meta span + span { margin-left: 3px; }
  .zw-center { padding: 8px; gap: 4px; }
  .zw-center strong { font-size: 15px; }
  .zw-center p { font-size: 11.5px; line-height: 1.5; }
  .zw-legend { font-size: 12px; }
  .save-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; border-radius: 18px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .save-bar .save-actions { display: grid; grid-template-columns: 1fr 1.4fr; }
  .save-bar .cta-button, .save-bar .ghost-button { width: 100%; padding: 0 12px; }
  .save-bar-spacer { height: 170px; }
  .member-head { padding: 20px 18px; }
  .chart-item { padding: 20px 18px; }
}
@media (max-width: 374px) {
  .luck-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillars .gz { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .system-nav { backdrop-filter: none; }
}
