/* 實證八字研究 — Flask 版樣式 */
:root {
  --paper: #f6f2e9;
  --card: #ffffff;
  --ink: #1d1b18;
  --ink-2: #4a453d;
  --muted: #857d70;
  --line: #ddd5c6;
  --accent: #b8322a;      /* 朱紅 */
  --accent-ink: #ffffff;
  --male: #1859FF;
  --female: #FF1010;
  /* 五行色（沿用原版） */
  --c-t: #00A300;
  --c-f: #FF1010;
  --c-e: #A34800;
  --c-g: #FFAF06;
  --c-w: #1859FF;
  --radius: 10px;
  --font: "Microsoft JhengHei", "微軟正黑體", "PingFang TC", "Noto Sans TC", "Heiti TC", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }

/* ---------- 頂列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--ink); color: #fff;
}
.topbar-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .08em; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.topbar-left { justify-self: start; display: flex; gap: 6px; }
.topbar-right { justify-self: end; display: flex; gap: 6px; }
.topbar a, .topbar button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28);
  background: transparent; color: #fff; text-decoration: none; font-size: 14px; cursor: pointer;
}
.topbar a:hover, .topbar button:hover { background: rgba(255,255,255,.12); }

.page { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; }
.page.narrow { max-width: 560px; }

/* ---------- 共用元件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 700; text-decoration: none; cursor: pointer; letter-spacing: .05em;
}
.btn:hover { filter: brightness(1.15); }
.btn.block { display: flex; width: 100%; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn.danger { background: #fff; color: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.field { margin-bottom: 14px; }
.field > label, .field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.input, select.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; }

.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button, .seg label {
  padding: 8px 18px; border: 0; background: #fff; cursor: pointer; font-weight: 700; color: var(--ink);
}
.seg button + button, .seg label + label { border-left: 1px solid var(--ink); }
.seg button.on, .seg input:checked + span { background: var(--ink); color: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 0; }
.seg label span { display: block; padding: 8px 22px; }
.seg.full { display: flex; }
.seg.full > * { flex: 1; text-align: center; }

/* ---------- 訊息 ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 24px; display: grid; justify-items: center; gap: 8px;
  z-index: 200; pointer-events: none; padding: 0 16px; }
.toast { background: rgba(29,27,24,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 700; animation: toast 3.2s ease forwards; max-width: 100%; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.alert { padding: 10px 14px; border-radius: 8px; background: #fff4f2; color: var(--accent); border: 1px solid #f0c9c4; }

.loading { position: fixed; inset: 0; background: rgba(0,0,0,.72); color: #fff; z-index: 300;
  display: grid; place-content: center; justify-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25);
  border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================================
   盤面（維持原版配置：時｜日｜月｜年 + 右側標籤欄）
   ====================================================================== */
.chart-layout { display: grid; gap: 20px; }
.chart-main { max-width: 560px; width: 100%; margin: 0 auto; }

.board {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(4, 1fr) 6.2%;
  grid-template-rows: repeat(4, 1fr);
  aspect-ratio: 1 / 0.97;
  width: 100%;
  background: #000;
  border: 3px solid #000;
  gap: 3px;
  font-family: var(--font);
  user-select: none;
}
.board .cell { background: #fff; padding: 2px 4px; line-height: 1.15; overflow: hidden; color: #222; }
.board .ten { font-size: 24px; font-size: 7.4cqw; }
.board .big { font-size: 36px; font-size: 11.2cqw; }
.board .dm-line { white-space: nowrap; }
.board .dm .sex { font-size: 16px; font-size: 4.9cqw; }
.board .dm .flags { font-size: 14px; font-size: 4.3cqw; font-weight: 700; margin-top: 2px; }
.board .label {
  background: #fff; color: #222;
  font-size: 15px; font-size: 4.6cqw; line-height: 1.12; padding: 3px 0 0;
  text-align: center; word-break: break-all; overflow: hidden;
}
.board .hide-cell { background: #000; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.board .sub { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; background: #000; }
.board .sub div { background: #fff; padding: 1px 3px; font-size: 15px; font-size: 4.8cqw; line-height: 1.15; color: #222; overflow: hidden; }

.t { color: var(--c-t) !important; }
.f { color: var(--c-f) !important; }
.e { color: var(--c-e) !important; }
.g { color: var(--c-g) !important; }
.w { color: var(--c-w) !important; }
.sex1 { color: var(--male); }
.sex0 { color: var(--female); }

.stats { margin-top: 10px; }
.stats .line { padding: 8px 4px; border-bottom: 1px solid #444; font-size: 17px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.stats .num { display: inline-block; min-width: 1.2em; font-weight: 700; color: #006600; }
.dates { padding: 6px 4px 0; font-size: 20px; }
.dates div { margin: 4px 0; }
.meta { font-size: 13px; color: var(--muted); padding: 2px 4px 0; }
.debug-box { display: flex; gap: 8px; margin-top: 10px; }
.debug-box .input { flex: 1; font-size: 13px; }

.view-toggle { margin: 16px 0 0; }

/* 解析區 */
.sections details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.sections summary {
  list-style: none; cursor: pointer; padding: 12px 16px; background: #2f2c28; color: #fff;
  font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px;
}
.sections summary::-webkit-details-marker { display: none; }
.sections summary::before { content: "＋"; display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; color: #2f2c28; font-size: 14px; }
.sections details[open] summary::before { content: "－"; }
.sections summary .count { margin-left: auto; font-size: 13px; opacity: .7; font-weight: 400; }
.answer { margin: 0; padding: 12px 16px 14px 36px; }
.answer li { margin: 3px 0; }
.answer li.bad { color: #82726D; }
.answer li.warn::marker { color: var(--accent); }
.answer li.warn { background: #fdf3f1; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.answer hr { border: 0; border-top: 1px solid var(--line); margin: 10px -20px 10px -20px; }
.empty { padding: 12px 16px; color: var(--muted); }

.flow-wrap { padding: 12px; overflow-x: auto; }
table.flow { width: 100%; border-collapse: collapse; font-size: 16px; background: #fff; }
table.flow th, table.flow td { border: 1px solid #000; padding: 4px 5px; text-align: left; vertical-align: middle; }
table.flow th { font-weight: 700; text-align: center; }
table.flow .c-label { width: 18%; white-space: nowrap; }
table.flow .c-ten { width: 10%; }
table.flow .c-col { width: 18%; }
table.flow tr.selected td { background: #d9d2c3; }
table.flow tbody tr.pick { cursor: pointer; }
table.flow tbody tr.pick:hover td { background: #f1ece1; }
table.flow tr.selected:hover td { background: #d9d2c3; }
.flow-caption { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 8px; }

@media (min-width: 1000px) {
  .chart-layout { grid-template-columns: 540px 1fr; align-items: start; }
  .chart-main { position: sticky; top: 68px; margin: 0; }
}

.sys-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; padding-bottom: 2px; }
.sys-tabs a { flex: 0 0 auto; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; text-decoration: none; font-weight: 700; }
.sys-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.my-charts .sys-tabs { margin: 0; }
.my-charts .sys-tabs a { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ======================================================================
   名單
   ====================================================================== */
.today { text-align: left; }
.today .date { font-size: 20px; font-weight: 700; color: #008800; }
.today .date b { color: #880000; font-size: 22px; padding: 0 2px; }
.today .gz { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-top: 4px; }
.today .gz span { font-size: 28px; font-weight: 700; color: #000088; }
.today .gz sup { font-size: 14px; color: #880000; font-weight: 700; margin-left: 1px; }
.today .gz em { font-style: normal; font-size: 26px; font-weight: 700; color: #333; margin-left: 4px; }

.list-tools { display: flex; gap: 10px; align-items: center; margin: 16px 0 10px; }
.search { flex: 1; position: relative; }
.search input { padding-left: 38px; }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); font-size: 20px; color: var(--muted); }

.plist { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plist .group { padding: 4px 14px; background: #efe9dc; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.pitem { display: flex; align-items: center; border-top: 1px solid var(--line); }
.plist .group + .pitem { border-top: 0; }
.pitem a.go { flex: 1; display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; column-gap: 12px;
  align-items: center; padding: 10px 14px; text-decoration: none; min-width: 0; }
.pitem a.go:hover { background: #faf7f1; }
.pitem .icon { grid-row: 1 / 3; width: 26px; height: 26px; border-radius: 4px; display: block; }
.pitem .icon.none { background: #ddd; }
.pitem .name { grid-column: 2; grid-row: 1; }
.pitem .bday { grid-column: 2; grid-row: 2; }
.pitem .name { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .bday { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.pitem .ew { font-size: 13px; color: var(--muted); letter-spacing: .05em; }
.pitem .ten3 { grid-row: 1 / 3; grid-column: 3; text-align: right; font-size: 15px; color: #333; white-space: nowrap; }
.pitem .del { display: none; margin-right: 12px; }
.plist.editing .pitem .del { display: inline-flex; }
.plist.editing .pitem a.go { pointer-events: none; opacity: .75; }
.list-foot { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.list-foot .count { margin-left: auto; color: var(--muted); font-size: 14px; }

/* ======================================================================
   新增 / 表單
   ====================================================================== */
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pillar-grid .col { display: grid; gap: 6px; text-align: center; }
.pillar-grid .col b { font-size: 14px; }
.pillar-grid select { text-align: center; text-align-last: center; font-size: 26px; min-height: 56px; padding: 4px;
  background: #1d1b18; color: #fff; border-radius: 8px; border: 0; appearance: none; -webkit-appearance: none; }
.cands { display: grid; gap: 8px; margin-top: 12px; }

/* 圖形密碼 */
.pattern-wrap { display: grid; justify-items: center; gap: 8px; }
.pattern { position: relative; width: min(260px, 78vw); aspect-ratio: 1; touch-action: none; user-select: none;
  background: #1d1b18; border-radius: 16px; }
.pattern svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pattern .dot { fill: #fff; opacity: .35; transition: opacity .1s; }
.pattern .dot.on { opacity: 1; }
.pattern .ring { fill: none; stroke: #fff; stroke-width: 2; opacity: 0; }
.pattern .ring.on { opacity: .6; }
.pattern polyline { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.pattern.bad polyline, .pattern.bad .ring.on { stroke: #ff6a5e; }
.pattern.bad .dot.on { fill: #ff6a5e; }
.pattern.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.phone-input { font-size: 28px; letter-spacing: .12em; text-align: center; font-weight: 700; }

/* ======================================================================
   首頁
   ====================================================================== */
.hero { text-align: center; padding: 28px 8px 8px; }
.hero h2 { font-size: 30px; margin: 0 0 6px; letter-spacing: .2em; }
.hero p { color: var(--ink-2); margin: 0; }
.five-strip { display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.five-strip span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; font-weight: 700;
  background: #fff; border: 2px solid currentColor; }
.tabs { display: flex; gap: 0; margin: 16px 0; border-bottom: 2px solid var(--ink); }
.tabs button { flex: 1; padding: 10px; border: 0; background: transparent; font-weight: 700; cursor: pointer; font-size: 16px; }
.tabs button.on { background: var(--ink); color: #fff; border-radius: 8px 8px 0 0; }
.prose p { text-indent: 2em; }
.prose details { margin-bottom: 8px; }
.prose ul { padding-left: 1.4em; }
.prose li { margin: 4px 0; }

/* ======================================================================
   站長
   ====================================================================== */
table.members { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.members th, table.members td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: middle; }
table.members form { display: flex; gap: 6px; align-items: center; }
table.members input { width: 80px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 760px) {
  table.members thead { display: none; }
  table.members tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.members td { display: flex; gap: 8px; border: 0; padding: 3px 8px; }
  table.members td::before { content: attr(data-th); min-width: 70px; color: var(--muted); }
  table.members form { flex-wrap: wrap; }
}

/* ======================================================================
   生命靈數
   ====================================================================== */
.num-head { text-align: center; padding: 14px; }
.num-date { font-size: 18px; color: var(--ink-2); letter-spacing: .05em; }
.num-expr { font-size: 14px; color: var(--muted); margin: 4px 0 6px; word-break: break-all; }
.num-big { font-size: 44px; font-weight: 700; line-height: 1.1; letter-spacing: .02em; }
.num-big span { color: var(--ink-2); }
.num-big b { color: var(--accent); font-size: 56px; }
.num-grid { display: block; width: 100%; max-width: 420px; margin: 14px auto 4px; background: #fff; border-radius: 12px; }
.num-grid .frame { fill: #fff; stroke: #000; stroke-width: 3; }
.num-grid .sep { stroke: #000; stroke-width: 1.5; }
.num-grid .ln { stroke: var(--accent); stroke-width: 12; stroke-linecap: round; opacity: .28; }
.num-grid .digit { font-size: 46px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; fill: var(--ink); }
.num-grid .digit.off { fill: #d8d2c6; }
.num-grid .marks { font-size: 15px; text-anchor: middle; fill: var(--accent); letter-spacing: 1px; }
.legend { text-align: center; font-size: 13px; }
.num-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.num-stats div { background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 8px 2px; }
.num-stats small { display: block; font-size: 12px; color: var(--muted); }
.num-stats b { font-size: 26px; }
.num-stats b.accent { color: var(--accent); }

/* ======================================================================
   紫微斗數
   ====================================================================== */
.zw-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(132px, auto);
  border: 3px solid #000; background: #000; gap: 2px; }
.zw-cell { position: relative; background: #fff; display: flex; flex-direction: column; padding: 3px 3px 2px; min-width: 0; }
.zw-cell.cur { background: #fbf3df; }
.zw-cell.ming { box-shadow: inset 0 0 0 2px var(--accent); }
.zw-tag { position: absolute; left: 2px; top: 2px; font-size: 10px; background: var(--ink); color: #fff; border-radius: 3px; padding: 0 3px; }
.zw-stars { flex: 1; display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-content: flex-start; gap: 1px 2px; }
.zw-stars .st { display: flex; flex-direction: column; align-items: center; width: 1.08em; font-size: 13px; line-height: 1.08; word-break: break-all; text-align: center; }
.zw-stars .st.major { font-weight: 700; font-size: 15px; color: #111; }
.zw-stars .st.lucky { color: #1d5fbf; }
.zw-stars .st.unlucky { color: #8a8076; }
.zw-stars .st.other { color: #c2477a; font-size: 12px; }
.hua { display: inline-block; font-style: normal; font-weight: 700; font-size: 11px; color: #fff; border-radius: 3px; padding: 1px 2px; line-height: 1.1; margin-top: 2px; }
.zw-stars .hua { padding: 1px 0; width: 100%; font-size: 10.5px; }
.h-祿 { background: #1b8a3a; } .h-權 { background: #7a3fb0; } .h-科 { background: #1d5fbf; } .h-忌 { background: #d22b2b; }
.zw-foot { display: grid; grid-template-columns: 1fr auto; font-size: 12px; line-height: 1.25; border-top: 1px dashed var(--line); padding-top: 2px; }
.zw-dec { grid-column: 1 / 3; color: var(--muted); font-size: 11px; }
.zw-name { font-weight: 700; font-size: 13px; color: var(--accent); white-space: nowrap; }
.zw-name em { font-style: normal; background: var(--ink); color: #fff; font-size: 10px; border-radius: 3px; padding: 0 2px; margin-left: 1px; }
.zw-gz { color: var(--ink-2); }
.zw-center { grid-row: 2 / 4; grid-column: 2 / 4; background: #fffdf8; padding: 10px; display: flex; flex-direction: column; justify-content: center; }
.zw-who { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.zw-center dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 0; font-size: 13px; }
.zw-center dt { color: var(--muted); }
.zw-center dd { margin: 0; }
.zw-legend { display: flex; gap: 4px; margin-top: 6px; }
.zw-legend .hua { font-size: 12px; padding: 1px 4px; }
@media (max-width: 420px) {
  .zw-board { grid-auto-rows: minmax(124px, auto); }
  .zw-stars .st { font-size: 12px; }
  .zw-stars .st.major { font-size: 13px; }
  .zw-center { padding: 6px; }
  .zw-center dl { font-size: 11.5px; }
  .zw-who { font-size: 15px; }
}

/* ======================================================================
   占星
   ====================================================================== */
.as-wheel { display: block; width: 100%; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 50%; }
.as-wheel .ring-out { fill: #fbf8f1; stroke: #000; stroke-width: 2; }
.as-wheel .ring { fill: #fff; stroke: #000; stroke-width: 1.2; }
.as-wheel .sign-sep { stroke: #000; stroke-width: 1; }
.as-wheel .sign-glyph { font-size: 24px; text-anchor: middle; dominant-baseline: central; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Apple Symbols", sans-serif; }
.as-wheel .el-fire { fill: #d23a2a; } .as-wheel .el-earth { fill: #8a5a12; } .as-wheel .el-air { fill: #c99700; } .as-wheel .el-water { fill: #1d5fbf; }
.as-wheel .cusp { stroke: #9a9284; stroke-width: 1; }
.as-wheel .cusp-axis { stroke: #000; stroke-width: 2.2; }
.as-wheel .house-num { font-size: 13px; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.as-wheel .asp { stroke-width: 1.3; opacity: .75; }
.as-wheel .asp-trine, .as-wheel .asp-sext { stroke: #1d5fbf; }
.as-wheel .asp-square, .as-wheel .asp-opp { stroke: #d22b2b; }
.as-wheel .asp-sext { stroke-dasharray: 5 4; }
.as-wheel .tick { stroke: #000; stroke-width: 1.5; }
.as-wheel .planet { font-size: 22px; text-anchor: middle; dominant-baseline: central; fill: #1d1b18;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", sans-serif; }
.as-wheel .p-sun, .as-wheel .p-moon { fill: var(--accent); font-weight: 700; }
.as-wheel .axis-label { font-size: 13px; font-weight: 700; }
.as-big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.as-big3 div { background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 8px 4px; }
.as-big3 small { display: block; color: var(--muted); font-size: 12px; }
.as-big3 b { display: block; font-size: 19px; }
.as-big3 span { font-size: 13px; color: var(--ink-2); }
.as-table td { font-size: 15px; }
.as-table th { white-space: nowrap; }
.as-table .glyph { display: inline-block; width: 1.3em; text-align: center; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif; }
.retro { color: #d22b2b; font-weight: 700; }

/* ======================================================================
   人類圖
   ====================================================================== */
.hd-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.hd-summary div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; min-width: 0; }
.hd-summary small { display: block; font-size: 12px; color: var(--muted); }
.hd-summary b { display: block; font-size: 16px; line-height: 1.3; }
.hd-summary b.sm { font-size: 12.5px; font-weight: 700; }
.hd-summary span { font-size: 12px; color: var(--ink-2); }
.hd-graph { display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; gap: 4px; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 4px; }
.hd-svg { width: 100%; height: auto; display: block; }
.hd-col { display: grid; gap: 2px; font-size: 13px; }
.hd-col-head { font-size: 12px; font-weight: 700; text-align: center; padding-bottom: 2px; border-bottom: 2px solid currentColor; margin-bottom: 2px; }
.hd-d { color: #c62828; }
.hd-p { color: #1d1b18; }
.hd-act { display: flex; justify-content: space-between; align-items: center; padding: 2px 3px; border-radius: 4px; }
.hd-act:nth-child(even) { background: #f6f2e9; }
.hd-act .gl { display: inline-block; width: 1.25em; text-align: center; line-height: 1; overflow: hidden; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", sans-serif; font-size: 14px; }
.hd-act b { font-variant-numeric: tabular-nums; }
.hd-red { color: #c62828; }
.hd-svg .hd-arrow line { stroke-width: 4; stroke-linecap: round; }
.hd-svg .hd-arrow-d line { stroke: #d22b2b; } .hd-svg .hd-arrow-d polygon { fill: #d22b2b; }
.hd-svg .hd-arrow-p line { stroke: #1d1b18; } .hd-svg .hd-arrow-p polygon { fill: #1d1b18; }
.hd-dir { display: inline-block; margin-left: 4px; font-weight: 700; }
.hd-ctb td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hd-svg .ch-track { stroke: #ece6d9; stroke-width: 9; stroke-linecap: round; }
.hd-svg .ch-p { stroke: #1d1b18; stroke-width: 7; stroke-linecap: round; }
.hd-svg .ch-d { stroke: #d22b2b; stroke-width: 7; stroke-linecap: round; }
.hd-svg .ch-stripe { stroke-dasharray: 5 5; stroke-linecap: butt; }
.hd-svg .ctr { stroke: #4a453d; stroke-width: 1.5; }
.hd-svg .gate { stroke-width: 1; }
.hd-svg .gate-off { fill: #fff; stroke: #c9c1b2; }
.hd-svg .gate-p { fill: #1d1b18; stroke: #1d1b18; }
.hd-svg .gate-d { fill: #d22b2b; stroke: #d22b2b; }
.hd-svg .gate-both { fill: #1d1b18; stroke: #d22b2b; stroke-width: 2.5; }
.hd-svg .gnum { font-size: 8.5px; text-anchor: middle; dominant-baseline: central; fill: #8d8578; font-family: Arial, sans-serif; }
.hd-svg .gnum-p, .hd-svg .gnum-d, .hd-svg .gnum-both { fill: #fff; font-weight: 700; }
.legend .lg { display: inline-block; width: 18px; height: 6px; border-radius: 3px; vertical-align: middle; margin: 0 2px 0 6px; }
.lg-p { background: #1d1b18; } .lg-d { background: #d22b2b; }
.lg-both { background: repeating-linear-gradient(90deg, #1d1b18 0 5px, #d22b2b 5px 10px); }
.hd-act .nm { display: none; }
@media (max-width: 520px) {
  .sys-tabs a { padding: 5px 12px; font-size: 14px; }
  .hd-graph { grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; }
  .hd-svg { grid-column: 1 / 3; grid-row: 1; }
  .hd-col.hd-d { grid-column: 1; grid-row: 2; }
  .hd-col.hd-p { grid-column: 2; grid-row: 2; }
  .hd-act { justify-content: flex-start; gap: 6px; }
  .hd-act .nm { display: inline; flex: 1; font-size: 12px; color: var(--ink-2); }
  .hd-summary { grid-template-columns: repeat(2, 1fr); }
}

.dst-note { background: #fff7e6; border: 1px solid #f0d9a8; color: #7a5410; border-radius: 8px; padding: 8px 12px;
  font-size: 14px; margin: -4px 0 12px; }

/* 紫微：雜曜、亮度、十二神 */
.zw-tools { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.zw-tools input { vertical-align: middle; }
.zw-stars .st.minor { color: #9a8f80; font-size: 11px; font-weight: 400; }
.zw-stars .st .br { font-style: normal; font-size: 9.5px; line-height: 1.1; color: #8a7d6a; margin-top: 1px; }
.zw-stars .st .br-廟, .zw-stars .st .br-旺 { color: #b8322a; }
.zw-stars .st .br-陷, .zw-stars .st .br-不 { color: #7a8aa0; }
.zw-board.hide-minor .st.minor { display: none; }
.zw-gods { grid-column: 1 / 3; font-size: 10.5px; color: #7d6f5c; letter-spacing: 1px; }
.zw-board.hide-gods .zw-gods { display: none; }
small.br { font-size: 11px; color: #8a7d6a; margin-left: 1px; }

/* ---- 天賦優勢（全息圖） ---- */
.tl-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date main" "key main"; align-items: center; gap: 2px 12px; padding: 12px 16px; }
.tl-date { grid-area: date; font-size: 18px; color: var(--ink-2); letter-spacing: .05em; }
.tl-key { grid-area: key; font-size: 15px; font-weight: 700; }
.tl-main { grid-area: main; text-align: center; line-height: 1; }
.tl-main small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tl-main b { font-size: 54px; color: var(--accent); }
.tl-main span { font-size: 14px; color: var(--ink-2); margin-left: 2px; }
.tl-svg { display: block; width: 100%; max-width: 460px; margin: 12px auto 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.tl-svg .tl-tri { fill: #faf6ec; stroke: #1d1b18; stroke-width: 2; stroke-linejoin: round; }
.tl-svg .tl-outer { fill: none; stroke: #bfb6a4; stroke-width: 1.2; stroke-dasharray: 4 4; }
.tl-svg .tl-z-left { fill: #eef5ea; } .tl-svg .tl-z-top { fill: #fbefe3; } .tl-svg .tl-z-right { fill: #eaf0f7; }
.tl-svg .tl-link { fill: none; stroke: #d9d0bf; stroke-width: 1.5; }
.tl-svg .tl-box { fill: #fff; stroke: #8d8578; stroke-width: 1; }
.tl-svg .tl-bnum { font-size: 15px; text-anchor: middle; dominant-baseline: central; fill: var(--ink-2); font-family: Arial, sans-serif; }
.tl-svg .tl-blabel { font-size: 11px; text-anchor: middle; fill: var(--muted); }
.tl-svg .tl-cell circle { fill: #fff; stroke: #1d1b18; stroke-width: 1.5; }
.tl-svg .tl-star circle { stroke-width: 2.5; }
.tl-svg .tl-main-cell circle { fill: var(--accent); stroke: var(--accent); }
.tl-svg .tl-n { font-size: 19px; font-weight: 700; text-anchor: middle; dominant-baseline: central; fill: #1d1b18; font-family: Arial, sans-serif; }
.tl-svg .tl-main-cell .tl-n { fill: #fff; }
.tl-svg .tl-l { font-size: 11px; text-anchor: middle; fill: #8d8578; font-family: Arial, sans-serif; font-weight: 700; }
.tl-svg .tl-s { font-size: 11px; text-anchor: middle; fill: var(--accent); }
.tl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.tl-stats div { background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 7px 4px; min-width: 0; }
.tl-stats small { display: block; font-size: 12px; color: var(--muted); }
.tl-stats b { display: block; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tl-stats span { font-size: 12px; color: var(--ink-2); }
.tl-joint td { vertical-align: top; }
.tl-joint td:nth-child(1), .tl-joint td:nth-child(2) { white-space: nowrap; }
.tl-groups { font-size: 13px; margin-top: 8px; }

/* ---- 雙人合盤（共用） ---- */
.sys-tabs a.pair-link { margin-left: auto; border-style: dashed; }
.pair-entry { font-weight: 700; }
.pair-form .field { margin-bottom: 12px; }
.pair-form label { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 4px; }
.pair-systems { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pair-systems label { font-weight: 400; margin: 0; }
.pair-tag { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px;
  font-size: 13px; font-weight: 700; color: #fff; flex: 0 0 auto; font-family: Arial, sans-serif; }
.pair-tag.a { background: #1d1b18; } .pair-tag.b { background: #2f6fd0; }
.pair-head { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; }
.pair-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pair-who b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair-who small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pair-who div { min-width: 0; }
.pair-swap { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid var(--line); text-decoration: none; font-size: 18px; }
.pair-change { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ca { color: #1d1b18; } .cb { color: #2f6fd0; }
.pair-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-cols > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 0; }
.pair-cols h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.pair-score { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.pair-score div { background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 7px 4px; min-width: 0; }
.pair-score small { display: block; font-size: 12px; color: var(--muted); }
.pair-score b { display: block; font-size: 22px; line-height: 1.25; }
.pair-score span { font-size: 12px; color: var(--ink-2); }
.rel { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 12.5px; line-height: 1.6; margin: 1px 1px; white-space: nowrap; }
.rel-good { background: #e3f1df; color: #24661a; } .rel-bad { background: #fbe3e1; color: #a3271f; } .rel-mid { background: #f1ece2; color: #5d5547; }
@media (max-width: 640px) {
  .pair-head { grid-template-columns: 1fr auto; }
  .pair-head .pair-who:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .pair-swap { grid-column: 2; grid-row: 1 / 3; }
  .pair-head .pair-who:nth-of-type(2) { grid-column: 1; grid-row: 2; }
  .pair-change { grid-column: 1 / 3; grid-row: 3; text-align: right; }
}
.accent-t { color: var(--accent); }
.num-grid .ln-together { stroke-dasharray: 2 16; opacity: .55; }
.num-grid .mk-a { fill: #1d1b18; } .num-grid .mk-b { fill: #2f6fd0; }
.pair-sub { margin: 14px 0 0; font-size: 16px; text-align: center; }
.pair-sub small { font-weight: 400; font-size: 12px; }
.tl-svg.tl-rel .tl-main-cell circle { fill: #2f6fd0; stroke: #2f6fd0; }
.tl-svg.tl-mini { margin: 0; border: 0; }
.tl-cmp td, .tl-cmp th { text-align: center; }
.tl-cmp td:first-child { text-align: left; white-space: nowrap; }
.bz-mini { width: 100%; border-collapse: collapse; text-align: center; table-layout: fixed; }
.bz-mini th { font-size: 12px; color: var(--muted); font-weight: 400; }
.bz-mini td { border: 1px solid #000; padding: 2px 0; }
.bz-mini tr.ten td { font-size: 12.5px; }
.bz-mini tr.big td { font-size: 28px; line-height: 1.25; }
.bz-five { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; font-weight: 700; }
.bz-meta { font-size: 12.5px; margin-top: 2px; }
.bz-cross td { text-align: center; vertical-align: top; min-width: 64px; }
.bz-cross th { white-space: nowrap; }
.zw-pair { grid-auto-rows: minmax(118px, auto); }
.zw-cell.bming { box-shadow: inset 0 0 0 2px #2f6fd0; }
.zw-cell.ming.bming { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 4px #2f6fd0; }
.hua.hb { background: #2f6fd0; }
.zw-bhua { display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 11.5px; color: #2f6fd0; margin: 2px 0; }
.zw-bhua span { white-space: nowrap; }
.zw-bhua .hua { margin: 0 1px 0 0; }
.zw-bname { grid-column: 1 / 3; color: #2f6fd0; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.zw-bname em { font-style: normal; background: #2f6fd0; color: #fff; font-size: 10px; border-radius: 3px; padding: 0 2px; margin-left: 2px; }
.as-bi .ring-b { fill: #f3f7fd; }
.as-bi .planet { font-size: 19px; }
.as-bi .pl-b { fill: #2f6fd0; }
.as-bi .tick-b { stroke: #2f6fd0; }
ul.plain { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.plain li { padding: 1px 0; }
.hd-pair-graph { display: block; max-width: 460px; margin: 0 auto; }
.hd-svg.hd-pair .ch-d { stroke: #2f6fd0; }
.hd-svg.hd-pair .gate-d { fill: #2f6fd0; stroke: #2f6fd0; }
.hd-svg.hd-pair .gate-both { stroke: #2f6fd0; }
.lg.lg-pb { background: #2f6fd0; }
.lg.lg-both-ab { background: repeating-linear-gradient(90deg, #1d1b18 0 5px, #2f6fd0 5px 10px); }

.hd-gmemo { font-size: 12.5px; }
.tr-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px 0; font-size: 14px; }
.tr-form input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
/* 潛能雷達 */
.radar { display: block; width: 100%; max-width: 380px; margin: 4px auto; }
.radar .rd-ring { fill: none; stroke: #e2dacb; stroke-width: 1; }
.radar .rd-axis { stroke: #e2dacb; stroke-width: 1; }
.radar .rd-poly { fill: rgba(184, 50, 42, .18); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar .rd-poly.rd-a { fill: rgba(29, 27, 24, .14); stroke: #1d1b18; }
.radar .rd-poly.rd-b { fill: rgba(47, 111, 208, .16); stroke: #2f6fd0; }
.radar .rd-label { font-size: 12.5px; fill: var(--ink-2); dominant-baseline: central; }
.cyc-table td { vertical-align: top; }
.cyc-table td.cyc-y { white-space: nowrap; text-align: center; line-height: 1.45; font-size: 14px; }
.cyc-table td { text-align: left; }

/* ---- 馬雅曆 ---- */
.my-c-red { --mc: #c8372d; --mb: #fbe7e4; } .my-c-white { --mc: #6b6458; --mb: #f4f2ee; }
.my-c-blue { --mc: #2f6fd0; --mb: #e6eefb; } .my-c-yellow { --mc: #b8860b; --mb: #fbf3d8; }
.my-t-red { color: #c8372d; } .my-t-white { color: #6b6458; } .my-t-blue { color: #2f6fd0; } .my-t-yellow { color: #b8860b; }
.my-head { display: flex; justify-content: space-between; align-items: center; background: var(--mb); border-color: var(--mc); }
.my-head small { display: block; color: var(--muted); }
.my-head b { display: block; font-size: 24px; color: var(--mc); }
.my-head span { font-size: 13px; color: var(--ink-2); }
.my-num { font-size: 46px; font-weight: 700; color: var(--mc); font-family: Arial, sans-serif; }
.my-cross { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-areas: ". guide ." "antipode destiny analog" ". occult ."; gap: 6px; margin: 14px auto; max-width: 420px; }
.my-cross.small { gap: 3px; margin: 0; }
.my-cell { grid-area: var(--area); background: var(--mb); border: 2px solid var(--mc); border-radius: 10px; text-align: center; padding: 6px 2px; min-width: 0; }
.my-guide { grid-area: guide; } .my-antipode { grid-area: antipode; } .my-destiny { grid-area: destiny; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.my-analog { grid-area: analog; } .my-occult { grid-area: occult; }
.my-cell small { display: block; font-size: 11.5px; color: var(--muted); }
.my-cell b { display: block; font-size: 17px; color: var(--mc); }
.my-cell span { display: block; font-size: 12px; color: var(--ink-2); }
.my-cell em { font-style: normal; font-size: 11px; color: var(--muted); }
.my-cross.small .my-cell b { font-size: 13px; } .my-cross.small .my-cell span, .my-cross.small .my-cell small { font-size: 10.5px; }
.my-cross.small .my-cell em { display: none; }
.my-tz { display: grid; grid-template-columns: repeat(13, 1fr); grid-auto-flow: row; gap: 2px; max-width: 360px; margin: 8px auto; }
.my-tz i { display: block; aspect-ratio: 1; background: #eee9df; border-radius: 2px; }
.my-tz i.gap { background: #b9d8b2; }
.my-tz i.me { background: #c8372d; } .my-tz i.today { background: #2f6fd0; } .my-tz i.you { background: #2f6fd0; } .my-tz i.both { background: #8a4fc2; }
.lg.lg-mix { background: #8a4fc2; }
.pair-score b.sm { font-size: 15px; }
.sys-tabs .print-link { flex: 0 0 auto; padding: 6px 14px; border-radius: 999px; border: 1px dashed var(--line); background: #fff; cursor: pointer; font-size: 14px; }
.sys-tabs a.pair-link { margin-left: 0; }
.sys-tabs .print-link { margin-left: auto; }

@media print {
  .topbar, .sys-tabs, .pair-swap, .pair-change, .tr-form, .view-toggle, .zw-tools, .toast-wrap, .loading,
  .list-tools, .print-link, .pair-link { display: none !important; }
  .sections[hidden] { display: block !important; }
  body { background: #fff; font-size: 12pt; }
  .page { max-width: none; padding: 0; }
  .chart-layout { display: block !important; }
  .chart-side { margin-top: 12px; }
  details { break-inside: auto; border: 0 !important; }
  details > summary { background: #eee !important; color: #000 !important; }
  details > summary::before { display: none !important; }
  li, tr, .my-cross, svg { break-inside: avoid; }
  a { text-decoration: none; }
}

/* ---- 綜合 ---- */
.ov-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.ov-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-decoration: none; }
.ov-card small { display: block; color: var(--muted); font-size: 12px; }
.ov-card span { font-size: 14px; font-weight: 700; }
.ov-years { display: grid; gap: 8px; }
.ov-year { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ov-year.now { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.ov-yh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 4px; }
.ov-yh b { font-size: 18px; } .ov-yh span { color: var(--muted); font-size: 13px; }
.ov-tags { flex: 1 1 100%; }
.ov-year dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 13.5px; }
.ov-year dt { color: var(--muted); white-space: nowrap; }
.ov-year dd { margin: 0; }
.ov-year dd small { color: var(--ink-2); }
.ov-chip { display: inline-block; border-radius: 999px; padding: 0 8px; margin: 2px 3px 2px 0; font-size: 12.5px; line-height: 1.7; background: #f1ece2; color: #5d5547; white-space: nowrap; }
.ov-chip.ov-3 { background: #fdeee0; color: #9a5a12; } .ov-chip.ov-4 { background: #fbe0dc; color: #a3271f; } .ov-chip.ov-5 { background: #b8322a; color: #fff; }
.ov-pair td { vertical-align: top; }
.pair-years { margin-top: 12px; }
.pair-yt td { vertical-align: top; }
.pair-yt td small { color: var(--ink-2); }
.pair-yt .py-notes { margin-top: 4px; }
.pair-yt .py-notes:empty { display: none; }

/* 查看日期列 */
.when-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; padding: 8px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.when-bar .wb-step { text-decoration: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.when-bar .wb-date { display: inline-flex; align-items: center; gap: 6px; }
.when-bar .wb-date span { color: var(--muted); }
.when-bar input[type=date] { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.when-bar .wb-today { color: var(--accent); font-weight: 700; text-decoration: none; }
.when-bar .wb-note { flex: 1 1 220px; color: var(--muted); font-size: 12.5px; }
.when-bar .wb-print { display: none; }
@media print {
  .when-bar { border: 0; padding: 0; margin: 0 0 6px; }
  .when-bar > *:not(.wb-print) { display: none !important; }
  .when-bar .wb-print { display: inline; }
}

/* 八字命格分析 */
.bz-meter { margin: 10px 16px 4px; }
.bz-meter-bar { position: relative; height: 12px; border-radius: 999px; background: #efe9dd; overflow: hidden; }
.bz-meter-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #d9b98a, var(--accent)); border-radius: 999px; }
.bz-meter-bar i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #1d1b18; opacity: .5; }
.bz-meter-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }
.bz-favor { display: grid; gap: 6px; margin: 10px 16px 0; font-size: 14px; }
.bz-favor > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.bz-favor small { color: var(--muted); min-width: 2.5em; }
.bz-favor em { font-style: normal; font-size: 12px; color: var(--muted); margin-right: 6px; }
.five-chip { display: inline-block; min-width: 1.8em; text-align: center; font-weight: 700; border: 1px solid currentColor; border-radius: 6px; padding: 0 4px; background: #fff; }
.bz-groups { margin: 10px 16px 0; display: grid; gap: 5px; font-size: 14px; }
.bz-group { display: grid; grid-template-columns: 4.8em 1fr 3em; align-items: center; gap: 8px; }
.bz-gname small { margin-left: 4px; font-size: 12px; color: var(--muted); }
.bz-gbar { height: 10px; background: #efe9dd; border-radius: 999px; overflow: hidden; }
.bz-gbar > span { display: block; height: 100%; background: #b9a888; border-radius: 999px; }
.bz-group.many .bz-gbar > span { background: var(--accent); }
.bz-group.none .bz-gname { color: var(--muted); }
.bz-gbar.t > span { background: var(--c-t); } .bz-gbar.f > span { background: var(--c-f); } .bz-gbar.e > span { background: var(--c-e); }
.bz-gbar.g > span { background: var(--c-g); } .bz-gbar.w > span { background: var(--c-w); }
.bz-gpts { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bz-groups p { margin: 2px 0 0; font-size: 12.5px; }
.luck-good { color: #2f7d4f; font-weight: 700; } .luck-bad { color: var(--accent); font-weight: 700; } .luck-mixed { color: var(--muted); }

/* ---- 首頁 ---- */
.page.home { max-width: 980px; }
.hm-hero { position: relative; text-align: center; padding: 44px 20px 30px; margin: 4px 0 8px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #2b2722 0%, #1d1b18 70%); color: #f4efe6; }
.hm-seal { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 34px; font-weight: 700; transform: rotate(-4deg);
  box-shadow: 0 6px 18px rgba(184, 50, 42, .35); }
.hm-hero h2 { font-size: clamp(30px, 6vw, 46px); line-height: 1.2; margin: 0 0 14px; letter-spacing: .12em; }
.hm-lead { max-width: 36em; margin: 0 auto; color: #d8d0c2; font-size: 16px; line-height: 1.8; }
.hm-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 6px; }
.hm-cta .btn { min-width: 150px; }
.hm-cta .btn.ghost { color: #f4efe6; border-color: #6b6457; }
.hm-five { display: flex; justify-content: center; gap: 14px; margin-top: 22px; font-size: 20px; font-weight: 700; }
.hm-five span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.hm-br { display: none; }
.hm-block { margin: 28px 0; }
.hm-h { font-size: 20px; margin: 0 0 12px; padding-left: 10px; border-left: 4px solid var(--accent); }
.hm-systems { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hm-sys { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.hm-sys b { font-size: 16px; }
.hm-sys p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.hm-glyph { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #f3ece0; color: var(--accent); font-size: 20px; font-weight: 700; }
.hm-feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hm-feats li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.hm-feats b { display: block; margin-bottom: 4px; }
.hm-feats span { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.hm-about p { line-height: 1.9; margin: 0 0 8px; }
.hm-foot { text-align: center; padding: 20px 0 34px; border-top: 1px solid var(--line); margin-top: 20px; }
.hm-foot a { color: var(--ink-2); text-decoration: none; }
@media (max-width: 480px) {
  .hm-hero { padding: 34px 16px 24px; }
  .hm-br { display: inline; }
  .hm-cta .btn { flex: 1 1 100%; }
}

/* ---- 名單頁（中性版） ---- */
.today-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.td-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.td-date b { font-size: 22px; letter-spacing: .02em; }
.td-date span { color: var(--muted); font-size: 14px; }
.td-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.td-label { flex: 0 0 4.5em; color: var(--muted); font-size: 13px; }
.td-main { font-weight: 700; }
.td-main sup { color: var(--accent); font-size: 11px; margin: 0 2px; font-weight: 700; }
.td-sub { color: var(--muted); font-size: 12.5px; }
.list-tools { display: flex; gap: 8px; align-items: center; }
.list-tools .search { flex: 1; }
.pitem a.go { flex: 1; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 1px;
  padding: 10px 6px 10px 14px; text-decoration: none; color: inherit; min-width: 0; }
.pitem .avatar { grid-row: 1 / 4; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; color: #fff; background: #9a9182; align-self: center; }
.pitem .avatar.sexbg1 { background: var(--male); } .pitem .avatar.sexbg0 { background: var(--female); }
.pitem .name { grid-column: 2; grid-row: 1; font-size: 17px; }
.pitem .bday { grid-column: 2; grid-row: 2; font-size: 13.5px; color: var(--ink-2); font-weight: 400; }
.pitem .tags { grid-column: 2; grid-row: 3; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pitem .tags i { font-style: normal; font-size: 12px; color: var(--ink-2); background: #f3ece0; border-radius: 999px; padding: 0 8px; line-height: 1.7; }
.pitem .edit { flex: 0 0 auto; margin-right: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; background: #fff; }
.pitem .edit:hover { border-color: var(--accent); color: var(--accent); }
.danger-zone { border-color: #f0c9c4; }
.hm-learn .answer p { line-height: 1.9; margin: 0 0 8px; }
.hm-sub { margin-top: 8px; }
.hm-sub > summary { cursor: pointer; color: var(--accent); font-weight: 700; padding: 6px 0; }
.hm-sub details summary { background: #f3ece0 !important; color: var(--ink) !important; }
