:root {
  --red: #9e1b1b;
  --red-soft: #c0392b;
  --gold: #b8892b;
  --gold-soft: #e9d6a7;
  --paper: #fbf5e8;
  --card: #fffdf7;
  --ink: #2b1d14;
  --muted: #7a6a5c;
  --line: #e4d4b4;
  --good: #2f7d4f;
  --good-bg: #edf6ef;
  --bad: #b23a2e;
  --bad-bg: #fbecea;
  --shadow: 0 2px 10px rgba(80, 40, 10, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #c94a3a; --red-soft: #e06a55; --gold: #d8ab52; --gold-soft: #4a3b22;
    --paper: #17120e; --card: #221a14; --ink: #f1e6d3; --muted: #b3a28e; --line: #3d3025;
    --good: #6cc48d; --good-bg: #1c2d22; --bad: #f08273; --bad-bg: #36201c;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --red: #c94a3a; --red-soft: #e06a55; --gold: #d8ab52; --gold-soft: #4a3b22;
  --paper: #17120e; --card: #221a14; --ink: #f1e6d3; --muted: #b3a28e; --line: #3d3025;
  --good: #6cc48d; --good-bg: #1c2d22; --bad: #f08273; --bad-bg: #36201c;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Noto Serif TC', 'PMingLiU', 'Songti TC', serif;
  line-height: 1.6; padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }

/* header */
.top {
  background: var(--red); color: #fbf5e8; padding: 14px 16px;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto; }
.seal { width: 46px; height: 46px; flex: none; }
.seal rect:first-child { fill: #fbf5e8; }
.seal rect:nth-child(2) { stroke: #9e1b1b; }
.seal g { fill: #9e1b1b; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .25em; font-weight: 900; }
.slogan { margin: 0; font-size: 12px; letter-spacing: .3em; opacity: .85; }

main { max-width: 720px; margin: 0 auto; padding: 16px; }
.tab { display: none; }
.tab.active { display: block; }

/* date bar */
.datebar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.nav-btn, .today-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  height: 40px; min-width: 40px; cursor: pointer; font-size: 20px; line-height: 1;
}
.today-btn { font-size: 14px; padding: 0 12px; color: var(--red); font-weight: 600; }
.datepick { flex: 1; }
.datepick input, .zw-form input[type=text], .zw-form input[type=date], .zw-form input[type=time], .zw-form input[type=number], .zw-form select {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); padding: 0 10px;
}

/* day card */
.day-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px; position: relative; overflow: hidden;
}
.day-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--gold) 14px 18px);
}
.day-head { display: flex; gap: 16px; align-items: stretch; padding-top: 6px; }
.solar {
  text-align: center; min-width: 96px; border-right: 1px dashed var(--line); padding-right: 16px;
}
.solar .ym { font-size: 13px; color: var(--muted); }
.solar .big { font-size: 64px; font-weight: 900; color: var(--red); line-height: 1.05; }
.solar .wk { font-size: 14px; }
.lunar { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.lunar-date { font-size: 24px; font-weight: 900; letter-spacing: .08em; }
.gz { color: var(--muted); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 12px; padding: 1px 8px; border-radius: 99px;
  background: var(--gold-soft); color: var(--ink); border: 1px solid var(--gold);
}
.tag.red { background: var(--red); color: #fff; border-color: var(--red); }

.yiji { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.yiji > div { border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.yi { background: var(--good-bg); }
.ji { background: var(--bad-bg); }
.yiji p { margin: 0; font-size: 14px; }
.badge {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 18px; color: #fff;
}
.yi .badge { background: var(--good); }
.ji .badge { background: var(--bad); }

.facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0;
  border-top: 1px solid var(--line);
}
.facts > div { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.facts > div.wide { grid-column: 1 / -1; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; }

.sub {
  font-size: 15px; margin: 16px 0 8px; color: var(--red); letter-spacing: .2em;
  display: flex; align-items: center; gap: 8px;
}
.sub::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.hours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hour {
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; text-align: center; font-size: 13px;
}
.hour b { display: block; font-size: 15px; }
.hour small { color: var(--muted); font-size: 11px; display: block; }
.hour.good b { color: var(--good); }
.hour.bad b { color: var(--bad); }
.hour.now { outline: 2px solid var(--gold); }

/* ziwei form */
.zw-form {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; box-shadow: var(--shadow);
}
.zw-form > label, .family-grid > label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.zw-form > label:first-child { grid-column: 1 / -1; }
.gender { border: 0; margin: 0; padding: 0; display: flex; gap: 16px; align-items: center; font-size: 15px; }
.gender legend { font-size: 13px; color: var(--muted); float: left; margin-right: 8px; white-space: nowrap; }
.gender label { white-space: nowrap; }
.primary {
  grid-column: 1 / -1; height: 46px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--red); color: #fff; font-size: 17px; letter-spacing: .5em; font-weight: 600;
}
.primary:active { transform: translateY(1px); }

/* chart */
.chart {
  margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, minmax(118px, auto));
  border: 2px solid var(--red); border-radius: 6px; background: var(--card); overflow: hidden;
}
.cell {
  border: 1px solid var(--line); padding: 4px 4px 3px; display: flex; flex-direction: column;
  cursor: pointer; min-width: 0; font-size: 12px; position: relative; background: var(--card);
  text-align: left; border-radius: 0;
}
.cell:hover { background: var(--gold-soft); }
.cell.sel { background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.cell.ming .pname { background: var(--red); color: #fff; }
.majors { display: flex; flex-wrap: wrap; gap: 0 4px; }
.major { color: var(--red); font-weight: 900; font-size: 14px; white-space: nowrap; }
.minors { display: flex; flex-wrap: wrap; gap: 0 4px; color: var(--ink); font-size: 11px; }
.minor.bad { color: var(--muted); }
.hua {
  display: inline-block; font-size: 10px; line-height: 14px; padding: 0 2px; margin-left: 1px;
  border-radius: 3px; color: #fff; vertical-align: 1px; font-weight: 600;
}
.hua.祿 { background: #2f7d4f; } .hua.權 { background: #8e44ad; }
.hua.科 { background: #2c6fb0; } .hua.忌 { background: #b23a2e; }
.cell-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 2px; }
.gzb { color: var(--muted); font-size: 11px; writing-mode: vertical-rl; }
.pname {
  font-size: 12px; font-weight: 600; padding: 0 4px; border-radius: 4px; border: 1px solid var(--red); color: var(--red);
  white-space: nowrap;
}
.decade { font-size: 10px; color: var(--muted); }
.shen { position: absolute; top: 3px; right: 3px; font-size: 10px; background: var(--gold); color: #fff; border-radius: 3px; padding: 0 3px; }
.center {
  grid-column: 2 / 4; grid-row: 2 / 4; border: 1px solid var(--line); padding: 10px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, var(--gold-soft), transparent 70%);
}
.center h2 { margin: 0 0 4px; font-size: 18px; color: var(--red); letter-spacing: .15em; }
.center p { margin: 0; font-size: 12px; }
.center .bureau { margin-top: 6px; font-weight: 900; font-size: 16px; }

/* reading */
.reading {
  margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow);
}
.reading h3 { margin: 0 0 4px; color: var(--red); font-size: 20px; letter-spacing: .1em; }
.reading .lead { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.star-block { border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; margin: 12px 0; }
.star-block h4 { margin: 0; font-size: 17px; }
.star-block h4 small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.star-block p { margin: 4px 0 0; font-size: 15px; }
.minor-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }

.soon { text-align: center; padding: 48px 16px; }
.soon-icon {
  width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  border: 3px double var(--red); color: var(--red); font-size: 40px; font-weight: 900;
}
.soon h2 { margin: 0 0 6px; color: var(--red); letter-spacing: .2em; }
.soon p { color: var(--muted); }

.disclaimer { font-size: 12px; color: var(--muted); text-align: center; margin: 24px 0 8px; }

/* bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,.06); z-index: 10;
}
.bottom-nav button {
  border: 0; background: none; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer;
}
.bottom-nav .ic {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  border: 1.5px solid currentColor; font-size: 15px; font-weight: 900;
}
.bottom-nav button.active { color: var(--red); }
.bottom-nav button.active .ic { background: var(--red); color: #fff; border-color: var(--red); }

@media (max-width: 480px) {
  .solar { min-width: 80px; padding-right: 12px; }
  .solar .big { font-size: 52px; }
  .lunar-date { font-size: 20px; }
  .yiji { grid-template-columns: 1fr; }
  .chart { grid-template-rows: repeat(4, minmax(104px, auto)); }
  .cell { padding: 3px 2px 2px; }
  .major { font-size: 12.5px; }
  .minors { font-size: 10px; }
  .pname { font-size: 11px; padding: 0 2px; }
  .gzb, .decade { font-size: 9.5px; }
  .center { padding: 6px; }
  .center h2 { font-size: 15px; }
  .center p { font-size: 11px; }
}

/* ---- 表單擴充 ---- */
.zw-form .full { grid-column: 1 / -1; }
.zw-form > label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.zw-form > label.check input { width: 18px; height: 18px; flex: none; accent-color: var(--red); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.family { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; }
.family summary { cursor: pointer; font-size: 14px; color: var(--red); font-weight: 600; }
.family-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }

/* ---- 流年 ---- */
.ln-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px;
}
.ln-bar label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--red); }
.ln-bar select {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 10px;
}
.cell.dx { box-shadow: inset 0 0 0 2px var(--red-soft); }
.cell.ln { background: color-mix(in srgb, var(--red) 7%, var(--card)); }
.cell.ln .ylabel { background: var(--red); color: #fff; border-radius: 3px; padding: 0 3px; }
.ylabel { font-size: 10px; color: var(--red-soft); white-space: nowrap; line-height: 1.4; }
.foot-r { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.decade { white-space: nowrap; }
.hua-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.hua-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.hua-card b { font-size: 15px; }
.relation { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.relation:last-child { border-bottom: 0; }
.relation .who {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); border: 1px solid var(--gold); font-weight: 900;
}
.relation p { margin: 2px 0 0; font-size: 14px; }
.pill { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 99px; color: #fff; margin-left: 4px; }
.pill.good { background: var(--good); } .pill.bad { background: var(--bad); } .pill.mid { background: var(--gold); }

/* ---- 面相 ---- */
.face-btns { display: flex; gap: 10px; margin-top: 12px; }
.btn-like {
  flex: 1; height: 46px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  font-size: 16px; letter-spacing: .3em; font-weight: 600;
}
.ghost { border: 1.5px solid var(--red); color: var(--red); background: var(--card); }
.privacy { font-size: 13px; background: var(--good-bg); border-radius: 8px; padding: 6px 10px; margin: 8px 0 0; }
.face-stage {
  margin-top: 16px; border-radius: 16px; overflow: hidden; border: 2px solid var(--gold); background: #000;
}
.face-stage canvas { display: block; width: 100%; height: auto; }
.metric { display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; align-items: center; margin: 8px 0; font-size: 14px; }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.bar span:nth-child(1) { background: var(--red); } .bar span:nth-child(2) { background: var(--gold); } .bar span:nth-child(3) { background: var(--good); }
.legend { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) {
  .family-grid, .hua-row { grid-template-columns: 1fr; }
}

/* ---- 相學分段 ---- */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; height: 36px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; letter-spacing: .2em; }
.seg button.on { background: var(--red); color: #fff; }

/* ---- 手相掌紋選擇 ---- */
.line-q { border: 0; padding: 0; margin: 14px 0 0; }
.line-q legend { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.line-q legend small { font-weight: 400; font-size: 12px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.line-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.line-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 6px; cursor: pointer; text-align: center; font-size: 12px; line-height: 1.35; display: flex; flex-direction: column; gap: 4px; background: var(--card); }
.line-opt input { position: absolute; opacity: 0; pointer-events: none; }
.line-opt svg { width: 100%; height: auto; max-height: 92px; }
.line-opt:has(input:checked) { border-color: var(--red); background: var(--gold-soft); box-shadow: 0 0 0 1px var(--red); }
.line-opt:has(input:focus-visible) { outline: 2px solid var(--gold); }

/* ---- 風水 ---- */
.row { display: flex; gap: 8px; }
.row select { flex: 1; }
.compass-btn { flex: none; border-radius: 10px; padding: 0 12px; height: 40px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.compass { display: block; width: 100%; max-width: 300px; margin: 8px auto; font-family: inherit; }
.inline-sel { margin-left: 6px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0 6px; }
.fs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 0; }
.fs-cell { border-radius: 10px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1.35; border: 1px solid var(--line); }
.fs-cell.good { background: var(--good-bg); } .fs-cell.bad { background: var(--bad-bg); }
.fs-cell b { font-size: 13px; }
.fs-num { font-size: 28px; font-weight: 900; line-height: 1.1; }
.fs-cell.good .fs-num { color: var(--good); } .fs-cell.bad .fs-num { color: var(--bad); }
.fs-cell small { color: var(--muted); font-size: 10.5px; }
.fs-tips { padding-left: 0; list-style: none; margin: 8px 0; font-size: 14px; }
.fs-tips li { padding: 6px 0 6px 14px; border-bottom: 1px dashed var(--line); position: relative; }
.fs-tips li::before { content: ''; position: absolute; left: 0; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.fs-tips li.good::before { background: var(--good); } .fs-tips li.bad::before { background: var(--bad); }
.explain summary { cursor: pointer; color: var(--red); font-size: 14px; margin-top: 8px; }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 14px; }
.issue input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--red); }
.issue em { display: none; font-style: normal; color: var(--good); margin-top: 4px; }
.issue span { display: flex; flex-direction: column; }
.issue:has(input:checked) { background: var(--gold-soft); border-color: var(--gold); }
.issue:has(input:checked) em { display: block; }

/* ---- 願望 ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 99px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
#wishText { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 10px; font-size: 16px; resize: vertical; }
.wish-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 14px; }
.wish-row label, .player label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.wish-row input, .wish-row select, .player select { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 10px; width: 100%; }
#wishGo { width: 100%; letter-spacing: .2em; }
.letter {
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--gold), var(--red)) border-box;
  border: 2px solid transparent;
}
.letter-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.para { font-size: 17px; line-height: 1.85; margin: 10px 0; padding: 2px 6px; border-radius: 6px; transition: background .3s; }
.para.reading-now { background: var(--gold-soft); }
.player { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; margin-top: 14px; }
.player .primary { height: 44px; letter-spacing: .1em; font-size: 16px; }
.player input[type=range] { width: 100%; accent-color: var(--red); height: 40px; }
.streak { text-align: center; margin: 12px 0 4px; font-size: 15px; }
.streak b { color: var(--red); font-size: 20px; }
@media (max-width: 480px) {
  .line-opts { grid-template-columns: repeat(2, 1fr); }
  .player { grid-template-columns: 1fr; }
}
.writing { text-align: center; color: var(--muted); padding: 24px 0; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
#wishGo:disabled { opacity: .6; }
.install-btn {
  margin-left: auto; border: 1.5px solid #e9d6a7; background: transparent; color: #fbf5e8;
  border-radius: 99px; padding: 4px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.install-btn:hover { background: rgba(255,255,255,.12); }

/* ---- 生肖 ---- */
.zgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0; }
.zchip {
  position: relative; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
  padding: 6px 0 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.25;
}
.zchip b { font-size: 20px; font-weight: 900; }
.zchip small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.zchip.good { background: var(--good-bg); } .zchip.good b { color: var(--good); }
.zchip.bad { background: var(--bad-bg); } .zchip.bad b { color: var(--bad); }
.zchip.on { border-color: var(--red); box-shadow: 0 0 0 1.5px var(--red); }
.zchip i { position: absolute; top: -6px; right: -4px; font-style: normal; font-size: 10px; background: var(--gold); color: #fff; border-radius: 99px; padding: 0 5px; }
.bad-text { color: var(--bad); }
@media (max-width: 480px) { .zgrid { grid-template-columns: repeat(4, 1fr); } }

/* ---- 合婚 ---- */
.seg.small { margin: 0 0 10px; max-width: 240px; }
.seg.small button { height: 30px; font-size: 13px; }
.match-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match-form .primary { grid-column: 1 / -1; }
.mperson { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mperson legend { color: var(--red); font-weight: 700; padding: 0 4px; }
.mperson > label, .nm-grid > label, .ai-box > label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.mperson input, .mperson select, .nm-grid input, .nm-grid select, .ai-box input {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 10px; width: 100%;
}
.mperson .gender { gap: 14px; font-size: 14px; }
.match-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; margin-bottom: 8px; }
.match-p b { display: block; font-size: 18px; }
.match-p small { color: var(--muted); font-size: 12px; }
.match-score { width: 108px; height: 108px; border-radius: 50%; display: grid; place-content: center; border: 4px double currentColor; }
.match-score span { font-size: 38px; font-weight: 900; line-height: 1; }
.match-score small { font-size: 13px; font-weight: 700; margin-top: 4px; }
.match-score.good { color: var(--good); } .match-score.mid { color: var(--gold); } .match-score.bad { color: var(--bad); }
.match-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mi-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.mi-top small { color: var(--muted); font-size: 12px; flex: 1; }
.mi-top span { font-weight: 700; color: var(--red); }
.match-item .bar span { background: var(--good); }
.match-item p { margin: 6px 0 0; font-size: 14px; }

/* ---- 改名 ---- */
.nm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 12px; }
.nm-grid .full { grid-column: 1 / -1; }
.nm-grid .gender, .ai-box .gender { align-items: flex-end; gap: 14px; font-size: 14px; }
.legend-lite { font-size: 13px; color: var(--muted); }
#nmGo, #ncGo { width: 100%; letter-spacing: .3em; }
.ai-box { margin-top: 14px; border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--gold-soft) 35%, var(--card)); }
.ai-box .btn-like { height: 42px; flex: none; }
#nmResult > .star-block, #nmResult > .name-card, #nmResult > p, #nmResult > h3 { margin-left: 0; }
#nmResult { margin-top: 16px; }
.name-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); }
.name-card.bad { border-color: var(--bad); }
.name-card p { margin: 6px 0; font-size: 14px; }
.nc-top { display: flex; justify-content: space-between; align-items: center; }
.nc-name { font-size: 26px; font-weight: 900; letter-spacing: .12em; }
.nc-name em { font-style: normal; color: var(--red); }
.nc-score { font-size: 28px; font-weight: 900; }
.nc-score small { font-size: 12px; margin-left: 2px; }
.nc-score.good { color: var(--good); } .nc-score.mid { color: var(--gold); } .nc-score.bad { color: var(--bad); }
.ge-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; }
.ge { border-radius: 8px; text-align: center; padding: 4px 0; border: 1px solid var(--line); display: flex; flex-direction: column; line-height: 1.3; }
.ge small { font-size: 11px; color: var(--muted); }
.ge b { font-size: 18px; }
.ge span { font-size: 11px; }
.ge.good { background: var(--good-bg); } .ge.good b { color: var(--good); }
.ge.bad { background: var(--bad-bg); } .ge.bad b { color: var(--bad); }
.extras summary { cursor: pointer; color: var(--red); font-size: 14px; margin-top: 6px; }
.tagchip { display: inline-flex; align-items: baseline; gap: 4px; border: 1px solid var(--gold); background: var(--gold-soft); border-radius: 99px; padding: 1px 10px; margin: 3px 4px 3px 0; font-size: 14px; }
.tagchip small { font-size: 11px; color: var(--muted); }
.ai-note { background: var(--gold-soft); border-radius: 8px; padding: 6px 10px; }
@media (max-width: 480px) {
  .match-form, .nm-grid { grid-template-columns: 1fr; }
  .match-score { width: 92px; height: 92px; }
  .match-score span { font-size: 30px; }
  .bottom-nav .ic { width: 26px; height: 26px; font-size: 13px; }
  .bottom-nav button { font-size: 11px; }
}
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink) !important; flex-direction: row !important; }
.consent input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--red); }
#palmAi:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 關於 ---- */
.about-btn { margin-left: auto; border: 0; background: transparent; color: #fbf5e8; font-size: 13px; cursor: pointer; padding: 4px 8px; opacity: .9; }
.about-btn + .install-btn { margin-left: 0; }
.brand { cursor: pointer; }
.about-hero { text-align: center; }
.seal.big { width: 84px; height: 84px; display: block; margin: 0 auto 8px; }
.motto { font-size: 18px; letter-spacing: .15em; margin: 4px 0 10px; }
.motto b { color: var(--red); font-size: 22px; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.values > div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.values b { color: var(--red); font-size: 17px; letter-spacing: .2em; }
.values p { margin: 4px 0 0; font-size: 14px; }
.books { padding-left: 22px; margin: 8px 0; }
.books li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.books li b { font-size: 15px; }
.books li small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.books li span { display: block; font-size: 13px; color: var(--ink); opacity: .85; }
@media (max-width: 480px) { .values { grid-template-columns: 1fr; } }

/* ---- 命盤總覽 ---- */
.sum-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sum-ic { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 900; }
.sum-row b { font-size: 16px; }
.sum-row small { color: var(--muted); margin-left: 6px; font-size: 12px; }
.sum-row p { margin: 4px 0 0; font-size: 14px; }
.talent { margin: 8px 0; }
.talent b { display: block; margin-bottom: 2px; font-size: 15px; }
.en-list { list-style: none; padding: 0; margin: 6px 0; }
.en-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 1px; }
.en-list li > b { font-size: 17px; }
.en-mean { font-size: 13px; color: var(--red); margin-left: 4px; }
.en-list small { font-size: 12px; color: var(--muted); }
.en-list .num { color: var(--red); font-size: 14px; }

/* ---- 進階服務 ---- */
.svc-card { margin-top: 14px; border: 1px solid var(--gold); border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--gold-soft) 45%, var(--card)); }
.svc-card > b { font-size: 16px; color: var(--red); }
.svc-card > p { font-size: 14px; margin: 6px 0; }
.svc-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.svc-item:last-of-type { border-bottom: 0; }
.svc-item b { font-size: 15px; }
.svc-price { margin-left: 8px; color: var(--red); font-weight: 700; font-size: 14px; }
.svc-item small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.svc-btn { flex: none; border-radius: 99px; padding: 6px 12px; font-size: 13px; background: var(--red); color: #fff; text-decoration: none; white-space: nowrap; }
.svc-btn.off { background: var(--line); color: var(--muted); }
.by-year { display: flex; flex-direction: column; }
.by-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.by-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.by-head b { font-size: 17px; color: var(--red); }
.by-head span { font-size: 14px; }
.by-head small { font-size: 12px; color: var(--muted); }
.by-head em { font-style: normal; color: var(--gold); margin-left: auto; letter-spacing: 1px; }
.by-row p { margin: 4px 0 0; font-size: 13.5px; }
.place-search { height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 10px; width: 100%; font-size: 14px; margin-bottom: 4px; }
.place-search:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.place-hint { font-size: 12px; color: var(--good); min-height: 0; }
.place-hint:empty { display: none; }

/* ---- 私隱中心、查詢表格 ---- */
.privacy-note { grid-column: 1 / -1; font-size: 12px; color: var(--good); margin: 6px 0 0; }
.trust { list-style: none; padding: 0; margin: 8px 0; }
.trust li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.ptable th, .ptable td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.ptable th { color: var(--muted); }
.pc-row { margin-top: 10px; }
.pc-row .btn-like { width: 100%; letter-spacing: .05em; font-size: 14px; }
.pc-link { color: var(--good); text-decoration: none; margin-right: 6px; }
.inq-dialog { border: 0; border-radius: 16px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.inq-dialog::backdrop { background: rgba(20, 10, 5, .55); }
.inq-dialog form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.inq-dialog h3 { margin: 0; color: var(--red); }
.inq-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.inq-dialog input:not([type=checkbox]), .inq-dialog select, .inq-dialog textarea { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 8px 10px; font-size: 15px; width: 100%; }
.inq-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.pics { font-size: 13px; background: var(--paper); border-radius: 10px; padding: 6px 10px; }
.pics summary { cursor: pointer; color: var(--red); }
.pics p { margin: 6px 0; }
.inq-btns { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; }
.inq-btns .btn-like { height: 44px; }
.inq-btns .primary { height: 44px; letter-spacing: .1em; }
.svc-btn { border: 0; cursor: pointer; }

/* ---- 語言 ---- */
.lang-switch { margin-left: auto; height: 30px; border-radius: 99px; border: 1.5px solid #e9d6a7; background: transparent; color: #fbf5e8; font-size: 13px; padding: 0 6px; cursor: pointer; }
.lang-switch option { color: #2b1d14; }
.lang-switch + .about-btn { margin-left: 0; }
.lang-notice { background: var(--gold-soft); color: var(--ink); font-size: 13px; text-align: center; padding: 6px 12px; }
html:not([lang^="zh"]) .bottom-nav button { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-switch { width: 52px; flex: none; padding: 0 2px; text-align: center; }
.about-btn { white-space: nowrap; flex: none; }
.brand > div { min-width: 0; }
@media (max-width: 400px) { .slogan { font-size: 10px; letter-spacing: .15em; } .brand h1 { font-size: 20px; } }

/* ---- 開業擇日、辦公室區域 ---- */
.biz-result { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.biz-result h3 { color: var(--red); margin: 6px 0 4px; }
.bz-days, .bz-areas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.bz-day, .bz-area { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.bz-day.good, .bz-area.good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.bz-day b, .bz-area b { font-size: 15px; }
.bz-day small, .bz-area small { color: var(--muted); }
@media (max-width: 480px) { .bz-days, .bz-areas { grid-template-columns: 1fr; } }
.lang-notice { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; align-items: center; justify-content: center; border-bottom: 1px solid var(--gold); }
.lang-notice button { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
html:not([lang^="zh"]) .zchip b { font-size: 12px; }
html:not([lang^="zh"]) .seg button { letter-spacing: 0; font-size: 13px; }
html:not([lang^="zh"]) .primary, html:not([lang^="zh"]) .btn-like { letter-spacing: .02em; }
/* 長文字語言（英、西）版面 */
.zw-form > *, .nm-grid > *, .match-form > *, .family-grid > *, .wish-row > * { min-width: 0; }
.gender { flex-wrap: wrap; gap: 6px 14px; }
html:not([lang^="zh"]) .brand h1 { letter-spacing: .05em; font-size: 20px; }
html:not([lang^="zh"]) .slogan { letter-spacing: .02em; }

/* ---- 購買、訂單、條款 ---- */
.svc-acts { display: flex; gap: 6px; flex: none; }
.svc-btn.ghost-btn { background: var(--card); color: var(--red); border: 1px solid var(--red); }
.co-svc { background: var(--paper); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.co-svc b { font-size: 16px; } .co-svc span { color: var(--red); font-weight: 700; } .co-svc small { color: var(--muted); font-size: 12px; }
.order-no { font-size: 20px; letter-spacing: .05em; color: var(--red); }
.pay-m { display: grid; grid-template-columns: 90px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.pay-m code { font-size: 15px; background: var(--gold-soft); padding: 0 6px; border-radius: 4px; user-select: all; }
.pay-amt { color: var(--red); font-size: 18px; }
.order-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.oc-top { display: flex; justify-content: space-between; align-items: center; }
.order-card small { color: var(--muted); font-size: 12px; }
.order-card p { font-size: 14px; margin: 6px 0; }
.pill.mid { background: var(--gold); }
.terms { padding-left: 20px; font-size: 14px; }
.terms li { margin: 6px 0; }
.inq-dialog .consent a { color: var(--red); }

/* ---- 客服機械人 ---- */
.chat-fab { position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; border: 0; border-radius: 99px;
  background: var(--red); color: #fff; padding: 9px 14px; font-size: 15px; display: flex; gap: 4px; align-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; }
.chat-fab span { font-size: 13px; font-weight: 600; }
.chat-panel { position: fixed; right: 10px; left: 10px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 31; max-width: 420px; margin-left: auto;
  height: min(560px, calc(100vh - 140px)); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.3);
  display: flex; flex-direction: column; overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { background: var(--red); color: #fff; padding: 10px 12px; display: flex; align-items: baseline; gap: 8px; }
.chat-head small { opacity: .85; font-size: 12px; flex: 1; }
.chat-x { border: 0; background: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.msg { max-width: 85%; padding: 8px 11px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.msg.bot { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--red); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-btns button, .chat-quick button { border: 1px solid var(--red); color: var(--red); background: var(--card); border-radius: 99px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; border-top: 1px solid var(--line); scrollbar-width: none; }
.chat-quick button { flex: none; }
.chat-input { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 99px; padding: 0 12px; background: var(--paper); }
.chat-input button { border: 0; background: var(--red); color: #fff; border-radius: 99px; padding: 0 14px; cursor: pointer; }
.inq-dialog label.consent { display: block !important; font-size: 13px; color: var(--ink); line-height: 1.6; }
.inq-dialog label.consent input { vertical-align: -3px; margin: 0 6px 0 0; width: 16px; height: 16px; }

/* ---- 生日同太歲提醒 ---- */
.rm-banner { background: var(--card); border: 1.5px solid var(--gold); border-radius: 14px; padding: 6px 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.rm-ev { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.rm-ev:last-child { border-bottom: 0; }
.rm-ev > span { font-size: 22px; }
.rm-ev b { display: block; font-size: 15px; }
.rm-ev small { color: var(--muted); font-size: 12px; }
.rm-person { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.rm-top { display: flex; align-items: baseline; gap: 8px; }
.rm-top b { font-size: 16px; } .rm-top small { color: var(--muted); flex: 1; font-size: 12px; }
.rm-del { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.rm-lines { display: flex; flex-direction: column; gap: 2px; font-size: 14px; margin-top: 4px; }
.rm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; align-items: end; }
.rm-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.rm-form input, .rm-form select { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 10px; width: 100%; }
.rm-form .btn-like { height: 40px; }
#rmIcs { width: 100%; letter-spacing: .1em; margin-top: 4px; }
@media (max-width: 480px) { .rm-form { grid-template-columns: 1fr; } }

/* ---- 法律聲明 ---- */
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.legal-toc a { font-size: 13px; color: var(--red); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; text-decoration: none; }
.legal .terms li { line-height: 1.7; }
.agree-list { padding-left: 18px; font-size: 14px; margin: 4px 0; }
.agree-list li { margin: 4px 0; }
.agree-dialog .primary { height: 46px; letter-spacing: .1em; }
.agree-dialog .primary:disabled { opacity: .45; }
.agree-dialog a { color: var(--red); }
.agree-bar { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 40; background: var(--gold-soft); border-top: 1px solid var(--gold);
  display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 12px; font-size: 13px; }
.agree-bar[hidden] { display: none; }
.agree-bar .primary { height: 36px; padding: 0 14px; letter-spacing: 0; font-size: 14px; flex: none; }
.disclaimer .pc-link { margin-right: 10px; }

/* ---- 旅行方位 ---- */
#trForm { margin-top: 8px; }
#trForm .tr-sec { margin: 6px 0 0; color: var(--red); font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
#trGo { grid-column: 1 / -1; }
.tr-dest.top { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.tr-avoid { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, transparent); }
.tr-avoid ul { margin: 6px 0; }
#travelResult { margin-top: 12px; }
.tr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tr-dest { border: 1px solid color-mix(in srgb, var(--good) 40%, var(--line)); background: var(--good-bg); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 1px; }
.tr-dest b { font-size: 15px; } .tr-dest small { color: var(--good); font-size: 12px; } .tr-dest span { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .tr-grid { grid-template-columns: 1fr 1fr; } }
.legal .terms ul { padding-left: 18px; margin: 4px 0; }
.legal .terms ul li { margin: 4px 0; }

/* ---- 八字五行、開運、今日運勢、擇日 ---- */
.bz-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 10px; text-align: center; }
.bz-pillars div { border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; background: var(--card); }
.bz-pillars small { display: block; color: var(--muted); font-size: 12px; }
.bz-pillars b { font-size: 20px; letter-spacing: .1em; color: var(--red); }
.el-bars { display: grid; gap: 4px; margin-bottom: 8px; }
.el-bar { display: grid; grid-template-columns: 22px 1fr 22px; align-items: center; gap: 6px; font-size: 13px; }
.el-bar i { height: 10px; border-radius: 5px; min-width: 2px; display: block; }
.el0 i { background: #3f8f4f; } .el1 i { background: #c8402f; } .el2 i { background: #b8862b; } .el3 i { background: #9a9a9a; } .el4 i { background: #2f5f9a; }
.md-form, .zr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.md-form label, .zr-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.md-form .primary { grid-column: 1 / -1; }
.zr-form .full { grid-column: 1 / -1; }
.zr-form .zr-wk { flex-direction: row; align-items: center; gap: 6px; }
.md-form input, .md-form select, .zr-form input[type=date], .zr-form input[type=text], .zr-form select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); color: var(--ink); font: inherit; min-width: 0; }
.md-date { font-size: 13px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.md-top { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 6px 0 10px; }
.md-top .match-score { width: 96px; height: 96px; }
.md-areas div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; font-size: 14px; }
.md-stars { color: var(--gold); letter-spacing: 1px; }
.md-lucky { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; text-align: center; }
.md-lucky div { background: var(--gold-soft); border-radius: 10px; padding: 6px 2px; }
.md-lucky small { display: block; font-size: 11px; color: var(--muted); }
.md-lucky b { font-size: 15px; }
@media (max-width: 400px) { .md-lucky { grid-template-columns: 1fr 1fr; } }
.bz-day.best { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
#zrResult { margin-top: 12px; }

/* ---- 願望達成計劃 ---- */
.wp-prog { position: relative; height: 22px; background: var(--line); border-radius: 11px; overflow: hidden; margin: 8px 0 4px; }
.wp-prog i { position: absolute; inset: 0 auto 0 0; background: var(--good); border-radius: 11px; transition: width .3s; }
.wp-prog span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; font-weight: 700; }
.wp-h { margin: 14px 0 4px; color: var(--red); font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.wp-h small { color: var(--muted); font-weight: 400; font-size: 12px; }
.wp-task { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; cursor: pointer; }
.wp-task input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--good); }
.wp-task.done span { text-decoration: line-through; color: var(--muted); }
.wp-actions { margin: 10px 0; }
.wp-actions .ghost-btn { height: 40px; padding: 0 14px; }

/* ---- 每日願望打氣 ---- */
.wc-card { display: grid; gap: 6px; }
.wc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wc-top b { font-size: 15px; min-width: 0; }
.wc-streak { flex: none; font-size: 13px; color: var(--red); font-weight: 700; }
.wc-cheer { margin: 2px 0; font-size: 15px; }
.wc-good { margin: 0; color: var(--good); font-weight: 700; font-size: 14px; }
.wc-task { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--gold-soft); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.wc-task .primary { height: 36px; padding: 0 14px; flex: none; letter-spacing: 0; font-size: 14px; }
.wc-review { border: 1px dashed var(--gold); border-radius: 10px; padding: 8px 10px; }
.wc-review p { margin: 4px 0; }
.wc-go, .wc-review .ghost-btn { height: 38px; padding: 0 12px; }
.wp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 22px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: calc(100% - 32px); transition: opacity .5s; }
.wp-toast.out { opacity: 0; }

/* ---- WhatsApp ---- */
.wa-only { display: none !important; }
.has-wa .wa-only { display: revert !important; }
.has-wa button.wa-only, .has-wa a.wa-btn.wa-only { display: inline-flex !important; }
.wa-btn { background: #25d366 !important; color: #fff !important; border-color: #1ebe5a !important; align-items: center; justify-content: center; }
.wa-link { display: inline-flex; padding: 8px 14px; border-radius: 20px; text-decoration: none; font-weight: 700; }
.chat-wa { margin-left: auto; margin-right: 8px; font-size: 13px; color: #fff; background: #25d366; border-radius: 14px; padding: 3px 10px; text-decoration: none; white-space: nowrap; }
@media (max-width: 520px) {
  .svc-item { flex-wrap: wrap; }
  .svc-item > div { flex: 1 1 100%; }
  .svc-acts { width: 100%; justify-content: flex-end; margin-top: 6px; }
}

/* ---- 祈福燈 ---- */
.bl-lamps { display: grid; gap: 8px; margin: 8px 0; }
.bl-lamp { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--card); }
.bl-lamp .primary { height: 38px; padding: 0 14px; letter-spacing: 0; font-size: 14px; }
.bl-lamp .ghost-btn { height: 36px; padding: 0 12px; }
.bl-info b { display: block; font-size: 15px; } .bl-info small { color: var(--muted); font-size: 12px; }
.bl-bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bl-bar i { display: block; height: 100%; background: var(--lc); }
.bl-ok { font-size: 12px; color: var(--good); font-weight: 700; white-space: nowrap; }
.bl-flame { width: 40px; height: 46px; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.bl-flame::after { content: ''; width: 34px; height: 12px; border-radius: 0 0 17px 17px; background: var(--lc); opacity: .85; }
.bl-flame span { position: absolute; bottom: 11px; width: 14px; height: 22px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6c8, #ffb02e 55%, #e8590c); opacity: .35; transform-origin: 50% 100%; }
.bl-lamp.lit .bl-flame span, .bl-lamp.full .bl-flame span { opacity: 1; animation: blFlicker 1.6s ease-in-out infinite; box-shadow: 0 0 14px 4px rgba(255, 176, 46, .45); }
@keyframes blFlicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, .94) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .bl-lamp.lit .bl-flame span { animation: none; } }
.bl-new { margin: 8px 0; } .bl-new summary { cursor: pointer; font-weight: 700; color: var(--red); padding: 6px 0; }
.bl-fam { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-prayer { font-size: 17px; line-height: 1.8; }
.bl-home { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; }
.bl-home .primary, .bl-home .ghost-btn { height: 38px; padding: 0 14px; flex: none; letter-spacing: 0; font-size: 14px; }

/* ---- 玄空飛星宅盤 ---- */
.xk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 330px; margin: 8px auto; }
.xk-cell { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--card); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.xk-cell b { font-size: 22px; color: var(--muted); }
.xk-cell small { font-size: 11px; color: var(--muted); }
.xk-m, .xk-w { position: absolute; top: 4px; font-size: 18px; font-weight: 900; }
.xk-m { left: 8px; } .xk-w { right: 8px; }
.xk-m.good, .xk-w.good { color: var(--good); } .xk-m.bad, .xk-w.bad { color: var(--bad); } .xk-m.mid, .xk-w.mid { color: var(--gold); }
.xk-face { border: 2px solid var(--red); } .xk-sit { border: 2px dashed var(--muted); }

/* ---- 風水學堂 ---- */
#fsSeg button { letter-spacing: .05em; }
.sc-list { display: grid; gap: 6px; margin: 10px 0; }
.sc-item { border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.sc-item.done { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }
.sc-head { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.sc-head b { flex: 1; font-size: 15px; }
.sc-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; background: var(--gold-soft); font-weight: 700; flex: none; }
.sc-item.done .sc-no { background: var(--good); color: #fff; }
.sc-lv { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; }
.sc-body { padding: 0 12px 12px; }
.sc-body > p { line-height: 1.8; }
.sc-act { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--gold-soft); border-radius: 10px; padding: 8px 10px; margin: 10px 0; font-size: 14px; }
.sc-act .ghost-btn { flex: none; height: 36px; padding: 0 12px; }
.sc-quiz { border-top: 1px dashed var(--line); padding-top: 8px; }
.sc-q { margin: 8px 0; padding: 6px 8px; border-radius: 8px; }
.sc-q label { display: block; padding: 4px 0; font-size: 14px; cursor: pointer; }
.sc-q.right { background: var(--good-bg); } .sc-q.wrong { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.sc-ans { font-weight: 700; } .sc-q.right .sc-ans { color: var(--good); } .sc-q.wrong .sc-ans { color: var(--bad); }
.sc-quiz .primary { width: 100%; height: 42px; margin-top: 6px; }
.sc-result { font-weight: 700; text-align: center; }
.sc-cert { position: relative; border: 3px double var(--gold); border-radius: 14px; padding: 18px 16px; text-align: center; background: var(--card); margin: 12px 0; }
.sc-cert h4 { color: var(--red); font-size: 20px; margin: 4px 0 8px; letter-spacing: .1em; }
.sc-seal { display: inline-block; border: 2px solid var(--red); color: var(--red); padding: 2px 8px; font-weight: 900; letter-spacing: .2em; transform: rotate(-4deg); }
/* ---- 今日運勢準確度 ---- */
.md-acc { font-size: 13px; border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.md-acc.acc-hi { background: var(--good-bg); color: var(--good); }
.md-acc.acc-mid { background: var(--gold-soft); }
.md-acc.acc-lo { background: color-mix(in srgb, var(--bad) 10%, transparent); }
#mdForm { margin-top: 8px; }
/* ---- 保留資料 ---- */
.md-cloud { border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.md-cloud.saved { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.md-cloud .primary { width: 100%; height: 42px; margin-top: 6px; }
.md-cloud .primary:disabled { opacity: .45; }
.md-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.6; }
.md-consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.md-code { font-size: 16px; font-weight: 700; letter-spacing: .05em; background: var(--card); padding: 2px 8px; border-radius: 6px; }
.md-cloud .ghost-btn { height: 30px; padding: 0 10px; }
.md-restore { margin-top: 10px; } .md-restore summary { cursor: pointer; color: var(--red); font-weight: 700; padding: 4px 0; }
.md-row { display: flex; gap: 8px; } .md-row input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: var(--card); color: var(--ink); }
.md-row .primary { height: 42px; padding: 0 16px; flex: none; }

@media (max-width: 400px) { .bottom-nav button { font-size: 11px; } .bottom-nav .ic { width: 27px; height: 27px; font-size: 14px; } }
#dvSeg button { letter-spacing: .05em; }
/* ---- 易經占卜 ---- */
.ic-ql { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 6px 0; }
.ic-ql input { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: var(--card); color: var(--ink); }
.ic-cast { display: grid; gap: 10px; justify-items: center; margin: 10px 0; }
.ic-cast .primary { width: 100%; height: 46px; }
.ic-cast .ghost-btn { height: 38px; padding: 0 14px; }
.ic-coins { display: flex; gap: 12px; }
.ic-coin { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: radial-gradient(circle at 35% 35%, #f3d98b, #b8862b); color: #5a3b0a; border: 2px solid #8a6418; box-shadow: inset 0 0 0 5px rgba(255,255,255,.15); }
.ic-coin.t { background: radial-gradient(circle at 35% 35%, #e6d2a0, #9b7a3a); }
.ic-coin.spin { animation: icSpin .5s ease-out; }
@keyframes icSpin { from { transform: rotateY(720deg) scale(.6); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .ic-coin.spin { animation: none; } }
.ic-hex { display: grid; gap: 6px; width: 96px; margin: 6px auto; }
.ic-line { display: flex; gap: 10px; height: 10px; }
.ic-line i { flex: 1; background: var(--ink); border-radius: 2px; }
.ic-line.yang i { margin: 0 -5px; } .ic-line.yang i:last-child { display: none; }
.ic-line.yang i:first-child { flex: 1; }
.ic-line.mv i { background: var(--red); }
.ic-line.empty i { background: var(--line); }
.ic-pair { display: flex; justify-content: center; align-items: center; gap: 10px; text-align: center; margin: 10px 0; }
.ic-pair > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ic-pair small { color: var(--muted); font-size: 12px; } .ic-pair b { font-size: 16px; }
.ic-arrow { font-size: 24px; color: var(--muted); }
.ic-q { text-align: center; font-weight: 700; }
/* ---- 奇門遁甲 ---- */
.qm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.qm-cell { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--card); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; }
.qm-cell.hl { border: 2px solid var(--gold); background: var(--gold-soft); }
.qm-god { position: absolute; top: 4px; left: 6px; font-size: 11px; }
.qm-star { position: absolute; top: 4px; right: 6px; font-size: 12px; font-weight: 700; }
.qm-star i { font-style: normal; font-size: 10px; color: var(--muted); margin-left: 2px; }
.qm-door { font-size: 22px; font-weight: 900; }
.qm-di { font-size: 13px; color: var(--muted); }
.qm-cell small { font-size: 11px; color: var(--muted); }
.qm-mid b { font-size: 18px; }
.qm-cell .g { color: var(--good); } .qm-cell .b { color: var(--bad); }
/* ---- 每日運勢會員 ---- */
.md-locked { border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: linear-gradient(135deg, var(--gold-soft), transparent); }
.md-locked h4 { margin: 0 0 4px; } .md-locked ul { margin: 4px 0 8px; padding-left: 18px; font-size: 14px; }
.md-locked .primary { width: 100%; height: 44px; letter-spacing: .05em; }
.md-premium { position: relative; border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.md-premium h4 { margin: 8px 0 4px; color: var(--red); }
.md-badge { position: absolute; top: -10px; right: 10px; background: var(--gold); color: #3a2a08; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.md-3d { display: grid; gap: 6px; }
.md-3d > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.md-3d small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.md-3s { font-weight: 700; } .md-3s.good { color: var(--good); } .md-3s.mid { color: var(--gold); } .md-3s.bad { color: var(--bad); }
.md-cloud.flash { animation: mdFlash 1.6s; }
@keyframes mdFlash { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 4px var(--gold); } }

/* ---- 求問者資料 ---- */
.qr-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.qr-box h4 { margin: 0 0 6px; color: var(--red); }
.qr-msg { margin: 6px 0 0; color: var(--bad); } .qr-msg.ok { color: var(--good); }
.ic-cast .primary:disabled, .ic-cast .ghost-btn:disabled, #qmForm .primary:disabled { opacity: .4; cursor: not-allowed; }

.qm-cell.ming { border: 2px solid var(--red); }
.qm-ming { position: absolute; bottom: 3px; right: 5px; font-style: normal; font-size: 11px; font-weight: 900; color: #fff; background: var(--red); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; }
.qr-box .zw-form { border: 0; padding: 0; margin: 0; background: none; box-shadow: none; }
.qr-box input[type=text] { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: var(--card); color: var(--ink); }
/* ---- 大運與關口 ---- */
.dy-list { display: grid; gap: 6px; }
.dy-item { display: grid; grid-template-columns: 64px 1fr; gap: 10px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 8px 10px; background: var(--card); }
.dy-item.good { border-left-color: var(--good); } .dy-item.mid { border-left-color: var(--gold); } .dy-item.bad { border-left-color: var(--bad); }
.dy-item.cur { box-shadow: 0 0 0 2px var(--gold) inset; background: var(--gold-soft); }
.dy-item.past { opacity: .6; }
.dy-gz { text-align: center; } .dy-gz b { display: block; font-size: 20px; color: var(--red); letter-spacing: .05em; } .dy-gz small { font-size: 11px; color: var(--muted); }
.dy-body b { font-size: 14px; margin-right: 6px; } .dy-body small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.dy-note { margin: 4px 0 0; font-size: 13px; } .dy-note.bad { color: var(--bad); } .dy-note.mid { color: #9a6b00; } .dy-note.good { color: var(--good); }
/* ---- 流年開運錦囊 ---- */
.ya-seg { max-width: 320px; } .ya-seg button { letter-spacing: 0; font-size: 13px; }
.ya-buy ol { margin: 6px 0; padding-left: 20px; } .ya-buy li { margin: 6px 0; } .ya-buy li small { display: block; color: var(--muted); font-size: 12px; }

/* ---- 開運物品 ---- */
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop-item { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; background: var(--card); }
.shop-item img, .shop-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--gold-soft); display: grid; place-items: center; font-size: 34px; }
.shop-item b { font-size: 14px; } .shop-item small { color: var(--muted); font-size: 12px; }
.shop-item .svc-btn { margin-top: auto; height: 36px; }
.shop-item.sold { opacity: .6; } .shop-sold { margin-top: auto; text-align: center; color: var(--bad); font-weight: 700; }
.ya-buybtn { display: inline-flex; margin-top: 4px; height: 32px; padding: 0 12px; font-size: 13px; }

/* ---- 生肖：開運、流月 ---- */
.zy-lucky b { font-size: 13px; }
.zy-sum { font-size: 14px; }
.zm { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.zm summary { cursor: pointer; padding: 10px 12px; font-weight: 700; color: var(--red); }
.zm-list { padding: 0 12px 4px; }
.zm-row { border-top: 1px dashed var(--line); padding: 8px 0; }
.zm-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.zm-h b { min-width: 52px; } .zm-h span { color: var(--muted); font-size: 13px; } .zm-h small { color: var(--muted); font-size: 12px; }
.zm-h em { margin-left: auto; font-style: normal; color: var(--gold); letter-spacing: 1px; }
.zm-row.good .zm-h b { color: var(--good); } .zm-row.bad .zm-h b { color: var(--bad); }
.zm-row p { margin: 2px 0 0; font-size: 14px; }
.zm .hint { padding: 0 12px 10px; margin: 0; }

/* ---- 數字吉凶 ---- */
.nl-out { margin-top: 12px; }
.nl-head p { margin: 2px 0; font-size: 14px; }
.nl-num { font-size: 18px !important; font-weight: 900; color: var(--red); }
.nl-pairs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.nl-pair { display: inline-flex; flex-direction: column; align-items: center; min-width: 54px; padding: 4px 6px; border-radius: 10px; background: var(--gold-soft); font-weight: 900; font-size: 18px; }
.nl-pair small { font-size: 11px; font-weight: 600; color: var(--muted); }
.nl-pair.good { background: var(--good-bg); color: var(--good); } .nl-pair.bad { background: var(--bad-bg); color: var(--bad); }
.nl-sum { font-weight: 600; }
.nl-pick { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.nl-pick h4 { margin: 0; }
.nl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nl-chips span { padding: 4px 12px; border-radius: 99px; border: 1.5px solid var(--gold); font-weight: 900; letter-spacing: .1em; }
.err { color: var(--bad); font-size: 14px; margin: 6px 0; }
#dvSeg button { letter-spacing: 0; font-size: 14px; }

/* ---- 分享圖卡 ---- */
.share-btn { display: block; width: 100%; margin: 12px 0 4px; height: 44px; border-radius: 12px; border: 1.5px solid var(--gold); background: var(--gold-soft); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.share-btn:disabled { opacity: .6; }
.sc-img { width: 100%; max-height: 52vh; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); }
.sc-btns { display: flex; flex-direction: column; gap: 8px; }
.sc-btns a, .sc-btns button { display: grid; place-items: center; height: 42px; border-radius: 10px; text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.sc-btns a.primary { background: var(--red); color: #fff; }

/* ---- 占卜四分頁 ---- */
@media (max-width: 420px) { #dvSeg { flex-wrap: wrap; } #dvSeg button { flex: 1 1 45%; } }

/* ---- 求籤 ---- */
.qq-stage { text-align: center; margin: 14px 0; }
.qq-tube { font-size: 64px; display: inline-block; }
.qq-tube.shaking { animation: qqShake .18s infinite alternate; }
@keyframes qqShake { from { transform: rotate(-12deg) translateY(2px); } to { transform: rotate(12deg) translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .qq-tube.shaking { animation: none; } }
.qq-cup { font-size: 16px; font-weight: 700; } .qq-cup.ok { color: var(--good); }
.qq-stick { text-align: center; margin: 10px auto; padding: 10px; border: 2px solid var(--gold); border-radius: 12px; max-width: 320px; background: var(--card); }
.qq-stick small { display: block; color: var(--muted); }
.qq-stick b { font-size: 18px; } .qq-stick.good b { color: var(--good); } .qq-stick.bad b { color: var(--bad); } .qq-stick.mid b { color: var(--gold); }
.qq-title { text-align: center; color: var(--red); font-size: 22px; margin: 8px 0; letter-spacing: .2em; }
.qq-verse { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; margin: 8px 0; background: var(--gold-soft); border-radius: 12px; font-size: 18px; font-weight: 600; letter-spacing: .15em; }

/* ---- 拜神日子 ---- */
.bs-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.bs-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.bs-row.bs-major { border-color: var(--gold); }
.bs-row.today { background: var(--good-bg); border-color: var(--good); }
.bs-date { text-align: center; } .bs-date b { display: block; font-size: 18px; color: var(--red); } .bs-date small { font-size: 11px; color: var(--muted); }
.bs-main { min-width: 0; } .bs-main b { display: block; } .bs-main small { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.bs-row em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bs-opt { display: flex; gap: 6px; align-items: center; font-size: 14px; margin: 6px 0 10px; }

/* ---- 流月 ---- */
.ly-row { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background: var(--card); }
.ly-row summary { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 8px 10px; cursor: pointer; }
.ly-row summary span { color: var(--muted); font-size: 13px; }
.ly-row summary em { margin-left: auto; font-style: normal; color: var(--gold); }
.ly-row.good summary b { color: var(--good); } .ly-row.bad summary b { color: var(--bad); }
.ly-row .fs-tips, .ly-row .hint { margin: 0 10px 8px; }
.ly-sum { font-size: 14px; }
.ly-locked { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.ly-locked div { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 8px; background: var(--gold-soft); font-size: 12px; opacity: .75; }

/* ---- 推薦 ---- */
.md-refer { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.md-refer p { margin: 4px 0; }

/* ---- 占卜五分頁 ---- */
@media (max-width: 420px) { #dvSeg button { flex: 1 1 30%; } }

/* ---- 星座 ---- */
.xz-seg { margin: 8px 0; }
.xz-grid .zchip b { font-size: 22px; }
.xz-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 8px 0; text-align: center; }
.xz-week div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; display: flex; flex-direction: column; font-size: 12px; }
.xz-week b { font-size: 14px; } .xz-week em { font-style: normal; font-weight: 900; font-size: 15px; color: var(--gold); }
.xz-week span { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.xz-week .good { border-color: var(--good); background: var(--good-bg); } .xz-week .good em { color: var(--good); }
.xz-week .bad { border-color: var(--bad); background: var(--bad-bg); } .xz-week .bad em { color: var(--bad); }

/* ---- 解夢 ---- */
.jm-card h4 small { margin-left: 6px; }
.jm-card .pill { vertical-align: middle; }
.jm-cat { padding: 4px 12px 8px; }
.jm-cat b { font-size: 13px; color: var(--muted); }
.jm-cat button { padding: 4px 12px; border-radius: 99px; border: 1.5px solid var(--gold); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }

/* ---- 年費、送禮會員卡 ---- */
.md-join-y { width: 100%; margin-top: 8px; height: 42px; }
.md-gift { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.md-gift-row { display: flex; gap: 6px; margin-top: 6px; }
.md-gift-row input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); color: var(--ink); font: inherit; letter-spacing: .05em; }
.gift-box { margin: 8px 0; padding: 10px 12px; border: 1.5px dashed var(--gold); border-radius: 12px; background: var(--gold-soft); }
.gift-box b { display: block; } .gift-box code { font-size: 17px; letter-spacing: .08em; user-select: all; }
.gift-box small { display: block; color: var(--muted); margin: 4px 0; }
.gift-box .wa-share { display: inline-block; margin-top: 4px; font-weight: 700; color: var(--good); }
