/* ==========================================================================
   回光 LightInward — 設計系統
   --------------------------------------------------------------------------
   全站唯一的一份樣式。頁面裡只留該頁獨有的幾行。

   ★ 為什麼要有這個檔案：功能是從三個專案搬來的（OneHeart 的會員、
     taiyidigital 的寄信、新寫的報告），每一頁各帶一套顏色與間距，
     使用者從登入頁走到報告頁像換了三個網站。
     設計系統的意義不是漂亮，是「同一件事在每一頁長得一樣」。

   概念：回光 —— 夜盡天明的那道光。
     紫微斗數源自星象，所以底是將亮未亮的夜空（靛墨），
     光是暖金（回光），紙是微暖的白。
   ========================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    /* 夜空 */
    --night:      #14122a;
    --night-2:    #1e1b3a;
    --night-3:    #2a2650;
    --night-line: rgba(255, 245, 214, .14);
    --night-text: #ece9f4;
    --night-mute: #a9a4c2;

    /* 紙 */
    --paper:   #fbfaf8;
    --paper-2: #f3f1f5;
    --paper-3: #ebe8f0;
    --ink:     #1c1a2e;
    --muted:   #625d78;
    --faint:   #9b96ad;
    --line:    #e4e1ec;
    --line-2:  #d3cfdc;

    /* 回光 */
    --glow:      #e8b954;
    --glow-soft: #f4dc9c;
    --glow-deep: #a67a1f;   /* 淺底上的金，對比夠讀 */
    --glow-wash: #fbf4e2;

    /* 語意：吉凶沿用傳統色，跟主色分開 */
    --good:      #c8553d;   /* 吉 · 硃砂 */
    --good-wash: #fbeae6;
    --bad:       #4f5b73;   /* 凶 · 石青 */
    --bad-wash:  #e9ecf1;
    --warn:      #b8882a;
    --warn-wash: #fbf1d8;
    --danger:    #b3423a;
    --danger-wash: #f7e6e4;

    /* 字 */
    --serif: "Noto Serif TC", "Songti TC", "PMingLiU", "Noto Serif CJK TC", serif;
    --sans:  "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
    --mono:  "SFMono-Regular", Consolas, "Roboto Mono", monospace;

    /* 尺度 */
    --measure: 42rem;          /* 內文寬度，約 40 個中文字 */
    --shell:   68rem;          /* 站台最大寬 */
    --r: 6px;
    --r-lg: 12px;
    --shadow: 0 1px 2px rgba(28, 26, 46, .06), 0 8px 24px -12px rgba(28, 26, 46, .18);
    --shadow-night: 0 30px 80px -30px rgba(0, 0, 0, .7);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* ★ hidden 屬性要贏過任何 display 規則。.btn 之類寫了 display:inline-flex 的元件，
   沒有這一條的話加了 hidden 還是會顯示（結果頁的「分享圖片」在桌機上就這樣露出來過）。 */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.8;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "palt";
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--glow-deep); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .01em;
    margin: 0;
    text-wrap: balance;
}
p { margin: 0; }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--glow-soft); color: var(--ink); }

.tnum { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny  { font-size: 13px; }

/* ── Type scale ─────────────────────────────────────────────────────────── */
.t-display { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.18; letter-spacing: .005em; }
.t-h1 { font-size: clamp(28px, 3.4vw, 36px); }
.t-h2 { font-size: clamp(22px, 2.6vw, 27px); }
.t-h3 { font-size: 19px; }
.t-lead { font-size: 17px; line-height: 1.9; color: var(--muted); }
.eyebrow {
    font-family: var(--sans); font-size: 12.5px; letter-spacing: .18em;
    color: var(--glow-deep); text-transform: uppercase; font-weight: 500;
}
.night .eyebrow { color: var(--glow); }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.measure { max-width: var(--measure); }
.center { margin-left: auto; margin-right: auto; }
.stack > * + * { margin-top: var(--gap, 16px); }

.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(251, 250, 248, .82);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header .shell { display: flex; align-items: center; gap: 26px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 26px; height: 26px; }
.brand .name { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: .2em; }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
/* ★ 通用的 a 規則一律排除 .btn：這兩條是 (0,1,1)，會贏過 .btn-primary / .btn-glow 的 (0,1,0)，
   結果站頭的「免費排盤」變成灰字配墨底、夜空裡的金按鈕變成淺金字配金底 ——
   hover 又正常是因為 .btn-*:hover 是 (0,2,0)。li.css 第五個「通用規則吃掉元件」的案例。 */
.site-nav a:not(.btn) { font-size: 14px; color: var(--muted); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--ink); }
.site-nav a.btn { padding: 8px 16px; font-size: 14px; }
.site-nav form { display: none; }
@media (max-width: 640px) { .site-nav { gap: 14px; } .site-nav .hide-sm { display: none; } }

.site-footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 13px; }
.site-footer .shell { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer .brand { margin-right: auto; }
.site-footer .brand .name { font-size: 15px; }
.site-footer .brand .mark { width: 18px; height: 18px; }
/* 交易主體。刻意比連結列再淡一階 —— 要看得到，但不跟導覽搶注意力 */
.site-footer .foot-operator { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }

/* 交易主體標示（_OperatorNotice.cshtml）。結帳、付款、完成頁各放一次 */
.op-notice { font-size: 12.5px; line-height: 1.85; color: var(--muted); margin: 0; }
.op-notice strong { color: var(--ink); font-weight: 600; }
.card .op-notice, .co-side .op-notice { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* 回 字標誌 */
.mark { display: inline-block; }
.mark .frame { fill: none; stroke: currentColor; stroke-width: 1.6; }
.mark .light { fill: var(--glow); }

/* ── Night panels（夜空區塊，星空畫在 canvas 上） ───────────────────── */
.night {
    position: relative; overflow: hidden;
    background: radial-gradient(120% 80% at 50% 0%, var(--night-3) 0%, var(--night-2) 45%, var(--night) 100%);
    color: var(--night-text);
}
.night a:not(.btn) { color: var(--glow-soft); }
.night .muted, .night .faint { color: var(--night-mute); }
.night .starfield, .kw-card .starfield { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.night > .shell, .night > .inner { position: relative; }
.night::after {
    /* 地平線上的那道光 */
    content: ""; position: absolute; left: 50%; bottom: -1px; width: min(1100px, 140%); height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, var(--glow) 35%, var(--glow-soft) 50%, var(--glow) 65%, transparent);
    opacity: .75;
}
.night.flat::after { display: none; }

/* 更深、更紫的夜空。分享頁與結果頁的主視覺用 —— 那兩處是會被截圖的，
   底色壓深、紫推足，關鍵字的白才跳得出來。一般區塊仍用 .night 就好。 */
.night.deep {
    background:
        radial-gradient(120% 55% at 50% 100%, rgba(232, 185, 84, .13) 0%, rgba(232, 185, 84, 0) 60%),
        radial-gradient(90% 60% at 50% 0%, #3a2670 0%, #2b1a52 40%, #1a1035 75%, #0d0819 100%);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 26px; border-radius: var(--r);
    font-size: 15.5px; font-weight: 500; line-height: 1.2; text-decoration: none;
    border: 1px solid var(--line-2); background: #fff; color: var(--ink);
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--night-2); color: #fff; }
.btn-glow { background: var(--glow); border-color: var(--glow); color: var(--night); font-weight: 600; }
.btn-glow:hover { background: var(--glow-soft); border-color: var(--glow-soft); color: var(--night); }
.btn-ghost { background: transparent; }
.night .btn-ghost { border-color: var(--night-line); color: var(--night-text); }
.night .btn-ghost:hover { background: rgba(255,255,255,.06); color: #fff; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; padding: 0; color: var(--glow-deep); text-decoration: underline; text-underline-offset: .18em; font-weight: 400; }
.btn-link:hover { transform: none; box-shadow: none; color: var(--ink); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field > label, .field .lbl { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
.field .hint { color: var(--faint); font-size: 13px; line-height: 1.6; margin-top: 6px; }
.field .err, .field-validation-error, .validation-summary-errors { color: var(--danger); font-size: 13.5px; }
.validation-summary-errors ul { margin: 0 0 16px; padding-left: 18px; }
.validation-summary-valid { display: none; }
.input, .field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=tel], .field input[type=date], .field input[type=time], .field input[type=number],
.field select, .field textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--line-2); border-radius: var(--r);
    background: #fff; font-size: 16px; line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
    outline: none; border-color: var(--glow-deep); box-shadow: 0 0 0 3px var(--glow-wash);
}
.field input.input-validation-error { border-color: var(--danger); }
.field textarea { resize: vertical; line-height: 1.7; }
.field select {
    appearance: none; -webkit-appearance: none; padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23625d78' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.field .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; cursor: pointer; }
.field .check input { width: 18px; height: 18px; margin: 4px 0 0; flex: none; accent-color: var(--ink); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .row-2 { grid-template-columns: 1fr; gap: 0; } }
/* 年／月／日：手機上也維持一列，生日拆成三行反而難讀 */
.row-3 { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .row-3 { gap: 6px; } .row-3 select { padding-left: 10px; padding-right: 30px; background-position: right 8px center; } }
/* 曆別／年／月／日。四個擠一列在手機上太窄（農曆的「閏五月」要放得下），所以折成 2×2 */
.row-birth { display: grid; grid-template-columns: 0.85fr 1.15fr 1fr 0.95fr; gap: 10px; }
/* 閏月的更正連結：那一年有同號閏月才會出現，所以刻意壓低存在感 */
.field .leap-hint { margin-top: 4px; }
.field .leap-hint a { color: var(--ink); text-underline-offset: 3px; }
@media (max-width: 560px) {
    .row-birth { grid-template-columns: 1fr 1fr; gap: 8px; }
    .row-birth select { padding-left: 12px; padding-right: 30px; background-position: right 8px center; }
}
fieldset { border: none; padding: 0; margin: 0 0 32px; min-width: 0; }
legend { font-family: var(--serif); font-weight: 600; font-size: 18px; padding: 0; margin-bottom: 18px; }

/* ── Cards / surfaces ───────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 28px; }
/* ★ .card 的白底寫在 .night 後面，兩者同為單一 class 時後者勝 ——
   所以 class="card night" 會變成白底配淺色字，對比只有 2.3:1，等於讀不到。
   兩個 class 疊起來時要把夜空底還回去。 */
.card.night {
    background: radial-gradient(120% 80% at 50% 0%, var(--night-3) 0%, var(--night-2) 45%, var(--night) 100%);
    border-color: transparent;
}
.card.raised { box-shadow: var(--shadow); border-color: transparent; }
.card.off { opacity: .55; }
.band { background: var(--paper-2); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

.notice { border-radius: var(--r); padding: 14px 18px; font-size: 14px; line-height: 1.8; border: 1px solid; }
.notice-warn { background: var(--warn-wash); border-color: #ecd9a0; }
.notice-danger { background: var(--danger-wash); border-color: #efc7c2; color: #7a2b25; }
.notice-info { background: var(--glow-wash); border-color: #efe0b5; }
.notice-ok { background: #e8f2ec; border-color: #bfdccb; color: #245a3d; }

/* ── Tags ───────────────────────────────────────────────────────────────── */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: 999px;
    font-weight: 500; letter-spacing: .02em; vertical-align: middle;
}
.tag-glow { background: var(--glow-wash); color: var(--glow-deep); }
.tag-good { background: var(--good-wash); color: var(--good); }
.tag-bad { background: var(--bad-wash); color: var(--bad); }
.tag-mute { background: var(--paper-3); color: var(--muted); }
.tag-warn { background: var(--warn-wash); color: #7a5a14; }
.tag-danger { background: var(--danger-wash); color: var(--danger); }
.tag-strong { background: var(--ink); color: #fff; }
.tag-medium { background: var(--paper-3); color: var(--ink); }
.tag-weak { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ── Plans（方案卡） ─────────────────────────────────────────────────────── */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan {
    position: relative; display: block; text-decoration: none; color: inherit;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 26px 28px;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.plan.main { border-color: var(--glow); box-shadow: 0 0 0 1px var(--glow), var(--shadow); }
.plan .mark-tag { position: absolute; top: -11px; left: 22px; }
.plan .pn { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.plan .pp { font-size: 34px; font-family: var(--serif); margin: 10px 0 14px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.plan .pp small { font-size: 14px; font-family: var(--sans); color: var(--muted); margin-right: 4px; letter-spacing: 0; }
.plan ul { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 14.5px; line-height: 1.9; }
.plan li { padding-left: 18px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: .78em; width: 8px; height: 1.5px; background: var(--glow-deep); }
.plan .cta { margin-top: 20px; }

/* ── 十二宮命盤 ──────────────────────────────────────────────────────────── */
.chart12 {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: var(--night-line);
    border: 1px solid var(--night-line); border-radius: var(--r-lg); overflow: hidden;
    /* 自己帶前景色，不要靠外層的 .night。命盤是一個完整的深色物件，
       放到紙色底上也該讀得到（跟 .kw-card 一樣的道理）。 */
    color: var(--night-text);
}
.chart12 .cell {
    background: var(--night-2); padding: 12px 12px 14px; min-height: 120px;
    display: flex; flex-direction: column;
}
.chart12 .cell .pname { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--night-mute); letter-spacing: .04em; }
.chart12 .cell .branch { font-family: var(--serif); color: var(--faint); opacity: .8; }
.chart12 .cell .stars { margin-top: auto; padding-top: 10px; font-family: var(--serif); font-size: 15px; line-height: 1.55; letter-spacing: .06em; }
.chart12 .cell .star { display: block; }
.chart12 .cell.yearly { background: linear-gradient(160deg, #3a3062, var(--night-3)); box-shadow: inset 0 0 0 1px var(--glow); }
.chart12 .cell.yearly .pname { color: var(--glow); }
.chart12 .cell.yearly .stars { color: var(--glow-soft); }
.chart12 .cell.yearly .pname::after { content: "流年"; font-size: 10.5px; padding: 2px 6px; border: 1px solid var(--glow); border-radius: 3px; margin-left: 6px; }
.chart12 .center {
    /* ★ margin 一定要歸零：上面那個通用的 .center 工具（.measure center 在用的）
       會把 margin 設成 auto，套在 grid 項目上會讓中央區塊縮成內容寬度、
       露出左右兩條底色。跟 .stars 一樣，是一個字的工具類名撞到元件內部類名。 */
    margin: 0;
    grid-column: 2 / 4; grid-row: 2 / 4; background: var(--night);
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px;
}
.chart12 .center .mark { width: 34px; height: 34px; color: var(--night-mute); margin-bottom: 14px; }
.chart12 .center .who { font-family: var(--serif); font-size: 21px; letter-spacing: .12em; }
.chart12 .center .sub { color: var(--night-mute); font-size: 12.5px; margin-top: 8px; line-height: 1.8; letter-spacing: .06em; }
@media (max-width: 560px) {
    .chart12 .cell { min-height: 92px; padding: 8px 8px 10px; }
    .chart12 .cell .stars { font-size: 12.5px; letter-spacing: .02em; }
    .chart12 .cell .pname { font-size: 11px; }
    .chart12 .cell.yearly .pname::after { display: none; }
    .chart12 .center .who { font-size: 16px; }
}

/* ── 關鍵字卡（分享物件） ────────────────────────────────────────────────── */
.kw-card {
    position: relative; overflow: hidden; text-align: center;
    border-radius: var(--r-lg); padding: 56px 28px 48px;
    background: radial-gradient(90% 70% at 50% 100%, #3a3062 0%, var(--night-2) 55%, var(--night) 100%);
    color: var(--night-text); box-shadow: var(--shadow-night);
}

.kw-card .inner { position: relative; }
.kw-card .eyebrow { color: var(--glow); }
.kw-card .word {
    font-family: var(--serif); font-weight: 600; font-size: clamp(44px, 9vw, 76px);
    letter-spacing: .18em; text-indent: .18em; line-height: 1.25; margin: 18px 0 14px;
    text-shadow: 0 2px 30px rgba(232, 185, 84, .18);
}
.kw-card .rule { width: 56px; height: 1px; background: var(--glow); margin: 0 auto 16px; opacity: .9; }
.kw-card .sub { color: var(--night-mute); font-size: 14px; letter-spacing: .1em; }
.kw-card .brand-line { margin-top: 34px; font-size: 12px; letter-spacing: .3em; color: var(--night-mute); }

/* ── 關鍵字海報（分享頁那一張，給人截圖用）─────────────────────────────── */
/* 跟 .kw-card 的差別：這是一整頁的主角，不是欄位裡的一張卡。
   四個字時排成 2x2 的大字塊 —— 中文四字方陣本來就比一長行耐看，
   而且在手機直式截圖裡佔得住畫面。字數不是四個就照常排一行。 */
.kw-poster { text-align: center; }
.kw-poster .year {
    font-family: var(--mono); font-size: 12px;
    letter-spacing: .3em; text-indent: .3em; color: var(--night-mute); opacity: .8;
}
.kw-poster .eyebrow { margin-top: 10px; }
.kw-poster .word {
    margin: 22px 0 0; font-family: var(--serif); font-weight: 600;
    font-size: clamp(56px, 13vw, 104px); line-height: 1.04; color: #fff;
    letter-spacing: .1em; text-indent: .1em;
    text-shadow: 0 0 40px rgba(232, 185, 84, .25), 0 2px 2px rgba(0, 0, 0, .35);
}
.kw-poster .word.grid4 {
    display: grid; grid-template-columns: repeat(2, auto); gap: 0 .06em;
    justify-content: center; letter-spacing: 0; text-indent: 0;
}
.kw-poster .word.grid4 span { display: block; }
.kw-poster .rule {
    width: 64px; height: 1px; background: var(--glow); margin: 24px auto 0;
    opacity: .9; box-shadow: 0 0 12px rgba(232, 185, 84, .6);
}
.kw-poster .sub { margin-top: 16px; font-size: 14px; letter-spacing: .14em; text-indent: .14em; color: var(--night-mute); }
.kw-poster .brand-line {
    margin-top: 30px; font-size: 11.5px; letter-spacing: .3em; text-indent: .3em;
    color: var(--night-mute); opacity: .85;
}

/* ── 可展開推導（收據） ───────────────────────────────────────────────────── */
details.ev { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
details.ev > summary {
    cursor: pointer; padding: 11px 16px; font-size: 13.5px; color: var(--glow-deep);
    list-style: none; display: flex; align-items: center; gap: 8px; user-select: none;
}
details.ev > summary::-webkit-details-marker { display: none; }
details.ev > summary::before {
    content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg); transition: transform .2s var(--ease); margin-left: 2px;
}
details.ev[open] > summary::before { transform: rotate(45deg); }
details.ev[open] > summary { border-bottom: 1px dashed var(--line); }
.ev-list { margin: 0; padding: 6px 16px 14px; }
.ev-item { padding: 12px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.ev-item:first-child { border-top: none; }
.ev-item .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
/* 白話為主、術語為次。正文已經不用術語了，展開來只給一句「流年化祿入財帛宮」
   等於沒有解釋 —— plain 是在講什麼，basis 是它在命盤上的出處。 */
.ev-plain { font-weight: 600; line-height: 1.7; }
.ev-basis { font-weight: 600; }
.ev-basis-sub { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; font-family: var(--mono); }
.ev-src { color: var(--muted); margin-top: 3px; font-size: 13.5px; }
/* 排盤提醒。放在命盤與內文之間，要看得見但不要像錯誤訊息 */
.warn-block { margin: 0 0 32px; }
.warn-block p { margin: 0; }
.warn-block p + p { margin-top: 10px; }
.ev-src .id { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-right: 8px; }

/* ── 流月時間軸 ──────────────────────────────────────────────────────────── */
.tl { display: flex; gap: 6px; flex-wrap: wrap; }
.tl .d {
    width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12.5px; border: 1px solid var(--line-2); color: var(--faint); text-decoration: none; font-variant-numeric: tabular-nums;
    transition: transform .15s var(--ease);
}
.tl a.d:hover { transform: translateY(-1px); }
.tl .d.on { background: var(--ink); border-color: var(--ink); color: var(--glow); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    cursor: pointer; padding: 18px 0; font-weight: 500; list-style: none;
    display: flex; gap: 14px; align-items: baseline; font-size: 16.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--glow-deep); flex: none; font-weight: 300; }
.faq details[open] summary::before { content: "－"; }
.faq .ans { padding: 0 0 20px 32px; color: var(--muted); line-height: 1.9; }
.faq .ans p { margin: 0 0 10px; }

/* ── 說明頁與法律頁 ───────────────────────────────────────────────────────── */
.legal { max-width: var(--measure); margin: 56px auto 96px; padding: 0 24px; }
.legal h1 { font-size: 30px; margin: 0 0 8px; }
.legal .ver { color: var(--faint); font-size: 13px; margin: 0 0 40px; }
.legal h2 { font-size: 19px; margin: 40px 0 12px; }
.legal p { line-height: 1.95; margin: 0 0 16px; }
.legal ul { line-height: 1.95; margin: 0 0 16px; padding-left: 22px; color: #3f3a52; }
.legal li { margin-bottom: 6px; }
.legal dt { font-weight: 600; margin-top: 18px; }
.legal dd { margin: 6px 0 0; line-height: 1.95; color: #3f3a52; }
.legal .box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin: 0 0 16px; background: #fff; }
.legal details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.legal details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: baseline; gap: 10px; }
.legal details summary::-webkit-details-marker { display: none; }
.legal details summary::before { content: "＋"; color: var(--glow-deep); font-weight: 300; flex: none; }
.legal details[open] summary::before { content: "－"; }
.legal details p { margin: 12px 0 0; color: #3f3a52; }

/* ── 簡單頁（成功／等待／錯誤） ─────────────────────────────────────────── */
.simple { max-width: 32rem; margin: 96px auto; padding: 0 24px; text-align: center; }
.simple .glyph { width: 44px; height: 44px; margin: 0 auto 22px; color: var(--faint); }
.simple h1 { font-size: 26px; margin-bottom: 12px; }
.simple p { color: var(--muted); line-height: 1.9; }
.simple .acts { margin-top: 28px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 14.5px; }
.kv:first-child { border-top: none; }
.kv .k { color: var(--muted); }
.kv .v { font-variant-numeric: tabular-nums; text-align: right; }

/* ── 表單頁（登入／註冊／結帳） ───────────────────────────────────────────── */
.auth { max-width: 26rem; margin: 64px auto 96px; padding: 0 24px; }
/* .brand 是 inline-flex，會縮到內容寬 —— 只寫 justify-content 是沒有作用的空宣告。
   要真的置中必須讓它變成 block 級的 flex 容器。 */
.auth .brand { display: flex; justify-content: center; margin-bottom: 28px; }
.auth h1 { font-size: 26px; text-align: center; margin-bottom: 8px; }
.auth .lead { text-align: center; color: var(--muted); font-size: 14.5px; margin-bottom: 28px; line-height: 1.8; }
.auth .or { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 13px; margin: 22px 0; }
.auth .or::before, .auth .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth .foot { text-align: center; font-size: 14px; color: var(--muted); margin-top: 24px; }
.btn-google { gap: 10px; }
.btn-google svg { width: 18px; height: 18px; }
/* LINE 的登入按鈕照它的品牌規範用綠底白字；Google 那顆是白底彩色 logo，各家照各家的。 */
.btn-line { gap: 10px; background: #06c755; border-color: #06c755; color: #fff; }
.btn-line:hover { background: #05b34c; border-color: #05b34c; color: #fff; }
.btn-line svg { width: 20px; height: 20px; }
/* ── 分享列（連結分享：LINE / Facebook / 複製）────────────────────────── */
/* 三顆等重的次要按鈕。品牌色只給一個小圓點當提示，不把整顆按鈕塗成 LINE 綠 ——
   那會跟頁面上唯一的主要動作搶眼。 */
.share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.share-row .btn { gap: 8px; flex: 1 1 150px; }   /* 手機上換行時撐滿，不會排成 1+2 */
.share-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.share-row .dot.line { background: #06c755; }
.share-row .dot.fb { background: #1877f2; }
.share-row .dot.copy { background: var(--glow); }
.night .share-row .btn { border-color: var(--night-line); color: var(--night-text); background: rgba(255,255,255,.04); }
.night .share-row .btn:hover { background: rgba(255,255,255,.09); color: #fff; }

.form-page { max-width: 36rem; margin: 56px auto 96px; padding: 0 24px; }
.form-page h1 { font-size: 28px; margin-bottom: 8px; }
.form-page .lead { color: var(--muted); margin-bottom: 32px; line-height: 1.85; }

/* ── 動效 ───────────────────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s var(--ease) both; }
.rise-2 { animation: rise .6s .12s var(--ease) both; }
.rise-3 { animation: rise .6s .24s var(--ease) both; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--glow); animation: breathe 1.6s ease-in-out infinite; vertical-align: middle; margin-right: 8px; }

/* ── 列印 ───────────────────────────────────────────────────────────────── */
@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: inherit; text-decoration: none; }
}
