/* 沿用官网排盘的宣纸、朱砂和楷体体系。 */
.bz-head-title b { font:700 19px/1.2 var(--kai); letter-spacing:2px; }
.bz-tool,.bz-tool.is-primary { font-family:var(--kai); font-size:14px; }
.bz-tool.is-primary { color:#a72f28; }
.bm-tabs button { font-family:var(--kai); font-size:16px; }
.bm-panel h2 { font:700 18px/1.4 var(--kai); color:#533d2b; }
.bm-panel { background:#fffdf8; }
.bm-table caption { font:700 17px var(--kai); color:#533d2b; }
.bm-table { font-family:var(--kai); font-size:16px; }
.bm-facts { font-size:14px; }
.ba-controls { display:flex; max-width:480px; margin:auto; justify-content:space-between; align-items:center; padding:8px 12px; background:#f3eddf; border-bottom:1px solid #e2d3b6; color:#7a6148; font:15px var(--kai); }
.ba-switch { display:flex; align-items:center; gap:8px; min-height:34px; cursor:pointer; position:relative; }
.ba-switch input { position:absolute; width:42px; height:26px; right:0; margin:0; opacity:0; cursor:pointer; }
.ba-switch i { display:block; width:42px; height:26px; border-radius:20px; background:#c9bda9; transition:background .18s; pointer-events:none; }
.ba-switch i::after { content:""; display:block; width:20px; height:20px; margin:3px; background:#fffdf8; border-radius:50%; transition:transform .18s; box-shadow:0 1px 3px #0002; }
.ba-switch input:checked+i { background:#a72f28; }.ba-switch input:checked+i::after { transform:translateX(16px); }
.ba-switch input:focus-visible+i { outline:2px solid #a72f28; outline-offset:3px; }
#bm-palace-view { min-height:0; padding:4px 0 8px; }
.bm-palace-table caption { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.bm-palace-table { font-size:14px; }
.bm-palace-table th:first-child { width:36px; }
.bm-palace-table .bm-ganzhi td { font:700 29px/1.3 var(--sans); }
.bm-palace-table td,.bm-palace-table th { padding:4px 1px; }
.bm-palace-table td:nth-child(5),.bm-palace-table th:nth-child(5) { border-left:1px solid #bba281; }
.bm-palace-table .bm-hidden small { font-size:11px; }
.bm-hidden td>div { white-space:nowrap; }
.bm-palace-table .bm-hidden td>div { display:flex; justify-content:center; align-items:baseline; gap:1px; font-size:12px; }
body.bm-large .bm-palace-table .bm-hidden small { font-size:11px; }
body.bm-palaces #chart-view .professional-pillar-board { display:none !important; }
body #chart-view .professional-fold-section { display:none !important; }
body #chart-view .ba-dayun-toggle,body #chart-view .ba-siling-button { border:1px solid #d7c3a6; border-radius:5px; background:#fffaf1; color:#a72f28; font:13px/1.3 var(--kai); padding:6px 9px; cursor:pointer; flex:none; }
body #chart-view .ba-siling-button { margin-right:6px; padding:4px 8px; }
body #chart-view .professional-siling-inline { display:inline-flex; align-items:center; }
body #chart-view .ba-dayun-toggle:hover,body #chart-view .ba-siling-button:hover { background:#f4e7d7; }
body #chart-view .professional-luck-band-title .web-hint { flex:1; }
body #chart-view .professional-luck-band-title .web-today { margin-left:0; }
.ba-energy,.ba-sky { padding:18px 0 14px; border-top:8px solid #f5efe3; margin-top:12px; }
.ba-chenggu { padding:18px 0 14px; border-top:8px solid #f5efe3; margin-top:12px; }
.ba-bone-total { text-align:center; font:700 26px var(--kai); color:#a72f28; margin:18px 0; }
.ba-bone-parts { display:grid; grid-template-columns:repeat(4,1fr); margin:0 14px; border:1px solid #e2d3b6; border-radius:6px; }
.ba-bone-parts>div { text-align:center; padding:10px 2px; border-right:1px solid #e2d3b6; }
.ba-bone-parts>div:last-child { border:0; }.ba-bone-parts small,.ba-bone-parts span { display:block; }.ba-bone-parts small { color:#887867; margin-bottom:6px; }
.ba-chenggu blockquote { margin:16px 14px; padding:16px 8px; background:#f3eddf; text-align:center; font:18px/1.9 var(--kai); }.ba-chenggu blockquote span { display:block; }
body #chart-view .ba-dayun-toggle { display:inline-flex; align-items:center; gap:5px; }
.ba-dayun-toggle i { width:28px; height:18px; background:#c9bda9; border-radius:12px; }
.ba-dayun-toggle i::after { content:""; display:block; width:14px; height:14px; margin:2px; border-radius:50%; background:#fffdf8; transition:transform .18s; }
.ba-dayun-toggle[aria-checked="true"] i { background:#a72f28; }
.ba-dayun-toggle[aria-checked="true"] i::after { transform:translateX(10px); }
body.bm-dayun-vertical #chart-view .professional-liunian-section { display:none!important; }
.ba-year-matrix { border-top:1px solid #e2d3b6; margin-top:8px; }
.ba-matrix-hint { margin:8px 0; font:12px/1.5 var(--kai); color:#887867; }
.ba-year-matrix-scroll { overflow-x:auto; overscroll-behavior-x:contain; }
.ba-year-matrix-grid { display:flex; width:max-content; min-width:100%; }
.ba-year-column { flex:0 0 76px; width:76px; box-sizing:border-box; border-right:1px solid #dfcdb0; text-align:center; }
.ba-matrix-bound { padding:7px 0; font:12px var(--sans); color:#79664f; }
.ba-matrix-years { height:600px; }
.ba-matrix-years button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:100%; height:60px; padding:5px 0; border:0; border-top:1px solid #eee2cf; background:transparent; color:#453b31; cursor:pointer; font:22px/1.2 var(--kai); }
.ba-matrix-years button small { font:12px/1.3 var(--sans); color:#887867; }

.ba-matrix-years button:hover { background:#f4e7d7; }
.ba-matrix-years button[aria-pressed="true"] { background:#ead9bd; color:#a72f28; font-weight:700; }
.ba-matrix-years button:focus-visible { outline:2px solid #a72f28; outline-offset:-2px; }
.ba-segments { display:flex; margin:0 14px 16px; background:#f1e8d6; border-radius:6px; padding:3px; gap:3px; }
.ba-segments button { flex:1; min-width:0; border:0; padding:9px 2px; border-radius:4px; color:#75634e; background:none; cursor:pointer; font:14px var(--kai); }
.ba-segments button[aria-pressed="true"] { background:#a72f28; color:#fffaf1; }
.ba-bars { margin:0 14px; }.ba-bar { display:grid; grid-template-columns:22px minmax(0,1fr) 44px 46px; gap:8px; align-items:center; margin:13px 0; }
.ba-bar>span { font:700 20px var(--kai); }.ba-bar strong { font-size:13px; font-weight:500; }.ba-bar small { color:#887867; font-size:12px; text-align:right; }
.ba-track { height:10px; background:#eee5d7; border-radius:3px; overflow:hidden; }.ba-fill { height:100%; display:block; min-width:0; border-radius:3px; transition:width .2s; }
.element-bg-wood{background:#238446}.element-bg-fire{background:#d62d2d}.element-bg-earth{background:#916c38}.element-bg-metal{background:#ad7800}.element-bg-water{background:#2863bd}
.ba-method { margin:14px; border:1px solid #e2d3b6; border-radius:5px; padding:10px; font-size:12px; color:#79664f; }.ba-method summary { cursor:pointer; font-size:13px; color:#a72f28; }
.ba-sky svg { display:block; width:100%; max-width:400px; margin:auto; aspect-ratio:1; }.ba-sky svg text { fill:#79664f; font:12px var(--kai); }.ba-ring { fill:#fcf7ed; stroke:#cbb58f; }.ba-ticks line { stroke:#b69b71; }.ba-orbit { fill:none; stroke:#e8dcc8; stroke-dasharray:2 4; }.ba-body { fill:#a72f28; stroke:#fffdf8; stroke-width:1.5; }.ba-earth { fill:#496f62; }.ba-hit { fill:transparent; cursor:pointer; }.ba-sky g[role="button"] { cursor:pointer; }.ba-sky g[role="button"]:focus-visible .ba-body { stroke:#1b1a18; stroke-width:3; }
.ba-sky-keys { display:flex; flex-wrap:wrap; justify-content:center; gap:5px; padding:0 12px; }.ba-sky-keys button { border:1px solid #dfcfb6; padding:7px 9px; border-radius:4px; background:#fffaf1; color:#79664f; cursor:pointer; font:13px var(--kai); }
.ba-sky-reading { margin:12px 14px; padding:10px; border-radius:5px; background:#f3eddf; min-height:42px; font-size:13px; color:#6d5036; }
@media(max-width:360px){.bm-palace-table{font-size:12px}.bm-palace-table th:first-child{width:30px}.bm-palace-table .bm-hidden small{font-size:10px}.bm-palace-table .bm-ganzhi td{font-size:25px}body #chart-view .web-hint{display:none}.ba-bar{gap:5px}}
@media(prefers-reduced-motion:reduce){.ba-fill,.ba-switch i,.ba-switch i::after{transition:none}}

/* Compact year comparison: shared dayun column width, minimal heading space. */
.ba-year-matrix{margin-top:4px}.ba-matrix-hint{margin:2px 0;padding:0 2px;font:11px/16px var(--sans)}
.ba-year-column{width:48px;flex-basis:48px;border-color:#eee5d8;padding:0 2px}
.ba-year-column:nth-child(even){background:transparent}
.ba-matrix-bound{height:22px;box-sizing:border-box;padding:3px 0;font-size:11px;line-height:16px;color:#806e58;font-variant-numeric:tabular-nums}
.ba-matrix-years{height:260px}
.ba-matrix-years button{position:relative;height:26px;padding:0;gap:0;border:0;border-radius:0;font-size:16px;line-height:26px;transition:background .16s,color .16s}
.ba-matrix-years button small{font-size:10px;letter-spacing:0}
.ba-matrix-years button[aria-pressed="true"]{background:#f0e0d0;box-shadow:none}
.ba-matrix-years button[aria-pressed="true"] small{color:#9d352c}
.ba-matrix-years button em{position:absolute;right:1px;top:0;font:7px/7px var(--sans);color:#a72f28}

.ba-patterns{padding:18px 0;border-top:8px solid #f5efe3;margin-top:12px}
.ba-patterns article{margin:12px 14px;padding:16px;border-left:3px solid #a72f28;background:#f6efe2}
.ba-patterns article small{font-size:11px;color:#887867}.ba-patterns h3{margin:8px 0;color:#a72f28;font:700 24px var(--kai)}.ba-patterns article p{font-size:13px;line-height:1.7;margin-bottom:0}
.ba-sky{background:#fbf7ef}.ba-sky .ba-ring{fill:#fffdf8;stroke:#c9b38f}.ba-sky .ba-orbit{stroke-dasharray:none;stroke:#ede3d3}
.ba-sky g[data-sky] text{font:11px var(--sans);fill:#674e36}.ba-sky .ba-earth{fill:#725c43}.ba-sky-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:0;padding:10px 14px}
.ba-sky-keys button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;border:0;border-bottom:1px solid #e5d7c3;border-radius:0;background:none}
.ba-sky-keys button small{color:#a7906c;font:10px var(--sans)}.ba-sky-keys button[aria-pressed="true"]{color:#a72f28;background:#efe2cf}
.ba-star-link{display:block;width:100%;padding:4px 0;border:0;background:none;color:#886129;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:#cbb58f;text-underline-offset:3px}
.professional-pillar-shen-sha-name[role="button"]{cursor:pointer;text-decoration:underline;text-decoration-color:#d9c7ab;text-underline-offset:3px}
.ba-star-dialog{width:min(420px,calc(100vw - 40px));box-sizing:border-box;max-height:80vh;overflow:auto;padding:26px;border:1px solid #dac8ab;border-radius:12px;background:#fffdf8;color:#473a2c;box-shadow:0 20px 70px #30231433}
.ba-star-dialog::backdrop{background:#201b175c}.ba-star-dialog form{float:right}.ba-star-dialog form button{background:#f3eadc;border:0;border-radius:4px;padding:8px 12px;color:#a72f28;cursor:pointer}
.ba-star-dialog>small{color:#887867;font-size:12px}.ba-star-dialog h2{font:700 28px var(--kai);margin:18px 0}.ba-star-dialog h3{font:700 16px var(--kai);margin-top:24px}.ba-star-dialog p{font:14px/1.9 var(--sans)}.ba-star-dialog .ba-star-location{color:#967a55;font-size:12px}
@media(prefers-reduced-motion:reduce){.ba-matrix-years button{transition:none}}

.ba-star-dialog{padding:0;overflow:hidden;width:min(480px,calc(100vw - 24px));max-height:86vh}
.ba-star-dialog-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 14px;border-bottom:1px solid #e5d8c5;background:#f7f0e5}
.ba-star-dialog-head small{font-size:12px;color:#8c775d}.ba-star-dialog-head h2{margin:6px 0 0;font-size:26px}.ba-star-dialog-head form{float:none}
.ba-star-dialog-body{max-height:calc(86vh - 100px);overflow-y:auto;overscroll-behavior:contain;padding:0 20px 18px}
.ba-star-dialog-body h3{color:#8e382e;margin-top:22px}.ba-star-dialog-body p{line-height:1.9;margin:10px 0;font-size:15px}
.ba-star-dialog-body a{font-size:12px;color:#8d5c30;overflow-wrap:anywhere;text-underline-offset:3px}.ba-star-hit{padding:1px 12px 8px;background:#f5eee1;border-left:2px solid #ba9b6b}.ba-star-hit h3{margin-top:12px}
.ba-star-rule{padding:14px 0;border-bottom:1px solid #e8ddcd}.ba-star-rule summary{font-size:14px;color:#8d5c30;cursor:pointer}.ba-star-rule ol{padding-left:20px}.ba-star-rule li{margin:8px 0}
