:root {
  color-scheme: light;
  --page: #f4f8f3;
  --surface: #fffdf7;
  --soft: #eaf4ef;
  --ink: #193f35;
  --text: #20352e;
  --muted: #5d746a;
  --line: #c9dcd3;
  --accent: #087260;
  --accent-soft: #d9eee5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", sans-serif;
  background: var(--page);
  color: var(--text);
}

* { box-sizing: border-box; }
html { background: var(--page); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
a { color: var(--accent); }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(244, 248, 243, .96); }
.header-inner, .content, .footer-inner { width: min(100% - 40px, 920px); margin: 0 auto; }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.brand-name { display: block; font-size: 16px; line-height: 18px; font-weight: 900; }
.brand-subtitle { display: block; color: var(--muted); font-size: 10px; line-height: 14px; font-weight: 700; }
.header-link { font-size: 14px; font-weight: 800; text-decoration: none; }
.language-menu { position: relative; flex: 0 0 auto; }
.language-menu summary { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; list-style: none; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after { content: ""; width: 7px; height: 7px; margin-inline-start: 2px; border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .16s ease; }
.language-menu[open] summary::after { transform: translateY(2px) rotate(225deg); }
.language-mark { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 900; }
.language-options { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; display: grid; width: 210px; max-height: min(420px, calc(100dvh - 96px)); overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 44px rgba(25, 63, 53, .14); }
.language-options a { min-height: 40px; padding: 10px 12px; border-radius: 5px; color: var(--text); font-size: 14px; line-height: 20px; font-weight: 700; text-decoration: none; }
.language-options a:hover, .language-options a:focus-visible { background: var(--soft); outline: none; }
.language-options a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.content { padding: 52px 0 80px; }
.breadcrumbs { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 20px; }
.breadcrumbs a { text-decoration: none; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 12px; line-height: 18px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { color: var(--ink); letter-spacing: 0; }
h1 { max-width: 780px; margin: 0; font-size: 48px; line-height: 1.08; font-weight: 900; }
.lede { max-width: 700px; margin: 20px 0 0; color: var(--muted); font-size: 19px; line-height: 1.6; }
.updated { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .75fr); gap: 48px; margin-top: 48px; align-items: start; }
article > :first-child { margin-top: 0; }
h2 { margin: 42px 0 12px; font-size: 25px; line-height: 1.25; }
h3 { margin: 28px 0 8px; font-size: 18px; line-height: 1.35; }
p, li { font-size: 16px; line-height: 1.72; }
li + li { margin-top: 8px; }
.definition { margin: 0; padding: 18px 20px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink); font-size: 18px; line-height: 1.6; font-weight: 750; }
.aside { position: sticky; top: 24px; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.aside h2 { margin: 0 0 12px; font-size: 17px; }
.aside nav { display: grid; gap: 10px; }
.aside a { font-size: 14px; line-height: 1.4; font-weight: 750; text-decoration: none; }
.rule-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.rule-list li { padding: 14px 16px; border-top: 1px solid var(--line); }
.rule-list strong { display: block; margin-bottom: 4px; color: var(--ink); }
.trigram-grid, .hexagram-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0; list-style: none; }
.trigram, .hexagram { min-width: 0; padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.hexagram { color: inherit; text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.hexagram:hover, .hexagram:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.trigram strong, .hexagram strong { display: block; color: var(--ink); }
.trigram span, .hexagram span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0 4px; }
.fact { padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.fact-label { margin: 0 0 5px; color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.fact-value { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.45; font-weight: 800; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { max-width: 48%; font-size: 14px; line-height: 1.45; font-weight: 800; text-decoration: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; font-size: 14px; line-height: 1.45; }
th { color: var(--ink); background: var(--soft); font-weight: 900; }
tr:last-child td { border-bottom: 0; }
.notice { margin-top: 32px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.notice p { margin: 0; }
.faq-list { display: grid; gap: 10px; }
.faq { border: 1px solid var(--line); background: var(--surface); }
.faq summary { cursor: pointer; padding: 17px 18px; color: var(--ink); font-size: 17px; line-height: 1.45; font-weight: 850; }
.faq summary::marker { color: var(--accent); }
.faq-answer { padding: 0 18px 17px; }
.faq-answer p { margin: 0; }
.faq-answer a { font-weight: 750; }
.cta { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; padding: 0 18px; border-radius: 8px; background: var(--accent); color: #fffdf7; font-size: 14px; font-weight: 850; text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding: 22px 0 30px; color: var(--muted); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { text-decoration: none; }
code { padding: 2px 5px; background: var(--soft); color: var(--ink); }
[dir="rtl"] .pager a:last-child { text-align: end; }
[dir="rtl"] .language-options a { text-align: start; }
@media (max-width: 700px) {
  .header-inner, .content, .footer-inner { width: min(100% - 32px, 920px); }
  .content { padding-top: 36px; }
  h1 { font-size: 34px; }
  .content-grid { display: block; margin-top: 34px; }
  .aside { position: static; margin-top: 40px; }
  .trigram-grid, .hexagram-grid { grid-template-columns: 1fr; }
  .fact-grid { grid-template-columns: 1fr; }
  .footer-inner { display: block; }
  .footer-links { margin-top: 12px; }
  .brand-subtitle { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .language-menu summary { padding-inline: 10px; }
  .language-options { width: min(210px, calc(100vw - 32px)); }
}
