:root {
  --bg: #050505;
  --bg-soft: rgba(255, 255, 255, 0.03);
  --bg-panel: rgba(8, 10, 18, 0.84);
  --cyan: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.12);
  --gold: #d4af37;
  --gold-dim: rgba(212, 175, 55, 0.12);
  --purple: #a78bfa;
  --red: #f87171;
  --green: #34d399;
  --text: #e5e7eb;
  /* WCAG AA：4.5:1 對 #050505 背景。
     原 #9ca3af 約 6.6:1（OK），#6b7280 約 3.9:1（不及格）。
     將 --text-dim 提到 #8b96a4 約 4.6:1，剛過 AA。 */
  --text-muted: #b1b9c4;
  --text-dim: #8b96a4;
  --border: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 240, 255, 0.25);
  --border-gold: rgba(212, 175, 55, 0.25);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 92px;
  --transition: 0.25s ease;
  --shadow-soft: 0 18px 54px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main,
section,
article,
aside,
header,
footer,
.section-wrap,
.panel,
.card,
.glass-panel {
  min-width: 0;
}

.en-primer {
  display: none;
  width: min(1120px, calc(100% - 32px));
  margin: clamp(32px, 6vw, 72px) auto;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 240, 255, 0.12), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(212, 175, 55, 0.1), transparent 32%),
    rgba(8, 10, 18, 0.78);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.3);
}

body.lang-en .en-primer {
  display: block;
}

.en-primer-kicker {
  margin: 0 0 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(0, 240, 255, 0.72);
}

.en-primer-title {
  margin: 0;
  max-width: 820px;
  font-family: "Cinzel", "Inter", serif;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.12;
  color: rgba(245, 241, 233, 0.96);
}

.en-primer-lead {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.8;
  color: rgba(220, 228, 240, 0.74);
}

.en-primer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.en-primer-card {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.en-primer-card h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 228, 168, 0.92);
}

.en-primer-card p,
.en-primer-card li {
  color: rgba(205, 214, 229, 0.7);
  line-height: 1.74;
}

.en-primer-card p {
  margin: 0;
}

.en-primer-list {
  margin: 0;
  padding-left: 18px;
}

.en-primer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 999px;
}

.font-serif {
  font-family: "Noto Serif SC", "Noto Serif TC", "STSong", serif;
}

.font-cinzel {
  font-family: "Cinzel", "Noto Serif SC", "Noto Serif TC", serif;
}

.text-cyan {
  color: var(--cyan);
}

.text-gold {
  color: var(--gold);
}

.text-dim {
  color: var(--text-dim);
}

.text-muted {
  color: var(--text-muted);
}

.section-wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.stack-24 {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stack-32 {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.page-top {
  padding-top: calc(var(--nav-h) + 54px);
}

.page-bottom {
  padding-bottom: 96px;
}

.page-grid {
  display: grid;
  gap: 24px;
}

.page-grid.two {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.9fr);
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
}

.section-title {
  margin: 0;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.2;
  color: rgba(240, 232, 204, 0.9);
  letter-spacing: 0.1em;
  text-shadow: 0 0 60px rgba(0, 240, 255, 0.08);
}

.section-body {
  margin: 0;
  max-width: 66ch;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.92;
}

.section-intro {
  margin: 0;
  color: rgba(107, 114, 128, 0.75);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.badge-cyan {
  border-color: var(--border-cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.badge-gold {
  border-color: var(--border-gold);
  background: var(--gold-dim);
  color: var(--gold);
}

.badge-gray {
  color: var(--text-muted);
}

.badge-red {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

.badge-green {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
  color: #6ee7b7;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-cyan {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.dot-gold {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all .3s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
  position: relative;
}

.btn:focus-visible,
.nav-lang-btn:focus-visible,
.nav-hamburger:focus-visible,
.mobile-menu-close:focus-visible,
.mobile-nav-item:focus-visible,
.mobile-nav-sub:focus-visible {
  outline: 2px solid rgba(0, 240, 255, 0.45);
  outline-offset: 3px;
}

.btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-primary:hover {
  background: var(--cyan-dim);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.24), 0 0 80px rgba(0, 240, 255, 0.06);
  transform: translateY(-2px);
}

.btn-gold {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-dim);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.2), 0 0 80px rgba(212, 175, 55, 0.06);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 0.72rem;
}

/* Mobile safety net: prevent silent clipping from long labels and narrow cards. */
@media (max-width: 768px) {
  body {
    overflow-wrap: anywhere;
  }

  .section-wrap {
    width: min(100% - 24px, 1280px);
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .page-grid.two,
  .en-primer-grid {
    grid-template-columns: 1fr;
  }

  .section-title,
  .detail-title {
    text-wrap: balance;
  }

  .btn-row {
    width: 100%;
  }

  .btn-row .btn {
    flex: 1 1 min(180px, 100%);
  }

  .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    min-height: 44px;
  }

  .panel-pad,
  .card-pad {
    padding: 18px;
  }

  .en-primer {
    width: min(100% - 24px, 1120px);
    margin: 28px auto;
    padding: 22px;
  }
}

.btn-gold-outline {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-gold-outline:hover {
  background: var(--gold-dim);
}

.panel,
.card,
.glass-panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.panel::before,
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  transition: opacity .4s;
}

.panel {
  background: var(--bg-panel);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.panel:hover {
  border-color: rgba(255, 255, 255, .12);
}

.glass-panel {
  background: rgba(10, 12, 20, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  transition: border-color .35s cubic-bezier(.22,1,.36,1), transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-cyan);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28), 0 0 24px rgba(0, 240, 255, 0.08);
}
.card:hover::before {
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, .15), transparent);
}

.card-gold:hover {
  border-color: var(--border-gold);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.28), 0 0 24px rgba(212, 175, 55, 0.08);
}

.panel-pad,
.card-pad {
  padding: 24px;
}

.page-loader {
  display: none;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-copy {
  text-align: center;
  position: relative;
}

.loader-copy::before,
.loader-copy::after {
  content: "";
  position: absolute;
  left: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.55), transparent);
}
.loader-copy::before {
  top: -28px;
  width: clamp(80px, 18vw, 200px);
  transform: translateX(-50%);
}
.loader-copy::after {
  bottom: -28px;
  width: clamp(60px, 12vw, 140px);
  transform: translateX(-50%);
}

.loader-title {
  font-family: "Cinzel", serif;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1;
  background: linear-gradient(180deg, #f4f1ea 0%, #d4af37 55%, #8a6d2b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(212, 175, 55, .25));
}

.loader-sub {
  margin-top: 16px;
  color: rgba(212, 175, 55, .55);
  font-family: "Noto Serif SC", serif;
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
}

.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100vw;
  max-width: 100vw;
  height: var(--nav-h);
  gap: clamp(18px, 2vw, 34px);
  padding: 0 clamp(22px, 3.2vw, 50px);
  background: rgba(5, 5, 5, 0.86);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.44);
  overflow: visible;
  transform: translateY(0);
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), box-shadow var(--transition);
}

.glass-nav.nav-visible {
  transform: translateY(0);
}

#nav-trigger {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 60px;
  z-index: 51;
}

#nav-indicator {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 2px;
  z-index: 52;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 200, 255, 0.35) 30%, rgba(212, 175, 55, 0.28) 65%, transparent 100%);
  transition: opacity var(--transition);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
  min-width: 0;
}

.nav-logo img {
  width: auto;
  height: 64px;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.38));
  transition: transform var(--transition), filter var(--transition);
}

.nav-logo:hover img {
  transform: scale(1.04);
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.68));
}

.nav-brand-main {
  font-family: "Cinzel", serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #ecdfa3;
  letter-spacing: 0.2em;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.38);
  white-space: nowrap;
}

.nav-brand-main sup {
  font-size: 0.5rem;
  vertical-align: super;
  color: #c9a227;
}

.nav-brand-sub {
  font-family: "Noto Serif SC", "Noto Serif TC", serif;
  font-size: 0.72rem;
  color: rgba(210, 192, 148, 0.6);
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
}

.nav-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.2vw, 38px);
  min-width: 0;
  flex: 1 1 auto;
}

.nav-links {
  position: relative;
  overflow: visible;
  gap: clamp(14px, 1.55vw, 30px);
  flex: 0 1 auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: clamp(0.08em, 0.7vw, 0.16em);
}

.nav-links > a,
.nav-item > a {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a.active {
  color: #fff;
  position: relative;
}

/* 「訂閱」inline 一級項：金色文字微強調，不破壞菜單視覺節奏 */
.nav-links a.nav-link-cta {
  color: rgba(212, 175, 55, 0.92);
}
.nav-links a.nav-link-cta:hover {
  color: rgba(236, 223, 163, 1);
}
.nav-links a.nav-link-cta.active {
  color: #fff;
}

/* 移動端「訂閱」項：同樣金色微強調 */
.mobile-nav-cta {
  color: rgba(212, 175, 55, 0.92) !important;
}
.mobile-nav-cta:hover {
  color: rgba(236, 223, 163, 1) !important;
}

/* Active 下劃線 ——
   兩個選擇器分支必須同時存在，否則「激活帶下拉的菜單項」（傳承者 / 拓撲引擎 /
   實驗室 / 日用）會缺失金色下劃線，與「激活直接子鏈接」（首頁 / 手記 / 聯絡）
   形成全站視覺不一致。
   此前長期只寫 `.nav-links > a.active::after`，導致書院 / 行旅 / 訂閱 等
   16 個頁面導航條看起來「比首頁缺一道線」—— 正是用戶反覆反饋
   「導航條與首頁不一致」的真正根因。
   2026-05-03 補上 `.nav-item > a.active::after` 分支徹底解決。 */
.nav-links > a.active::after,
.nav-item > a.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  opacity: 0.7;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  z-index: 1;
}

/* Hover bridge — invisible 8px strip just below the nav-item that keeps
   :hover active while the cursor crosses from the link to the dropdown.
   Without it, sub-pixel rounding or animation timing can flicker hover off.
   IMPORTANT: bridge is `pointer-events:none` by default; only activates while
   the cursor is already inside the nav. Otherwise on pages where the nav is
   translated off-screen (e.g. zixi immersive mode), the bridge would silently
   capture hovers on the top 8px of viewport and accidentally pop dropdowns. */
.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
  pointer-events: none;
}
#main-nav:hover .nav-item::after,
#main-nav:focus-within .nav-item::after {
  pointer-events: auto;
}

.dropdown {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: 112px;
  max-width: min(240px, calc(100vw - 32px));
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 6px 0;
  background: rgba(4, 5, 12, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid rgba(212, 175, 55, 0.55);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.88);
  z-index: 60;
}

.nav-item:hover,
.nav-item:focus-within {
  z-index: 2;
}

.nav-item:hover .dropdown {
  display: flex;
  flex-direction: column;
  animation: dropdown-in 0.18s ease forwards;
}

.nav-item:focus-within .dropdown {
  display: flex;
  flex-direction: column;
  animation: dropdown-in 0.18s ease forwards;
}

@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dropdown a {
  display: block;
  padding: 9px 18px;
  color: rgba(156, 163, 175, 0.9);
  font-size: 0.69rem;
  letter-spacing: 0.09em;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  transition: color 0.18s ease, background 0.18s ease;
}

.dropdown a:hover {
  color: rgba(236, 223, 163, 0.95);
  background: rgba(212, 175, 55, 0.06);
}

.nav-actions {
  gap: clamp(8px, 1vw, 14px);
  padding-left: clamp(12px, 1.4vw, 24px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.nav-cta {
  padding: 7px 16px;
  border: 1px solid rgba(212, 175, 55, 0.65);
  border-radius: var(--radius-sm);
  color: rgba(212, 175, 55, 0.9);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-cta:hover {
  color: #fff;
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.nav-login {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.nav-login:hover {
  color: #fff;
}

.nav-lang-btn,
.nav-hamburger,
.mobile-menu-close {
  border: 0;
  background: transparent;
}

.nav-lang-btn {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.nav-lang-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.36);
}

.nav-hamburger {
  display: none;
  color: var(--cyan);
  font-size: 1.5rem;
  line-height: 1;
}

#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 96px 28px 40px;
  background: rgba(4, 4, 10, 0.98);
  backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  color: rgba(156, 163, 175, 0.6);
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.mobile-menu-close:hover {
  color: #fff;
}

.mobile-nav-item {
  display: block;
  padding: 4px 0;
  font-size: 1rem;
  color: rgba(209, 213, 219, 0.88);
  letter-spacing: 0.05em;
  line-height: 1.45;
  transition: color var(--transition);
}

.mobile-nav-item:hover {
  color: #fff;
}

.mobile-nav-item.active {
  color: #fff;
  border-left: 2px solid rgba(212, 175, 55, 0.7);
  padding-left: 12px;
}

.mobile-nav-sub {
  display: block;
  padding-left: 18px;
  color: rgba(107, 114, 128, 0.75);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
  transition: color var(--transition);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-sub:hover {
  color: rgba(212, 175, 55, 0.85);
}

.mobile-nav-sub.active {
  color: rgba(236, 223, 163, 0.95);
  border-left-color: rgba(212, 175, 55, 0.68);
}

.site-footer {
  margin-top: 96px;
  padding: 60px 0 32px;
  border-top: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.72));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr .9fr .9fr .9fr .9fr;
  gap: 36px 28px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: url("../images/logo.png") center / contain no-repeat;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.28));
}

.footer-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-brand-title {
  font-family: "Cinzel", serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(236, 223, 163, 0.85);
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.footer-brand-sub {
  font-family: "Noto Serif SC", "Noto Serif TC", serif;
  font-size: 0.7rem;
  color: rgba(210, 192, 148, 0.5);
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.footer-brand-desc {
  margin-top: 4px;
  max-width: 30ch;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.85;
}

/* 生態 · 行內鏈接（合併到品牌欄之下） */
.footer-brand-eco {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-family: "Noto Serif SC", serif;
  font-size: 0.78rem;
}
.footer-brand-eco a {
  position: relative;
  color: rgba(212, 175, 55, 0.56);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 2px 0;
  transition: color 0.24s, transform 0.24s;
}
.footer-brand-eco a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.48), rgba(212, 175, 55, 0.1));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s;
}
.footer-brand-eco a:hover {
  color: var(--gold, #d4af37);
  transform: translateY(-1px);
}
.footer-brand-eco a:hover::after {
  transform: scaleX(1);
}

.footer-brand p {
  max-width: 30ch;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.85;
}

.footer-title {
  margin: 0 0 14px;
  color: rgba(107, 114, 128, 0.7);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col h4 {
  margin: 0 0 6px;
  color: rgba(107, 114, 128, 0.7);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.footer-col a,
.footer-bottom a {
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: color var(--transition);
}

.footer-col a:hover,
.footer-bottom a:hover {
  color: rgba(236, 223, 163, 0.85);
}

.footer-bottom {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-bottom p {
  margin: 0;
  color: rgba(107, 114, 128, 0.6);
  font-size: 0.71rem;
}

/* ══════════════════════════════════════════════════════════
   TIER 2 · DAILY EPHEMERIS + COLOPHON
   站內底部的「活脈搏」— 每 30 秒刷新
══════════════════════════════════════════════════════════ */
.footer-ephemeris {
  margin-top: 36px;
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(212, 175, 55, .015), transparent);
  font-family: "JetBrains Mono", monospace;
  font-size: .58rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(160, 175, 200, .52);
  transition: background .5s ease;
}
.footer-ephemeris:hover {
  background: linear-gradient(180deg, rgba(212, 175, 55, .035), transparent);
}

.fe-dot {
  width: 6px; height: 6px;
  background: var(--gold, #d4af37);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(212, 175, 55, .55);
  animation: fePulse 3.2s ease-in-out infinite;
  position: relative;
  top: -1px;
}
@keyframes fePulse {
  0%, 100% { opacity: .5; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.2); }
}

.fe-sep {
  color: rgba(160, 175, 200, .18);
  letter-spacing: 0;
}

.fe-date {
  font-family: "Cinzel", serif;
  font-size: .72rem;
  letter-spacing: .28em;
  color: rgba(212, 175, 55, .68);
  font-weight: 500;
}

.fe-term {
  font-family: "Noto Serif SC", serif;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: none;
  color: rgba(244, 228, 168, .82);
  font-weight: 500;
}

.fe-moon {
  font-family: "Cinzel", serif;
  font-size: .7rem;
  letter-spacing: .16em;
  color: rgba(180, 195, 215, .6);
}

.fe-time {
  color: rgba(160, 175, 200, .48);
}

/* Colophon · 發行銘文 */
.footer-colophon {
  padding: 10px 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: .54rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(130, 145, 165, .36);
}
.fc-issue {
  font-family: "Cinzel", serif;
  color: rgba(212, 175, 55, .48);
  letter-spacing: .32em;
  font-size: .6rem;
  font-weight: 500;
}
.fc-craft {
  color: rgba(140, 155, 175, .4);
  text-transform: none;
  letter-spacing: .08em;
  font-family: "Noto Serif SC", serif;
  font-size: .7rem;
  font-weight: 300;
  flex: 1;
  text-align: center;
  min-width: 260px;
}
.fc-ink {
  font-family: "Cinzel", serif;
  color: rgba(130, 145, 165, .42);
  letter-spacing: .26em;
  font-size: .58rem;
}

@media (max-width: 720px) {
  .footer-ephemeris {
    gap: 8px 10px;
    padding: 14px 12px;
    font-size: .5rem;
    letter-spacing: .16em;
  }
  .fe-date, .fe-moon { font-size: .62rem; letter-spacing: .2em; }
  .fe-term { font-size: .74rem; }
  .fe-sep { display: none; }
  .footer-colophon {
    justify-content: center;
    text-align: center;
    gap: 6px;
  }
  .fc-craft { min-width: 0; font-size: .64rem; }
}

.footer-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════
   ICP & 公網安備（中華人民共和國工信部 / 公安部要求）
   每頁頁尾必須出現，置於 .footer-bottom 之下作為獨立一行
   ══════════════════════════════════════════════════════════ */
.footer-beian {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  font-family: "JetBrains Mono", "Inter", "Noto Sans SC", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: rgba(107, 114, 128, 0.55);
}
.footer-beian .fb-link {
  color: rgba(170, 180, 195, 0.62);
  text-decoration: none;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.footer-beian .fb-link:hover {
  color: rgba(212, 175, 55, 0.92);
}
.footer-beian .fb-shield {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.footer-beian .fb-link:hover .fb-shield { opacity: 1; }
.footer-beian .fb-sep {
  color: rgba(107, 114, 128, 0.35);
}
@media (max-width: 720px) {
  .footer-beian {
    gap: 4px 10px;
    font-size: 0.62rem;
    text-align: center;
  }
  .footer-beian .fb-sep { display: none; }
}

#cosmos-bg,
#cosmos-stars-a,
#cosmos-stars-b,
#starry-overlay,
#earth-horizon {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#cosmos-bg {
  z-index: -5;
  background:
    radial-gradient(120% 84% at 50% 15%, rgba(74, 112, 210, 0.38), transparent 52%),
    radial-gradient(92% 58% at 50% 46%, rgba(156, 96, 210, 0.28), transparent 64%),
    linear-gradient(to bottom, #040814 0%, #04050b 45%, #020206 100%);
}

#cosmos-stars-a,
#cosmos-stars-b {
  inset: -6%;
  transform-origin: center;
  mix-blend-mode: screen;
}

#cosmos-stars-a {
  z-index: -4;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgba(216, 232, 255, 0.44) 0.7px, transparent 1.35px),
    radial-gradient(circle, rgba(152, 192, 255, 0.25) 0.8px, transparent 1.6px);
  background-size: 220px 220px, 330px 330px;
  background-position: 0 0, 110px 140px;
  animation: sky-drift-a 180s linear infinite;
}

#cosmos-stars-b {
  z-index: -3;
  opacity: 0.2;
  background-image:
    radial-gradient(circle, rgba(216, 184, 255, 0.2) 0.75px, transparent 1.5px),
    radial-gradient(circle, rgba(180, 212, 255, 0.17) 0.65px, transparent 1.35px);
  background-size: 260px 260px, 380px 380px;
  background-position: 50px 90px, 170px 60px;
  animation: sky-drift-b 260s linear infinite;
}

#starry-overlay {
  z-index: -2;
  background:
    radial-gradient(circle at 50% 28%, rgba(112, 146, 255, 0.13), transparent 44%),
    radial-gradient(circle at 50% 66%, rgba(176, 124, 245, 0.11), transparent 50%),
    linear-gradient(to bottom, rgba(3, 6, 18, 0.5), rgba(1, 1, 6, 0.85));
}

#earth-horizon {
  top: auto;
  height: 28vh;
  z-index: -1;
  background:
    radial-gradient(130% 85% at 50% 120%, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.72) 52%, transparent 72%),
    linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.24) 42%, transparent 80%);
}

#earth-horizon::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(140, 195, 255, 0.24), transparent);
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: 40px;
  min-height: calc(100vh - 120px);
  padding-bottom: 80px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-kicker {
  color: var(--cyan);
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--gold);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 60ch;
  color: var(--text-muted);
  line-height: 1.95;
}

.hero-visual {
  position: relative;
  min-height: 540px;
}

.signal-orbit {
  position: absolute;
  inset: 12% 10% auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.18);
  box-shadow: inset 0 0 60px rgba(0, 240, 255, 0.05), 0 0 80px rgba(0, 0, 0, 0.4);
}

.signal-orbit::before,
.signal-orbit::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.signal-orbit::after {
  inset: 20%;
  border-color: rgba(255, 255, 255, 0.08);
}

.signal-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.45), rgba(0, 240, 255, 0.08) 55%, transparent 72%);
  box-shadow: 0 0 80px rgba(212, 175, 55, 0.18);
}

.signal-card {
  position: absolute;
  padding: 16px 18px;
  min-width: 180px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(8, 10, 18, 0.82);
  box-shadow: var(--shadow-soft);
}

.signal-card small {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.signal-card strong {
  display: block;
  font-family: "Cinzel", serif;
  color: #fff;
  font-size: 1rem;
}

.signal-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.7;
}

.signal-card.a {
  top: 6%;
  right: 4%;
}

.signal-card.b {
  bottom: 24%;
  left: 0;
}

.signal-card.c {
  right: 8%;
  bottom: 0;
}

.logic-grid,
.path-grid,
.case-grid,
.list-grid,
.stat-grid {
  display: grid;
  gap: 20px;
}

.logic-grid,
.path-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.case-grid,
.list-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logic-item,
.path-card,
.case-card,
.list-card,
.stat-card {
  padding: 22px;
}

.logic-item h3,
.path-card h3,
.case-card h3,
.list-card h3,
.sidebar-title,
.block-title {
  margin: 0;
  font-family: "Noto Serif SC", "Noto Serif TC", serif;
  color: #fff;
  line-height: 1.55;
}

.logic-item p,
.path-card p,
.case-card p,
.list-card p,
.sidebar-copy,
.block-copy {
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.88rem;
}

.logic-item small,
.path-card small,
.case-card small,
.list-meta,
.sidebar-label,
.block-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
}

.list-hero,
.page-hero {
  padding-bottom: 40px;
  text-align: center;
}

.filter-bar,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.filter-btn,
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.filter-btn.active,
.filter-btn:hover,
.chip.active {
  color: var(--cyan);
  border-color: var(--border-cyan);
  background: var(--cyan-dim);
}

.search-wrap {
  max-width: 460px;
  margin: 0 auto 26px;
}

.search-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px 16px;
  outline: none;
}

.search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.list-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.list-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.list-card-excerpt {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.82;
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.featured-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: 28px;
}

.featured-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.18));
}

.featured-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.status-box,
.empty-state {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

.detail-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 34px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.76rem;
}

.breadcrumb a:hover {
  color: #fff;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-title {
  margin: 0;
  font-family: "Cinzel", "Noto Serif SC", "Noto Serif TC", serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.15;
  color: #fff;
}

.detail-excerpt {
  margin: 0;
  max-width: 70ch;
  color: var(--text-muted);
  line-height: 1.9;
}

.prose {
  color: rgba(229, 231, 235, 0.9);
  line-height: 1.95;
  font-size: 1rem;
  font-family: "Noto Serif SC", "Noto Serif TC", serif;
}

.prose h2,
.prose h3 {
  margin: 2em 0 0.8em;
  color: #fff;
  font-family: "Cinzel", "Noto Serif SC", "Noto Serif TC", serif;
  line-height: 1.35;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.12rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 1.1em 0;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
}

.prose blockquote {
  padding: 0.9em 1.2em;
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(0, 240, 255, 0.05);
  color: var(--text-muted);
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.info-list,
.toc-list,
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.info-row strong {
  color: #fff;
}

.attachment-link,
.toc-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.attachment-link:hover,
.toc-link:hover {
  color: #fff;
  border-color: var(--border-cyan);
}

.comment-box {
  padding: 20px;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.comment-body {
  color: var(--text-muted);
  line-height: 1.82;
  font-size: 0.86rem;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.helper-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.inline-note {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.7;
}

.placeholder-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
}

.placeholder-card {
  width: min(760px, 100%);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap > table {
  min-width: 640px;
}

pre,
code {
  max-width: 100%;
}

pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.data-table th {
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.toast-wrap {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 0.82rem;
}

.toast-info {
  color: var(--cyan);
  background: rgba(6, 10, 24, 0.92);
  border-color: var(--border-cyan);
}

.toast-success {
  color: #6ee7b7;
  background: rgba(6, 24, 16, 0.92);
  border-color: rgba(52, 211, 153, 0.3);
}

.toast-error {
  color: #fca5a5;
  background: rgba(24, 6, 10, 0.92);
  border-color: rgba(248, 113, 113, 0.28);
}

/* ── Scroll Reveal ── */
.rv {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1), transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.rv.show {
  opacity: 1;
  transform: none;
}

.rv.d1 { transition-delay: 0.08s; }
.rv.d2 { transition-delay: 0.18s; }
.rv.d3 { transition-delay: 0.28s; }
.rv.d4 { transition-delay: 0.38s; }
.rv.d5 { transition-delay: 0.48s; }

/* ── Form fields ── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* ── Loader variants ── */
.loader-text {
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  color: var(--cyan);
  letter-spacing: 0.45em;
}

/* ── Pulse animation ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ── mb-4 utility (for Tailwind-less pages) ── */
.mb-4 {
  margin-bottom: 1rem;
}

@keyframes sky-drift-a {
  from {
    transform: rotate(0deg) scale(1.08);
  }
  to {
    transform: rotate(360deg) scale(1.08);
  }
}

@keyframes sky-drift-b {
  from {
    transform: rotate(0deg) scale(1.12);
  }
  to {
    transform: rotate(-360deg) scale(1.12);
  }
}

@media (max-width: 1100px) {
  .hero-home,
  .page-grid.two,
  .grid-4,
  .logic-grid,
  .path-grid,
  .case-grid,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-home {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .nav-cluster {
    gap: 16px;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: inline-flex;
  }

  .glass-nav {
    transform: translateY(0);
  }

  #nav-trigger,
  #nav-indicator {
    display: none;
  }

  .hero-home,
  .featured-strip,
  .grid-2,
  .grid-3,
  .page-grid.two {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: span 2;
  }
}

@media (max-width: 1120px) {
  .glass-nav {
    padding: 0 clamp(16px, 2.2vw, 28px);
  }

  .nav-logo {
    gap: 11px;
  }

  .nav-logo img {
    height: 56px;
  }

  .nav-brand-main {
    font-size: 1rem;
    letter-spacing: 0.16em;
  }

  .nav-brand-sub {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
  }

  .nav-links {
    gap: clamp(11px, 1.15vw, 18px);
    font-size: 0.72rem;
  }

  .nav-cta {
    padding: 6px 12px;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 980px) {
  .nav-brand-sub,
  .nav-cta {
    display: none;
  }

  .nav-actions {
    padding-left: 12px;
  }
}

@media (max-width: 940px) {
  .nav-links {
    display: none;
  }

  /* 觸控可達性：漢堡按鈕從 769px 起就可見，必須在這個區段保證 ≥44×44 命中區，
     避免平板豎屏 / 可分屏手機 (769–940px) 區間誤觸。 */
  .nav-hamburger,
  .nav-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .glass-nav {
    transform: translateY(0);
  }

  #nav-trigger,
  #nav-indicator {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-actions {
    gap: 8px;
    padding-left: 10px;
  }

  .nav-login {
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .nav-lang-btn,
  .nav-hamburger {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #mobile-menu {
    gap: 14px;
    padding: calc(var(--nav-h) + 22px) 22px 34px;
  }

  /* WCAG 2.5.5 推薦觸控目標 ≥44×44px。原 34px 會在窄屏連續列表上易誤觸。 */
  .mobile-nav-item,
  .mobile-nav-sub {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 74px;
  }

  .glass-nav {
    padding: 0 14px;
  }

  .nav-brand-sub,
  .nav-cta {
    display: none;
  }

  .nav-logo img {
    height: 46px;
  }

  .nav-brand-main {
    font-size: 0.92rem;
    letter-spacing: 0.1em;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-login {
    max-width: 5.5rem;
    font-size: 0.68rem;
  }

  .section-wrap {
    width: min(100% - 24px, 1280px);
  }

  .section-title,
  .detail-title {
    font-size: clamp(1.6rem, 8vw, 2.3rem);
  }

  .btn-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .logic-grid,
  .path-grid,
  .case-grid,
  .grid-4,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .helper-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-input,
  .form-select,
  .form-textarea {
    min-width: 0;
    width: 100%;
  }

  .toast-wrap {
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* ── 文章卡片 ──────────────────────────────────────────── */
.article-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  text-decoration: none;
}
.article-card:hover {
  border-color: rgba(0,240,255,.25);
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35), 0 0 30px rgba(0, 240, 255, .06);
}
.article-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #070a16;
  position: relative;
  overflow: hidden;
}
.article-card-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.article-card-cat {
  font-size: .66rem;
  letter-spacing: .2em;
  color: var(--cyan);
  text-transform: uppercase;
}
.article-card-date { font-size: .72rem; color: var(--text-dim); }
.article-card-title {
  font-family: "Noto Serif SC", "Noto Serif TC", serif;
  font-size: 1rem;
  color: #fff;
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-excerpt {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.04);
  margin-top: auto;
}
.article-card-author { font-size: .72rem; color: var(--text-dim); }
.article-card-read  { font-size: .72rem; color: var(--cyan); }

/* ── 分頁 ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.page-btn {
  /* 桌面 36px、移動 44px：在 ≤768px 時自動放大到觸控可達區（見下方 media 規則） */
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: all var(--transition);
  padding: 0 10px;
  cursor: pointer;
}
.page-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.page-btn.active { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.page-btn:disabled { opacity: .35; pointer-events: none; }

/* ── 麵包屑 ─────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--text-dim); }
.breadcrumb a { transition: color var(--transition); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: rgba(255, 255, 255, .2); }

/* ── Section reveal on scroll (award-level micro-animation) ── */
.section-wrap.will-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.section-wrap.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
.section-wrap.will-reveal:nth-child(2) { transition-delay: .06s; }
.section-wrap.will-reveal:nth-child(3) { transition-delay: .12s; }
.section-wrap.will-reveal:nth-child(4) { transition-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Issue Imprint · 期號刻印 (cross-site consistency for Tier-B pages) ── */
.ct-imprint {
  position: relative;
  z-index: 20;
  max-width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 13px 16px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: .56rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(160, 175, 200, .44);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  background: linear-gradient(180deg, rgba(8,10,16,.55), transparent);
}
.ct-imprint-dot {
  width: 6px; height: 6px;
  background: #d4af37;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(212, 175, 55, .55);
  animation: ct-imprint-blink 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes ct-imprint-blink {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1;   }
}
.ct-imprint-sep {
  color: rgba(160, 175, 200, .22);
}
.ct-imprint-issue {
  color: rgba(212, 175, 55, .78);
  letter-spacing: .22em;
  font-family: "Cinzel", serif;
  font-weight: 500;
  text-transform: none;
  font-size: .74rem;
}
.ct-imprint-chapter {
  margin-left: auto;
  color: rgba(180, 195, 215, .55);
  font-weight: 500;
}
.ct-imprint-chapter em {
  font-style: normal;
  color: rgba(212, 175, 55, .7);
  padding: 0 6px;
}
@media (max-width: 720px) {
  .ct-imprint {
    font-size: .5rem;
    gap: 10px;
    padding: 10px 16px;
  }
  .ct-imprint-issue { font-size: .66rem; }
  .ct-imprint-chapter {
    margin-left: 0;
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────
   Imprint-aware top spacing (cross-page safety net)
   .ct-imprint already sits in document flow above <main>, providing
   natural clearance from the fixed nav. The first hero/section inside
   <main> therefore must NOT reserve another `var(--nav-h)` of padding,
   otherwise an empty band ≈ nav height appears between imprint and title.

   Specificity (0,2,3) wins over per-page inline `.xx-hero{padding:…}`
   (0,1,0). Per-page CSS still removes the redundant `var(--nav-h) +`
   as a defensive fallback for environments without :has() support.
   ───────────────────────────────────────────────────────────── */
/* iOS Safari 14 / 老 WebKit 不支持 :has()。site-shell.js 在 DOMContentLoaded 後會
   給 <body> 加上 `.has-imprint`，這條 fallback 規則用類選擇器確保老瀏覽器也生效。 */
body.has-imprint main > section:first-child,
body.has-imprint main > header:first-child,
body.has-imprint main > section:first-child > header:first-child,
body.has-imprint main > div:first-child > section:first-child,
body.has-imprint main > div:first-child > header:first-child,
body:has(> .ct-imprint) main > section:first-child,
body:has(> .ct-imprint) main > header:first-child,
body:has(> .ct-imprint) main > section:first-child > header:first-child,
body:has(> .ct-imprint) main > div:first-child > section:first-child,
body:has(> .ct-imprint) main > div:first-child > header:first-child {
  padding-top: clamp(28px, 4vh, 56px);
}
@media (max-width: 720px) {
  body.has-imprint main > section:first-child,
  body.has-imprint main > header:first-child,
  body.has-imprint main > div:first-child > section:first-child,
  body.has-imprint main > div:first-child > header:first-child,
  body:has(> .ct-imprint) main > section:first-child,
  body:has(> .ct-imprint) main > header:first-child,
  body:has(> .ct-imprint) main > div:first-child > section:first-child,
  body:has(> .ct-imprint) main > div:first-child > header:first-child {
    padding-top: clamp(20px, 3vh, 40px);
  }
}

/* Skip-to-main 無障礙鏈接（鍵盤/讀屏用戶可跳過頂栏直達主內容）。
   默認 visually-hidden，鍵盤焦點時顯示為左上角浮動按鈕。 */
.skip-to-main {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-to-main:focus,
.skip-to-main:focus-visible {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--bg, #050505);
  color: var(--gold, #d4af37);
  border: 1px solid var(--gold, #d4af37);
  border-radius: 6px;
  font-size: 0.85rem;
  text-decoration: none;
  outline: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ≤768px 觸控目標統一加大：分頁按鈕、icon-only 按鈕等 */
@media (max-width: 768px) {
  .page-btn { min-width: 44px; height: 44px; }
}

/* Corner seal · 右下角金色封印（fixed position） */
.ct-seal {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  width: 64px; height: 64px;
  pointer-events: none;
  opacity: .72;
  transition: opacity .35s ease, transform .45s ease;
  animation: ct-seal-spin 90s linear infinite;
}
.ct-seal:hover { opacity: 1; }
@keyframes ct-seal-spin { to { transform: rotate(360deg); } }
.ct-seal svg { width: 100%; height: 100%; display: block; }
@media (max-width: 720px) {
  .ct-seal { width: 48px; height: 48px; bottom: 14px; right: 14px; opacity: .55; }
}

/* ══════════════════════════════════════════════════════════
   TIER 1 · SCROLL REVEAL · FOCUS · PRINT
══════════════════════════════════════════════════════════ */

/* ── Reveal on scroll — animation-based (avoids conflict with page-level transitions) ── */
@keyframes siteRevealUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes siteRevealFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes siteRevealLeft {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes siteRevealRight {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Initial hidden state — ONLY for below-the-fold elements.
   Above-the-fold masthead containers (.mast-letter, .mast-panel, .drift-main,
   .drift-orbit, .lex-toc) are EXCLUDED — they need to be visible immediately
   even if site.css loads asynchronously.
   Pure fade animation (no transform lock), so hover transforms remain free. */
.ed-vol, .lex-entry, .log-entry,
.pa-art, .pa-sign, .chapter, .ed-section,
.desk-drawer, .desk-card,
.story-card, .front-brief, .feed-card,
.lex-chapter, .lex-colophon {
  opacity: 0;
  will-change: opacity;
}
.ed-vol.is-revealed, .lex-entry.is-revealed, .log-entry.is-revealed,
.pa-art.is-revealed, .pa-sign.is-revealed, .chapter.is-revealed, .ed-section.is-revealed,
.desk-drawer.is-revealed, .desk-card.is-revealed,
.story-card.is-revealed, .front-brief.is-revealed, .feed-card.is-revealed,
.lex-chapter.is-revealed, .lex-colophon.is-revealed {
  animation: siteRevealFade .85s cubic-bezier(.22,1,.36,1) both;
  will-change: auto;
}

/* [data-reveal] is explicit opt-in — supports directional movement */
[data-reveal] {
  opacity: 0;
  will-change: opacity, transform;
}
[data-reveal].is-revealed {
  animation: siteRevealUp .85s cubic-bezier(.22,1,.36,1) both;
  will-change: auto;
}
[data-reveal="fade"].is-revealed { animation-name: siteRevealFade; }
[data-reveal="left"].is-revealed { animation-name: siteRevealLeft; }
[data-reveal="right"].is-revealed { animation-name: siteRevealRight; }

/* Staggered delays (overrides the delay portion of the shorthand above) */
[data-reveal-delay="1"].is-revealed,
.is-revealed[data-reveal-delay="1"] { animation-delay: .08s; }
[data-reveal-delay="2"].is-revealed { animation-delay: .16s; }
[data-reveal-delay="3"].is-revealed { animation-delay: .24s; }
[data-reveal-delay="4"].is-revealed { animation-delay: .32s; }
[data-reveal-delay="5"].is-revealed { animation-delay: .4s; }
[data-reveal-delay="6"].is-revealed { animation-delay: .48s; }

/* ── Focus-visible states (keyboard accessibility) ── */
*:focus {
  outline: none;
}
*:focus-visible {
  outline: 1px solid var(--gold, #d4af37);
  outline-offset: 3px;
  border-radius: 2px;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline-offset: 4px;
  box-shadow:
    0 0 0 2px rgba(12, 14, 22, .9),
    0 0 0 3px rgba(212, 175, 55, .55);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* Respect user preference */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  .ed-vol, .lex-entry, .log-entry,
  .pa-art, .pa-sign, .chapter, .ed-section,
  .desk-drawer, .desk-card,
  .story-card, .front-brief, .feed-card,
  .letter, .gate-card, .key-card,
  .lex-chapter, .lex-colophon {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   PRINT STYLESHEET · 列印樣式
   讓編輯式內容可作為正式文書列印
══════════════════════════════════════════════════════════ */
@media print {
  /* Reset stage */
  :root {
    --bg: #fff !important;
    --text: #111 !important;
    --text-muted: #333 !important;
    --text-dim: #555 !important;
  }
  html, body {
    background: #fff !important;
    color: #111 !important;
  }

  /* Hide everything not suitable for print */
  #cosmos-bg,
  #cosmos-stars-a,
  #cosmos-stars-b,
  #starry-overlay,
  #earth-horizon,
  #page-loader,
  .page-loader,
  #site-header,
  .glass-nav,
  #nav-trigger,
  #nav-indicator,
  #mobile-menu,
  .toast-wrap,
  .ct-seal,
  .rp-rail,
  video,
  .hero-visual canvas,
  .sb-ticker,
  .ed-ticker,
  .obs-nav,
  .arc-nav,
  .desk-bell-form,
  .hp-search,
  .ab-hero canvas,
  iframe,
  .btn-row,
  .cta-row,
  button,
  .gate-btn,
  .key-btn,
  .letter-btn,
  .chapter-more-btn,
  .drift-actions,
  .mast-live-list,
  nav.obs-nav,
  .form-field,
  form,
  [data-skip-print="true"] {
    display: none !important;
  }

  /* Typography for print — black ink on white */
  body,
  main,
  article,
  section {
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
  }

  * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  h1, h2, h3, h4, h5, h6,
  .mast-title, .spread-title, .chapter-title,
  .ed-mast-title, .ed-sec-title,
  .lex-mast-title, .lex-ch-name, .lex-entry-term,
  .desk-mast-title, .desk-sec-title,
  .pa-mast-title, .pa-art-title, .pa-art-title-cn,
  .log-mast-title, .log-entry-title,
  .art-detail-title,
  .art-prose h2, .art-prose h3 {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    -webkit-text-stroke: 0 !important;
    background: none !important;
    background-clip: initial !important;
    page-break-after: avoid;
  }

  p, li, .art-prose p, .art-prose li,
  .mast-letter-body, .pa-art-intro, .lex-entry-def,
  .desk-mast-desc, .log-mast-desc, .ed-mast-intro,
  .story-excerpt, .feed-excerpt, .art-detail-excerpt {
    color: #222 !important;
    orphans: 3;
    widows: 3;
  }

  /* Drop ornamental borders / gradients */
  .mast-panel, .chapter, .ed-vol, .lex-entry, .pa-art, .log-entry,
  .desk-drawer, .desk-card, .story-card, .feed-card, .front-brief,
  .letter, .gate-card, .key-card,
  .ed-order-card, .pa-sign, .lex-colophon {
    background: #fff !important;
    border-color: #ccc !important;
    page-break-inside: avoid;
  }

  /* Links show URL after */
  a[href^="http"]::after,
  a[href^="/"]::after,
  a[href^="."]::after {
    content: " (" attr(href) ")";
    font-family: "JetBrains Mono", monospace;
    font-size: .75em;
    color: #666;
  }
  a[href^="#"]::after,
  a[href^="mailto:"]::after {
    content: "";
  }

  /* Imprint in print: show but minimal */
  .ct-imprint {
    border: none !important;
    border-bottom: 1px solid #000 !important;
    padding: 10px 0 !important;
    margin-bottom: 16px !important;
    color: #000 !important;
  }
  .ct-imprint-dot { display: none !important; }
  .ct-imprint *, .ct-imprint-sep { color: #000 !important; }

  /* Body padding reset for print */
  main {
    padding: 0 !important;
    margin: 0 !important;
  }
  .section-wrap,
  .mast-wrap, .ed-section-wrap, .spread-wrap, .chapter-wrap,
  .lex-page, .desk-page, .pa-page, .log-page {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Page breaks */
  .chapter,
  .ed-section,
  .lex-chapter,
  .log-entry,
  .pa-art {
    page-break-inside: avoid;
  }
  .art-detail-banner {
    page-break-after: avoid;
    padding: 0 0 16px 0 !important;
    border-bottom: 1px solid #000 !important;
  }

  /* Page number footer */
  @page {
    margin: 18mm 14mm 22mm 14mm;
    size: A4;
  }

  /* Preserve the site footer as a minimal colophon */
  #site-footer {
    border-top: 1px solid #000 !important;
    margin-top: 24pt !important;
    padding-top: 10pt !important;
    font-size: 9pt !important;
    color: #444 !important;
  }
  #site-footer .footer-grid { display: none !important; }
  #site-footer .footer-bottom { color: #444 !important; }
  #site-footer .footer-beian,
  #site-footer .footer-beian .fb-link { color: #555 !important; }
  #site-footer .footer-beian .fb-shield path { stroke: #555 !important; }
}

/* ══════════════════════════════════════════════════════════
   智慧財產權聲明 · INTELLECTUAL PROPERTY NOTICE
   ─────────────────────────────────────────────────────────
   用於含核心算法 / 專屬資料集的頁面（taixua / zixi / market 等）。
   置於 main 結束、site-footer 之前；視覺低調但醒目，
   字體與品牌金色體系一致。
   ══════════════════════════════════════════════════════════ */
.cai-ip-notice{
  position:relative;
  max-width:1100px;
  margin:48px auto;
  padding:18px 24px;
  display:flex;gap:16px;align-items:flex-start;
  background:linear-gradient(180deg,rgba(20,16,10,.55),rgba(8,6,4,.7));
  border:1px solid rgba(212,175,55,.22);
  border-left:3px solid rgba(212,175,55,.55);
  border-radius:2px;
  font-family:"Noto Serif SC","PingFang SC",serif;
  z-index:1;
}
.cai-ip-notice::before,
.cai-ip-notice::after{
  content:"";position:absolute;width:10px;height:10px;
  border:1px solid rgba(212,175,55,.4);
  pointer-events:none;
}
.cai-ip-notice::before{top:6px;right:6px;border-left:none;border-bottom:none}
.cai-ip-notice::after{bottom:6px;right:6px;border-left:none;border-top:none}
.cai-ip-notice-mark{
  flex-shrink:0;width:32px;height:32px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid rgba(212,175,55,.45);border-radius:50%;
  font-family:"Cinzel",serif;font-size:.95rem;font-weight:600;
  color:rgba(244,228,168,.92);
  margin-top:2px;
}
.cai-ip-notice-body{flex:1;min-width:0}
.cai-ip-notice-title{
  display:block;margin-bottom:6px;
  font-family:"Cinzel","Noto Serif SC",serif;font-weight:500;
  font-size:.6rem;letter-spacing:.32em;text-transform:uppercase;
  color:rgba(244,228,168,.85);
}
.cai-ip-notice-text{
  margin:0;font-size:.78rem;line-height:1.85;
  color:rgba(220,210,180,.7);font-weight:300;
  letter-spacing:.02em;
}
.cai-ip-notice-text strong{
  color:rgba(244,228,168,.95);font-weight:500;
}
@media(max-width:560px){
  .cai-ip-notice{margin:32px 16px;padding:16px;flex-direction:column;gap:10px}
  .cai-ip-notice-text{font-size:.74rem}
}
@media print{
  .cai-ip-notice{
    background:#fff !important;border-color:#000 !important;
    color:#000 !important;page-break-inside:avoid;
  }
  .cai-ip-notice-mark{border-color:#000 !important;color:#000 !important}
  .cai-ip-notice-title,
  .cai-ip-notice-text,
  .cai-ip-notice-text strong{color:#000 !important}
}

/* ══════════════════════════════════════════════════════════
   生活注腳 · LIFE BRIDGE
   ─────────────────────────────────────────────────────────
   把「市場之外的日用」見縫插針地植入到每一頁。
   研究是手段，把生活還給時間，才是根本。

   四個變體 · One namespace, four densities:
     .life-bridge--band     薄行帶 ── section 之間的呼吸縫
     .life-bridge--colo     落款   ── 詳情頁／長文末尾收筆
     .life-bridge--quote    引文塊 ── 章節中段，打破密集數據
     .life-bridge--aside    側欄卡 ── 列表頁右欄（articles.html 已用，沿用既有 .blog-eco-list）

   兩個色域 · Two contexts:
     默認        ── 黑底頁（market / whitepaper / index / track-record / subscribe …）
     .on-paper   ── 米黃信箋頁（articles 詳情）

   聲線 · 裸體現代簡篤：「看完週期，去一趟山。」
                       「市場可以散，山泉不歇。」
   ══════════════════════════════════════════════════════════ */
.life-bridge{
  --lb-rule:      rgba(212,175,55,.20);
  --lb-rule-soft: rgba(212,175,55,.08);
  --lb-ink:       rgba(232,228,210,.78);
  --lb-ink-2:     rgba(232,228,210,.42);
  --lb-name:      rgba(244,228,168,.94);
  --lb-arrow:     rgba(212,175,55,.55);
  --lb-bg:        rgba(20,16,10,.32);
  --lb-bg-hover:  rgba(212,175,55,.06);
  font-family:"Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
  position:relative;
  z-index:1;
  break-inside:avoid;
}
.life-bridge.on-paper{
  --lb-rule:      rgba(122,72,22,.22);
  --lb-rule-soft: rgba(122,72,22,.1);
  --lb-ink:       rgba(35,25,16,.78);
  --lb-ink-2:     rgba(122,72,22,.6);
  --lb-name:      #2a1a0c;
  --lb-arrow:     rgba(122,72,22,.55);
  --lb-bg:        rgba(255,249,236,.42);
  --lb-bg-hover:  rgba(155,28,31,.04);
}
.life-bridge a{ text-decoration:none; color:inherit; }
.life-bridge a:focus-visible{ outline:1px dashed var(--lb-name); outline-offset:3px; }

/* — 主咒（mantra）：每變體可換不同句，但類別一致 — */
.life-bridge-mantra{
  font-family:"Noto Serif SC","STSong",serif;
  font-weight:300;
  font-size:clamp(.95rem,1.45vw,1.14rem);
  letter-spacing:.14em;
  color:var(--lb-ink);
  line-height:1.85;
  margin:0;
}
.life-bridge-mantra em{
  font-style:normal;
  color:var(--lb-name);
  font-weight:400;
  letter-spacing:.06em;
}
.life-bridge.on-paper .life-bridge-mantra em{
  color:#2a1a0c;
  font-weight:500;
}

/* — 落款短語 — */
.life-bridge-foot{
  margin:6px 0 0;
  font-family:"Noto Serif SC",serif;
  font-style:italic;
  font-size:.76rem;
  letter-spacing:.08em;
  color:var(--lb-ink-2);
}

/* — 入口列表（4 個落地頁） — */
.life-bridge-entries{
  display:flex;
  flex-wrap:wrap;
  gap:0;
  margin:0;
  padding:0;
  list-style:none;
}
.life-bridge-entries .lb-entry{ display:contents; }
.life-bridge-entries .lb-entry > a{
  display:inline-flex;
  align-items:baseline;
  gap:10px;
  padding:10px 18px;
  border-right:1px solid var(--lb-rule);
  transition:color .22s ease, background .22s ease;
  white-space:nowrap;
}
.life-bridge-entries .lb-entry:last-child > a{ border-right:none; }
.life-bridge-entries .lb-entry > a:hover{
  color:var(--lb-name);
  background:var(--lb-bg-hover);
}
.lb-entry-mark{
  font-family:"Noto Serif SC","STSong",serif;
  font-size:.95rem;
  color:var(--lb-name);
  letter-spacing:0;
  font-weight:500;
}
.lb-entry-name{
  font-family:"Noto Serif SC",serif;
  font-size:.88rem;
  font-weight:400;
  letter-spacing:.08em;
}
.lb-entry-sub{
  font-family:"JetBrains Mono",monospace;
  font-size:.58rem;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--lb-ink-2);
  margin-left:4px;
}

/* ── Variant: BAND（薄行帶／橫向插縫） ──────── */
.life-bridge--band{
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:center;
  padding:clamp(22px,3vw,30px) clamp(20px,4vw,40px);
  margin:clamp(48px,7vw,80px) auto;
  max-width:min(1180px, calc(100% - 32px));
  border-top:1px solid var(--lb-rule);
  border-bottom:1px solid var(--lb-rule);
  background:
    linear-gradient(90deg, transparent 0%, var(--lb-bg) 50%, transparent 100%);
  text-align:center;
}

/* ── Variant: COLOPHON（落款／文末收筆） ────── */
.life-bridge--colo{
  margin:clamp(56px,8vw,96px) auto clamp(40px,6vw,56px);
  padding:clamp(28px,4vw,40px) clamp(20px,4vw,32px) clamp(24px,3vw,28px);
  max-width:min(900px, calc(100% - 32px));
  border-top:1px solid var(--lb-rule);
  text-align:center;
}
.life-bridge--colo{
  position:relative;
}
.life-bridge--colo::before{
  content:"";
  position:absolute;
  top:-1px; left:50%;
  width:36px; height:1px;
  background:var(--lb-name);
  transform:translateX(-50%);
}
.life-bridge--colo .life-bridge-mantra{
  font-size:clamp(1rem,1.55vw,1.2rem);
  margin-bottom:clamp(16px,2.5vw,22px);
}
.life-bridge--colo .life-bridge-entries{
  justify-content:center;
  margin:0 auto;
}
.life-bridge--colo .life-bridge-foot{
  margin-top:clamp(20px,3vw,26px);
}

/* ── Variant: PULL-QUOTE（章節中段引文） ────── */
.life-bridge--quote{
  position:relative;
  margin:clamp(40px,6vw,64px) auto;
  padding:clamp(40px,6vw,64px) clamp(20px,5vw,40px);
  max-width:min(820px, calc(100% - 32px));
  text-align:center;
}
.life-bridge--quote::before,
.life-bridge--quote::after{
  content:"";
  display:block;
  width:52px; height:1px;
  background:var(--lb-rule);
  margin:0 auto;
}
.life-bridge--quote::before{ margin-bottom:clamp(24px,4vw,36px); }
.life-bridge--quote::after{ margin-top:clamp(24px,4vw,36px); }
.life-bridge--quote .life-bridge-mantra{
  font-size:clamp(1.25rem,2.2vw,1.72rem);
  font-weight:300;
  letter-spacing:.18em;
  color:var(--lb-name);
  line-height:1.7;
}
.life-bridge--quote .life-bridge-mantra em{
  background:linear-gradient(90deg,#f4e4a8 0%,#d4af37 50%,#a8822a 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  font-weight:400;
}
.life-bridge.on-paper.life-bridge--quote .life-bridge-mantra em{
  background:none;
  -webkit-text-fill-color:#2a1a0c;
  color:#2a1a0c;
}
.life-bridge--quote .life-bridge-entries{
  margin-top:clamp(20px,3vw,28px);
  justify-content:center;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width:640px){
  .life-bridge-entries{ flex-direction:column; align-items:stretch; }
  .life-bridge-entries .lb-entry > a{
    width:100%;
    border-right:none;
    border-bottom:1px dashed var(--lb-rule);
    padding:11px 4px;
  }
  .life-bridge-entries .lb-entry:last-child > a{ border-bottom:none; }
  .life-bridge--band{ padding-left:16px; padding-right:16px; }
  .life-bridge--quote .life-bridge-mantra{ letter-spacing:.12em; }
}

@media print{
  .life-bridge{
    color:#000 !important;
    background:#fff !important;
    border-color:#999 !important;
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .life-bridge-mantra,
  .life-bridge-mantra em,
  .lb-entry-mark,
  .lb-entry-name,
  .life-bridge-foot{ color:#000 !important; -webkit-text-fill-color:#000 !important; background:none !important; }
  .life-bridge a{ text-decoration:underline !important; color:#000 !important; }
}
