/* yongshen.css — 「喜用神」叢集專用樣式（暖象牙精品風，沿用 shenqiang/wuxing-yong 色系）。
   在 :root 覆蓋 style.css 的暗金 token（本檔在 style.css / article.css 之後載入），整頁 chrome 自動翻亮；
   共用件沿用 article.css 結構，本檔只覆蓋配色/字體並補本叢集專屬元件：
   .ys-layers 取用神五層、.ys-stats 引擎實測數字、.ys-tool 頁內查詢、.ys-table 對照表、.ys-myths、.ys-note。
   配色克制：區塊標題與結論數字用深色，金色只留強調點（見 design-gold-restraint）。 */

:root {
  --bg: #f7f3ec; --bg-card: #ffffff; --bg-input: #fffdf9; --border: #e4ddce;
  --text: #201d18; --text-dim: #6f685c; --gold: #a6824c; --gold-soft: #c0a070;
  --radius: 14px;
  --xi: #4f8c5f;    /* 喜用 綠 */
  --ji: #b45c3f;    /* 忌 緋 */
  --grey: #5a7fb0;  /* 灰色地帶／提示 藍 */
  --lux-serif: 'Cormorant Garamond', 'Noto Serif TC', Georgia, serif;
  --lux-sans: 'Jost', 'Noto Sans TC', 'Helvetica Neue', Arial, sans-serif;
}

body { font-family: var(--lux-sans); }
.article h1, .article h2, .ys-note h2 { font-family: var(--lux-serif); font-weight: 600; }
.article h1 { font-size: 2.2rem; letter-spacing: 0.01em; line-height: 1.32; }
.article h2 { letter-spacing: 0.02em; }
.article h3 { font-family: var(--lux-serif); font-weight: 600; font-size: 1.22rem; margin: 22px 0 8px; color: var(--text); }
.article .lead { font-size: 1.08rem; }
.ys-sub { color: var(--text-dim); font-size: 0.98rem; margin: 0 0 18px; }

/* 喜／忌／灰 小標籤 */
.ys-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.86rem; font-weight: 500; line-height: 1.7; border: 1px solid currentColor; margin: 0 2px; }
.ys-chip.xi { color: var(--xi); } .ys-chip.ji { color: var(--ji); } .ys-chip.grey { color: var(--grey); }

/* 取用神的層次：一層一張卡，左側色條表示它對喜忌的作用 */
.ys-layers { display: grid; gap: 12px; margin: 6px 0 12px; counter-reset: ys-layer; }
.ys-layer {
  background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--gold-soft);
  border-radius: 12px; padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: start;
}
.ys-layer h3 { margin: 0; font-size: 1.18rem; }
.ys-layer h3::before { counter-increment: ys-layer; content: counter(ys-layer) "　"; color: var(--gold); font-size: 0.95rem; }
.ys-layer p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 0.94rem; line-height: 1.85; color: var(--text); }
.ys-layer .ys-rate { font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.04em; text-align: right; white-space: nowrap; }
.ys-layer .ys-rate b { font-family: var(--lux-serif); font-size: 1.15rem; color: var(--text); font-weight: 600; }
.ys-layer.base { border-left-color: var(--xi); }
.ys-layer.hint { border-left-color: var(--grey); }
.ys-layer a { color: var(--gold); }

/* 引擎實測數字 */
.ys-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 8px; }
.ys-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 12px 12px; text-align: center; }
.ys-stat .n { display: block; font-family: var(--lux-serif); font-size: 1.9rem; font-weight: 600; color: var(--text); line-height: 1.1; }
.ys-stat .l { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--text-dim); line-height: 1.55; }
.ys-source { font-size: 0.82rem; color: var(--text-dim); margin: 0 0 16px; }

/* 對照表 */
.ys-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 4px 0 12px; }
.ys-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.93rem; }
.ys-table th, .ys-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.75; }
.ys-table.wide { min-width: 760px; }
.ys-table thead th { white-space: nowrap; background: var(--bg-input); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 600; }
.ys-table tbody th { font-family: var(--lux-serif); font-size: 1.02rem; color: var(--text); white-space: nowrap; }
.ys-table tr:last-child th, .ys-table tr:last-child td { border-bottom: 0; }
.ys-table .col-xi { color: var(--xi); } .ys-table .col-ji { color: var(--ji); }
.ys-table td.col-xi, .ys-table td.col-ji { color: var(--text); }
.ys-table thead .col-xi { color: var(--xi); } .ys-table thead .col-ji { color: var(--ji); }

/* 迷思 */
.ys-myths { display: grid; gap: 12px; margin: 6px 0 10px; }
.ys-myth { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.ys-myth .m-wrong { margin: 0; color: var(--ji); font-size: 0.95rem; font-weight: 500; }
.ys-myth .m-wrong::before { content: "迷思"; font-size: 0.64rem; letter-spacing: 0.14em; background: var(--ji); color: #fffdf9; padding: 2px 7px; border-radius: 999px; margin-right: 8px; vertical-align: 1px; }
.ys-myth .m-right { margin: 8px 0 0; color: var(--text); font-size: 0.94rem; line-height: 1.85; }
.ys-myth .m-right::before { content: "其實"; font-size: 0.64rem; letter-spacing: 0.14em; background: var(--xi); color: #fffdf9; padding: 2px 7px; border-radius: 999px; margin-right: 8px; vertical-align: 1px; }
html[lang^="en"] .ys-myth .m-wrong::before { content: "MYTH"; }
html[lang^="en"] .ys-myth .m-right::before { content: "REALITY"; }
html[lang="zh-Hans"] .ys-myth .m-wrong::before { content: "误区"; }
html[lang="zh-Hans"] .ys-myth .m-right::before { content: "其实"; }

/* 範例盤：用一張真盤走一遍 */
.ys-case { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 14px; }
.ys-case .pillars { display: flex; gap: 10px; margin: 2px 0 12px; flex-wrap: wrap; }
.ys-case .pillar { border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; text-align: center; background: var(--bg-input); min-width: 58px; }
.ys-case .pillar small { display: block; font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.08em; }
.ys-case .pillar b { font-family: var(--lux-serif); font-size: 1.25rem; color: var(--text); letter-spacing: 0.08em; }
.ys-case .pillar.dm { border-color: var(--gold-soft); }
.ys-case ol { margin: 0; padding-left: 1.3em; }
.ys-case li { margin: 4px 0; line-height: 1.85; font-size: 0.95rem; }

/* 誠實框 */
.ys-note { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--gold-soft); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 22px 0; }
.ys-note h2 { margin-top: 0; font-size: 1.3rem; }
.ys-note p { margin: 8px 0 0; line-height: 1.9; }

/* 頁內查詢工具 */
.ys-tool { background: var(--bg-card); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 18px 18px 16px; margin: 10px 0 18px; }
.ys-tool h2 { margin-top: 0; }
.ys-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.ys-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-dim); letter-spacing: 0.04em; }
.ys-form select, .ys-form input[type="number"] {
  font: inherit; font-size: 0.98rem; color: var(--text); background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; width: 100%; box-sizing: border-box;
}
.ys-form .ys-opt { grid-column: 1 / 3; flex-direction: row; align-items: center; gap: 8px; font-size: 0.86rem; }
.ys-form button { grid-column: 3 / -1; }
.ys-form button {
  font: inherit; font-weight: 600; letter-spacing: 0.06em; border: 0; border-radius: 10px; padding: 11px 14px; cursor: pointer;
  background: var(--gold); color: #fffdf9;
}
.ys-form button:disabled { opacity: .6; cursor: wait; }
.ys-err { color: var(--ji); font-size: 0.9rem; margin: 10px 0 0; }
.ys-out { margin-top: 16px; }
.ys-out[hidden] { display: none; }
.ys-verdict { background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.ys-verdict .v-h { font-size: 0.78rem; letter-spacing: 0.1em; color: var(--text-dim); margin: 0 0 6px; }
.ys-verdict .v-row { margin: 4px 0; font-size: 1rem; line-height: 1.9; }
.ys-verdict .v-row .k { display: inline-block; min-width: 3.2em; color: var(--text-dim); font-size: 0.86rem; }
.ys-steps { display: grid; gap: 8px; }
.ys-step { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 0.92rem; line-height: 1.8; background: var(--bg-card); }
.ys-step .s-h { font-weight: 600; color: var(--text); margin-right: 6px; }
.ys-step.off { color: var(--text-dim); }
.ys-step.on { border-left: 3px solid var(--gold-soft); }
.ys-step.hint { border-left: 3px solid var(--grey); }
.ys-next { margin: 12px 0 0; font-size: 0.92rem; line-height: 1.85; }
.ys-next a { color: var(--gold); }

@media (max-width: 640px) {
  .article h1 { font-size: 1.7rem; }
  .ys-stats { grid-template-columns: repeat(2, 1fr); }
  .ys-form { grid-template-columns: repeat(2, 1fr); }
  .ys-form .ys-opt, .ys-form button { grid-column: 1 / -1; }
  .ys-layer { grid-template-columns: 1fr; }
  .ys-layer .ys-rate { text-align: left; }
}
