/* PROTOTYPE（#30）：蘋果原生風格。色彩都放在變數裡，之後加深色模式只要換這一組 */
.pt-root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --label: #0a0a0a;   /* 玄 */
  --label2: #3a3a3c;
  --label3: #8e8e93;
  --sep: rgba(60, 60, 67, 0.16);
  --grid: #e9e9ee;
  --board-line: #8e8e93;
  --main-star: #861c20;   /* 紫微格子的字色照文墨天機截圖取色（2026-11-03 重取） */
  --god: #234d77;   /* 雜曜深鋼藍（文墨） */
  --palace-name: #e8443c;   /* 宮名朱紅（文墨） */
  --dim: #5d5d5d;   /* 廟旺、長生、流年小限（文墨） */
  --fill: rgba(118, 118, 128, 0.12);
  --lu: #2a7d2a;   /* 四化照文墨天機「自化圖示」：祿綠、權紫、科藍、忌紅（2026-11-03） */
  --quan: #651d65;
  --ke: #3f7cc4;
  --ji: #e8443c;
  --tap: #007aff;   /* 可以點：系統藍 */
  --wx-mu: #2d7a3a; --wx-huo: #c23b2e; --wx-tu: #7a4a12; --wx-jin: #b8961a; --wx-shui: #2a5aa8;   /* 五行字色，跟八字盤同一組（2026-10-15） */
  --life: #c2410c;
  --decade: #3a7d22;   /* 運限層：限草綠、年寶藍、月深橘、日紫、時墨青、小限天青（2026-10-15 加深，白底對比 ≥ 4.5） */
  --year: #1667b8;
  --month: #bf520a;
  --day: #7b3db5;
  --hour: #0b7a6a;
  --xiaoxian: #0a78b0;
  --lucky: #631c63;   /* 六吉、祿存、天馬（文墨紫） */
  --boshi: #4f9a9a;   /* 十二神博士組（文墨青） */

  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--label);
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(58px + env(safe-area-inset-bottom));
}
.pt-root button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* 導覽列 */
.pt-nav {
  position: sticky; top: 0; z-index: 5; flex: none; box-sizing: border-box;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  background: rgba(242, 242, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.pt-nav.pt-nav-extra { grid-template-columns: 88px 1fr 88px; }
.pt-nav-end { display: flex; align-items: center; justify-content: flex-end; }
.pt-nav-title { text-align: center; font-size: 17px; font-weight: 600; line-height: 1.2; }
.pt-brand { font-size: 17px; font-weight: 600; letter-spacing: 0.18em; color: var(--label2); white-space: nowrap; }
.pt-nav-title small { display: block; font-size: 11px; font-weight: 400; color: var(--label3); }
.pt-root .pt-icon { width: 44px; height: 44px; font-size: 22px; color: var(--label); }
.pt-root .pt-compass-btn { display: grid; place-items: center; }
.pt-root .pt-compass-btn[hidden] { display: none; }
.pt-root .pt-compass-btn.on { color: #b8322a; }
.pt-nav-pen { display: flex; align-items: center; justify-content: center; }
.pt-nav-pen.on { color: #007aff; }
.pt-nav-pen { position: relative; }
.pt-pen-dot { position: absolute; top: 9px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; }
.pt-ink-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  margin: 0 16px 8px; padding: 6px 10px; border-radius: 12px; background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.pt-ink-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.pt-ink-dot.on { box-shadow: 0 0 0 2px var(--label); }
.pt-ink-tool { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--label2); }
.pt-ink-tool.on { background: var(--fill); color: var(--label); }
.pt-ink-clear { width: auto; padding: 0 8px; font-size: 13px; }
.pt-root .pt-ink-done { width: auto; padding: 0 8px; font-size: 15px; font-weight: 600; color: #007aff; }
.pt-ink-tool:disabled { opacity: 0.35; }
.pt-ink {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4;
  pointer-events: none; touch-action: none;
}
.pt-ink.on { pointer-events: auto; cursor: crosshair; }
.pt-ink.erase { cursor: cell; }

/* 紫微｜八字 */
.pt-seg { flex: none; display: flex; margin: 4px 16px 10px; padding: 2px; border-radius: 9px; background: var(--fill); }
.pt-root .pt-seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.pt-root .pt-seg button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1); }

/* 盤面 */
.pt-board {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 1px; margin: 0 8px; background: var(--board-line);
  outline: 1.5px solid var(--board-line); outline-offset: -1.5px; border-radius: 6px; overflow: hidden;
  touch-action: pan-y pinch-zoom; position: relative;
  flex: 1 1 auto; min-height: 0; height: auto;
}
/* 盤外方位：盤的外圈留一條邊，字對著午、子、卯、酉宮的正中（午在上排第二格、子在下排第三格、酉在右欄第二格、卯在左欄第三格） */
.pt-compass {
  --cx: 13px; --cy: 15px; --cfs: 11px; --r2: 0.375; --r3: 0.625;
  position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
  margin: 0 1px; padding: var(--cy) var(--cx);
}
.pt-compass > .pt-board { margin: 0; }
.pt-compass.off { padding: 0; }
.pt-compass.off > .pt-cmp { display: none; }
.pt-cmp {
  position: absolute; font-size: var(--cfs); line-height: 1; color: var(--label3); pointer-events: none;
}
.pt-cmp.n { top: calc((var(--cy) - var(--cfs)) / 2); left: calc(var(--cx) + (100% - 2 * var(--cx)) * 0.375); transform: translateX(-50%); }
.pt-cmp.s { bottom: calc((var(--cy) - var(--cfs)) / 2); left: calc(var(--cx) + (100% - 2 * var(--cx)) * 0.625); transform: translateX(-50%); }
.pt-cmp.e { left: calc((var(--cx) - var(--cfs)) / 2); top: calc(var(--cy) + (100% - 2 * var(--cy)) * var(--r3)); transform: translateY(-50%); }
.pt-cmp.w { right: calc((var(--cx) - var(--cfs)) / 2); top: calc(var(--cy) + (100% - 2 * var(--cy)) * var(--r2)); transform: translateY(-50%); }
.pt-cell {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 0; overflow: hidden;
  padding: 6px 4px 4px; background: var(--card); transition: background 0.15s;
}
/* 版面一：直書 */
/* 主星／輔星同字級（--star-fs）；雜曜手機另用 --extra-fs（全盤一致、略小）。字級跟格子／盤走 */
.pt-cell > * { --star-fs: 11.5px; }
.pt-stars-v { font-size: var(--star-fs); flex: 1; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: flex-start; align-content: flex-start; gap: 0.2em 0.25em; min-height: 0; min-width: 0; overflow: hidden; }
.pt-star-tier { display: contents; }
.pt-board .pt-cell .pt-stars-v.pack { gap: 0.08em 0; }
.pt-stars-v.many { row-gap: 0.1em; }
.pt-age-lines { flex: none; margin: 2px 0; padding: 0 5px; text-align: center; font-size: calc(8px * var(--age-fit, 1)); line-height: 1.25; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; }
.pt-hstars { display: contents; font-size: max(8px, calc(var(--star-fs) * 0.8)); }
.pt-cell-foot.pt-foot-a { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; min-height: 0; }
.pt-foot-left { flex: none; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.pt-foot-names { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; align-items: flex-end; gap: 3px; }
.pt-cell.packed .pt-god { font-size: 7.5px; line-height: 1.05; }
.pt-cell.packed .pt-name-row { min-height: 0; line-height: 1.15; flex: none; }
.pt-cell.packed .pt-hname, .pt-cell.packed .pt-pname { font-size: 11px; line-height: 1.15; }
.pt-cell.tiny .pt-god { font-size: 7px; }
.pt-cell.tiny .pt-hname, .pt-cell.tiny .pt-pname { font-size: 10px; }
.pt-cell.tiny .pt-name-row { min-height: 0; line-height: 1.1; }
.pt-cell.cram { padding-left: 2px; padding-right: 2px; }
.pt-cell.cram .pt-star-v { max-height: none; }
.pt-cell.cram .pt-god { font-size: 7.5px; line-height: 1.05; }
.pt-cell.dense .pt-hname, .pt-cell.dense .pt-pname { font-size: 9.5px; line-height: 1.05; }
.pt-cell.dense .pt-name-row { min-height: 0; line-height: 1.05; }
.pt-natal-row { flex: none; }
.pt-name-row { position: relative; display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; min-height: 1.2em; flex: none; width: 100%; }
.pt-name-row > .pt-hname, .pt-name-row > .pt-pname, .pt-name-row > .pt-hname-pair { flex: none; white-space: nowrap; margin-left: auto; }
/* 選到流月以下：月日時另起一欄，疊在年限宮名的左邊 */
.pt-foot-left .pt-ages { font-size: 8px; letter-spacing: -0.2px; }
.pt-name-col { display: flex; flex-direction: column; align-items: flex-end; flex: none; white-space: nowrap; }
.pt-name-left { align-self: flex-start; }
.pt-cell.dense .pt-name-col > * { line-height: 1.05; }
.pt-hname-pair { display: inline-flex; flex-shrink: 0; gap: 3px; white-space: nowrap; }
.pt-hname-pair .pt-hname { margin-left: 0; flex: none; }
.pt-name-row .pt-ages { margin-right: auto; flex: none; font-size: 8px; letter-spacing: -0.2px; text-align: left; white-space: nowrap; }
.pt-foot-a .pt-ages { line-height: 1.2; white-space: nowrap; }
.pt-ages.year { color: var(--year); }
.pt-ages.pt-xian { color: var(--xiaoxian); }
.pt-ages.month { color: var(--month); }
.pt-ages.day { color: var(--day); }
.pt-ages.hour { color: var(--hour); }
.pt-god { font-size: 9px; line-height: 1.1; color: var(--label2); white-space: nowrap; }
.pt-god.boshi { color: var(--boshi); }
.pt-foot-a .pt-pname em { margin: 0; }
/* 干支欄跟著底列排，底列至少有干支那麼高，流年小限兩行才不會掉下來壓到它 */
.pt-gz-col {
  flex: none; width: 1.15em; margin: 0 -1px 0 -3px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.pt-gz-col .pt-god { font-size: 8.5px; line-height: 1.1; }
.pt-gz-v {
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 1px; color: var(--label);
}
.pt-wide .pt-gz-v { font-size: 16px; }
.pt-star-v {
  flex: 0 0 auto; align-self: flex-start; min-width: 1.05em; max-height: 100%;
  overflow: hidden; min-height: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  line-height: 1.05; letter-spacing: 0;
}
/* 一字一列，不用直排。Android 的直排字盒比字寬，四化方塊會偏到星名左邊 */
.pt-star-name {
  display: flex; flex-direction: column; align-items: center;
  flex: 1 1 auto; min-height: 0; overflow: hidden; line-height: 1.05;
}
.pt-star-name i { font-style: normal; }
.pt-star-v .pt-badge { flex: none; writing-mode: horizontal-tb; }
.pt-bright { flex: none; font-size: 8px; font-weight: 400; line-height: 1; color: var(--dim); }
.pt-star-v.main { font-weight: 700; color: var(--main-star); }
.pt-star-v.support { font-weight: 500; color: var(--god); }
.pt-star-v.main, .pt-star-v.support { font-size: max(9px, var(--star-fs)); }
.pt-star-v.support.lucky { font-weight: 700; color: var(--lucky); }
.pt-star-v.support.sha { font-weight: 700; color: var(--label); }
.pt-star-v.extra { font-size: max(8px, var(--star-fs)); font-weight: 400; color: var(--god); }
/* 生年四化：星名塗底色、白字（暫用色，等美術稿） */
.pt-hstar.decade { color: var(--decade); }
.pt-hstar.year { color: var(--year); }
.pt-hstar.month { color: var(--month); }
.pt-hstar.day { color: var(--day); }
.pt-hstar.hour { color: var(--hour); }
.pt-hstar.pt-xian { color: var(--xiaoxian); }

/* 版面二：橫書 */
.pt-main-h { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.pt-main-h span, .pt-rest-h span, .pt-detail-stars span { display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; }
.pt-rest-h { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0 5px; margin-top: 2px; font-size: 11px; line-height: 1.45; color: var(--label2); }
.pt-rest-h .extra { color: var(--label3); }
.pt-empty { color: var(--label3); font-weight: 400; font-size: 12px; }
/* 點到的宮用淡暖黃：灰色會跟盤外的底色混在一起，像那格被挖空 */
.pt-cell.is-focus { background: linear-gradient(rgba(255, 193, 7, 0.14), rgba(255, 193, 7, 0.14)) var(--card); }
.pt-cell.is-pointed { background: linear-gradient(rgba(0, 122, 255, 0.2), rgba(0, 122, 255, 0.2)) var(--card); box-shadow: inset 0 0 0 2px #007aff; }
.pt-root.pt-bare { height: 100%; min-height: 0; padding: 0; background: transparent; overflow: hidden; }
.pt-root.pt-bare .pt-board { margin: 0; outline-offset: -1.5px; }
.pt-root.pt-bare .pt-board {
  grid-template-rows: minmax(0, 0.84fr) minmax(0, 1.16fr) minmax(0, 1.16fr) minmax(0, 0.84fr);
}
.pt-root.pt-bare > .pt-compass { margin: 0; --r2: 0.355; --r3: 0.645; }
.pt-root.pt-bare .pt-center {
  container: center / size; overflow: hidden; min-height: 0;
  justify-content: center; padding: 6px 6px 8px; gap: 2px; font-size: 11px; line-height: 1.2;
}
.pt-root.pt-bare .pt-center:has(.pt-center-ask),
.pt-root.pt-bare .pt-center:has(.pt-center-ask-input) {
  justify-content: flex-start; padding-top: 22px;
}
/* 用 auto margin 置中：空間不夠時歸零，從上往下排不會切到頂 */
.pt-root.pt-bare .pt-center > .pt-center-edit { margin-top: auto; }
.pt-root.pt-bare .pt-center > :last-child { margin-bottom: auto; }
.pt-root.pt-bare .pt-center-ask,
.pt-root.pt-bare .pt-center-ask-input { margin-bottom: 1.2em; }
.pt-root.pt-bare .pt-center-name { font-size: 13px; line-height: 1.2; }
.pt-root.pt-bare .pt-center-title { font-size: 12px; }
.pt-root.pt-bare .pt-center-bazi { gap: 8px; margin-top: 0; }
.pt-root.pt-bare .pt-center-bazi b { font-size: 14px; }
@container center (max-height: 150px) {
  .pt-center-lunar, .pt-center-lords { display: none; }
}
/* 四化：一層一色的實心方塊、白字，跟那一層的宮名同色；祿權科忌看字 */
.pt-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 3px; font-size: 9.5px; font-weight: 500; font-style: normal;
  writing-mode: horizontal-tb; color: #fff; background: var(--layer);
}
.pt-badge.natal { --layer: var(--ji); } /* 本命四化方塊照文墨一律朱紅，看字分祿權科忌 */
.pt-hua-swatch.lu, .pt-star-v.hua.lu { --layer: var(--lu); }
.pt-hua-swatch.quan, .pt-star-v.hua.quan { --layer: var(--quan); }
.pt-hua-swatch.ke, .pt-star-v.hua.ke { --layer: var(--ke); }
.pt-hua-swatch.ji, .pt-star-v.hua.ji { --layer: var(--ji); }
/* 生年四化：星名整個塗底色 */
.pt-star-v.hua > .pt-star-name { background: var(--layer); color: #fff; border-radius: 3px; padding: 1px 0; }
.pt-hua-key { display: inline-flex; gap: 1px; font-style: normal; }
.pt-hua-swatch { display: inline-block; width: 4px; height: 11px; border-radius: 1px; background: var(--layer); }
.pt-badge.decade { --layer: var(--decade); }
.pt-badge.pt-xian { --layer: var(--xiaoxian); }
.pt-badge.year { --layer: var(--year); }
.pt-badge.month { --layer: var(--month); }
.pt-badge.day { --layer: var(--day); }
.pt-badge.hour { --layer: var(--hour); }
/* 宮裡四化方塊跟星名同一個字級。正方形、方塊間留縫；格子矮就整格縮，不壓扁 */
.pt-star-v .pt-badge { font-size: max(8px, var(--star-fs)); width: 1em; height: 1em; line-height: 1; border-radius: 0.2em; }
.pt-star-v .pt-badge + .pt-badge { margin-top: 1px; }
.pt-badge-gap { visibility: hidden; }
/* 星曜區跟底下運限列（大限年齡、流年流月宮名）之間留縫，方塊再多也不貼上去；
   方塊疊太高時（fitHua）方塊間不留縫、字級整欄縮，照文墨「空間不夠就壓縮、不重疊」 */
.pt-cell > .pt-stars-v { margin-bottom: 2px; }
.pt-stars-v.hua-tight .pt-star-v { gap: 0; }
.pt-stars-v.hua-tight .pt-star-v .pt-badge + .pt-badge { margin-top: 0.5px; }
.pt-stars-v.hua-tight .pt-bright { display: none; }
.pt-stars-v.brightness-hidden .pt-bright { display: none; }
.pt-stars-v.compact-lines .pt-star-v, .pt-stars-v.compact-lines .pt-star-name { line-height: 0.92; }
.pt-stars-v.compact-lines .pt-star-v { gap: 0; }
.pt-stars-v.compact-lines .pt-star-v .pt-badge + .pt-badge { margin-top: 0; }
.pt-stars-v.tight-columns { column-gap: 0; }
.pt-stars-v.tight-columns .pt-star-v { min-width: 1em; }
.pt-stars-v.scroll-fallback { overflow: auto; overscroll-behavior: contain; scrollbar-width: none; }
.pt-stars-v.scroll-fallback::-webkit-scrollbar { display: none; }
.pt-stars-v.scroll-fallback .pt-star-v { max-height: none; overflow: visible; }
.pt-stars-v.scroll-fallback .pt-star-name { flex: none; overflow: visible; }
/* 格子大（平板）時星字放大，干支欄寬要跟著放大，長生兩字和直排干支才不會被切掉、壓到宮名 */
.pt-board .pt-cell .pt-gz-col { width: max(1.15em, calc(var(--star-fs) * 1.7)); }
/* 不顯示十二神時，流月以下名字欄有三列高：大限年齡比照有十二神的排法擺在名字上面，不跟月日時那欄擠同一列 */
.pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) > .pt-foot-left:not(:has(.pt-god))::after { content: ''; flex: none; height: calc(var(--foot-fs) * 1.2 * 3 + 2px); }

/* 宮位底部 */
.pt-hnames { display: flex; gap: 3px; font-size: 10px; font-weight: 600; }
.pt-hnames .decade { color: var(--decade); } .pt-hnames .year { color: var(--year); } .pt-hnames .month { color: var(--month); } .pt-hnames .day { color: var(--day); } .pt-hnames .hour { color: var(--hour); }
.pt-ages { font-size: 10px; color: var(--label3); text-align: center; font-variant-numeric: tabular-nums; }
.pt-root .pt-ages-btn { font-size: 10px; color: var(--label3); padding: 2px 0; border-radius: 4px; }
.pt-root .pt-ages-btn.on { color: var(--label); font-weight: 600; }
.pt-root .pt-ages-btn:active { background: var(--fill); }
.pt-cell-foot { display: flex; justify-content: space-between; align-items: baseline; }
.pt-pname { font-size: 12px; font-weight: 600; color: var(--palace-name); }
.pt-pname em { margin-left: 2px; font-size: 9px; font-style: normal; color: var(--card); background: var(--label3); border-radius: 3px; padding: 0 2px; white-space: nowrap; }
.pt-gz { font-size: 10px; color: var(--label); }

/* 中宮 */
.pt-center {
  grid-row: 2 / 4; grid-column: 2 / 4; background: var(--card);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px; text-align: center; font-size: 12px; color: var(--label3);
}
.pt-center:has(.pt-compass-overlay) { z-index: 3; }
.pt-root .pt-compass-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; width: 100%; height: 100%; padding: 8px;
  border-radius: 4px; color: #0a0a0a; background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.pt-compass-rose { width: min(78%, 170px); max-height: 78%; height: auto; aspect-ratio: 1; flex: none; overflow: visible; }
.pt-compass-turn { transform-box: fill-box; transform-origin: center; }
.pt-compass-turn > circle:first-child { fill: rgba(255, 255, 255, 0.38); stroke: #0a0a0a; stroke-width: 2; }
.pt-compass-turn line { stroke: rgba(10, 10, 10, 0.32); stroke-width: 1; }
.pt-compass-turn polygon { stroke: #0a0a0a; stroke-width: 1; stroke-linejoin: round; }
.pt-compass-north-tip { fill: #b8322a; }
.pt-compass-south-tip { fill: #0a0a0a; }
.pt-compass-pin { fill: #fff; stroke: #0a0a0a; stroke-width: 2; }
.pt-compass-label-bg { fill: #fff; stroke: none; }
.pt-compass-label text { fill: #0a0a0a; font-size: 14px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.pt-compass-caption { max-width: 90%; color: #8e8e93; font-size: 10px; line-height: 1.3; text-align: center; white-space: normal; }
.pt-center-bazi { display: flex; gap: 12px; margin-top: 2px; }
.pt-center-bazi > div { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pt-center-bazi small { font-size: 10px; font-weight: 400; color: var(--label3); }
.pt-center-bazi b { font-size: 15px; font-weight: 600; color: var(--label); line-height: 1.15; }
.pt-center-bazi b.wx-mu { color: var(--wx-mu); } .pt-center-bazi b.wx-huo { color: var(--wx-huo); } .pt-center-bazi b.wx-tu { color: var(--wx-tu); } .pt-center-bazi b.wx-jin { color: var(--wx-jin); } .pt-center-bazi b.wx-shui { color: var(--wx-shui); }
.pt-center-title { font-size: 13px; font-weight: 600; color: var(--label); }
.pt-center-horizon { font-size: 15px; font-weight: 600; color: var(--year); line-height: 1.4; }
.pt-hua-pick { display: flex; justify-content: center; gap: 2px; max-width: 100%; margin-top: 2px; }
.pt-root .pt-hua-pick button {
  position: relative; flex: 0 1 26px; min-width: 0; height: 28px; border-radius: 6px;
  font-size: 13px; line-height: 1; color: var(--label2); background: var(--fill);
}
.pt-root .pt-hua-pick button::after { content: ''; position: absolute; left: -1px; right: -1px; top: 50%; height: max(100%, 44px); transform: translateY(-50%); }
.pt-root .pt-hua-pick button.on { color: #fff; background: var(--layer); }
.pt-root .pt-hua-pick button:disabled { color: var(--label3); opacity: 0.4; cursor: default; }
.pt-hua-pick .natal { --layer: var(--ji); }
.pt-hua-pick .decade { --layer: var(--decade); }
.pt-hua-pick .year { --layer: var(--year); }
.pt-hua-pick .pt-xian { --layer: var(--xiaoxian); }
.pt-hua-pick .month { --layer: var(--month); }
.pt-hua-pick .day { --layer: var(--day); }
.pt-hua-pick .hour { --layer: var(--hour); }
.pt-hint { margin-top: 10px; font-size: 10.5px; line-height: 1.6; color: #aeaeb2; }

/* 底部收合列 */
.pt-root .pt-bar {
  position: relative; z-index: 6; flex: none; margin: 8px 12px 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  min-height: 50px; padding: 8px 12px 8px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 0.5px var(--sep);
}
.pt-root .pt-bar.mini { min-height: 0; padding: 6px 12px; gap: 0; }
.pt-bar-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; }
.pt-bar-open { display: flex; align-items: center; gap: 2px; flex: none; margin-right: auto; }
.pt-bar-label { font-size: 13px; color: var(--label3); }
.pt-bar-value { width: 100%; text-align: left; font-size: 13px; font-weight: 500; line-height: 1.25; white-space: nowrap; }
.pt-bar-chev { color: var(--label3); }
/* 紫微：左邊最下面那層運限，中間同梁巳亥，右邊太極與 ⋯；時辰切換在中宮 */
.pt-nav.pt-nav-hz { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
.pt-nav-start { min-width: 0; display: flex; align-items: center; }
.pt-nav-hz > .pt-nav-end { min-width: 0; }
.pt-root .pt-nav-leading-slot, .pt-root .pt-nav-slot { display: grid; flex: none; place-items: center; width: 44px; height: 44px; }
.pt-root .pt-nav-tail-slot > button { grid-area: 1 / 1; }
.pt-root .pt-nav-leading-slot > * { grid-area: 1 / 1; }
.pt-nav-menu { position: relative; }
.pt-root .pt-hz {
  flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 3px;
  height: 32px; padding: 0 4px; background: transparent; color: #007aff; font-size: 15px; text-align: left;
}
.pt-root .pt-hz span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-root .pt-hz em { flex: none; font-style: normal; font-size: 13px; transform: translateY(-2px); }
.pt-root .pt-hz:disabled { color: var(--label3); opacity: 1; }
.pt-root .pt-full-btn {
  flex: none; width: 44px; height: 44px;
  font-size: 14px; font-weight: 600; color: #007aff; white-space: nowrap;
}
.pt-root.pt-full {
  position: fixed; inset: 0; z-index: 40;
  padding-right: env(safe-area-inset-right); padding-bottom: 0; padding-left: env(safe-area-inset-left);
}
.pt-full-hz {
  flex: none; display: flex; flex-direction: column; gap: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  background: #fbf8f6;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 0.5px var(--sep);
}
.pt-root.pt-full .pt-full-hz {
  margin: 0 12px calc(12px + env(safe-area-inset-bottom));
  padding-bottom: 0;
}
/* 時辰切換固定單獨一行，名字日期多長都不會跑位 */
.pt-center-birth { max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pt-center-birth > span { white-space: nowrap; }
.pt-center-hour { display: inline-flex; align-items: center; border-radius: 8px; background: var(--fill); }
.pt-root .pt-center-hour button { position: relative; width: 22px; height: 22px; font-size: 16px; line-height: 1; color: var(--tap); }
.pt-root .pt-center-hour button::after { content: ''; position: absolute; inset: -11px -4px; }
/* 立太極：換掉的那層宮名用太極色；盤心頂端一顆可取消的標籤 */
.pt-root { --taiji: #a21caf; }
.pt-root .pt-pname.pt-taiji, .pt-root .pt-hname.pt-taiji { color: var(--taiji); }
.pt-center { position: relative; }
.pt-root .pt-taiji-tag {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; background: var(--taiji);
}
.pt-root .pt-taiji-btn { flex: none; display: grid; place-items: center; font-size: 22px; line-height: 1; color: var(--taiji); }
.pt-root .pt-taiji-btn.on { width: 30px; height: 30px; margin: 0 7px; border-radius: 15px; color: #fff; background: var(--taiji); }
.pt-cell { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.pt-cell:focus { outline: none; }
.pt-cell:focus-visible { outline: 2px solid #007aff; outline-offset: -2px; }
.pt-root .pt-toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; color: #fff; background: rgba(0, 0, 0, 0.78);
}
.pt-root .pt-hua-notice {
  max-width: calc(100% - 24px); max-height: 50%; overflow: auto; overflow-wrap: anywhere;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; color: #fff; background: rgba(0, 0, 0, 0.78);
}
.pt-compass > .pt-hua-notice {
  position: absolute; inset-inline: 0; bottom: 8px; width: max-content; margin-inline: auto; z-index: 5;
}
/* 點擊範圍至少 44px：看起來維持原本大小，透明的 ::after 往外撐 */
.pt-root .pt-seg button,
.pt-root .pt-mini-seg button,
.pt-root .pt-step button,
.pt-root .pt-step-reset,
.pt-root .pt-taiji-btn,
.pt-ink-dot,
.pt-bar-open,
.pt-bar-value,
.pt-bar-shrink,
.pt-center-name,
button.pt-set-title { position: relative; }
.pt-root .pt-seg button::after,
.pt-root .pt-mini-seg button::after,
.pt-root .pt-step button::after,
.pt-root .pt-step-reset::after,
.pt-root .pt-taiji-btn::after,
.pt-ink-dot::after,
.pt-bar-open::after,
.pt-bar-value::after,
.pt-bar-shrink::after,
.pt-center-name::after,
button.pt-set-title::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}
.pt-bar-shrink {
  flex: none; width: 32px; height: 32px; margin-left: 2px;
  display: flex; align-items: center; justify-content: center; color: var(--label3);
}
.pt-steppers { display: flex; align-items: center; gap: 8px; }
.pt-step {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 4px; border-radius: 10px; background: var(--fill); font-size: 14px; font-weight: 500;
}
.pt-root .pt-step button { width: 28px; height: 28px; font-size: 20px; line-height: 1; color: var(--tap); }
.pt-root .pt-step-reset {
  flex: none; height: 32px; padding: 0 10px; border-radius: 10px;
  background: var(--fill); font-size: 13px; font-weight: 500; color: var(--tap);
}
.pt-root .pt-step-reset:disabled { color: var(--label3); }
.pt-bar-legend { display: flex; justify-content: space-between; font-size: 10px; color: var(--label3); }
.pt-bar-legend span { display: inline-flex; align-items: center; gap: 2px; }
.pt-bar-legend .pt-badge { width: 11px; height: 11px; font-size: 7px; }

.pt-root .pt-fab {
  position: fixed; right: 20px; bottom: calc(166px + env(safe-area-inset-bottom)); z-index: 6;
  width: 50px; height: 50px; border-radius: 25px; font-size: 26px; line-height: 50px;
  background: var(--label); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* 底部卡片 */
.pt-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.28); }
.pt-backdrop.peek { background: transparent; }
.pt-sheet {
  /* 排盤的第二層選單畫在 .pt-root 外面，變數要自己帶，不然底是透明的，字會壓在格子上 */
  --bg: #f2f2f7;
  --card: #ffffff;
  --label: #0a0a0a;
  --sep: rgba(60, 60, 67, 0.16);
  --tap: #007aff;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 78dvh; overflow-y: auto;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0;
  background: var(--bg); color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  animation: pt-up 0.22s ease-out;
}
.pt-sheet button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.pt-sheet.peek { max-height: 40dvh; }
#horizon-sheet > .pt-backdrop { position: absolute; }
.pt-horizon-stack {
  position: absolute; inset: env(safe-area-inset-top) 0 0; z-index: 21;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  pointer-events: none; animation: pt-up 0.22s ease-out;
}
.pt-horizon-stack > .pt-hua-notice { flex: none; align-self: center; pointer-events: auto; }
#horizon-sheet .pt-horizon-stack > .pt-sheet {
  position: static; min-height: 0; max-height: 78%; pointer-events: auto; animation: none;
}
@keyframes pt-up { from { transform: translateY(30%); opacity: 0.6; } to { transform: none; opacity: 1; } }
.pt-grabber { width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: #c7c7cc; touch-action: none; }
.pt-sheet-head { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 4px 8px; font-size: 17px; font-weight: 600; }
.pt-root .pt-link { font-size: 15px; font-weight: 400; color: var(--tap); }
.pt-sheet-head .pt-cal-seg { align-self: center; margin: 0 14px 0 auto; font-weight: 400; }
.pt-section { margin: 14px 4px 6px; font-size: 13px; color: var(--label3); }
.pt-pending { margin-left: 8px; }
.pt-year-kind { margin: 14px 4px 8px; }
.pt-year-kind .pt-mini-seg { width: 100%; }
.pt-year-kind .pt-mini-seg button { flex: 1; }
.pt-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pt-root .pt-chip {
  flex: none; display: flex; flex-direction: column; align-items: center; min-width: 54px;
  padding: 7px 12px; border-radius: 12px; background: var(--card); font-size: 14px; font-variant-numeric: tabular-nums;
}
.pt-chip small { font-size: 10.5px; color: var(--label3); }
.pt-root .pt-chip.on { background: var(--label); color: #fff; }
.pt-chip.on small { color: rgba(255, 255, 255, 0.7); }
.pt-root .pt-full-hz .pt-yrow {
  display: grid; grid-template-columns: repeat(10, minmax(0, 1fr));
  border-left: 0.5px solid #d5cce0;
}
.pt-root .pt-full-hz .pt-ycell {
  display: flex; flex-direction: column; min-width: 0; padding: 0; border-radius: 0;
  border-right: 0.5px solid #d5cce0; background: #fff; color: #1c1c1e;
  font-weight: 400; line-height: 1.15;
}
.pt-root .pt-full-hz .pt-ytop,
.pt-root .pt-full-hz .pt-ybot {
  display: flex; flex-direction: column; align-items: center; width: 100%;
  padding: 2px 0 3px; white-space: nowrap;
}
.pt-root .pt-full-hz .pt-ytop { background: #e7dcf3; border-bottom: 0.5px solid #d5cce0; }
.pt-root .pt-full-hz .pt-ybot { background: #fff; }
.pt-root .pt-full-hz .pt-lim { font-size: 10px; }
.pt-root .pt-full-hz .pt-ycell small { font-size: 9px; color: #3a3a3c; }
.pt-root .pt-full-hz .pt-ytop.on { background: #c9b3e0; }
.pt-root .pt-full-hz .pt-ybot.on { background: #f3eafa; }
.pt-root .pt-full-hz .pt-ytop.on small,
.pt-root .pt-full-hz .pt-ybot.on small { color: #1c1c1e; }
.pt-root .pt-chips.pt-off .pt-chip:not([data-now-level]):not([data-bazi-now]), .pt-root .pt-mini-seg.pt-off button { opacity: 0.35; }
.pt-root .pt-chip[data-now-level], .pt-root .pt-chip[data-bazi-now] { box-shadow: inset 0 0 0 0.5px var(--sep); }
.pt-chips-empty {
  display: flex; align-items: center; height: 48px; padding: 0 12px;
  border-radius: 12px; background: var(--card); font-size: 13px; color: var(--label3);
}
.pt-legend { display: flex; gap: 14px; justify-content: center; margin-top: 18px; font-size: 11px; color: var(--label3); }
.pt-legend span { display: inline-flex; align-items: center; gap: 4px; }

.pt-group { display: block; width: 100%; border-radius: 12px; overflow: hidden; background: var(--card); }
.pt-root .pt-group-item { display: block; width: 100%; padding: 13px 16px; text-align: left; font-size: 16px; border-bottom: 0.5px solid var(--sep); }
.pt-sheet .pt-group-item { display: block; width: 100%; padding: 13px 16px; text-align: left; font-size: 16px; border: 0; background: none; border-bottom: 0.5px solid var(--sep); }
.pt-sheet .pt-group-item.on { font-weight: 600; }
.pt-sheet .pt-group-item.pt-kind { display: flex; align-items: center; justify-content: space-between; }
.pt-kind-check { margin-left: auto; color: var(--tap); font-weight: 700; visibility: hidden; }
.pt-kind.on .pt-kind-check { visibility: visible; }
.pt-root .pt-group-item.on { font-weight: 600; }
.pt-group-item:last-child { border-bottom: 0; }
.pt-root .pt-cancel, .pt-sheet .pt-cancel { margin-top: 8px; text-align: center; font-weight: 600; color: var(--tap); }
.pt-row { display: grid !important; grid-template-columns: 40px 48px 1fr; gap: 8px; font-size: 15px !important; }
.pt-row-stars { font-weight: 600; }
.pt-muted { color: var(--label3); font-size: 13px; font-weight: 400; }
.pt-note { margin: 8px 4px 0; }
.pt-detail-stars { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 14px 16px; border-radius: 12px; background: var(--card); font-size: 16px; }
.pt-detail-stars .main { font-weight: 600; }
.pt-detail-stars .extra { color: var(--label3); }

/* 八字 */
.bz-title {
  flex: none; display: flex; align-items: baseline; gap: 8px; min-width: 0;
  margin: 2px 16px 0; padding: 4px 0; border: 0; background: none;
  text-align: left; color: var(--label); font: inherit; cursor: pointer;
}
.bz-title[hidden] { display: none; }
#birth-tag-list[hidden] { display: none; }
#birth-tag-list .pt-set-check { visibility: hidden; }
#birth-tag-list [aria-checked="true"] .pt-set-check { visibility: visible; }
.pt-place-sub { padding-left: 32px; }
#birth-dst[hidden], #birth-solar-hint[hidden] { display: none; }
.pt-dst-note { margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px; background: #fff4d6; color: #7a5200; font-size: 14px; line-height: 1.5; }
#place-custom:disabled { color: var(--label3); }
.bz-title b { flex: none; font-size: 15px; font-weight: 600; }
.bz-title small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--label3); }
.pt-card { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 8px; padding: 18px 14px; border-radius: 14px; background: var(--card); }
.pt-bazi.pt-card { padding: 4px 0 16px; border-radius: 0; background: transparent; }
.pt-bazi-ink { position: relative; display: flex; flex-direction: column; gap: 10px; }
.pt-bazi-body { display: flex; flex-direction: column; gap: 10px; }
.pt-bazi-natal,
.pt-bazi .pt-luck,
.pt-bazi-flow,
.pt-liuyue {
  border-radius: 12px; background: var(--card);
  box-shadow: inset 0 0 0 0.5px rgba(60, 60, 67, 0.28);
}
.pt-bazi-natal { padding: 14px 6px 4px; }
.pt-bazi .pt-luck { padding: 10px 8px 12px; }
.pt-bazi .pt-luck .pt-section { margin-top: 0; }
.pt-bazi-grid { display: flex; flex-direction: column; text-align: center; }
.pt-bazi-flow { display: flex; flex-direction: column; margin-top: 0; padding: 12px 6px 8px; text-align: center; }
.bz-luck-start {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px;
  padding: 8px 4px 0; font-size: 11px; line-height: 1.35; color: var(--label2); text-align: center;
}
.pt-bazi-row { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); align-items: center; }
.pt-bazi-row.head { min-height: 14px; font-size: 12px; line-height: 1; color: var(--label3); }
.pt-bazi-row.meta { min-height: 28px; align-items: start; }
.pt-bazi-row.meta > span { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.15; }
.pt-bazi-row.meta b { font-size: 12px; font-weight: 500; color: var(--ke); }
.pt-bazi-row.meta small { font-size: 11px; color: var(--label3); font-variant-numeric: tabular-nums; }
.pt-bazi-row.mark, .pt-bazi-row.gods { align-items: start; }
.pt-bazi-row.mark > span { min-height: 18px; font-size: 11px; line-height: 1.3; color: var(--label2); }
.pt-bazi-row .bz-nayin { font-weight: 500; }
.pt-bazi-row .bz-zizuo, .pt-bazi-row .bz-kong { color: var(--label3); }
.pt-bazi-row .bz-kong { letter-spacing: 0.04em; }
.pt-bazi-row .bz-nayin.wx-mu { color: var(--wx-mu); }
.pt-bazi-row .bz-nayin.wx-huo { color: var(--wx-huo); }
.pt-bazi-row .bz-nayin.wx-tu { color: var(--wx-tu); }
.pt-bazi-row .bz-nayin.wx-jin { color: #937a0e; }
.pt-bazi-row .bz-nayin.wx-shui { color: var(--wx-shui); }
.pt-bazi-row .gods {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-height: 16px; padding-top: 2px; font-size: 11px; font-style: normal; line-height: 1.3; color: var(--label2);
}
.pt-bazi-row .gods i { font-style: normal; }
.pt-bazi-flow .gz { font-size: 26px; }
.pt-pillar .meta { min-height: 28px; margin-top: 2px; font-size: 11px; line-height: 1.15; color: var(--label3); }
.pt-pillar .meta b { display: block; font-weight: 500; color: var(--ke); }
.pt-liuyue { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; overflow-x: auto; padding: 8px 4px 10px; scrollbar-width: none; }
.pt-liuyue::-webkit-scrollbar { display: none; }
.pt-ly-row { display: grid; grid-template-columns: 36px repeat(var(--timeline-cols, 12), minmax(32px, 1fr)); align-items: center; min-width: var(--timeline-min-width, 420px); text-align: center; }
.pt-ly-lab { font-size: 11px; line-height: 1.1; color: var(--label3); }
.pt-ly-meta { min-height: 25px; }
.pt-ly-time { display: flex; min-width: 0; flex-direction: column; align-items: center; line-height: 1.1; }
.pt-ly-time b { max-width: 100%; font-size: 9px; font-weight: 500; color: var(--label2); white-space: nowrap; }
.pt-ly-time small { max-width: 100%; font-size: 9px; color: var(--label3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-ly-cell { position: relative; display: flex; align-items: center; justify-content: center; gap: 0; min-width: 0; height: 32px; border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; cursor: pointer; }
.pt-ly-cell > b { min-width: 0; font-size: clamp(15px, 4.2vw, 17px); font-weight: 600; line-height: 1; }
.pt-ly-cell > i { min-width: 8px; font-size: 8px; font-style: normal; font-weight: 400; line-height: 1.1; color: var(--label2); }
.pt-ly-cell.now { box-shadow: inset 0 0 0 1.5px var(--label); }
.pt-ly-cell.on { background: var(--fill); }
.pt-ly-cell:disabled { opacity: 0.35; cursor: default; }
.pt-ly-cell::after { content: ''; position: absolute; left: 50%; top: 50%; width: 100%; height: max(100%, 44px); transform: translate(-50%, -50%); }
.pt-bazi.side .pt-bazi-body { flex-direction: row; align-items: flex-start; }
.pt-bazi-natal { min-width: 0; }
.pt-bazi.side .pt-bazi-natal { flex: 1.4; }
.bz-fold {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 22px; margin-top: 2px; border: 0; background: none; color: var(--label3); cursor: pointer;
}
.pt-bazi:not(.natal-open) .pt-bazi-grid .mark,
.pt-bazi:not(.natal-open) .pt-bazi-grid .gods,
.pt-bazi.side:not(.natal-open) .pt-bazi-flow .mark,
.pt-bazi.side:not(.natal-open) .pt-bazi-flow .gods,
.pt-bazi:not(.side):not(.luck-open) .pt-bazi-flow .mark,
.pt-bazi:not(.side):not(.luck-open) .pt-bazi-flow .gods { display: none; }
.pt-bazi.side .pt-luck { flex: 0.9; min-width: 112px; }
.pt-bazi.side .pt-section { font-size: 12px; line-height: 1.35; }
.pt-bazi.side .pt-dayun { flex-direction: column; align-items: stretch; overflow: visible; }
.pt-bazi.side .pt-yun { flex-direction: row; justify-content: space-between; gap: 6px; min-width: 0; padding: 6px 8px; }
.wx-mu { color: var(--wx-mu); }
.wx-huo { color: var(--wx-huo); }
.wx-tu { color: var(--wx-tu); }
.wx-jin { color: var(--wx-jin); }
.wx-shui { color: var(--wx-shui); }
.pt-bazi-row .bz-side .wx-jin,
.pt-ly-cell .wx-jin,
.bz-wang .wx-jin { color: #937a0e; }
.pt-bazi-row .gz.pair { display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 44px; }
.pt-bazi-row .gz.pair > b { font-size: 34px; font-weight: 600; line-height: 1; }
.pt-bazi-flow .gz.pair > b { font-size: 26px; }
.pt-bazi.side .pt-bazi-grid .gz.pair > b { font-size: 26px; }
.pt-bazi.side .pt-bazi-flow .gz.pair > b { font-size: 22px; }
.pt-bazi-row .gz.pair > i,
.pt-bazi-row .gz.pair .bz-side {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 11px; margin-top: 0; font-size: 10px; font-style: normal; line-height: 1.15; color: var(--label2);
}
.pt-bazi-row .bz-side i { font-style: normal; white-space: nowrap; }
.pt-pillar .hidden { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 13px; }
.pt-pillar .hidden small { margin-left: 2px; font-size: 10px; color: var(--label3); }
.pt-pillar .mark { margin-top: 3px; font-size: 11px; line-height: 1.3; color: var(--label3); }
.pt-pillar .mark.wx-mu { color: var(--wx-mu); }
.pt-pillar .mark.wx-huo { color: var(--wx-huo); }
.pt-pillar .mark.wx-tu { color: var(--wx-tu); }
.pt-pillar .mark.wx-jin { color: #937a0e; }
.pt-pillar .mark.wx-shui { color: var(--wx-shui); }
.pt-pillar .gods { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; font-size: 11px; font-style: normal; color: var(--label2); }
.pt-pillar .gods i { font-style: normal; }
.pt-tips {
  display: flex; flex-direction: column; gap: 6px; margin-top: 0; padding: 8px 12px;
  border-radius: 12px; background: var(--card);
  box-shadow: inset 0 0 0 0.5px rgba(60, 60, 67, 0.28);
}
.pt-tips-head {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600;
  text-align: left; color: var(--label); cursor: pointer;
}
.pt-tips-head small { flex: 1; text-align: right; font-size: 12px; font-weight: 400; color: var(--label3); }
.pt-tips-head svg { flex: none; color: var(--label3); }
.pt-tips-row { display: grid; grid-template-columns: 36px 1fr; gap: 6px; font-size: 12px; line-height: 1.5; }
.pt-tips-row span { color: var(--label3); }
.pt-tips-row p { margin: 0; color: var(--label2); }
.pt-yun .hidden { display: flex; flex-direction: column; align-items: flex-end; margin-top: 0; font-size: 11px; }
.pt-yun .detail { max-width: 64px; font-size: 10px; line-height: 1.3; text-align: center; }
.pt-dayun { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pt-yun { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; padding: 10px 6px; border: 0; border-radius: 12px; background: var(--bg); font: inherit; color: inherit; }
.pt-yun b { font-size: 18px; font-weight: 600; line-height: 1.2; text-align: center; }
.pt-yun small { font-size: 10.5px; color: var(--label3); font-variant-numeric: tabular-nums; }

/* 電腦版：紫微、八字並排 */
.pt-wide .pt-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 16px; max-width: 1240px; margin: 12px auto 0; padding: 0 16px; align-items: start; }
.pt-wide .pt-board, .pt-wide .pt-card { margin: 0; }
.pt-wide .pt-board { grid-template-rows: repeat(4, minmax(0, 1fr)); height: calc(100dvh - 52px - env(safe-area-inset-top) - 80px); }
.pt-wide .pt-compass { --cx: 18px; --cy: 18px; --cfs: 13px; margin: 0; }
.pt-wide .pt-compass > .pt-board { height: calc(100dvh - 52px - env(safe-area-inset-top) - 80px - 2 * var(--cy)); }
.pt-wide .pt-bar { width: 480px; margin-left: auto; margin-right: auto; }
.pt-wide .pt-cell { padding: 6px 6px 4px; }
.pt-wide .pt-main-h { font-size: 19px; }
.pt-wide .pt-rest-h { font-size: 14px; }
.pt-wide :is(.pt-stars-v, .pt-hstars) { --star-fs: calc(15px * var(--fit, 1)); }
/* 格子拉高後星名不能跟著長，亮度跟四化才會貼在星名下面 */
.pt-wide .pt-star-name { flex: none; }
.pt-wide .pt-bright { font-size: calc(var(--star-fs) * 0.72); }
.pt-wide .pt-god { font-size: 12px; }
.pt-wide .pt-age-lines { font-size: calc(11px * var(--age-fit, 1)); }
.pt-wide .pt-pname { font-size: 16px; }
.pt-wide .pt-gz, .pt-wide .pt-ages, .pt-wide .pt-hnames, .pt-root.pt-wide .pt-ages-btn { font-size: 12px; }
.pt-wide .pt-center { font-size: 14px; }
.pt-wide .pt-center-title { font-size: 17px; }

/* 手機排盤：以 iPhone 16 Pro（格寬 92.75px、星曜 11px）為準。跟著格子比較窄的那邊。
   系統字型放大不作用在盤上。放不下時 --fit 把星曜、流年、宮名、干支一起縮。 */
.pt-root:not(.pt-wide):not(.pt-bare) .pt-compass {
  container: compass / size;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.pt-root:not(.pt-wide):not(.pt-bare) .pt-board {
  container: phoneboard / size;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* 雜曜字級由 board.js fitStars 寫入 --extra-fs（跟盤、不跟單格 / --fit / cram）：
   十二宮同大，略小於主星。8px @ 盤 339（≈84.75×4）≈主星 11px 的 0.73。
   桌面採共用的 --star-fs 與雜曜字級下限。 */
.pt-root:not(.pt-wide):not(.pt-bare) .pt-board .pt-star-v.extra {
  font-size: max(8px, var(--extra-fs, calc(var(--star-fs) * 0.72)));
}
.pt-root:not(.pt-wide):not(.pt-bare) .pt-board > .pt-cell { container: cell / size; }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center { --cf: calc(min(100cqi, 100cqb) / 374px); }
@container compass (min-width: 0px) {
  /* 平板直放盤變大，字不能比外圈留的邊寬，不然東、西會被切掉 */
  .pt-cmp { --cfs: min(var(--cx), calc(11px * min(100cqi, 100cqb) / 374px)); }
}
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center { font-size: calc(12px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-bazi small { font-size: calc(10px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-bazi b { font-size: calc(15px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-title { font-size: calc(13px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-horizon { font-size: calc(15px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-name,
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-name-input { font-size: calc(16px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-name em { font-size: calc(10px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-ask,
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-ask-input { font-size: calc(17px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-center-hour button { font-size: calc(16px * var(--cf)); }
.pt-root:not(.pt-wide):not(.pt-bare) .pt-hua-pick button { font-size: calc(13px * var(--cf)); }
/* 小螢幕開盤外方位時格子再窄幾 px，流年小限那兩行少留點邊才放得下 */
@container cell (max-width: 88px) {
  .pt-board .pt-cell .pt-age-lines { padding: 0; }
}
/* 內容盒比較窄的那邊 84.75 時星曜 11px。寬了但不夠高就按高度，避免壓字。 */
@container cell (min-width: 0px) {
  .pt-board .pt-cell > * { --star-fs: calc(11px * min(100cqw, 100cqh) / 84.75px * var(--fit, 1)); }
  .pt-board .pt-cell .pt-stars-v { gap: 0.1em; }
  .pt-board .pt-cell .pt-hstars { font-size: max(8px, calc(var(--star-fs) * 0.8)); }
  .pt-board .pt-cell .pt-age-lines { font-size: calc(var(--star-fs) * 0.68 * var(--age-fit, 1)); }
  .pt-board .pt-cell .pt-bright { font-size: calc(var(--star-fs) * 0.75); color: var(--dim); }
  .pt-board .pt-cell .pt-foot-left .pt-ages { font-size: calc(var(--star-fs) * 0.8); line-height: 1.2; letter-spacing: 0; }
  /* 照文墨量測（星曜字＝1）：十二神 0.78、長生 0.82、亮度 0.75、宮名 0.95、干支 1.1 */
  .pt-board .pt-cell .pt-foot-left .pt-god { font-size: calc(var(--star-fs) * 0.78); line-height: 1.25; letter-spacing: 0; color: #1a1a1c; }
  .pt-board .pt-cell .pt-foot-left .pt-god.boshi { color: var(--boshi); }
  .pt-board .pt-cell :is(.pt-pname, .pt-hname) { font-size: calc(var(--star-fs) * 0.95); font-weight: 500; line-height: 1.2; }
  .pt-board .pt-cell .pt-gz-v { font-size: calc(var(--star-fs) * 1.1); }
  .pt-board .pt-cell .pt-gz-col .pt-god { font-size: calc(var(--star-fs) * 0.82); color: var(--dim); }
}
/* 選到流月以下底列多一欄月日時，四欄並排比格子寬：底列字級照格寬縮到放得下（9–11px），欄間至少 3px；
   9px 還放不下就省掉「時日月年限」只留宮名那一字，靠顏色分層 */
.pt-root.pt-bare:not(.pt-wide) .pt-board > .pt-cell { container-type: inline-size; }
.pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) {
  --foot-fs: clamp(9px, (100cqw - 9px) / 7.7, var(--star-fs));
  gap: 3px;
}
.pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) .pt-foot-names { gap: 3px; }
.pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) :is(.pt-hname, .pt-pname, .pt-foot-left .pt-god) {
  font-size: var(--foot-fs);
}
.pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) .pt-gz-v { font-size: calc(var(--foot-fs) * 1.15); }
.pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) .pt-gz-col .pt-god { font-size: calc(var(--foot-fs) * 0.75); }
@container (max-width: 77px) {
  .pt-root:not(.pt-wide) .pt-board > .pt-cell > .pt-foot-a:has(.pt-name-left) .pt-hpre { display: none; }
}

/* 原型切換列（不屬於設計） */
.pt-switcher {
  position: fixed; left: 50%; bottom: calc(116px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 999px;
  background: #111; color: #fff; font: 13px/1 -apple-system, "PingFang TC", sans-serif; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); outline: 2px dashed #facc15; outline-offset: 2px;
}
.pt-switcher button { width: 30px; height: 30px; border: 0; border-radius: 15px; background: #333; color: #fff; font-size: 18px; cursor: pointer; }

/* 底部五個按鈕（比照 LINE，iOS 分頁列） */
.pt-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; height: calc(50px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(249, 249, 249, 0.9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(60, 60, 67, 0.29);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif;
}
.pt-tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: #8e8e93; font-size: 10px; font-weight: 500; cursor: pointer;
}
.pt-tabbar button.on { color: #1c1c1e; }
.pt-tabbar button.reserved { opacity: 0.4; }
.pt-placeholder { margin: 40px 32px; text-align: center; font-size: 15px; line-height: 1.7; color: #8e8e93; }

/* 設定頁（iOS 分組列表） */
.pt-set-title { margin: 20px 32px 6px; font-size: 13px; color: var(--label3); }
.pt-set-group { margin: 0 16px; border-radius: 10px; background: var(--card); overflow: hidden; }
.pt-root .pt-set-row {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 0 16px; font-size: 17px; color: var(--label); text-align: left;
}
.pt-root .pt-set-row + .pt-set-row { border-top: 0.5px solid rgba(60, 60, 67, 0.29); }
.pt-root .pt-set-choice { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.pt-set-choice b { display: block; font-weight: 400; }
.pt-set-choice small { display: block; margin-top: 2px; font-size: 12px; color: var(--label3); }
.pt-root .pt-set-row:disabled { opacity: 1; cursor: default; }
.pt-root .pt-set-row.is-soon { color: var(--label3); }
.pt-set-check { color: #007aff; }
.pt-set-foot { margin: 6px 32px; font-size: 13px; line-height: 1.5; color: var(--label3); }
.pt-set-foot.pt-solar-hint { color: #7a5200; }
.pt-set-foot.pt-set-error { color: #d0344a; }
.pt-root .pt-set-row select { font: inherit; color: var(--label3); background: transparent; border: 0; }
.pt-root .pt-set-row.soon { color: var(--label3); }
/* 排盤設定：起始組合、安星方法 */
.pt-set-top { margin-top: 20px; }
.pt-set-default { margin-left: 6px; font-size: 12px; color: var(--label3); }
.pt-set-check { flex: none; color: var(--tap); }
.pt-set-value { display: inline-flex; align-items: center; gap: 2px; color: var(--label3); }
.pt-set-soon { font-size: 15px; color: var(--label3); }

.pt-switch { position: relative; width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 120, 128, 0.16); transition: background 0.2s; flex: none; }
.pt-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.2s; }
.pt-switch.on { background: #0A0A0A; }
.art-seal { display: block; object-fit: contain; background: none; }
.art-seal.missed, .art-seal.soon { filter: grayscale(1); opacity: 0.28; }
.pt-switch.on::after { transform: translateX(20px); }
.pt-god.changsheng { color: var(--label3); }

/* 三方四正虛線（版面一） */
.pt-sf-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.pt-sf-lines line { stroke-width: 1.5; stroke-linecap: round; }
.pt-sf-lines { opacity: 0.8; }
.pt-sf-lines .trine, .pt-sf-lines .opposite { stroke: #8e8e93; fill: #8e8e93; }
.pt-sf-lines line.trine, .pt-sf-lines line.opposite { stroke-dasharray: 5 4; }
.pt-sf-lines circle { stroke: none; }
.pt-sf-lines line.fly-lu, .pt-sf-lines path.fly-lu { stroke: var(--lu); }
.pt-sf-lines line.fly-quan, .pt-sf-lines path.fly-quan { stroke: var(--quan); }
.pt-sf-lines line.fly-ke, .pt-sf-lines path.fly-ke { stroke: var(--ke); }
.pt-sf-lines line.fly-ji, .pt-sf-lines path.fly-ji { stroke: var(--ji); }
.pt-sf-lines line[class^="fly-"] { stroke-width: 1.5; fill: none; stroke-linecap: butt; }
.pt-sf-lines marker path.fly-lu { fill: var(--lu); stroke: none; }
.pt-sf-lines marker path.fly-quan { fill: var(--quan); stroke: none; }
.pt-sf-lines marker path.fly-ke { fill: var(--ke); stroke: none; }
.pt-sf-lines marker path.fly-ji { fill: var(--ji); stroke: none; }
/* 版面一：運限宮名由下往上疊（本命 → 大限 → 流年 → 流月） */
.pt-hname { font-size: 12px; font-weight: 600; line-height: 1.2; }
.pt-hname.decade { color: var(--decade); } .pt-hname.year { color: var(--year); } .pt-hname.pt-xian { color: var(--xiaoxian); } .pt-hname.month { color: var(--month); } .pt-hname.day { color: var(--day); } .pt-hname.hour { color: var(--hour); }
.pt-wide .pt-hname { font-size: 16px; }
/* 15 吋左欄：格內容比較窄的那邊 134.75 時星曜 15px。格子再大也不超過；命盤庫中間很寬就按格高往下縮。 */
.pt-wide .pt-board { container: wboard / size; }
.pt-wide .pt-board > .pt-cell { container: wcell / size; }
@container wcell (min-width: 0px) {
  .pt-wide .pt-cell > * { --desk-scale: calc(min(1, min(100cqw, 100cqh) / 134.75px)); --star-fs: calc(15px * var(--desk-scale) * var(--fit, 1)); }
  .pt-wide :is(.pt-stars-v, .pt-hstars) { --star-fs: calc(15px * var(--desk-scale) * var(--fit, 1)); }
  .pt-wide .pt-bright { font-size: calc(var(--star-fs) * 0.72); }
  .pt-wide .pt-hstars { font-size: max(8px, calc(var(--star-fs) * 0.8)); }
  .pt-wide .pt-pname { font-size: calc(16px * var(--desk-scale)); }
  .pt-wide .pt-hname { font-size: calc(16px * var(--desk-scale)); }
  .pt-wide .pt-gz-v { font-size: calc(16px * var(--desk-scale)); }
  .pt-wide .pt-god { font-size: calc(12px * var(--desk-scale)); }
  .pt-wide .pt-age-lines { font-size: calc(11px * var(--desk-scale) * var(--age-fit, 1)); }
  .pt-wide .pt-gz, .pt-wide .pt-ages, .pt-wide .pt-hnames, .pt-root.pt-wide .pt-ages-btn { font-size: calc(12px * var(--desk-scale)); }
  .pt-wide .pt-gz-col .pt-god { font-size: calc(8.5px * var(--desk-scale)); }
  .pt-wide .pt-main-h { font-size: calc(19px * var(--desk-scale)); }
  .pt-wide .pt-rest-h { font-size: calc(14px * var(--desk-scale)); }
}
@container wboard (min-width: 0px) {
  .pt-wide .pt-center { --desk-scale: calc(min(100cqi, 100cqb) / 606px); font-size: calc(14px * var(--desk-scale)); }
  .pt-wide .pt-center-title { font-size: calc(17px * var(--desk-scale)); }
  .pt-wide .pt-center-bazi small { font-size: calc(10px * var(--desk-scale)); }
  .pt-wide .pt-center-bazi b { font-size: calc(15px * var(--desk-scale)); }
  .pt-wide .pt-center-name, .pt-wide .pt-center-name-input { font-size: calc(16px * var(--desk-scale)); }
  .pt-wide .pt-center-horizon { font-size: calc(15px * var(--desk-scale)); }
}

/* 出生資料整頁 */
.pt-root .pt-back {
  display: flex; align-items: center; justify-content: flex-start;
  width: 44px; height: 44px; padding: 0; color: #007aff;
}
.pt-root .pt-back svg { margin-left: -6px; color: #007aff; }
.pt-page { position: fixed; inset: 0; z-index: 40; display: block; height: auto; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
@keyframes pt-push { from { transform: translate3d(100%, 0, 0); } }
.pt-page,
.ex-page { animation: pt-push 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
@media (prefers-reduced-motion: reduce) {
  .pt-page,
  .ex-page { animation: none; }
}
.pt-page .pt-nav { grid-template-columns: 72px 1fr 72px; }
.pt-nav > .pt-icon:last-child,
.pt-nav > .pt-nav-end > .pt-icon,
.pt-nav > .ex-tools > button {
  display: flex; align-items: center; justify-content: flex-end;
}
.pt-nav > .pt-icon:last-child,
.pt-nav > .pt-nav-action,
.pt-nav > .pt-nav-end,
.pt-nav > .pt-link,
.pt-nav > .ex-tools { justify-self: end; }
.pt-root .pt-nav-action { width: auto; min-width: 44px; padding: 0 0 0 8px; font-size: 17px; font-weight: 400; }
.pt-root .pt-nav-done { color: #007aff; font-weight: 600; }
.pt-root .pt-nav-done:disabled { opacity: 0.35; }
.pt-kind-pick { padding-top: 8px; padding-bottom: 8px; }
.pt-kind-pick .pt-mini-seg { width: 100%; }
.pt-kind-pick .pt-mini-seg button { flex: 1; }
.pt-field-input {
  flex: 1; min-width: 0; margin-left: 12px; border: 0; background: none;
  font: inherit; font-size: 17px; text-align: right; color: var(--label); outline: none;
}
.pt-root .pt-time-row { position: relative; box-sizing: border-box; min-height: 52px; }
.pt-time-row > span, .pt-time-icon { position: relative; z-index: 1; pointer-events: none; }
.pt-time-icon { flex: none; margin-left: 8px; color: var(--label3); }
.pt-time-text { position: relative; z-index: 1; margin-left: auto; font-size: 17px; color: var(--label); pointer-events: none; white-space: nowrap; }
.pt-time-text.empty { color: var(--label3); }
/* iPhone 的時間框自己排字、不理 padding，會壓到時鐘：框本身透明，只用來叫出轉盤，字由 .pt-time-text 畫 */
.pt-time-input {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0;
  opacity: 0; cursor: pointer;
}
.pt-time-input::-webkit-date-and-time-value { text-align: right; }
.pt-time-input::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto;
  margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.pt-dst-note { margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px; background: #fff4d6; color: #7a5200; font-size: 14px; line-height: 1.5; }
.bz-tab-seg { display: flex; justify-content: center; padding: 12px 16px 0; }
.bz-shensha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 4px; }
.bz-shensha span { display: flex; justify-content: space-between; gap: 6px; padding: 7px 10px; font-size: 14px; }
.bz-shensha span.empty { color: var(--label3); }
.bz-shensha b { font-weight: 500; }
.bz-wang { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; }
.bz-row-on { font-weight: 600; }
.pt-yun.on { box-shadow: inset 0 0 0 2px var(--tap); }
#bazi-horizon .bz-sheet-links { display: flex; align-items: baseline; gap: 16px; margin-left: auto; font-weight: 400; }
#bazi-horizon .pt-link:disabled { color: var(--label3); }
.pt-mini-seg { display: flex; padding: 2px; border-radius: 8px; background: var(--fill); }
.pt-mini-seg button { min-width: 44px; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 15px; }
.pt-root .pt-mini-seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.pt-ymd { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; padding: 10px 16px 12px; }
.pt-ymd label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--label3); text-align: center; }
.pt-ymd + .pt-set-row { border-top: 0.5px solid rgba(60, 60, 67, 0.29); }
.pt-ymd select {
  width: 100%; height: 44px; border: 0; border-radius: 10px; background: var(--fill);
  font: inherit; font-size: 22px; font-variant-numeric: tabular-nums; text-align: center; color: var(--label); outline: none;
}
.pt-ymd.lunar { grid-template-columns: 1.2fr 1.25fr 1fr; }
.pt-hour-chips { flex-wrap: wrap; padding: 0 16px 8px; overflow: visible; }
.pt-center-edit { width: 100%; }
.pt-root .pt-center-name { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto; font-family: ui-serif, "Times New Roman", "Songti TC", "Noto Serif TC", serif; font-size: 16px; font-weight: 700; color: var(--label); }
.pt-center-name em {
  font-style: normal; font-size: 10px; font-weight: 500; line-height: 1.2;
  color: #007aff; background: rgba(0, 122, 255, 0.12); border-radius: 4px; padding: 2px 4px;
}
.pt-center-name-input {
  width: 100%; border: 0; background: transparent; text-align: center;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--label); outline: none;
}
.pt-root .pt-center-ask {
  width: 100%; margin: 0 0 2px; font-size: 17px; font-weight: 600; line-height: 1.25;
  color: var(--label); text-align: center;
}
.pt-root .pt-center-ask.empty { color: var(--label3); font-weight: 500; }
.pt-root button.pt-center-ask { position: relative; z-index: 1; }
.pt-root .pt-center-ask-input {
  width: 100%; margin: 0 0 2px; border: 0; background: transparent; text-align: center;
  font: inherit; font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--label); outline: none;
}
.pt-root.pt-bare .pt-center-ask,
.pt-root.pt-bare .pt-center-ask-input { font-size: 16px; }
.pt-recent { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.pt-recent span { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.pt-recent b { font-size: 17px; font-weight: 600; }
.pt-recent small { font-size: 13px; color: var(--label3); }
.pt-report {
  margin: 8px 16px 24px; padding: 12px 16px; border-radius: 10px; background: var(--card);
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; color: var(--label);
}
.pt-report-in {
  display: block; box-sizing: border-box; width: 100%; min-height: 88px; padding: 12px 16px; border: 0; background: none;
  font: inherit; font-size: 16px; color: var(--label); resize: none; outline: none;
}
.pt-root .pt-report-go { justify-content: center; color: #007aff; }
.pt-root .pt-report-go:disabled { color: #c7c7cc; }
.pt-report-status { color: #d0344a; }
.pt-report-status.ok { color: #1f7a3a; }
#recents-error { color: #d0344a; }
#open-menu { position: relative; }
#open-menu .pt-pen-dot { top: 8px; right: 6px; }
.lb-drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 22;
  display: flex; flex-direction: column; box-sizing: border-box;
  height: 72dvh; padding-bottom: env(safe-area-inset-bottom);
  border-radius: 14px 14px 0 0; background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
}
.lb-drawer-shade { position: fixed; inset: 0; z-index: 21; background: rgba(0, 0, 0, 0.18); }
.pt-root .lb-drawer-grab {
  flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  width: 100%; padding: 6px 16px 8px;
}
.lb-drawer-grab i { align-self: center; width: 36px; height: 5px; border-radius: 3px; background: rgba(60, 60, 67, 0.28); }
.lb-drawer-head { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--label); }
.lb-drawer-head b { flex: none; font-size: 15px; font-weight: 600; }
.lb-drawer-head em { flex: none; font-style: normal; font-size: 12px; color: var(--label3); }
.lb-drawer-head svg { flex: none; margin-left: auto; color: var(--label3); }
.lb-drawer-text {
  flex: 1; min-height: 0; margin: 0 16px 12px; padding: 12px; border: 0; border-radius: 10px;
  background: var(--bg); font: inherit; font-size: 17px; line-height: 1.6; color: var(--label); resize: none; outline: none;
}
.lb-drawer-text:disabled { color: var(--label2); opacity: 0.85; }
.lb-drawer-foot { flex: none; margin: 0 16px 12px; font-size: 12px; color: var(--label3); }
.pt-wide .lb-drawer { left: 50%; right: auto; width: 480px; transform: translateX(-50%); }

/* 命盤上的字一律不粗；要跟上面各處的字重比才用 !important */
.pt-board, .pt-board * { font-weight: 400 !important; }
