/* 耀具工坊：入口页与排盘表单（依赖 /assets/style.css、/assets/tool.css 的设计变量） */

.ws-hero {
  padding: 34px 0 8px;
}
.ws-hero h1 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  margin: 0 0 12px;
}
.ws-hero p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted-fg);
  font-size: 15px;
  line-height: 1.7;
}

.ws-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 28px 0 8px;
}

.ws-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.ws-card:hover { border-color: var(--accent-sec); transform: translateY(-2px); box-shadow: var(--shadow); }
.ws-card h2, .ws-card h3 {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.3;
  margin: 0;
}
.ws-card__head { display: flex; align-items: center; gap: 12px; }
.ws-card__icon {
  width: 44px; height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(4, 120, 87, .09);
  color: var(--accent);
}
.ws-card__icon svg { width: 22px; height: 22px; }
.ws-card__sum { font-size: 14px; color: var(--muted-fg); line-height: 1.6; margin: 0; }
.ws-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}
.ws-card__foot .btn { font-family: var(--sans); letter-spacing: 0; }
.ws-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(4, 120, 87, .1);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
}
.ws-badge--wip { background: #fff7ed; color: #9a3412; }

/* 分类入口（工坊首页） */
.ws-cats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 28px 0 8px;
}
.ws-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ws-card__tags li {
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-fg);
}

.ws-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted-fg);
}

/* ---------- 表单 ---------- */
.ws-form-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 24px;
  margin: 24px 0;
}
.ws-form-card h2 { font-family: var(--display); font-size: 20px; margin: 0 0 6px; }
.ws-form-card > p { margin: 0 0 20px; color: var(--muted-fg); font-size: 14px; }

.ws-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.ws-field { margin-bottom: 18px; }
.ws-field > label,
.ws-field > .ws-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ws-field input[type="text"],
.ws-field input[type="number"],
.ws-field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ws-field input:focus-visible,
.ws-field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.ws-triple { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.ws-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }

.ws-radios { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-radios label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  cursor: pointer;
}
.ws-radios input { accent-color: var(--accent); }

.ws-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ws-check input { margin-top: 4px; accent-color: var(--accent); }

.ws-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.ws-submit[disabled] { opacity: .5; cursor: not-allowed; }

.ws-wip {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  color: var(--muted-fg);
}
.ws-wip a { color: var(--accent); }

.ws-back { margin: 22px 0 0; font-size: 13px; }
.ws-back a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-fg);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
}
.ws-back a:hover { color: var(--accent); border-color: var(--accent-sec); }
.ws-back a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (min-width: 640px) {
  .ws-grid { grid-template-columns: repeat(3, 1fr); }
  .ws-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .ws-cats { grid-template-columns: repeat(2, 1fr); }
  .ws-row--2 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .ws-triple { grid-template-columns: 1fr 1fr; }
  .ws-triple select:first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-card { transition: none; }
  .ws-card:hover { transform: none; }
}

/* ---------- 命盘结果 ---------- */
.ws-alert {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.6;
}

.ws-form-card, .ws-result { scroll-margin-top: 84px; }

.ws-result {
  margin: 24px 0 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}
.ws-result__title { font-family: var(--display); font-size: 20px; margin: 0 0 4px; }
.ws-result__sub { margin: 0 0 16px; color: var(--muted-fg); font-size: 13px; }

.ws-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0 0 18px;
}
.ws-meta__item { display: flex; gap: 6px; align-items: baseline; min-width: 0; font-size: 13px; }
.ws-meta dt { flex: none; color: var(--muted-fg); }
.ws-meta dd { margin: 0; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }

.ws-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(88px, auto);
  gap: 6px;
}
.ws-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.ws-cell--soul { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ws-cell__head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.ws-cell__name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.ws-cell__pos { font-family: var(--mono); font-size: 11px; color: var(--muted-fg); white-space: nowrap; }
.ws-cell__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ws-cell__stars { display: flex; flex-wrap: wrap; gap: 1px 6px; font-size: 13px; line-height: 1.55; }
.ws-cell__empty { font-size: 12px; color: var(--muted-fg); }
.ws-star { white-space: nowrap; }
.ws-bright { margin-left: 1px; font-size: 10px; color: #6b7280; }

.ws-cell__aux { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; font-size: 11px; line-height: 1.5; }
.ws-aux { white-space: nowrap; }
.ws-aux--good { color: #1d6f4a; }
.ws-aux--bad { color: #9a3412; }
.ws-cell__xx { margin-top: 3px; font-size: 10px; line-height: 1.45; color: #6b7280; overflow-wrap: anywhere; }

.ws-tag {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(4, 120, 87, .1);
  color: var(--accent);
  font-size: 10px;
  line-height: 1.6;
}
.ws-tag--soul { background: var(--accent); color: #fff; }
.ws-tag--body { background: #fffbeb; color: #92400e; }

.ws-mutagen {
  display: inline-block;
  margin-left: 2px;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.5;
  vertical-align: 1px;
}
.ws-mutagen--lu { background: #dcfce7; color: #166534; }
.ws-mutagen--quan { background: #dbeafe; color: #1e40af; }
.ws-mutagen--ke { background: #fef3c7; color: #92400e; }
.ws-mutagen--ji { background: #fee2e2; color: #991b1b; }

.ws-center {
  grid-area: 2 / 2 / 4 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-fg);
}
.ws-center p { margin: 0; }
.ws-center__ju { font-family: var(--display); font-size: 16px; color: var(--fg); }

.ws-result__notes { margin: 16px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }
.ws-result__notes p { margin: 0 0 4px; }
.ws-result__notes p:last-child { margin-bottom: 0; }

/* 大限 / 流年 */
.ws-cell--decade { border-color: #c7d2fe; background: #eef2ff; }
.ws-cell--year { border-color: #fdba74; background: #fff7ed; }

/* 三方四正：点宫后本宫实线高亮，对宫与三合两宫描虚线 */
.ws-cell[role="button"] { cursor: pointer; }
.ws-cell[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-cell--sel { border-color: #6d28d9; background: #f5f3ff; box-shadow: inset 0 0 0 1px #6d28d9; }
.ws-cell--sf { border-color: #a78bfa; border-style: dashed; background: #faf5ff; }
.ws-sanfang { margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }
.ws-tag--age { background: transparent; color: var(--muted-fg); padding: 0; font-family: var(--mono); }
.ws-tag--decade { background: #e0e7ff; color: #3730a3; }
.ws-tag--year { background: #ffedd5; color: #9a3412; }

.ws-limits { margin: 18px 0 0; }
.ws-limits__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; }
.ws-limits__head h3 { margin: 0; font-family: var(--display); font-size: 16px; }
.ws-limits__note { margin: 0; font-size: 12px; color: var(--muted-fg); }
.ws-year__pick { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-fg); }
.ws-year__pick input {
  width: 84px;
  padding: 5px 6px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.ws-decades {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 6px;
}
.ws-decade {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.6;
}
.ws-decade--on { border-color: #6366f1; background: #eef2ff; }
.ws-decade__head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.ws-decade__age { flex: none; font-family: var(--mono); font-weight: 400; color: var(--muted-fg); }
.ws-decade__mutagens { color: var(--muted-fg); }
.ws-year__body { margin: 8px 0 0; font-size: 13px; line-height: 1.8; color: var(--fg); }
.ws-year__body b { font-weight: 600; }
.ws-mutagen--off { opacity: .5; }

/* 「你可能想问」：折叠问答，点开才展开，移动端也只用原生 details */
.ws-qa { margin: 18px 0 0; }
.ws-qa__list { margin: 8px 0 0; display: grid; gap: 8px; }
.ws-qa__item { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 0 12px; }
.ws-qa__item[open] { border-color: #c7d2fe; background: var(--card); }
.ws-qa__item summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ws-qa__item summary::-webkit-details-marker { display: none; }
.ws-qa__item summary::before {
  content: "问";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.ws-qa__item summary::after { content: "＋"; margin-left: auto; color: var(--muted-fg); font-weight: 400; }
.ws-qa__item[open] summary::after { content: "－"; }
.ws-qa__item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ws-qa__a { padding: 2px 0 12px; font-size: 13px; line-height: 1.8; color: var(--fg); }
.ws-qa__a p { margin: 0 0 6px; }
.ws-qa__a p:last-child { margin-bottom: 0; }
.ws-qa__a b { font-weight: 600; color: #4338ca; }
.ws-qa__disc { margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }

/* ---------- 紫微盘面：详略工具条 / 详版附注 / SVG 连线覆盖层 ---------- */
.ws-boardbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted-fg);
}
.ws-seg {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.ws-seg button {
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-fg);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.ws-seg button:hover { color: var(--accent); }
.ws-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ws-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ws-chip { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.ws-chip input { margin: 0; accent-color: var(--accent); cursor: pointer; }
.ws-boardbar__hint { flex: 1 1 100%; font-size: 11px; line-height: 1.7; color: var(--muted-fg); }
@media (min-width: 900px) {
  .ws-boardbar__hint { flex: 1 1 0; text-align: right; min-width: 0; }
}

/* 详版每宫追加：长生/博士/方位、杂曜、流年落宫 */
.ws-cell__marks { display: flex; flex-wrap: wrap; gap: 0 5px; font-size: 10px; line-height: 1.4; color: #6b7280; }
.ws-mark { white-space: nowrap; }
.ws-mark--cs { color: #0f766e; }
.ws-mark--bs { color: #7c3aed; }
.ws-mark--dir { margin-left: auto; color: #9ca3af; }
.ws-cell__misc { display: flex; flex-wrap: wrap; gap: 0 5px; font-size: 10px; line-height: 1.45; }
.ws-misc--good { color: #1d6f4a; }
.ws-misc--bad { color: #9a3412; }
.ws-misc--mid { color: #6b7280; }
.ws-cell__ln { font-size: 10px; line-height: 1.45; color: #7c3aed; overflow-wrap: anywhere; }

/* 中宫两行四柱：上行农历口径（正月初一换年、月建），下行节气口径（立春换年、十二节） */
.ws-center__fp { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--fg); }
.ws-center__fp-tag { flex: none; padding: 0 4px; border-radius: 4px; background: #f3f4f6; color: var(--muted-fg); font-family: inherit; font-size: 10px; }
.ws-center__fp-gz { letter-spacing: .04em; }
.ws-center__dir { font-size: 11px; color: #9ca3af; }

/* 连线层：绝对定位铺满盘面、不吃鼠标事件，不改 4×4 宫格布局 */
.ws-board { position: relative; }
.ws-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
.ws-line { fill: none; stroke-linecap: round; stroke-linejoin: round; animation: ws-line-in .18s var(--ease) both; }
.ws-line--body { stroke: #9ca3af; stroke-width: .8; stroke-dasharray: 3 4; opacity: .55; }
.ws-line--sf { stroke: #6d28d9; stroke-width: 1.15; stroke-dasharray: 4 4; opacity: .75; }
.ws-line--fh { stroke-width: .95; opacity: .8; }
.ws-line--fhlu { stroke: #16a34a; }
.ws-line--fhquan { stroke: #2563eb; }
.ws-line--fhke { stroke: #d97706; }
.ws-line--fhji { stroke: #dc2626; }
.ws-arrow__head { stroke: none; }
.ws-arrow__head.ws-line--fhlu { fill: #16a34a; }
.ws-arrow__head.ws-line--fhquan { fill: #2563eb; }
.ws-arrow__head.ws-line--fhke { fill: #d97706; }
.ws-arrow__head.ws-line--fhji { fill: #dc2626; }
.ws-arrow__label { font-family: var(--mono); font-size: 10px; fill: #4b5563; paint-order: stroke; stroke: #fff; stroke-width: 2.4px; }
@keyframes ws-line-in { from { opacity: 0; } }

@media (max-width: 480px) {
  .ws-cell__marks, .ws-cell__misc, .ws-cell__ln { font-size: 9px; }
  .ws-seg button { padding: 4px 10px; }
}

@media (min-width: 640px) {
  .ws-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .ws-result { padding: 14px; }
  .ws-board { gap: 4px; grid-auto-rows: minmax(74px, auto); }
  .ws-cell { padding: 5px 6px; }
  .ws-cell__name { font-size: 12px; }
  .ws-cell__stars { font-size: 12px; gap: 0 4px; }
  .ws-cell__aux { gap: 0 4px; font-size: 10px; }
  /* 窄屏中宫收窄但仍留两行四柱；命宫/命主两行在 meta 里已有，隐去避免挤成一团 */
  .ws-center { gap: 2px; padding: 2px; font-size: 10px; }
  .ws-center > p { display: none; }
  .ws-center > p.ws-center__ju { display: block; font-size: 12px; }
  .ws-center__fp { font-size: 9px; gap: 3px; }
  .ws-center__fp-tag { font-size: 9px; padding: 0 2px; }
}

/* ---------- 排盘结果头部与档案栏（四柱 / 紫微共用） ---------- */
.bz-head, .ws-result__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bz-copy, .ws-act {
  flex: none;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--muted-fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.bz-copy:hover, .ws-act:hover { color: var(--accent); border-color: var(--accent); }
.bz-copy[disabled], .ws-act[disabled] { opacity: .6; cursor: default; }
.bz-head__acts, .ws-acts { display: flex; flex: none; flex-wrap: wrap; gap: 8px; }

/* 从出生档案带入（登录后出现） */
.bz-profile, .ws-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bz-profile > label, .ws-profile > label { font-size: 13px; font-weight: 600; }
.bz-profile select, .ws-profile select {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 8px;
  font: inherit;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bz-profile .ws-hint, .ws-profile .ws-hint { flex: 1 1 100%; margin: 0; }
.bz-save-hint, .ws-save-hint { margin: 0 0 14px; font-size: 12px; color: var(--accent); }

/* 三体系对比入口（紫微 / 八字 / 星座三页页尾常显） */
.ws-cross {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin: 56px 0 8px;
  padding: 22px 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}
.ws-cross__body { flex: 1 1 320px; }
.ws-cross__title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.35;
}
.ws-cross__hint {
  max-width: 62ch;
  margin: 0;
  color: var(--muted-fg);
  font-size: 14px;
  line-height: 1.7;
}
.ws-cross__go {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
}
.ws-cross__go:hover { background: var(--accent-sec); }

.bz-e-木 { color: #047857; }
.bz-e-火 { color: #b91c1c; }
.bz-e-土 { color: #a16207; }
.bz-e-金 { color: #475569; }
.bz-e-水 { color: #1d4ed8; }

.bz-chart {
  display: grid;
  grid-template-columns: 54px repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 18px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.bz-chart > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 4px;
  background: var(--card);
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}
.bz-rowlabel {
  justify-content: flex-start !important;
  background: var(--bg) !important;
  color: var(--muted-fg);
  font-size: 12px;
}
.bz-cell--gz { padding: 6px 2px !important; }
.bz-cell--gz span { font-family: var(--display); font-size: 24px; line-height: 1.25; }
.bz-cell--ss { font-size: 12px; color: var(--muted-fg); }
.bz-cell--self { color: var(--accent); font-weight: 600; }
.bz-cell--cang {
  display: block !important;
  padding: 7px 4px !important;
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}
.bz-canggan__gan { color: var(--fg); }
.bz-canggan__ss { color: var(--muted-fg); margin-left: 1px; }
.bz-sep { color: var(--border); margin: 0 2px; }

.bz-cols { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
.bz-block { margin: 0 0 18px; min-width: 0; }
.bz-block h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  margin: 0 0 10px;
}
.bz-block__hint { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted-fg); }

/* 八字↔紫微对照入口：与上方排盘口径注释拉开距离，说明与按钮之间留出呼吸 */
.bz-cross {
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.bz-cross h3 { margin: 0 0 10px; }
.bz-cross .ws-hint { margin: 0; font-size: 12px; line-height: 1.7; max-width: 64ch; }
.bz-cross .bz-copy { margin: 14px 0 0; }

.bz-master { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.bz-master__label { font-size: 12px; color: var(--muted-fg); }
.bz-master > .bz-e-木, .bz-master > .bz-e-火, .bz-master > .bz-e-土,
.bz-master > .bz-e-金, .bz-master > .bz-e-水 { font-family: var(--display); font-size: 26px; }
.bz-master__elem { font-size: 12px; color: var(--muted-fg); }
.bz-strength { padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.bz-strength--strong { background: #dcfce7; color: #166534; }
.bz-strength--mid { background: #e0e7ff; color: #3730a3; }
.bz-strength--weak { background: #fee2e2; color: #991b1b; }
.bz-score { font-family: var(--mono); font-size: 12px; color: var(--muted-fg); }

.bz-reasons { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }
.bz-reasons li { margin: 0 0 2px; }

.bz-bars { display: flex; flex-direction: column; gap: 7px; }
.bz-bar { display: grid; grid-template-columns: 18px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; }
.bz-bar__name { font-weight: 600; text-align: center; }
.bz-bar__track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.bz-bar__fill { display: block; height: 100%; border-radius: 999px; background: currentColor; }
.bz-bar__val { font-family: var(--mono); text-align: right; color: var(--muted-fg); }
.bz-summary { margin: 10px 0 0; font-size: 12px; color: var(--muted-fg); }

.bz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bz-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
}
.bz-chip b { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.bz-chip__name { font-weight: 600; }
.bz-chip__sub { font-size: 11px; color: var(--muted-fg); }
.bz-chip--shensha { border-color: rgba(4, 120, 87, .25); }
.bz-chip--link {
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.bz-chip--link:hover { border-color: var(--accent-sec); background: var(--card); }
.bz-chip--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 术语释义弹层 */
.bz-kb {
  width: min(560px, calc(100vw - 32px));
  max-height: min(78vh, 660px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .18);
}
.bz-kb::backdrop { background: rgba(15, 23, 42, .38); }
.bz-kb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.bz-kb__title { flex: 1 1 auto; min-width: 0; margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: .01em; }
.bz-kb__back {
  flex: none;
  max-width: 46%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}
.bz-kb__back:hover { color: var(--accent-sec); border-color: var(--accent-sec); }
.bz-kb__back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bz-kb__close {
  flex: none;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  color: var(--muted-fg);
  cursor: pointer;
}
.bz-kb__close:hover { color: var(--fg); border-color: var(--accent-sec); }
.bz-kb__body { padding: 18px 20px 22px; overflow-y: auto; max-height: calc(78vh - 60px); }
.bz-kb__state { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted-fg); }
.bz-kb__meta { margin: 0 0 10px; font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.6; letter-spacing: 0; color: var(--muted-fg); }
.bz-kb__def { margin: 0; font-size: 15px; line-height: 1.75; }
.bz-kb__h3 { margin: 18px 0 8px; font-size: 15px; line-height: 1.5; }
.bz-kb__text { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted-fg); }
.bz-kb__h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: .04em; color: var(--muted-fg); }
.bz-kb__srcs { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.8; }
.bz-kb__srcs li + li { margin-top: 2px; }
.bz-kb__note { margin: 16px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }
.bz-kb__more {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline dotted currentColor;
  text-underline-offset: 2px;
}
.bz-kb__more:hover { color: var(--accent-sec); text-decoration-style: solid; }
.bz-kb__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* 大运、流年里的十神：看起来是文字，实际是按钮 */
.bz-ss-link {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted currentColor;
  text-underline-offset: 2px;
}
.bz-ss-link:hover { color: var(--accent-sec); text-decoration-style: solid; }
.bz-ss-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.bz-empty { font-size: 12px; color: var(--muted-fg); }

.bz-luck { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bz-luckcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
}
.bz-luckcard__gz { font-family: var(--display); font-size: 19px; }
.bz-luckcard__year { font-family: var(--mono); font-size: 11px; color: var(--muted-fg); }
.bz-luckcard__age { font-size: 11px; color: var(--muted-fg); }
.bz-luckcard__ss { font-size: 11px; color: var(--accent); }
.bz-luckcard__toggle {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 5px;
  text-decoration: underline dotted transparent;
  text-underline-offset: 3px;
}
.bz-luckcard__toggle:hover { color: var(--accent-sec); text-decoration-color: currentColor; }
.bz-luckcard__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bz-luckcard.is-open { border-color: var(--accent); }
.bz-luckcard.is-open .bz-luckcard__gz { color: var(--accent-sec); }
.bz-luckcard.is-current { border-color: var(--accent); background: var(--card); box-shadow: inset 0 0 0 1px var(--accent); }
.bz-luckcard__badge {
  align-self: center;
  margin-top: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
}

.bz-luckdetail {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg);
}
.bz-luckdetail[hidden] { display: none; }
.bz-luckdetail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.bz-luckdetail__title { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.bz-luckdetail__meta { font-size: 11px; color: var(--muted-fg); }
.bz-luckdetail__close {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted-fg);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.bz-luckdetail__close:hover { color: var(--fg); border-color: var(--accent); }
.bz-luckdetail__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bz-liunian--detail { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bz-luckdetail .ws-hint { margin: 8px 0 0; }

.bz-liunian { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.bz-year {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  text-align: center;
}
.bz-year__num { font-family: var(--mono); font-size: 11px; color: var(--muted-fg); }
.bz-year__gz { font-family: var(--display); font-size: 16px; }
.bz-year__ss { font-size: 10px; color: var(--accent); }
.bz-year.is-current { border-color: var(--accent); background: var(--card); box-shadow: inset 0 0 0 1px var(--accent); }
.bz-year.is-current .bz-year__num { color: var(--accent); font-weight: 600; }

.bz-lng { margin: 12px 0 0; }
.bz-lng > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bz-lng input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bz-lng input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

@media (min-width: 640px) {
  .bz-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .bz-chart { grid-template-columns: 42px repeat(4, minmax(0, 1fr)); }
  .bz-chart > div { padding: 6px 2px; font-size: 12px; }
  .bz-cell--gz span { font-size: 20px; }
  .bz-rowlabel { font-size: 11px; }
  .bz-luck { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .bz-luckcard { padding: 7px 3px; }
  .bz-luckcard__gz { font-size: 16px; }
  .bz-luckcard__ss { font-size: 10px; }
  .bz-liunian { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .bz-chip { min-height: 32px; align-items: center; padding: 5px 11px; }
  .bz-luckdetail { padding: 8px; }
  .bz-luckdetail__title { font-size: 12px; }
  .bz-liunian--detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 单人 / 双人切换（紫微页与合盘页共用） ---------- */
.ws-hero__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 0 0 12px;
}
.ws-hero__head h1 { margin: 0; }
.ws-mode {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}
.ws-mode a {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted-fg);
  text-decoration: none;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.ws-mode a:hover { color: var(--accent); }
.ws-mode a[aria-current="page"] { background: var(--accent); color: #fff; }

/* ---------- 合盘：表单 ---------- */
.hp-sides {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0 0 20px;
}
.hp-side {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  animation: hp-rise .5s var(--ease) both;
}
.hp-side:nth-child(2) { animation-delay: 90ms; }
.hp-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.hp-side__head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
}
.hp-badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
}
.hp-side .ws-field { margin-bottom: 14px; }
.hp-side .ws-profile { margin-bottom: 12px; padding: 8px 10px; }
.hp-side .ws-hint { line-height: 1.6; }

/* ---------- 合盘：结果 ---------- */
.hp-result { overflow: hidden; }
.hp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border);
}
.hp-ring { position: relative; flex: none; width: 118px; height: 118px; }
.hp-ring__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hp-ring__bg { fill: none; stroke: var(--border); stroke-width: 9; }
.hp-ring__fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.1s var(--ease), stroke .3s var(--ease);
}
.hp-ring__fg[data-grade="较合"] { stroke: #0f766e; }
.hp-ring__fg[data-grade="平稳"] { stroke: #b45309; }
.hp-ring__fg[data-grade="需磨合"] { stroke: #b91c1c; }
.hp-ring__num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.hp-ring__num b { font-family: var(--display); font-size: 30px; line-height: 1; }
.hp-ring__num span { font-size: 10px; color: var(--muted-fg); }
.hp-head__text { flex: 1 1 260px; min-width: 0; }
.hp-grade { margin: 0 0 4px; font-family: var(--display); font-size: 19px; }
.hp-advice { margin: 0 0 8px; font-size: 14px; line-height: 1.7; }
.hp-disclaimer { margin: 0; font-size: 12px; color: var(--muted-fg); }

.hp-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0 0;
}
.hp-person {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  animation: hp-rise .5s var(--ease) both;
}
.hp-person__head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.hp-person__badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(4, 120, 87, .12);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}
.hp-person__name { display: flex; flex-direction: column; min-width: 0; }
.hp-person__name b { font-size: 15px; }
.hp-person__name span { font-size: 12px; color: var(--muted-fg); }
.hp-person__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
}
.hp-person__meta-item { display: flex; gap: 6px; min-width: 0; font-size: 12px; }
.hp-person__meta dt { flex: none; color: var(--muted-fg); }
.hp-person__meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.hp-sec { margin: 20px 0 0; }
.hp-sec h3 { margin: 0 0 10px; font-family: var(--display); font-size: 16px; }
.hp-hint { margin: 0 0 8px; font-size: 12px; color: var(--muted-fg); }

.hp-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hp-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  animation: hp-row-in .4s var(--ease) both;
}
.hp-item__head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hp-item__delta { font-family: var(--mono); font-size: 13px; color: var(--muted-fg); }
.hp-item__delta--pos { color: #166534; }
.hp-item__delta--neg { color: #991b1b; }
.hp-item__track {
  position: relative;
  height: 6px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.hp-item__track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, .18);
}
.hp-item__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left center;
  animation: hp-bar-in .6s var(--ease) both;
}
.hp-item__fill--neg { background: #dc2626; transform-origin: right center; }
.hp-item__detail { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted-fg); }

.hp-mutual { display: grid; gap: 12px; }
.hp-mutual__group {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.hp-mutual__group h4 { margin: 0 0 8px; font-size: 13px; }
.hp-mutual__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.hp-mutual__item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; line-height: 1.6; }
.hp-mutual__delta { font-family: var(--mono); }

.hp-boards { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0 0 10px; }
.hp-board-wrap { min-width: 0; }
.hp-board-label { margin: 0 0 6px; font-size: 12px; color: var(--muted-fg); }
.hp-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(78px, auto);
  gap: 4px;
}
.hp-board__center {
  grid-area: 2 / 2 / 4 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-fg);
}
.hp-board__center b { font-family: var(--display); font-size: 15px; color: var(--fg); }
.hp-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.hp-cell--soul { border-color: rgba(4, 120, 87, .45); }
.hp-cell:hover { border-color: #a78bfa; }
.hp-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp-cell--on { border-color: #6d28d9; background: #f5f3ff; box-shadow: inset 0 0 0 1px #6d28d9; }
.hp-cell .ws-cell__name { font-size: 12px; }
.hp-cell .ws-cell__stars { font-size: 12px; gap: 0 4px; }
.hp-cell .ws-cell__aux { font-size: 10px; gap: 0 4px; }

.hp-link { margin: 0 0 10px; font-size: 12px; line-height: 1.6; color: var(--accent); }

.hp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hp-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  align-items: stretch;
  gap: 4px 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  font-size: 12px;
  cursor: pointer;
  animation: hp-row-in .42s var(--ease) both;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.hp-row__br { display: grid; place-items: center; font-family: var(--display); font-size: 16px; color: var(--muted-fg); }
.hp-row__cell { min-width: 0; }
.hp-row__cell-head { display: flex; align-items: baseline; gap: 6px; }
.hp-row__cell-head b { font-size: 12px; }
.hp-row__cell-head span { font-family: var(--mono); font-size: 10px; color: var(--muted-fg); }
.hp-row__who {
  display: none;
  flex: none;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(4, 120, 87, .1);
  color: var(--accent);
  font-size: 10px;
  line-height: 1.6;
}
.hp-row__stars { margin: 1px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.hp-row__aux { margin: 1px 0 0; font-size: 11px; line-height: 1.5; color: #9a3412; }
.hp-row__note { grid-column: 1 / -1; font-size: 11px; color: var(--accent); }
.hp-row--on { border-color: #6d28d9; background: #f5f3ff; box-shadow: inset 0 0 0 1px #6d28d9; }

@keyframes hp-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes hp-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes hp-bar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (min-width: 700px) {
  .hp-pair { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 760px) {
  .hp-sides { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 860px) {
  .hp-boards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hp-row { grid-template-columns: 26px 1fr; }
  .hp-row__cell { grid-column: 2; }
  .hp-row__note { grid-column: 2; }
  .hp-row__who { display: inline-block; }
  .hp-board { grid-auto-rows: minmax(66px, auto); gap: 3px; }
  .hp-cell { padding: 4px 5px; }
  .hp-cell .ws-cell__stars { font-size: 11px; }
  .hp-person__meta { grid-template-columns: 1fr; }
}

/* ---------- 排盘后的主动引导 ---------- */
.ws-guide {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--bg);
}
.ws-guide__head h3 { margin: 0 0 4px; font-family: var(--display); font-size: 16px; line-height: 1.5; }
.ws-guide__head p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted-fg); }
.ws-guide__topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.ws-guide__topics button,
.ws-guide__segs button {
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}
.ws-guide__topics button:hover,
.ws-guide__segs button:hover { border-color: var(--accent); }
.ws-guide__topics button[aria-pressed="true"],
.ws-guide__segs button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ws-guide__topics button:focus-visible,
.ws-guide__segs button:focus-visible,
.ws-guide__go:focus-visible,
.ws-guide__note input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-guide__more { margin: 12px 0 0; }
.ws-guide__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ws-guide__label { font-size: 13px; color: var(--muted-fg); }
.ws-guide__segs { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-guide__segs button { padding: 6px 12px; text-align: center; }
.ws-guide__note { display: block; margin: 10px 0 0; font-size: 13px; }
.ws-guide__note span { display: block; margin: 0 0 4px; color: var(--muted-fg); }
.ws-guide__note input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ws-guide__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; }
.ws-guide__go {
  flex: none;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.ws-guide__go:hover { filter: brightness(1.05); }
.ws-guide__hint { flex: 1 1 240px; margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted-fg); }
.ws-guide__hint:empty { display: none; }

@media (max-width: 560px) {
  .ws-guide { padding: 12px; }
  .ws-guide__topics { grid-template-columns: 1fr; }
  .ws-guide__foot { align-items: stretch; flex-direction: column; }
  .ws-guide__go { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hp-side, .hp-person, .hp-item, .hp-row, .hp-item__fill, .hp-cell { animation: none !important; }
  .hp-side, .hp-cell { transition: none; }
  .hp-ring__fg { transition: none !important; }
  .hp-result { scroll-behavior: auto; }
  .ws-line, .ws-arrow__label { animation: none !important; transition: none !important; }
}

/* ---------- 西方本命盘 ---------- */
.as-adv {
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.as-adv > summary {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
  cursor: pointer;
}
.as-adv > summary:hover { color: var(--accent); }
.as-adv[open] > summary { border-bottom: 1px solid var(--border); }
.as-adv > .ws-row { padding: 0 14px; margin-top: 12px; }
.as-adv > .ws-hint { padding: 0 14px 12px; margin: 6px 0 0; }

.as-static {
  margin: 0 0 0;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.as-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 9px;
}

/* 星座页保存档案：只补档案需要的性别，不影响排盘 */
.as-save { width: min(480px, calc(100vw - 32px)); }
.as-save__note { margin: 0 0 10px; font-size: 13px; line-height: 1.8; color: var(--muted-fg); }
.as-save__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.as-save__actions .ws-submit {
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 0 18px;
  font-size: 14px;
}

.as-wheel {
  margin: 4px auto 20px;
  max-width: 640px;
}
.as-wheel__svg { display: block; width: 100%; height: auto; }
.as-wheel__edge { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.as-wheel__ring { fill: none; stroke: var(--border); stroke-width: 1; }
.as-wheel__ring--inner { stroke-dasharray: 2 4; opacity: .7; }
.as-wheel__sign-line { stroke: var(--border); stroke-width: 1; }
.as-wheel__sign { font-size: 17px; }
.as-wheel__cusp { stroke: var(--border); stroke-width: .8; }
.as-wheel__cusp--angle { stroke: var(--accent); stroke-width: 1.4; }
.as-wheel__house-num { font-family: var(--mono); font-size: 10px; fill: var(--muted-fg); }
.as-wheel__tick { stroke: var(--muted-fg); stroke-width: .7; opacity: .5; }
.as-wheel__planet .as-wheel__glyph {
  font-size: 21px;
  fill: var(--fg);
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.as-wheel__planet .as-wheel__deg {
  font-family: var(--mono);
  font-size: 8.5px;
  fill: var(--muted-fg);
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 2.5px;
}
.as-wheel__planet--point .as-wheel__glyph { fill: var(--muted-fg); }
.as-wheel__axis { stroke: var(--accent); stroke-width: 1.6; }
.as-wheel__axis-label { font-family: var(--mono); font-size: 10px; fill: var(--accent); font-weight: 600; }
.as-wheel__asp { opacity: .5; stroke-width: 1.2; }
.as-wheel__asp--conj { stroke: #6b7280; }
.as-wheel__asp--sext { stroke: #16a34a; }
.as-wheel__asp--squar { stroke: #dc2626; }
.as-wheel__asp--trine { stroke: #2563eb; }
.as-wheel__asp--opp { stroke: #d97706; }

.as-cols { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
.as-block { margin: 0 0 20px; min-width: 0; }
.as-block h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.4;
}
.as-table-wrap { width: 100%; overflow-x: auto; }
.as-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.as-table th {
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-fg);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.as-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: baseline;
}
.as-table tbody tr:last-child td { border-bottom: 0; }
.as-table__glyph { margin-right: 5px; font-size: 15px; }
.as-table__name { font-weight: 600; }
.as-table__retro {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: #9a3412;
  background: #fff7ed;
  border-radius: 4px;
}
.as-table__num { font-family: var(--mono); font-size: 12px; color: var(--muted-fg); white-space: nowrap; }
.as-table__empty { padding: 14px 8px; color: var(--muted-fg); text-align: center; }
.as-sign--fire { color: #b91c1c; }
.as-sign--earth { color: #a16207; }
.as-sign--air { color: #1d4ed8; }
.as-sign--water { color: #047857; }
.as-asp { display: inline-block; padding: 1px 7px; font-size: 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }
.as-asp--conj { color: #4b5563; border-color: #d1d5db; }
.as-asp--sext { color: #15803d; border-color: #bbf7d0; }
.as-asp--squar { color: #b91c1c; border-color: #fecaca; }
.as-asp--trine { color: #1d4ed8; border-color: #bfdbfe; }
.as-asp--opp { color: #b45309; border-color: #fde68a; }
.as-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 落座落宫速览与术语入口 */
.as-terms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 16px;
}
.as-terms__label { font-size: 12px; color: var(--muted-fg); }
.as-terms .bz-copy { padding: 5px 10px; }
.as-kb-link {
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  cursor: pointer;
}
.as-kb-link:hover { color: var(--accent); border-bottom-style: solid; }
.as-kb-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.as-lines {
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.as-lines__title { margin: 0 0 10px; font-family: var(--display); font-size: 15px; line-height: 1.4; }
.as-lines__lead { display: grid; gap: 6px; margin: 0 0 12px; }
.as-lines__lead-item { margin: 0; font-size: 14px; line-height: 1.8; }
.as-lines__lead-item strong { margin-right: 6px; font-weight: 600; }
.as-lines__meta { margin: 0 4px; font-family: var(--mono); font-size: 11.5px; color: var(--muted-fg); }
.as-lines__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.as-lines__list li { display: flex; gap: 10px; font-size: 13px; line-height: 1.7; }
.as-lines__key { flex: none; width: 68px; font-size: 12.5px; color: var(--muted-fg); }
.as-lines__text { min-width: 0; }

@media (min-width: 780px) {
  .as-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .as-wheel__sign { font-size: 15px; }
  .as-wheel__planet .as-wheel__glyph { font-size: 18px; }
  .as-table { font-size: 12.5px; }
  .as-table th, .as-table td { padding: 7px 6px; }
  .as-lines { padding: 12px 13px; }
  .as-lines__list li { gap: 6px; }
  .as-lines__key { width: 60px; }
}
