/* ==========================================================
   tips.html — "風水札記 The Codex"
   Editorial long-read built on luopan.css tokens (v3.34.0).
   Chapters 壹 貳 參, drop caps, pull quotes, a before/after
   bedroom slider, element-coloured Period 9 remedy cards and a
   compass-needle reading-progress dial under the header.
   ========================================================== */

.reveal-init [data-reveal="right"]:not(.is-revealed) { transform: translateX(40px); }
[data-parallax] { will-change: transform; }

.nav-link[aria-current="page"] { color: var(--fg); }
.nav-link[aria-current="page"]::after { transform: translateX(-50%) scale(1); }
@media (max-width: 1320px) {
  .nav-link[aria-current="page"] { color: var(--cinnabar); }
  .nav-link[aria-current="page"]::after { transform: translateY(50%) scale(1); }
}

/* ==========================================================
   Reading progress — a thin track under the header and a
   羅經 dial whose needle turns a full circle over the article
   ========================================================== */
.codex-progress {
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.site-header:has(.main-nav.nav-open) .codex-progress { opacity: 0; }
.cp-track {
  position: absolute; left: 0; right: 0; top: -1px;
  height: 2px;
  background: transparent;
}
.cp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--cinnabar));
  transform-origin: 0 50%;
  transform: scaleX(0);
  box-shadow: 0 0 12px color-mix(in srgb, var(--cinnabar) 60%, transparent);
}
.cp-dial {
  position: absolute;
  right: var(--gutter);
  top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.codex-progress.is-on .cp-dial { opacity: 1; transform: none; }
.cp-dial svg { width: 46px; height: 46px; order: 3; overflow: visible; }
.cp-ch {
  order: 1;
  font-family: var(--f-brush);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--cinnabar);
}
.cp-pct {
  order: 2;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  min-width: 3.4ch;
  text-align: right;
}
.cp-ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.cp-arc {
  fill: none;
  stroke: var(--cinnabar);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: 32px 32px;
}
.cp-ticks line { stroke: var(--fg-3); stroke-width: 1.2; }
.cp-needle { transform-origin: 32px 32px; }
.cp-n-s { fill: var(--cinnabar); }
.cp-n-n { fill: var(--fg-3); }
.cp-pin { fill: var(--fg); }
@media (max-width: 640px) {
  /* on phones the dial shrinks to a bare compass so it never covers the text */
  .cp-dial { top: 8px; right: 12px; padding: 3px; gap: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); }
  .cp-dial svg { width: 34px; height: 34px; }
  .cp-ch, .cp-pct { display: none; }
}

/* ==========================================================
   Hero — masthead
   ========================================================== */
.codex-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 130px 0 90px;
  overflow: hidden;
  z-index: 2;
}
.ch-dial-wrap {
  --dsize: min(1000px, 92vw);
  position: absolute;
  width: var(--dsize);
  height: var(--dsize);
  right: calc(var(--dsize) * -0.28);
  top: calc(50% - var(--dsize) / 2);
  opacity: 0.6;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 71%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 71%);
}
.ch-dial { width: 100%; height: 100%; }
body.theme-bright .ch-dial-wrap { opacity: 0.5; }

.ch-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.ch-mast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 720px;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--fg-3);
  margin-bottom: 18px;
  text-transform: uppercase;
}
.ch-mast-rule { flex: 1; height: 1px; background: var(--line-2); min-width: 30px; }
.ch-title-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.3em; margin-bottom: 26px; }
.ch-brush {
  font-size: clamp(4.2rem, 12.5vw, 11.5rem);
  line-height: 1;
  color: var(--fg);
  letter-spacing: 0.02em;
  -webkit-mask-image: linear-gradient(100deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(100deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: inkWipe 2.4s var(--ease) 0.35s forwards;
}
@keyframes inkWipe { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.ch-en {
  font-family: var(--f-disp);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.7rem, 3.8vw, 3.4rem);
  color: var(--cinnabar);
  letter-spacing: -0.01em;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 18px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--cinnabar);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cinnabar) 25%, transparent);
  animation: codexPulse 2.4s ease-in-out infinite;
}
@keyframes codexPulse { 50% { box-shadow: 0 0 0 9px transparent; } }
.ch-h1 {
  font-family: var(--f-han);
  font-weight: 900;
  font-size: clamp(1.7rem, 3.3vw, 2.9rem);
  line-height: 1.2;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
  max-width: 760px;
}
html[lang="en"] .ch-h1 { font-family: var(--f-disp); font-weight: 500; letter-spacing: -0.01em; }
.ch-sub { max-width: 560px; color: var(--fg-2); font-size: 1.06rem; margin-bottom: clamp(40px, 6vw, 70px); }

/* Contents */
.toc { max-width: 1080px; }
.toc-head { font-size: 0.7rem; letter-spacing: 0.24em; color: var(--cinnabar); margin-bottom: 12px; text-transform: uppercase; }
.toc-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.toc-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 18px 18px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  position: relative;
}
.toc-list li + li .toc-item { padding-left: 18px; border-left: 1px solid var(--line); }
.toc-item::before {
  content: '';
  position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: var(--cinnabar);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.6s var(--ease);
}
.toc-item:hover::before, .toc-item.active::before { transform: scaleX(1); }
.toc-num {
  font-family: var(--f-han);
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--fg-3);
  transition: color 0.4s var(--ease), -webkit-text-stroke-color 0.4s;
}
.toc-item:hover .toc-num, .toc-item.active .toc-num { color: var(--cinnabar); -webkit-text-stroke-color: var(--cinnabar); }
.toc-text { font-family: var(--f-han); font-weight: 700; font-size: 1.05rem; color: var(--fg); }
html[lang="en"] .toc-text { font-family: var(--f-ui); font-weight: 600; font-size: 0.98rem; }
.toc-arrow { font-family: var(--f-mono); color: var(--fg-3); transition: transform 0.4s var(--ease), color 0.3s; }
.toc-item:hover .toc-arrow { transform: translateY(4px); color: var(--cinnabar); }

.ch-scroll {
  position: absolute; left: 50%; bottom: 26px;
  width: 1px; height: 56px;
  background: var(--line);
  overflow: hidden;
}
.ch-scroll span {
  position: absolute; left: 0; top: 0; width: 1px; height: 22px;
  background: var(--cinnabar);
  animation: scrollCue 2.2s var(--ease) infinite;
}
@keyframes scrollCue { from { transform: translateY(-24px); } to { transform: translateY(60px); } }

@media (max-width: 900px) {
  .toc-list { grid-template-columns: 1fr; }
  .toc-list li + li .toc-item { padding-left: 0; border-left: 0; }
  .toc-num { font-size: 2.1rem; }
  .ch-dial-wrap { --dsize: 130vw; right: -62vw; opacity: 0.32; }
  body.theme-bright .ch-dial-wrap { opacity: 0.3; }
}
@media (max-width: 640px) {
  .codex-hero { padding-top: 110px; }
  .ch-title-wrap { flex-direction: column; gap: 4px; }
  .ch-scroll { display: none; }
}

/* ==========================================================
   Chapters
   ========================================================== */
.chapter { position: relative; z-index: 2; scroll-margin-top: 70px; overflow-x: clip; }
.colophon { overflow-x: clip; }
.chapter-alt {
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.chapter .sec-num span { display: block; }
.ch-brush-title {
  font-family: var(--f-brush);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.15;
}
.chapter .sec-tag { flex-wrap: wrap; }

/* Body column: an editorial indent leaves room for margin glyphs */
.prose, .pillar, .pillar-pair, .pull, .compare, .tip-list-container, .plates, .wuxing {
  --indent: 0px;
}
@media (min-width: 1000px) {
  .prose, .pillar, .pillar-pair { --indent: 170px; }
}
.prose { padding-left: var(--indent); max-width: calc(820px + var(--indent)); margin-bottom: clamp(50px, 7vw, 90px); }
.lede {
  font-size: clamp(1.14rem, 1.7vw, 1.38rem);
  line-height: 1.95;
  color: var(--fg);
  text-align: justify;
  text-justify: inter-character;
}
html[lang="en"] .lede { text-align: left; font-family: var(--f-disp); font-weight: 300; }
.dropcap::first-letter {
  float: left;
  font-family: var(--f-brush);
  font-weight: 400;
  font-size: 4.4em;
  line-height: 0.92;
  margin: 0.06em 0.16em 0 0;
  color: var(--cinnabar);
}
html[lang="en"] .dropcap::first-letter { font-family: var(--f-disp); font-weight: 500; font-size: 4.2em; line-height: 0.8; margin-top: 0.08em; }

/* Pillars */
.pillar {
  display: grid;
  grid-template-columns: var(--indent) minmax(0, 1fr);
  margin-bottom: clamp(60px, 8vw, 110px);
}
.pillar-glyph {
  position: relative;
  align-self: stretch;
}
.pillar-glyph span {
  display: block;
  position: sticky;
  top: 140px;
  font-family: var(--f-han);
  font-weight: 900;
  font-size: 7.5rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  user-select: none;
}
.pillar-body { max-width: 820px; min-width: 0; }
.pillar-title {
  font-family: var(--f-han);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.25;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
html[lang="en"] .pillar-title { font-family: var(--f-disp); font-weight: 500; letter-spacing: -0.01em; }
.pillar-p { color: var(--fg-2); font-size: 1.04rem; line-height: 1.95; margin-bottom: 26px; max-width: 70ch; }
@media (max-width: 999px) {
  .pillar { grid-template-columns: minmax(0, 1fr); }
  .pillar-glyph { position: absolute; right: 0; margin-top: -30px; z-index: -1; }
  .pillar { position: relative; }
  .pillar-glyph span { position: static; font-size: 5.5rem; opacity: 0.8; }
}

.margin-note {
  border-left: 2px solid var(--cinnabar);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
  padding: 22px 26px;
  margin-bottom: 34px;
  border-radius: 0 4px 4px 0;
}
.margin-note strong { display: block; font-family: var(--f-han); font-weight: 700; margin-bottom: 12px; }
.margin-note ul { list-style: none; display: grid; gap: 10px; }
.margin-note li { position: relative; padding-left: 20px; color: var(--fg-2); font-size: 0.97rem; line-height: 1.8; }
.margin-note li::before {
  content: '';
  position: absolute; left: 2px; top: 0.72em;
  width: 7px; height: 7px;
  background: var(--cinnabar);
  transform: rotate(45deg);
}

.consider-head { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 14px; }
.consider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.consider {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 20px;
  background: color-mix(in srgb, var(--bg-2) 55%, transparent);
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.consider:hover { transform: translateY(-4px); border-color: var(--line-2); }
.consider-ico { width: 44px; height: 44px; margin-bottom: 14px; fill: none; stroke: var(--fg-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.consider-ico .fillc { fill: var(--cinnabar); stroke: none; }
.consider-ico .dash { stroke: var(--cinnabar); stroke-dasharray: 2 3; }
.consider-ico text { font-family: var(--f-han); font-size: 7px; font-weight: 900; fill: var(--cinnabar); stroke: none; text-anchor: middle; }
.consider strong { display: block; font-family: var(--f-han); font-weight: 700; margin-bottom: 6px; }
.consider span { display: block; color: var(--fg-2); font-size: 0.92rem; line-height: 1.75; }
@media (max-width: 900px) { .consider-grid { grid-template-columns: 1fr; } }

.inline-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--cinnabar);
  border-bottom: 1px solid color-mix(in srgb, var(--cinnabar) 40%, transparent);
  padding-bottom: 3px;
  transition: gap 0.35s var(--ease), border-color 0.3s;
}
.inline-link:hover { gap: 14px; border-color: var(--cinnabar); }

/* Shape table */
.shape-table-wrapper { margin: 10px 0 20px; border-top: 1px solid var(--line-2); }
.shape-table { width: 100%; border-collapse: collapse; text-align: left; }
.shape-table th {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 14px 16px 12px 0;
  border-bottom: 1px solid var(--line);
}
.shape-table td {
  padding: 18px 16px 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 0.97rem;
  line-height: 1.7;
  vertical-align: middle;
}
.shape-table td:first-child { display: flex; align-items: center; gap: 14px; color: var(--fg); font-weight: 600; white-space: nowrap; }
.shape-table tbody tr { transition: background 0.3s; }
.shape-table tbody tr:hover { background: color-mix(in srgb, var(--fg) 3%, transparent); }
.shape-ico { width: 36px; height: 36px; flex-shrink: 0; fill: none; stroke: var(--fg-2); stroke-width: 1.5; stroke-linejoin: round; }
.shape-ico .missing { stroke: var(--cinnabar); stroke-dasharray: 3 3; }
tr.is-good .shape-ico { stroke: var(--dir-e); fill: color-mix(in srgb, var(--dir-e) 16%, transparent); }
.verdict {
  font-family: var(--f-brush);
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--cinnabar);
  color: var(--cinnabar);
  margin-left: auto;
}
html[lang="en"] .verdict { font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
tr.is-good .verdict { border-color: var(--dir-e); color: var(--dir-e); }
.footnote { font-size: 0.9rem; font-style: italic; color: var(--fg-3); line-height: 1.8; padding-left: 14px; border-left: 1px solid var(--line-2); }
@media (max-width: 640px) {
  .shape-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .shape-table, .shape-table tbody, .shape-table tr, .shape-table td { display: block; width: 100%; }
  .shape-table tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .shape-table td { border: 0; padding: 0; }
  .shape-table td:first-child { margin-bottom: 8px; white-space: normal; }
  .shape-table td + td { padding-left: 50px; font-size: 0.94rem; }
}

/* Pull quotes */
.pull {
  position: relative;
  max-width: 940px;
  margin: 0 auto clamp(70px, 9vw, 120px);
  padding: 20px 0 0 clamp(40px, 6vw, 80px);
}
.pull::before {
  content: '「';
  position: absolute; left: 0; top: -0.18em;
  font-family: var(--f-han);
  font-weight: 900;
  font-size: clamp(4rem, 9vw, 7.5rem);
  line-height: 1;
  color: var(--cinnabar);
}
html[lang="en"] .pull::before { content: '“'; font-family: var(--f-disp); top: -0.1em; }
.pull p {
  font-family: var(--f-brush);
  font-weight: 400;
  font-size: clamp(1.8rem, 4.3vw, 3.5rem);
  line-height: 1.32;
  color: var(--fg);
  margin-bottom: 18px;
  text-wrap: balance;
}
html[lang="en"] .pull p { font-family: var(--f-disp); font-style: italic; font-weight: 300; line-height: 1.2; }
.pull cite { font-style: normal; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-3); }
.pull-right { margin-right: 0; text-align: right; padding: 20px clamp(40px, 6vw, 80px) 0 0; }
.pull-right::before { left: auto; right: 0; content: '」'; top: auto; bottom: 0.2em; }
html[lang="en"] .pull-right::before { content: '”'; }
.pull-center { text-align: center; padding: 30px 0 0; margin-top: clamp(60px, 8vw, 110px); }
.pull-center::before { left: 50%; transform: translateX(-50%); top: -0.55em; }

.pillar-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(30px, 5vw, 70px); padding-left: var(--indent); }
.pillar-mini { grid-template-columns: minmax(0, 1fr); position: relative; margin-bottom: 0; padding-top: 70px; }
.pillar-mini .pillar-glyph { position: absolute; top: 0; left: 0; z-index: 0; margin: 0; }
.pillar-mini .pillar-glyph span { position: static; font-size: 5rem; }
.pillar-mini .pillar-body { position: relative; z-index: 1; }
@media (max-width: 900px) { .pillar-pair { grid-template-columns: 1fr; gap: 60px; } }

/* ==========================================================
   貳 — before / after comparison slider
   ========================================================== */
.compare { max-width: 1120px; margin: 0 auto clamp(60px, 8vw, 100px); }
.cmp-stage {
  --pos: 50%;
  --p: 50;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  background: var(--bg-3);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}
.cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-before-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 48px;
  margin-left: -24px;
  display: grid;
  place-items: center;
  z-index: 3;
  cursor: ew-resize;
  outline: none;
}
.cmp-line {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--bone) 12%, var(--bone) 88%, transparent);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.5);
}
.cmp-knob {
  position: relative;
  width: 58px; height: 58px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cinnabar);
  color: var(--cinnabar-ink);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--cinnabar) 25%, transparent), 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.cmp-knob svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cmp-stage.is-drag .cmp-knob, .cmp-handle:hover .cmp-knob { transform: scale(1.1); }
.cmp-handle:focus-visible .cmp-knob { box-shadow: 0 0 0 3px var(--bone), 0 0 0 7px var(--cinnabar), 0 10px 30px rgba(0, 0, 0, 0.45); }
.cmp-tag {
  position: absolute; top: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s;
}
.cmp-tag b {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--f-brush);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0;
}
.cmp-tag-bad { left: 16px; background: rgba(10, 8, 7, 0.6); color: #f4ece0; opacity: clamp(0, (var(--p) - 12) / 18, 1); }
.cmp-tag-bad b { background: #e2462c; color: #fff4ec; }
.cmp-tag-good { right: 16px; background: rgba(251, 246, 236, 0.78); color: #1c1712; opacity: clamp(0, (88 - var(--p)) / 18, 1); }
.cmp-tag-good b { background: #2e7d4a; color: #f3fbf5; }
.compare figcaption { text-align: center; margin-top: 14px; font-size: 0.7rem; letter-spacing: 0.16em; color: var(--fg-3); }
@media (max-width: 640px) {
  .cmp-stage { aspect-ratio: 4 / 5; }
  .cmp-tag { top: 10px; padding-right: 10px; font-size: 0.58rem; }
  .cmp-tag-bad { left: 10px; }
  .cmp-tag-good { right: 10px; }
}

/* 宜 / 忌 columns */
.tip-list-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}
.tip-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 3.4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  --tone: var(--dir-e);
}
.donts-column { --tone: var(--cinnabar); }
.tip-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tone); }
.col-watermark {
  position: absolute;
  right: -0.08em; top: -0.12em;
  font-family: var(--f-brush);
  font-size: clamp(9rem, 16vw, 14rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--tone) 45%, transparent);
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}
.tip-card-title {
  position: relative;
  font-family: var(--f-han);
  font-weight: 900;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  color: var(--tone);
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  max-width: 75%;
}
.tip-list { list-style: none; position: relative; }
.tip-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.tip-item:last-child { border-bottom: 0; padding-bottom: 0; }
.tip-no { font-size: 0.78rem; color: var(--tone); padding-top: 4px; letter-spacing: 0.05em; }
.tip-item-content strong { display: block; font-family: var(--f-han); font-weight: 700; font-size: 1.06rem; margin-bottom: 4px; }
html[lang="en"] .tip-item-content strong { font-family: var(--f-ui); }
.tip-item-content span { display: block; color: var(--fg-2); font-size: 0.95rem; line-height: 1.8; }
@media (max-width: 900px) { .tip-list-container { grid-template-columns: 1fr; } }

/* ==========================================================
   參 — Period 9 plates and element-coloured remedies
   ========================================================== */
.wuxing {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: -30px 0 clamp(40px, 5vw, 60px);
}
.wuxing li {
  --el-line: var(--el);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.wuxing b {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--el);
  color: var(--el-on);
  font-family: var(--f-brush);
  font-weight: 400;
  font-size: 1rem;
  box-shadow: 0 0 0 1px var(--line-2);
}
.wuxing span { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--fg-2); }

.plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); align-items: start; }
.plate {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(22px, 3vw, 40px);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
}
.plate-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.plate-plan { width: 96px; height: 96px; flex-shrink: 0; overflow: visible; }
.pp-house { fill: color-mix(in srgb, var(--fg) 3%, transparent); stroke: var(--fg-3); stroke-width: 1.2; }
.pp-back { stroke: var(--cinnabar); stroke-width: 4; stroke-linecap: round; }
.pp-lbl { fill: var(--fg-3); font-family: var(--f-han); font-size: 12px; font-weight: 700; text-anchor: middle; }
.pp-lbl-on { fill: var(--cinnabar); font-weight: 900; }
.pp-star { fill: var(--gold); }
.pp-n { fill: var(--bg); font-family: var(--f-mono); font-size: 9px; text-anchor: middle; dominant-baseline: central; font-weight: 500; }
.pp-arrow { stroke: var(--fg-3); stroke-width: 1.2; stroke-dasharray: 2 3; }
.plate-title { font-family: var(--f-han); font-weight: 900; font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.3; margin-bottom: 8px; }
html[lang="en"] .plate-title { font-family: var(--f-disp); font-weight: 500; }
.plate-badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
  color: var(--gold);
}
.plate-intro { color: var(--fg-2); font-size: 0.97rem; line-height: 1.85; margin-bottom: 24px; }
.remedies { display: grid; gap: 14px; }
.remedy {
  --el-line: var(--el);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--el-line);
  border-radius: 4px;
  padding: 20px 22px 22px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--el-line) 12%, transparent), transparent 55%), color-mix(in srgb, var(--bg) 60%, transparent);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.remedy.is-metal, .wuxing li.is-metal { --el-line: var(--dir-w-ink); }
.remedy:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -28px color-mix(in srgb, var(--el-line) 80%, transparent); }
.rm-glyph {
  position: absolute;
  right: 8px; top: -14px;
  font-family: var(--f-brush);
  font-size: 6rem;
  line-height: 1;
  color: var(--el-line);
  opacity: 0.16;
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.remedy:hover .rm-glyph { opacity: 0.32; transform: scale(1.08) rotate(-4deg); }
.rm-chip {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--el);
  color: var(--el-on);
  box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 12px;
}
.remedy strong { position: relative; display: block; font-family: var(--f-han); font-weight: 700; font-size: 1.06rem; margin-bottom: 6px; padding-right: 60px; }
html[lang="en"] .remedy strong { font-family: var(--f-ui); }
.remedy > span:last-child { position: relative; display: block; color: var(--fg-2); font-size: 0.94rem; line-height: 1.8; }
@media (max-width: 1000px) { .plates { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .plate-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .plate-plan { width: 80px; height: 80px; }
  .wuxing { margin-top: -20px; }
}

/* ==========================================================
   Colophon
   ========================================================== */
.colophon {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(80px, 10vw, 140px) var(--gutter);
}
.colo-mark { font-size: clamp(4rem, 9vw, 7rem); line-height: 1; color: var(--cinnabar); margin-bottom: 20px; }
.colo-text {
  font-family: var(--f-han);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.5;
  max-width: 660px;
  margin: 0 auto 36px;
}
html[lang="en"] .colo-text { font-family: var(--f-disp); font-weight: 400; }
.colo-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .ch-brush { -webkit-mask-image: none; mask-image: none; animation: none; }
  .ch-scroll span { animation: none; }
}
