/* 禪修導航 · 樣式。僅用系統字體，無外部資源。 */
:root {
  --paper: #f6f3ec;
  --ink: #2b2a27;
  --muted: #6b665b;
  --rule: #ddd6c7;
  --accent: #9a4a2f;
  --ghost: #e9e1d0;
  --wash: #efebe0;
  --measure: 36em;
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", "Noto Serif CJK TC", "PMingLiU", "Songti SC", serif;
  color-scheme: light dark;
}
:lang(zh-Hans) {
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", "Songti TC", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1b19;
    --ink: #dcd7cb;
    --muted: #9b9588;
    --rule: #3a3731;
    --accent: #cf8a68;
    --ghost: #292722;
    --wash: #24221e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  line-height: 1.9;
  line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;
  text-spacing-trim: trim-start;
  hanging-punctuation: first;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ghost); }

.cr-skip { position: absolute; left: -999px; top: 0; padding: 0.4em 1em; background: var(--paper); z-index: 9; }
.cr-skip:focus { left: 0.5rem; top: 0.5rem; }

/* 頁首 */
.cr-head { max-width: 46em; margin: 0 auto; padding: 1.1rem 1.25rem 0; }
.cr-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.cr-brand { text-decoration: none; letter-spacing: 0.14em; font-size: 1.02rem; display: inline-flex; align-items: baseline; gap: 0.7em; }
.cr-brand::before { content: ""; width: 0.5em; height: 0.5em; background: var(--accent); flex: none; transform: translateY(-0.05em); }
.cr-lang { font-size: 0.85rem; letter-spacing: 0.1em; color: var(--muted); display: flex; gap: 1em; white-space: nowrap; }
.cr-lang a { text-decoration: none; }
.cr-nav { margin-top: 0.5rem; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.cr-nav::-webkit-scrollbar { display: none; }
.cr-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6em; white-space: nowrap; }
.cr-nav a { display: block; padding: 0.35em 0 0.45em; font-size: 0.92rem; letter-spacing: 0.16em; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.cr-nav a:hover, .cr-nav a[aria-current] { color: var(--ink); }
.cr-nav a[aria-current] { border-bottom-color: var(--accent); }

/* 版心 */
.cr-main { max-width: calc(var(--measure) + 2.5rem); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.cr-page-head { margin: 0 0 2.2rem; }
.cr-crumb { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.06em; margin-bottom: 1.8rem; }
.cr-crumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.5em; }
.cr-crumb li + li::before { content: "\00b7"; margin-right: 0.5em; color: var(--rule); }
.cr-crumb a { text-decoration: none; }
.cr-eyebrow { margin: 0 0 0.4em; font-size: 0.85rem; letter-spacing: 0.3em; color: var(--accent); }
.cr-eyebrow a { text-decoration: none; }
h1 { margin: 0; font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.2rem); font-weight: 600; line-height: 1.4; letter-spacing: 0.06em; text-wrap: balance; }
h2 { margin: 3rem 0 0.9rem; font-size: 1.3rem; font-weight: 600; line-height: 1.5; letter-spacing: 0.05em; text-wrap: balance; }
h2::before { content: ""; display: block; width: 1.6rem; height: 1px; background: var(--accent); margin-bottom: 0.9rem; }
h3 { margin: 2.2rem 0 0.5rem; font-size: 1.1rem; font-weight: 600; letter-spacing: 0.04em; }

.cr-main p, .cr-main li { text-align: justify; text-justify: inter-character; }
.cr-main p { margin: 0 0 1.15em; }
.cr-main ul, .cr-main ol { margin: 0 0 1.4em; padding-left: 1.6em; }
.cr-main li { margin-bottom: 0.45em; }
.cr-main li::marker { color: var(--accent); }
.cr-lead { font-size: 1.1em; line-height: 2; }
.cr-byline { margin: 0 0 1.8rem; font-size: 0.88rem; color: var(--muted); letter-spacing: 0.06em; }
.cr-note { margin-top: 3rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--muted); line-height: 1.85; }
blockquote { margin: 1.8em 0; padding: 0 0 0 1.4em; color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem auto; width: 3rem; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.8em 0; font-size: 0.94em; line-height: 1.7; }
th, td { padding: 0.65em 1em 0.65em 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; letter-spacing: 0.06em; border-bottom-color: var(--accent); white-space: nowrap; }

/* 連結清單 */
.cr-links { list-style: none; padding: 0; margin: 1.2em 0 0; border-top: 1px solid var(--rule); }
.cr-links li { margin: 0; padding: 0.7em 0; border-bottom: 1px solid var(--rule); text-align: left; }
.cr-links a { text-decoration-color: var(--rule); }
.cr-links a:hover { text-decoration-color: var(--accent); }

/* 內容語義塊 */
.cr-tag { margin: 0 0 0.6em; font-size: 0.78rem; letter-spacing: 0.3em; color: var(--accent); line-height: 1.6; text-align: left; }
.cr-say { margin: 2.2em 0; padding: 0.1em 0 0.1em 1.3em; border-left: 1px solid var(--accent); }
.cr-say > :last-child { margin-bottom: 0; }
.cr-ext { margin: 2.2em 0; padding: 1.3em 1.4em 1.1em; background: var(--wash); }
.cr-ext .cr-tag { color: var(--muted); }
.cr-ext > :last-child { margin-bottom: 0; }
.cr-ed { margin: 2.4em 0; padding-top: 0.9em; border-top: 1px solid var(--rule); font-size: 0.88rem; line-height: 1.85; color: var(--muted); }
.cr-ed > :last-child { margin-bottom: 0; }
.cr-pending { margin: 2em 0; padding: 1.2em 1.4em; border: 1px dashed var(--rule); color: var(--muted); font-size: 0.92em; }
.cr-pending > :last-child { margin-bottom: 0; }

/* 六重導航圖：一條由上而下的路 */
.cr-map { list-style: none; margin: 3.5rem 0 3rem; padding: 0; }
.cr-map li { position: relative; margin: 0; padding: 0 0 2.4rem 2.4rem; text-align: left; }
.cr-map li::before { content: ""; position: absolute; left: 0.3rem; top: 1.05rem; bottom: -0.2rem; width: 1px; background: var(--rule); }
.cr-map li:last-child { padding-bottom: 0.4rem; }
.cr-map li:last-child::before { display: none; }
.cr-map li::after { content: ""; position: absolute; left: 0; top: 0.8rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 1px solid var(--accent); background: var(--paper); transition: background-color 0.2s; }
.cr-map li:hover::after, .cr-map li:focus-within::after { background: var(--accent); }
.cr-map a { position: relative; display: block; text-decoration: none; padding: 0.2rem 3.6rem 0.2rem 0; }
.cr-map a:hover { color: inherit; }
.cr-map-no { position: absolute; right: 0; top: -0.6rem; font-size: 4.2rem; line-height: 1; color: var(--ghost); pointer-events: none; user-select: none; }
.cr-map-ord { display: block; font-size: 0.8rem; letter-spacing: 0.3em; color: var(--accent); }
.cr-map-name { display: inline-block; font-size: 1.4rem; font-weight: 600; letter-spacing: 0.08em; line-height: 1.5; }
.cr-map-sub { margin-left: 0.9em; font-size: 0.9rem; color: var(--muted); letter-spacing: 0.1em; }
.cr-map-line { position: relative; display: block; margin-top: 0.15rem; font-size: 0.95rem; line-height: 1.8; color: var(--muted); }
.cr-map a:hover .cr-map-name { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.3em; }

/* 上一重 / 下一重 */
.cr-pager { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 4rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.cr-pager a { display: block; text-decoration: none; max-width: 48%; }
.cr-pager-next { margin-left: auto; text-align: right; }
.cr-pager small { display: block; font-size: 0.78rem; letter-spacing: 0.3em; color: var(--accent); }
.cr-pager span { font-size: 1.1rem; letter-spacing: 0.06em; }
.cr-children { margin-top: 3rem; }
.cr-children h2 { margin-top: 0; }

/* 首頁 */
.cr-home .cr-page-head { text-align: center; padding: 2.5rem 0 1rem; }
.cr-home .cr-page-head::before { content: ""; display: block; width: 1px; height: 3.2rem; margin: 0 auto 1.8rem; background: var(--accent); }
.cr-home h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 2.7rem); letter-spacing: 0.18em; text-indent: 0.18em; }
.cr-home .cr-page-head .cr-sub { text-align: center; }
.cr-sub { margin: 1rem 0 0; font-size: 0.92rem; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--muted); }

/* 頁尾 */
.cr-foot { max-width: 46em; margin: 0 auto; padding: 2rem 1.25rem 3rem; border-top: 1px solid var(--rule); text-align: center; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.08em; line-height: 2; }
.cr-foot p { margin: 0; }
.cr-foot-name { color: var(--ink); letter-spacing: 0.16em; }
.cr-foot nav { margin-top: 0.4rem; display: flex; justify-content: center; gap: 1.6em; }
.cr-foot a { text-decoration: none; }
.cr-foot a:hover { text-decoration: underline; }

@media (min-width: 48em) {
  .cr-head { padding-top: 1.6rem; }
  .cr-main { padding-top: 3.5rem; padding-bottom: 6rem; }
  .cr-nav ul { gap: 2.2em; }
  .cr-map { margin: 4.5rem 0 4rem; }
  .cr-map li { padding-left: 3.6rem; padding-bottom: 3.4rem; }
  .cr-map li::before { left: 0.32rem; }
  .cr-map a { padding-right: 6rem; }
  .cr-map-no { font-size: 6.5rem; top: -1.2rem; }
  .cr-map-name { font-size: 1.6rem; }
  .cr-map-line { font-size: 1rem; }
  h2 { margin-top: 3.6rem; }
}
@media (max-width: 30em) {
  .cr-main p, .cr-main li { text-align: left; }
  .cr-ext { padding: 1.1em 1.1em 0.9em; }
  .cr-map-sub { display: block; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .cr-nav, .cr-lang, .cr-pager, .cr-skip { display: none; }
  body { background: #fff; color: #000; }
}
.cr-main ul.cr-check { list-style: none; padding-left: 0.2em; }
.cr-main table { display: block; overflow-x: auto; }
