/* ============================================================
   通玄 · 合盘 · 西占细目 hepan-west.css（2026-11-11）
   配 assets/js/hepan-west.js；全部落在纸底的「西占」卡（.hp-tcard-body）与表单折叠里。
   块序：基础 → 袖中天 → 窄屏 → 打印 → 触屏（触屏块须居文末，同权重后源取胜）
   ============================================================ */

/* ---------- 表单：西占口径折叠 ---------- */
.hp-west-opts {
  max-width: 640px;
  margin: 18px auto 0;
  border: 1px dashed rgba(150, 114, 58, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.hp-west-opts > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.hp-west-opts > summary::-webkit-details-marker { display: none; }
.hp-west-opts > summary b { font-family: var(--font-serif); font-size: 14px; letter-spacing: 0.3em; color: var(--gold-700); }
.hp-west-opts > summary span { font-size: 12.5px; color: var(--paper-ink-soft); }
.hp-west-opts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.hp-west-opts .field { margin-top: 12px; min-width: 0; }

/* ---------- 细目外壳 ---------- */
.hpw { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(44, 42, 36, 0.12); }
.hpw[hidden] { display: none; }
.hpw-title {
  font-family: var(--font-serif); font-size: 14px; font-weight: 700; letter-spacing: 0.24em;
  color: var(--gold-700);
}
.hpw-note, .hpw-meta, .hpw-wait {
  margin-top: 8px;
  font-size: 12.5px; line-height: 1.8; letter-spacing: 0.02em;
  color: var(--paper-ink-soft);
}
.hpw-meta { font-variant-numeric: tabular-nums; }
.hpw-wait { padding: 18px 0 6px; text-align: center; }

/* ---------- 页签与分段钮 ---------- */
.hpw-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hpw-tab, .hpw-seg-btn {
  min-height: 34px;
  padding: 6px 14px;
  font-family: var(--font-serif); font-size: 13px; letter-spacing: 0.08em; line-height: 1.4;
  color: var(--paper-ink);
  background: rgba(250, 247, 239, 0.7);
  border: 1px solid rgba(44, 42, 36, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.hpw-tab:hover, .hpw-seg-btn:hover { border-color: rgba(150, 114, 58, 0.7); }
.hpw-tab:focus-visible, .hpw-seg-btn:focus-visible { outline: 2px solid var(--gold-600); outline-offset: 2px; }
.hpw-tab.is-on, .hpw-seg-btn.is-on {
  color: #fdfaf2;
  background: var(--gold-700);
  border-color: var(--gold-700);
}
.hpw-pane { margin-top: 6px; }
.hpw-pane:empty { display: none; }
.hpw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; }
.hpw-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.hpw-bar-lab { font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 0.06em; color: var(--paper-ink-soft); }
.hpw-seg-btn { font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 0.03em; padding: 5px 12px; }
.hpw-again { display: block; margin: 4px auto 0; }

/* ---------- 星盘 ---------- */
.hpw-wheel { margin: 14px auto 0; max-width: 440px; }
.hpw-wheel-svg { display: block; width: 100%; height: auto; }
.hpw-w-ring { fill: none; stroke: rgba(44, 42, 36, 0.42); stroke-width: 1; }
.hpw-w-ring.is-band { fill: rgba(150, 114, 58, 0.1); }
.hpw-w-ring.is-face { fill: #fbf8f0; }
.hpw-w-ring.is-inner { stroke: rgba(44, 42, 36, 0.28); }
.hpw-w-ring.is-core { fill: rgba(150, 114, 58, 0.06); stroke: rgba(44, 42, 36, 0.28); }
.hpw-w-tick { stroke: rgba(44, 42, 36, 0.42); stroke-width: 1; }
.hpw-w-sign { font-family: var(--font-serif); font-size: 13px; font-weight: 600; fill: #6b5326; }
.hpw-w-cusp { stroke: rgba(44, 42, 36, 0.2); stroke-width: 0.8; }
.hpw-w-cusp.is-axis { stroke: rgba(44, 42, 36, 0.62); stroke-width: 1.3; }
.hpw-w-hnum { font-family: var(--font-sans); font-size: 9.5px; fill: rgba(44, 42, 36, 0.55); }
.hpw-w-axis { font-family: var(--font-serif); font-size: 11px; font-weight: 700; fill: #2c2a24; }
.hpw-w-body { font-family: var(--font-serif); font-size: 15px; font-weight: 700; }
.hpw-w-body.is-a, .hpw-w-retro.is-a { fill: #7a5a1e; }
.hpw-w-body.is-b, .hpw-w-retro.is-b { fill: #a3452f; }
.hpw-w-mark { stroke-width: 1.4; }
.hpw-w-lead { stroke-width: 0.6; opacity: 0.55; }
.hpw-w-mark.is-a, .hpw-w-lead.is-a { stroke: #7a5a1e; }
.hpw-w-mark.is-b, .hpw-w-lead.is-b { stroke: #a3452f; }
.hpw-wheel-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px;
  margin-top: 8px;
  font-size: 12px; line-height: 1.7;
  color: var(--paper-ink-soft);
}
.hpw-lg { font-family: var(--font-serif); font-weight: 700; }
.hpw-lg.is-a { color: #7a5a1e; }
.hpw-lg.is-b { color: #a3452f; }

/* ---------- 折叠与表 ---------- */
.hpw-fold { margin-top: 12px; }
.hpw-fold > summary {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 2px;
  font-family: var(--font-serif); font-size: 13.5px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--paper-ink);
  cursor: pointer; user-select: none; list-style: none;
  border-bottom: 1px solid rgba(44, 42, 36, 0.14);
}
.hpw-fold > summary::-webkit-details-marker { display: none; }
.hpw-count { font-style: normal; font-family: var(--font-sans); font-size: 11.5px; font-weight: 400; letter-spacing: 0; color: var(--paper-ink-soft); }
.hpw-scroll {
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  border: 1px solid rgba(44, 42, 36, 0.12);
  border-radius: 9px;
  background: rgba(250, 247, 239, 0.65);
}
.hpw-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--paper-ink); }
.hpw-table th {
  padding: 8px 12px 7px;
  text-align: left;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--paper-ink-soft);
  border-bottom: 1px solid rgba(44, 42, 36, 0.16);
  white-space: nowrap;
}
.hpw-table td { padding: 7px 12px; line-height: 1.7; border-bottom: 1px solid rgba(44, 42, 36, 0.07); vertical-align: top; white-space: nowrap; }
.hpw-table tbody tr:last-child td { border-bottom: 0; }
.hpw-table tr.is-head td { border-top: 1px solid rgba(44, 42, 36, 0.14); }
.hpw-table tbody tr.is-head:first-child td { border-top: 0; }
.hpw-table th.num, .hpw-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.hpw-table td:first-child { font-family: var(--font-serif); font-weight: 600; }
.hpw-retro {
  display: inline-block;
  margin-left: 4px; padding: 0 5px;
  font-style: normal; font-family: var(--font-sans); font-size: 11px; font-weight: 400; line-height: 1.6;
  color: #a3452f;
  border: 1px solid rgba(163, 69, 47, 0.45);
  border-radius: 6px;
  vertical-align: 1px;
}
.hpw-cusps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; margin-top: 10px; }
.hpw-cusp { font-size: 12.5px; line-height: 1.7; color: var(--paper-ink); white-space: nowrap; }
.hpw-cusp b { display: inline-block; min-width: 3.4em; font-family: var(--font-serif); font-weight: 600; color: var(--paper-ink-soft); }

/* ---------- 分数与配分条 ---------- */
.hpw-score { margin-top: 14px; }
.hpw-score-num b { font-family: var(--font-serif); font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--gold-700); }
.hpw-score-num i { font-style: normal; font-size: 14px; color: var(--paper-ink-soft); }
.hpw-meter { height: 6px; margin-top: 8px; max-width: 320px; border-radius: 3px; background: rgba(44, 42, 36, 0.12); overflow: hidden; }
.hpw-meter span { display: block; height: 100%; border-radius: 3px; background: var(--gold-600); }
.hpw-meter.is-thin { flex: 1 1 auto; max-width: none; margin-top: 0; }
.hpw-ctl { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--paper-ink-soft); }
.hpw-ctl-label { letter-spacing: 0.06em; white-space: nowrap; }
.hpw-sel.hpw-sel { flex: 0 1 auto; width: auto; min-width: 120px; max-width: 100%; padding: 8px 30px 8px 12px; font-size: 13.5px; }
.hpw-koota { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.hpw-koota-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--paper-ink); }
.hpw-koota-name { flex: 0 0 5.2em; font-family: var(--font-serif); font-weight: 600; }
.hpw-koota-val { flex: 0 0 4.6em; text-align: right; font-variant-numeric: tabular-nums; color: var(--gold-700); }
.hpw-dosha { margin-top: 14px; padding: 10px 14px; border: 1px solid rgba(163, 69, 47, 0.35); border-radius: 9px; background: rgba(250, 247, 239, 0.7); }
.hpw-dosha p { font-size: 13px; line-height: 1.8; color: var(--paper-ink); }
.hpw-dosha b { font-family: var(--font-serif); color: #a3452f; }

/* ---------- 袖中天 ---------- */
html[data-theme="xiu"] .hp-west-opts { border-color: rgba(88, 74, 133, 0.4); }
html[data-theme="xiu"] .hp-west-opts > summary b,
html[data-theme="xiu"] .hpw-title,
html[data-theme="xiu"] .hpw-score-num b,
html[data-theme="xiu"] .hpw-koota-val { color: var(--zi-700); }
html[data-theme="xiu"] .hpw-tab:hover, html[data-theme="xiu"] .hpw-seg-btn:hover { border-color: rgba(88, 74, 133, 0.7); }
html[data-theme="xiu"] .hpw-tab:focus-visible, html[data-theme="xiu"] .hpw-seg-btn:focus-visible { outline-color: var(--zi-500); }
html[data-theme="xiu"] .hpw-tab.is-on, html[data-theme="xiu"] .hpw-seg-btn.is-on { background: var(--zi-700); border-color: var(--zi-700); color: #f7f4fa; }
html[data-theme="xiu"] .hpw-meter span { background: var(--zi-500); }
html[data-theme="xiu"] .hpw-w-ring.is-band { fill: rgba(127, 111, 174, 0.14); }
html[data-theme="xiu"] .hpw-w-ring.is-face { fill: #f8f6fb; }
html[data-theme="xiu"] .hpw-w-ring.is-core { fill: rgba(127, 111, 174, 0.08); }
html[data-theme="xiu"] .hpw-w-sign { fill: #584a85; }
html[data-theme="xiu"] .hpw-w-body.is-a, html[data-theme="xiu"] .hpw-w-retro.is-a { fill: #4a3d78; }
html[data-theme="xiu"] .hpw-w-mark.is-a, html[data-theme="xiu"] .hpw-w-lead.is-a { stroke: #4a3d78; }
html[data-theme="xiu"] .hpw-lg.is-a { color: #4a3d78; }

/* ---------- 窄屏 ---------- */
@media (max-width: 560px) {
  .hp-west-opts-grid { grid-template-columns: 1fr; }
  .hpw-table th, .hpw-table td { padding-left: 9px; padding-right: 9px; }
  .hpw-table { font-size: 12.5px; }
  .hpw-cusps { grid-template-columns: repeat(2, 1fr); }
  .hpw-tabs { gap: 6px; }
  .hpw-tab { padding-left: 12px; padding-right: 12px; }
  .hpw-koota-row { gap: 8px; }
}


/* 小字抬到十一像素（收尾波清查：乾坤小印与宿曜远近标原 10px） */
.hp-plaque-names .hp-name > i, .hp-xiu-rel > i { font-size: 11px; }

/* ---------- 盘面细读（与本命盘同款面板，收尾波） ----------
   呈现器与 zxp- 样式来自占星页（zhanxing-west-panels.js / zhanxing-west.css，只引用）。它还用到占星页主样式表里的
   几条基础规则（面板壳、表、徽标），那张表带整页布局不宜整张引进合盘页，故把用到的几条照抄在此并圈在 .hpw-natal 之内。
   占星页改了这几条的话，这里要跟着改。 */
.hpw-natal-fold { margin-top: 14px; }
.hpw-natal { margin-top: 12px; display: grid; gap: 14px; min-width: 0; }
.hpw-natal > div:empty { display: none; }
.hpw-natal > div { min-width: 0; max-width: 100%; }
.hpw-natal .zx-panel { min-width: 0; max-width: 100%; box-sizing: border-box; }
.hpw-natal .zx-panel { padding: 24px 26px 20px; background: rgba(250, 247, 239, 0.78); border: 1px solid rgba(44, 42, 36, 0.12); border-radius: var(--radius-md); box-shadow: 0 2px 10px rgba(44, 42, 36, 0.05); }
.hpw-natal .zx-panel-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 16px; letter-spacing: 0.18em; color: var(--paper-ink); }
.hpw-natal .zx-panel-note { font-family: var(--font-sans); font-weight: 400; font-size: 12px; letter-spacing: 0.06em; color: var(--paper-ink-soft); }
.hpw-natal .zx-table-wrap { margin-top: 14px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(150, 114, 58, 0.4) transparent; }
.hpw-natal .zx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; letter-spacing: 0.04em; }
.hpw-natal .zx-table th { padding: 8px 10px; font-family: var(--font-serif); font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-align: left; color: var(--gold-700); border-bottom: 1px solid rgba(150, 114, 58, 0.4); white-space: nowrap; }
.hpw-natal .zx-table td { padding: 9px 10px; color: var(--paper-ink); border-bottom: 1px dashed rgba(150, 114, 58, 0.22); white-space: nowrap; }
.hpw-natal .zx-table tr:last-child td { border-bottom: none; }
.hpw-natal .zx-table .num { font-variant-numeric: tabular-nums; }
.hpw-natal .zx-dim { color: var(--paper-ink-soft); }
.hpw-natal .zx-badge { display: inline-block; margin: 0 3px 2px 0; padding: 1px 7px; font-family: var(--font-serif); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; border-radius: 5px; border: 1px solid transparent; }
.hpw-natal .zx-badge.retro { color: var(--cinnabar); border-color: rgba(184, 73, 62, 0.5); background: rgba(184, 73, 62, 0.09); }
.hpw-natal .zx-badge.oob { color: #8a6d1f; border-color: rgba(184, 145, 75, 0.6); background: rgba(var(--gold-rgb), 0.16); }
.hpw-natal .zx-badge.mutual { color: var(--gold-700); border-color: rgba(150, 114, 58, 0.5); background: rgba(var(--gold-rgb), 0.14); font-size: 10.5px; }
.hpw-natal .zx-phase { display: inline-block; padding: 1px 7px; font-family: var(--font-serif); font-size: 11.5px; font-weight: 600; border-radius: 5px; border: 1px solid transparent; }
.hpw-natal .zx-phase.exact { color: #b8410f; border-color: rgba(184, 73, 62, 0.55); background: rgba(184, 73, 62, 0.1); }
.hpw-natal .zx-phase.applying { color: var(--gold-700); border-color: rgba(150, 114, 58, 0.5); background: rgba(var(--gold-rgb), 0.14); }
.hpw-natal .zx-phase.separating { color: var(--paper-ink-soft); border-color: rgba(150, 114, 58, 0.3); background: rgba(150, 114, 58, 0.06); }
.hpw-natal .zx-dim2 { color: var(--paper-ink-soft); font-size: 12.5px; }
.hpw-natal .zx-lot-name { font-family: var(--font-serif); font-weight: 600; color: var(--gold-700); }
@media (max-width: 960px) {
  .hpw-natal .zx-pro > .zx-panel, .hpw-natal .zx-panels > .zx-panel {min-width: 0; max-width: 100%;}
}
@media (max-width: 720px) {
  .hpw-natal .zx-panel {padding: 20px 16px 16px;}
  .hpw-natal .zx-table {font-size: 12.5px;}
  .hpw-natal .zx-table th, .hpw-natal .zx-table td {padding: 7px 8px;}
}
.hpw-natal .zx-house-num { font-family: var(--font-serif); letter-spacing: 0.06em; }
.hpw-natal .zx-house-ruler { color: var(--gold-700); font-weight: 600; }

/* ---------- UI-1118 逐页清查（2026-11-18） ---------- */
/* 横滑表：右（左）沿还有列时露一道阴影提示可滑（曾在 375 把「误差/权重」两列整列藏在框外、毫无提示）。
   local 底衬随内容滚、scroll 阴影钉在框沿：滚到头底衬盖住阴影，表不溢出时两端阴影都被盖住 */
.hpw-scroll {
  background:
    linear-gradient(90deg, rgb(250, 247, 239) 30%, rgba(250, 247, 239, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(270deg, rgb(250, 247, 239) 30%, rgba(250, 247, 239, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(44, 42, 36, 0.3), rgba(44, 42, 36, 0)) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(44, 42, 36, 0.3), rgba(44, 42, 36, 0)) right center / 14px 100% no-repeat scroll,
    rgba(250, 247, 239, 0.65);
}
html[data-theme="xiu"] .hpw-scroll {
  background:
    linear-gradient(90deg, rgb(248, 246, 251) 30%, rgba(248, 246, 251, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(270deg, rgb(248, 246, 251) 30%, rgba(248, 246, 251, 0)) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(42, 32, 64, 0.3), rgba(42, 32, 64, 0)) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(42, 32, 64, 0.3), rgba(42, 32, 64, 0)) right center / 14px 100% no-repeat scroll,
    rgba(248, 246, 251, 0.65);
}
/* 折叠题「盘面细读」曾被同排副题挤成「盘面细 / 读」：题不折，副题放到下一行 */
.hpw-fold > summary { flex-wrap: wrap; row-gap: 2px; }
.hpw-fold > summary > b { flex: none; white-space: nowrap; }
@media (min-width: 721px) {
  /* 西占口径折叠与其下「用法与口径」同宽（曾 640 对 980，两条上下不齐） */
  .hp-west-opts { max-width: 980px; }
}
@media (min-width: 341px) and (max-width: 560px) {
  /* 375 排得进就排进：星名一格按词（空格）折行——「乙方 / 内插近地点」，五列表不再整列藏出框；
     ≤340 折了也排不下，仍单行横滑（靠上面的沿影提示） */
  .hpw-table td:not(.num) { white-space: normal; word-break: keep-all; }
  .hpw-table th, .hpw-table td { padding-left: 7px; padding-right: 7px; }
}

/* ---------- 打印：表按纸面走，不留滚动框；控件不印 ---------- */
@media print {
  .hp-west-opts { display: none; }
  .hpw-scroll { overflow: visible; border-color: #999; background: none; }
  .hpw-tabs, .hpw-bar, .hpw-ctl, .hpw-again { display: none; }
  .hpw-wheel { max-width: 320px; break-inside: avoid; }
}

/* ⚠ 触屏块居文末（同权重后源取胜） */
@media (hover: none), (pointer: coarse) {
  .hpw-scroll { -webkit-overflow-scrolling: touch; }
  .hpw-tab, .hpw-seg-btn { min-height: 44px; }
  .hpw-sel.hpw-sel { font-size: 16px; min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .hpw-fold > summary { min-height: 44px; align-items: center; }
  .hp-west-opts > summary { min-height: 44px; align-items: center; }
}
