/* ─── CSS Variables · Warm Ink Palette ──────────────── */
:root {
  /* Backgrounds — deep warm ink, not cold blue-black */
  --bg:      #0e0c0a;
  --bg2:     #161310;
  --bg3:     #1f1b17;

  /* Borders — warm stone */
  --border:  #2e2925;
  --border2: #3d3830;

  /* Text — warm cream, not stark white */
  --text:    #ede4d8;
  --text2:   #9a8e80;
  --text3:   #5c5248;

  /* Concept semantic colors — slightly warmer */
  --c-structure:  #5ec8f8;   /* sky */
  --c-dynamic:    #5ecf72;   /* sage */
  --c-cognition:  #c084fc;   /* lavender */
  --c-defilement: #f06b5e;   /* terracotta-red */
  --c-nature:     #f5aa32;   /* amber */
  --c-path:       #3acfdf;   /* teal */

  /* Brand — warm terracotta, not cold red */
  --c-brand:      #e8574a;

  --sidebar-w: 220px;
  --map-w: 300px;
  --top-h: 52px;
  --radius: 6px;
  --transition: 0.22s ease;
}

/* Light mode — aged parchment */
.light {
  --bg:      #faf7f2;
  --bg2:     #f3ede4;
  --bg3:     #ece5da;
  --border:  #d8d0c4;
  --border2: #c4baac;
  --text:    #1c1814;
  --text2:   #5c5248;
  --text3:   #9a8e80;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 300;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }

/* ─── Layout ─────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* Top Bar */
#topbar {
  height: var(--top-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}
#brand {
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--c-brand);
  flex-shrink: 0;
  text-shadow: 0 0 20px rgba(232,87,74,0.25);
}
#brand span { font-size: 11px; color: var(--text2); margin-left: 8px; letter-spacing: 0.12em; text-transform: uppercase; font-family: 'Noto Sans TC', sans-serif; }

#spiral-tabs { display: flex; gap: 4px; margin-left: 8px; }
.s-tab {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text2);
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.s-tab.active { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.s-tab:hover:not(.active) { border-color: var(--border2); color: var(--text); }

#topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text2);
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--border2); color: var(--text); background: var(--bg3); }
.icon-btn.active { border-color: var(--c-brand); color: var(--c-brand); }

/* Main area */
#main { display: flex; flex: 1; overflow: hidden; }

/* Left Sidebar */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  padding-bottom: 24px;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sidebar-section { padding: 12px 0 4px; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 14px 6px;
}
.sidebar-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 14px 3px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-sub::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sub-structure .sidebar-sub::before { background: var(--c-structure); }
.sub-dynamic .sidebar-sub::before   { background: var(--c-dynamic); }
.sub-cognition .sidebar-sub::before { background: var(--c-cognition); }
.sub-defilement .sidebar-sub::before{ background: var(--c-defilement); }
.sub-nature .sidebar-sub::before    { background: var(--c-nature); }
.sub-path .sidebar-sub::before      { background: var(--c-path); }

.sidebar-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  gap: 8px;
}
.sidebar-item:hover { background: var(--bg3); }
.sidebar-item.active {
  background: var(--bg3);
  border-left-color: var(--c-brand);
}
.sidebar-item .v-name { font-size: 13px; font-weight: 400; flex-shrink: 0; }
.sidebar-item .t-name { font-size: 10px; color: var(--text3); text-align: right; white-space: nowrap; }
.sidebar-item.active .v-name { color: var(--text); font-weight: 500; }

/* technical mode: swap prominence */
body.technical-names .sidebar-item .v-name {
  font-size: 11px; color: var(--text3); font-weight: 300;
}
body.technical-names .sidebar-item .t-name {
  font-size: 13px; color: var(--text2); font-weight: 400;
  order: -1;
}
body.technical-names .sidebar-item.active .t-name {
  color: var(--text); font-weight: 500;
}

/* Center */
#center {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}
#center::-webkit-scrollbar { width: 8px; }
#center::-webkit-scrollbar-track { background: transparent; }
#center::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#center::-webkit-scrollbar-thumb:hover {
  background: var(--c-brand);
  border-width: 1px;
}

/* Entry */
.entry-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.entry-vernacular {
  font-family: 'Noto Serif TC', serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.entry-tagline { font-family: 'Noto Serif TC', serif; font-size: 15px; color: var(--text2); margin-bottom: 14px; line-height: 1.6; font-weight: 300; }
.entry-terms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.term-pill {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.04em;
}
.term-pill.zh { border-color: var(--c-structure); color: var(--c-structure); }
.term-pill.en { font-style: italic; font-family: 'EB Garamond', serif; font-size: 13px; }
.term-pill.sa { font-style: italic; font-family: 'EB Garamond', serif; font-size: 13px; color: var(--c-nature); border-color: var(--c-nature); }

.entry-section { margin-bottom: 24px; }
.entry-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.entry-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Dual Column */
.dual-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dual-col-header { background: var(--bg3); padding: 8px 14px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); }
.dual-col-body { background: var(--bg2); padding: 14px; font-family: 'Noto Serif TC', serif; font-size: 13px; line-height: 1.9; font-weight: 300; }

/* Misreading — warm amber-red instead of cold red */
.misreading {
  background: rgba(240,107,94,0.06);
  border: 1px solid rgba(240,107,94,0.22);
  border-left: 3px solid var(--c-brand);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
}
.misreading strong { color: var(--c-brand); font-weight: 600; display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* Link Network */
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  font-size: 13px;
}
.link-item:hover { border-color: var(--border2); background: var(--bg2); }
.link-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.link-name { font-weight: 500; }
.link-term { font-size: 11px; color: var(--text3); margin: 0 4px; }
.link-rel { color: var(--text2); font-size: 12px; }

/* Backlinks */
.backlink-list { display: flex; flex-wrap: wrap; gap: 6px; }
.backlink-pill {
  padding: 4px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text2);
}
.backlink-pill:hover { border-color: var(--border2); color: var(--text); background: var(--bg2); }

/* Spiral Badges */
.spiral-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.spiral-badge {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg3);
}
.spiral-badge.active-s1 { border-color: var(--c-structure); }
.spiral-badge.active-s2 { border-color: var(--c-dynamic); }
.spiral-badge.active-s3 { border-color: var(--c-nature); }
.spiral-badge .s-label { font-weight: 700; margin-right: 6px; }
.spiral-badge.active-s1 .s-label { color: var(--c-structure); }
.spiral-badge.active-s2 .s-label { color: var(--c-dynamic); }
.spiral-badge.active-s3 .s-label { color: var(--c-nature); }
.spiral-badge .s-desc { color: var(--text2); font-size: 11px; }

/* Right Map */
#map-panel {
  width: var(--map-w);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#map-resizer {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  transition: width 0.15s, background 0.15s;
}
#map-resizer::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  transition: width 0.15s, background 0.15s;
  pointer-events: none;
}
#map-resizer:hover::after,
#map-resizer.dragging::after {
  width: 6px;
  background: var(--c-brand);
  box-shadow: 0 0 8px var(--c-brand);
}
#map-panel.hidden { width: 0 !important; border-left: none; }
#map-panel.hidden + #map-resizer, #map-resizer.panel-hidden { display: none; }
#map-title {
  padding: 12px 14px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#map-svg { flex: 1; width: 100%; }

/* Hover Popup */
#popup {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  max-width: 240px;
}
#popup.visible { opacity: 1; pointer-events: auto; }
#popup-inner {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.popup-v { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.popup-tag { font-size: 11px; color: var(--text2); margin-bottom: 6px; line-height: 1.4; }
.popup-terms { font-size: 10px; color: var(--text3); font-style: italic; font-family: 'EB Garamond', serif; }

/* Inline concept links */
.c-link {
  color: inherit;
  border-bottom: 1px dotted var(--border2);
  cursor: pointer;
  transition: border-color var(--transition);
}
.c-link:hover { border-bottom-color: var(--text2); }

/* Scrollbar — sidebar only (center defined above) */
#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── Mode Toggle ────────────────────────────────── */
#mode-tabs { display: flex; gap: 2px; background: var(--bg3); border-radius: 8px; padding: 3px; }
.mode-tab {
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
  letter-spacing: 0.03em;
}
.mode-tab.active { background: var(--bg2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.mode-tab:hover:not(.active) { color: var(--text); }

/* ─── Name Mode Toggle ───────────────────────────────── */
#name-toggle {
  display: flex; gap: 2px;
  background: var(--bg3);
  border-radius: 8px; padding: 3px;
}
.name-tab {
  padding: 4px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--text2); transition: all var(--transition);
  letter-spacing: 0.03em; border: none; cursor: pointer;
  background: none;
}
.name-tab.active {
  background: var(--bg2); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.name-tab:hover:not(.active) { color: var(--text); }
.sidebar-season-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text2);
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
.sidebar-season-btn:hover { color: var(--text); background: var(--bg3); }
.sidebar-season-btn.active { border-left-color: var(--c-brand); color: var(--text); background: var(--bg3); }
.sidebar-season-btn .s-count {
  font-size: 10px; font-weight: 400;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 7px;
  color: var(--text3);
}
.sidebar-article-item {
  padding: 6px 14px 6px 18px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  display: flex; align-items: flex-start; gap: 8px;
}
.sidebar-article-item:hover { background: var(--bg3); }
.sidebar-article-item.active { background: var(--bg3); border-left-color: var(--c-brand); }
.sidebar-article-item .a-num { font-size: 10px; color: var(--text3); flex-shrink: 0; padding-top: 2px; min-width: 22px; }
.sidebar-article-item .a-title { font-size: 12px; line-height: 1.4; }
.sidebar-article-item.active .a-title { font-weight: 500; }

/* ─── Article List View ──────────────────────────── */
.season-block { margin-bottom: 32px; }
.season-header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.season-label {
  font-family: 'EB Garamond', serif;
  font-size: 22px; font-weight: 500;
  color: var(--text);
}
.season-en { font-size: 12px; color: var(--text2); }
.season-desc { font-size: 12px; color: var(--text3); margin-left: auto; font-style: italic; }

.article-card {
  display: flex; gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg2);
}
.article-card:hover { border-color: var(--border2); background: var(--bg3); }
.article-card.active { border-color: var(--c-brand); background: var(--bg3); }
.article-num {
  font-size: 11px; color: var(--text3);
  flex-shrink: 0; padding-top: 2px;
  min-width: 28px;
}
.article-body { flex: 1; min-width: 0; }
.article-card-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.article-target { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.article-target strong { color: var(--text2); font-weight: 500; }
.article-target-inline {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--text3); text-transform: uppercase;
  margin: 4px 0 8px;
}
.article-target-inline strong { color: var(--c-brand); font-weight: 700; }
.article-hook-inline {
  font-size: 15px; line-height: 1.65;
  color: var(--text2); font-family: 'Noto Serif TC', serif;
  font-weight: 300; font-style: italic;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--c-brand);
}
.article-concepts { display: flex; flex-wrap: wrap; gap: 4px; }
.concept-chip {
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; border: 1px solid;
  transition: all var(--transition);
}

/* status pill */
.status-pill {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  flex-shrink: 0; align-self: flex-start; margin-top: 2px;
  border: 1px solid;
}
.status-draft { color: var(--text3); border-color: var(--border); }
.status-published { color: var(--c-dynamic); border-color: var(--c-dynamic); }
.status-substack { color: var(--c-structure); border-color: var(--c-structure); }

/* ─── Article Detail View ────────────────────────── */
.article-detail-header {
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
@keyframes articleFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.article-fade-in {
  animation: articleFadeIn 0.3s ease forwards;
}
.article-season-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 12px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text3);
}
.article-season-tag .dot { width: 6px; height: 6px; border-radius: 50%; }
.article-detail-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 28px; font-weight: 600;
  line-height: 1.3; margin-bottom: 8px;
}
.article-detail-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.article-target-detail {
  font-size: 13px; color: var(--text2);
  padding: 8px 14px; background: var(--bg3);
  border-radius: var(--radius); border-left: 3px solid var(--border2);
  margin-bottom: 16px;
}
.article-target-detail strong { color: var(--text); display: block; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; color: var(--text3); }

.concept-links-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.concept-link-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; border: 1px solid;
  cursor: pointer; transition: all var(--transition);
}
.concept-link-tag:hover { opacity: 0.8; background: var(--bg3); }
.concept-link-tag .dot { width: 5px; height: 5px; border-radius: 50%; }

.content-placeholder {
  background: var(--bg3); border: 1px dashed var(--border2);
  border-radius: var(--radius); padding: 40px 24px;
  text-align: center; color: var(--text3);
}
.content-placeholder .ph-title { font-size: 15px; margin-bottom: 8px; color: var(--text2); }
.content-placeholder p { font-size: 13px; line-height: 1.7; max-width: 400px; margin: 0 auto 16px; }
.substack-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  border: 1px solid var(--c-structure);
  color: var(--c-structure);
  font-size: 12px; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.substack-btn:hover { background: rgba(79,195,247,0.08); }

/* ─── Related Articles (in concept entry) ──────── */
.article-ref-list { display: flex; flex-direction: column; gap: 6px; }
.article-ref-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg3);
  border-radius: var(--radius); cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition); font-size: 13px;
}
.article-ref-item:hover { border-color: var(--border2); background: var(--bg2); }
.article-ref-season {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0;
}
.ref-s1 { background: rgba(79,195,247,0.15); color: var(--c-structure); }
.ref-s2 { background: rgba(83,215,105,0.15); color: var(--c-dynamic); }
.ref-s3 { background: rgba(245,166,35,0.15); color: var(--c-nature); }
.article-ref-title { font-weight: 500; flex: 1; }
.article-ref-target { font-size: 11px; color: var(--text3); }

/* Empty state */
#empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text3);
  text-align: center;
  gap: 12px;
}
#empty-state .gem-logo {
  font-family: 'EB Garamond', serif;
  font-size: 48px;
  color: var(--border2);
  letter-spacing: 0.1em;
}
#empty-state p { font-size: 13px; max-width: 280px; line-height: 1.7; }

/* ─── Mode Landing Pages (#37-40) ───────────────────── */
.mode-landing { padding: 52px 48px 80px; max-width: 560px; }
.mode-landing-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 32px;
}
.mode-landing-section { margin-bottom: 36px; }
.mode-landing-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 14px;
}
.mode-landing-section p {
  font-size: 13.5px; line-height: 2; color: var(--text2);
  font-family: 'Noto Serif TC', serif; font-weight: 300;
}
.mode-landing-ops { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.mode-landing-ops li {
  font-size: 13px; color: var(--text2);
  display: flex; gap: 12px; line-height: 1.75;
}
.mode-landing-ops li::before {
  content: '—'; color: var(--text3); flex-shrink: 0; margin-top: 1px;
}
.mode-landing-ops .op-key { color: var(--text); font-weight: 500; }

/* ─── Mode Landing Pages (37-40) ─────────────────────── */
.mode-landing {
  padding: 52px 48px 80px;
  max-width: 560px;
}
.mode-landing-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 28px;
}
.mode-landing-section { margin-bottom: 36px; }
.mode-landing-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}
.mode-landing-section p {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text2);
  font-family: 'Noto Serif TC', serif;
  font-weight: 300;
}
.mode-landing-ops {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode-landing-ops li {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  gap: 12px;
  line-height: 1.7;
}
.mode-landing-ops li::before {
  content: '—';
  color: var(--text3);
  flex-shrink: 0;
  margin-top: 1px;
}
.mode-landing-ops .op-key { color: var(--text); font-weight: 500; }

/* ─── Homepage ───────────────────────────────────────── */
#home-view {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 0 32px 80px;
}
#home-view.visible { display: block; }
.home-inner { max-width: 660px; margin: 0 auto; padding-top: 72px; }

.home-series-tag {
  font-family: 'EB Garamond', serif;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 44px;
  display: flex; align-items: center; gap: 14px;
}
.home-series-tag::before, .home-series-tag::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.home-headline {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(34px, 5.5vw, 54px);
  font-weight: 400; line-height: 1.3;
  letter-spacing: 0.04em; color: var(--text);
  margin-bottom: 24px;
}
.home-headline em { font-style: normal; color: var(--c-brand); }
.home-sub {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px; font-weight: 300;
  color: var(--text2); line-height: 2.0;
  margin-bottom: 12px; max-width: 540px;
}
.home-bridge {
  font-family: 'EB Garamond', serif;
  font-size: 15px; font-style: italic;
  color: var(--text3); margin-bottom: 48px;
  padding-left: 14px; border-left: 2px solid var(--border);
  line-height: 1.8; max-width: 480px;
}
.home-ctas { display: flex; gap: 10px; margin-bottom: 60px; flex-wrap: wrap; }
.cta-primary {
  padding: 11px 26px;
  background: var(--c-brand); color: #fff;
  border-radius: var(--radius); font-size: 13px;
  font-weight: 500; letter-spacing: 0.04em;
  cursor: pointer; border: none;
  transition: all var(--transition);
}
.cta-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.cta-secondary {
  padding: 11px 26px;
  border: 1px solid var(--border2); color: var(--text2);
  border-radius: var(--radius); font-size: 13px;
  cursor: pointer; background: none;
  transition: all var(--transition);
}
.cta-secondary:hover { border-color: var(--text3); color: var(--text); }

.home-seasons {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 52px;
}
.season-card {
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2); cursor: pointer;
  transition: all var(--transition);
}
.season-card:hover { border-color: var(--border2); transform: translateY(-2px); background: var(--bg3); }
.sc-label { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 7px; }
.sc-title { font-family: 'Noto Serif TC', serif; font-size: 14px; margin-bottom: 5px; line-height: 1.4; }
.sc-desc { font-size: 11px; color: var(--text3); margin-bottom: 10px; line-height: 1.5; }
.sc-count { font-size: 10px; color: var(--text3); }

.home-footer {
  padding-top: 28px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.home-footer-left { font-size: 11px; color: var(--text3); line-height: 1.8; }
.home-footer-right { font-size: 12px; color: var(--text3); font-style: italic; font-family: 'EB Garamond', serif; }

/* brand = home link */
#brand { cursor: pointer; transition: opacity var(--transition); }
#brand:hover { opacity: 0.75; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Specials (專題文章) ────────────────────────────── */
.special-hero {
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.special-hero-tag {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.special-hero-tag::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.special-hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 24px; line-height: 1.35;
  margin-bottom: 10px; letter-spacing: 0.04em;
}
.special-hero-desc {
  font-family: 'Noto Serif TC', serif;
  font-size: 13px; color: var(--text2);
  line-height: 1.9; font-weight: 300;
  max-width: 540px; margin-bottom: 14px;
}
.special-prereq {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text3);
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
}
.special-prereq .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--c-nature); }

.special-article-card {
  display: flex; gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg2);
}
.special-article-card:hover { border-color: var(--border2); background: var(--bg3); }
.special-article-card.active { border-color: var(--c-cognition); background: var(--bg3); }
.special-num {
  font-size: 11px; color: var(--text3);
  flex-shrink: 0; padding-top: 2px; min-width: 28px;
  font-family: 'EB Garamond', serif; font-style: italic;
}
.special-body { flex: 1; min-width: 0; }
.special-card-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.special-card-hook { font-size: 12px; color: var(--text3); line-height: 1.5; }
.special-card-concepts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* Sidebar for specials */
.sidebar-special-header {
  padding: 14px 14px 8px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3); border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.sidebar-special-series {
  padding: 8px 14px 4px;
  font-size: 11px; color: var(--text2);
  font-weight: 600; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 6px;
}
.sidebar-special-series .s-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-cognition);
}
.sidebar-special-item {
  padding: 6px 14px 6px 22px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px;
}
.sidebar-special-item:hover { background: var(--bg3); }
.sidebar-special-item.active { background: var(--bg3); border-left-color: var(--c-cognition); font-weight: 500; }
.sidebar-special-item .sp-num { font-size: 10px; color: var(--text3); flex-shrink: 0; padding-top: 2px; min-width: 20px; font-family: 'EB Garamond', serif; font-style: italic; }

/* Home CTA for specials */
.home-specials-teaser {
  margin-top: 24px; padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  cursor: pointer; transition: all var(--transition);
}
.home-specials-teaser:hover { border-color: var(--c-cognition); background: var(--bg3); }
.home-specials-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-cognition); margin-bottom: 8px;
}
.home-specials-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px; margin-bottom: 6px;
}
.home-specials-desc { font-size: 12px; color: var(--text3); line-height: 1.6; }

/* ─── Series Home ────────────────────────── */
.series-home {
  padding: 0 0 12px;
  margin-bottom: 8px;
}
.series-home-tag {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.series-home-tag .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.series-home-tag-line { flex: 1; height: 1px; background: var(--border); }
.series-home-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 26px; line-height: 1.35;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}
.series-home-engine {
  font-family: 'Noto Serif TC', serif;
  font-size: 13px; color: var(--text2);
  line-height: 1.8; font-weight: 300;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-left: 2px solid var(--border);
  background: var(--bg2);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.series-home-engine-label {
  font-family: 'EB Garamond', serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
  display: block; margin-bottom: 4px;
}
.series-home-intro {
  font-family: 'Noto Serif TC', serif;
  font-size: 14px; font-weight: 300;
  line-height: 2; color: var(--text);
  margin-bottom: 24px;
  max-width: 600px;
}
.series-home-intro p { margin-bottom: 14px; }
.series-home-intro p:last-child { margin-bottom: 0; }
.series-home-journey {
  font-family: 'Noto Serif TC', serif;
  font-size: 13px; font-weight: 300;
  color: var(--text2);
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  margin-bottom: 24px;
  line-height: 1.8;
  font-style: italic;
}
.series-home-journey-icon {
  color: var(--c-brand); margin-right: 6px;
  font-style: normal;
}
.series-home-meta-row {
  display: flex; gap: 24px;
  margin-bottom: 8px;
}
.series-home-meta-item {
  display: flex; flex-direction: column; gap: 2px;
}
.series-home-meta-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text3);
}
.series-home-meta-val {
  font-size: 12px; color: var(--text2);
}
.series-home-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 20px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3);
}
.series-home-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── Sidebar home item ────────────────────────── */
.sidebar-home-item {
  font-style: italic;
}

#auth-modal {
  display: none;
  position: fixed; inset: 0; z-index: 600;
  background: rgba(10,8,6,0.92);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
#auth-modal.visible { display: flex; }

.auth-box {
  width: 100%; max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  position: relative;
}
.auth-close {
  position: absolute; top: 16px; right: 16px;
  font-size: 18px; color: var(--text3);
  cursor: pointer; transition: color var(--transition);
  background: none; border: none;
}
.auth-close:hover { color: var(--text); }

.auth-gem {
  font-family: 'EB Garamond', serif;
  font-size: 22px; color: var(--c-brand);
  letter-spacing: 0.1em; margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(232,87,74,0.25);
}
.auth-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px; margin-bottom: 6px;
}
.auth-sub {
  font-size: 12px; color: var(--text3);
  margin-bottom: 28px; line-height: 1.6;
}

/* Plan selector */
.plan-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 24px;
}
.plan-tab {
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  cursor: pointer; text-align: center;
  transition: all var(--transition);
}
.plan-tab.selected {
  border-color: var(--c-brand);
  background: rgba(232,87,74,0.08);
}
.plan-tab:hover:not(.selected) { border-color: var(--border2); }
.plan-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.plan-price { font-size: 11px; color: var(--text3); }
.plan-tab.selected .plan-price { color: var(--c-brand); }
.plan-features {
  font-size: 11px; color: var(--text3);
  margin-top: 6px; line-height: 1.5;
}

/* Input */
.auth-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 6px; display: block;
}
.auth-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; color: var(--text);
  font-family: 'Noto Sans TC', sans-serif;
  outline: none; margin-bottom: 16px;
  transition: border-color var(--transition);
}
.auth-input:focus { border-color: var(--border2); }
.auth-input::placeholder { color: var(--text3); }

.auth-btn {
  width: 100%; padding: 12px;
  background: var(--c-brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer; letter-spacing: 0.04em;
  transition: opacity var(--transition);
  font-family: 'Noto Sans TC', sans-serif;
}
.auth-btn:hover { opacity: 0.85; }

.auth-note {
  font-size: 11px; color: var(--text3);
  text-align: center; margin-top: 14px;
  line-height: 1.6;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0; color: var(--text3); font-size: 11px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Status bar */
#auth-status {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 11px; cursor: pointer;
  transition: all var(--transition);
  color: var(--text2);
  white-space: nowrap;
}
#auth-status:hover { border-color: var(--border2); color: var(--text); }
#auth-status .status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3); flex-shrink: 0;
}
#auth-status.logged-in .status-dot { background: var(--c-dynamic); }
#auth-status.member .status-dot { background: var(--c-nature); }

/* ─── Paywall ─────────────────────────────────────────── */
.paywall-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}
.paywall-preview {
  padding: 20px;
  background: var(--bg2);
  font-family: 'Noto Serif TC', serif;
  font-size: 14px; line-height: 2.0;
  color: var(--text2);
  position: relative;
}
.paywall-preview::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg2));
}
.paywall-gate {
  padding: 24px 20px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  text-align: center;
}
.paywall-icon { font-size: 22px; margin-bottom: 10px; }
.paywall-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px; margin-bottom: 6px;
}
.paywall-desc {
  font-size: 12px; color: var(--text3);
  margin-bottom: 18px; line-height: 1.7;
}
.paywall-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.paywall-btn-primary {
  padding: 9px 20px;
  background: var(--c-brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: opacity var(--transition);
  font-family: 'Noto Sans TC', sans-serif;
}
.paywall-btn-primary:hover { opacity: 0.85; }
.paywall-btn-secondary {
  padding: 9px 20px;
  border: 1px solid var(--border2); color: var(--text2);
  background: none; border-radius: var(--radius);
  font-size: 12px; cursor: pointer;
  transition: all var(--transition);
  font-family: 'Noto Sans TC', sans-serif;
}
.paywall-btn-secondary:hover { border-color: var(--text3); color: var(--text); }

/* Season badges with lock */
.sidebar-article-item .lock-icon {
  font-size: 9px; color: var(--text3);
  flex-shrink: 0; margin-left: auto;
}

/* ─── Search ─────────────────────────────────────────── */
#search-btn { }
#search-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,8,6,0.88);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,8,6,0.88);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
#search-overlay.visible { display: flex; }
.search-box {
  width: 100%; max-width: 600px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
#search-input {
  width: 100%; padding: 16px 20px;
  background: none; border: none;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 16px; color: var(--text);
  outline: none; border-bottom: 1px solid var(--border);
}
#search-input::placeholder { color: var(--text3); }
#search-results { max-height: 460px; overflow-y: auto; }
.search-group-label {
  padding: 10px 20px 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text3); border-bottom: 1px solid var(--border);
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg3); }
.sr-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sr-main { flex: 1; min-width: 0; }
.sr-title { font-size: 13px; font-weight: 500; }
.sr-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }
.sr-tag {
  font-size: 10px; padding: 2px 7px;
  border-radius: 4px; flex-shrink: 0;
  background: var(--bg3); color: var(--text3);
  letter-spacing: 0.06em;
}
.search-empty { padding: 32px 20px; text-align: center; color: var(--text3); font-size: 13px; }

/* ─── Article Typography ─────────────────────────────── */
.article-text {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px; font-weight: 300;
  line-height: 1.9; color: var(--text);
  max-width: 640px;
}
.article-text p { margin-bottom: 1.4em; }
.article-text h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: 19px; font-weight: 400;
  margin: 2em 0 0.8em;
  letter-spacing: 0.04em; color: var(--text);
}
.article-text h3 {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text3); margin: 1.8em 0 0.6em;
}
.article-text blockquote {
  border-left: 2px solid var(--border2);
  padding: 8px 0 8px 18px;
  margin: 1.4em 0;
  color: var(--text2);
  font-style: italic;
  font-family: 'EB Garamond', serif;
  font-size: 16px;
}
.article-text .insight {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c-nature);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 1.6em 0;
  font-size: 14px;
  font-family: 'Noto Serif TC', serif;
  color: var(--text);
}
.article-text hr {
  border: none; border-top: 1px solid var(--border);
  margin: 2em 0;
}
.article-text strong { font-weight: 600; color: var(--text); }
.article-text .concept-inline {
  border-bottom: 1px dotted var(--border2);
  cursor: pointer; font-style: italic;
  transition: border-color var(--transition);
}
.article-text .concept-inline:hover { border-bottom-color: var(--text2); }

/* technical mode: entry header flips */
body.technical-names .entry-vernacular {
  font-family: 'Noto Serif TC', serif;
  font-size: 28px; letter-spacing: 0.06em;
}
body.technical-names .entry-tagline {
  font-size: 14px;
}
.entry-vernacular-sub {
  font-size: 13px; color: var(--text3);
  margin-bottom: 6px; font-family: 'Noto Sans TC', sans-serif;
  font-weight: 300;
}

/* ─── Article bottom metadata ────────────────────────── */
.article-bottom-meta {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.dual-meta-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}
.meta-block {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.meta-block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}
.meta-block-val {
  font-size: 13px;
  color: var(--text2);
  font-family: 'Noto Serif TC', serif;
  font-weight: 300;
  line-height: 1.6;
}

/* Surprise Me */
#empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; color: var(--text3);
  text-align: center; gap: 16px;
}
.surprise-btn {
  margin-top: 8px;
  padding: 9px 22px;
  border: 1px solid var(--border2);
  border-radius: 20px;
  font-size: 13px; color: var(--text2);
  cursor: pointer; background: none;
  transition: all var(--transition);
  font-family: 'Noto Sans TC', sans-serif;
}
.surprise-btn:hover {
  border-color: var(--c-nature);
  color: var(--c-nature);
  background: rgba(245,170,50,0.05);
}

/* ─── Reading Progress ───────────────────────────────── */
.sidebar-progress-bar {
  height: 2px; background: var(--border);
  margin: 4px 14px 4px; border-radius: 1px; overflow: hidden;
}
.sidebar-progress-fill {
  height: 100%; background: var(--c-dynamic);
  border-radius: 1px; transition: width 0.4s ease;
}
.sidebar-progress-label {
  font-size: 10px; color: var(--text3);
  padding: 2px 14px 10px;
  display: flex; justify-content: space-between;
}
.sidebar-article-item.read .a-title { color: var(--text3); }
.read-check { font-size: 10px; color: var(--c-dynamic); flex-shrink: 0; margin-left: auto; }
.article-card.read { border-left: 3px solid var(--c-dynamic); }

/* ─── Prev / Next Navigation ─────────────────────────── */
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 40px;
  padding-top: 28px; border-top: 1px solid var(--border);
}
.article-nav-btn {
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2);
  cursor: pointer; transition: all var(--transition); text-align: left;
}
.article-nav-btn:hover { border-color: var(--border2); background: var(--bg3); }
.article-nav-btn.nav-next { text-align: right; }
.article-nav-btn.nav-disabled { opacity: 0.28; cursor: default; pointer-events: none; }
.nav-dir {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 5px;
}
.nav-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.nav-num { font-size: 10px; color: var(--text3); margin-top: 3px; font-family: 'EB Garamond', serif; }
/* ── Interlude tab (same level as S1/S2/S3) ── */
.interlude-tab {
  border-left-color: var(--c-brand) !important;
  letter-spacing: 0.02em;
}
.interlude-tab.active {
  color: var(--c-brand) !important;
  background: color-mix(in srgb, var(--c-brand) 8%, transparent) !important;
}
.interlude-tab:hover { color: var(--c-brand) !important; }

/* ── Interlude sidebar ── */
.interlude-item {
  border-left: 2px solid var(--c-brand) !important;
  background: color-mix(in srgb, var(--c-brand) 6%, transparent) !important;
}
.interlude-item .a-num { font-family: 'EB Garamond', serif; }
.sidebar-interlude-divider {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; margin: 2px 0;
  font-size: 10px; color: var(--text3); letter-spacing: 0.08em;
}
.sidebar-interlude-divider::before,
.sidebar-interlude-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Interlude card (series home) ── */
.interlude-card {
  border: 1px solid var(--c-brand);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 8px;
  cursor: pointer;
  background: color-mix(in srgb, var(--c-brand) 5%, transparent);
  transition: background 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.interlude-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--c-brand);
}
.interlude-card:hover { background: color-mix(in srgb, var(--c-brand) 10%, transparent); transform: translateY(-1px); }
.interlude-card-badge {
  font-size: 10px; color: var(--c-brand); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 8px; font-family: 'EB Garamond', serif; font-style: italic;
}
.interlude-card-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px; color: var(--text); margin-bottom: 8px;
}
.interlude-card-hook { font-size: 13px; color: var(--text2); margin-bottom: 10px; line-height: 1.6; }
.interlude-card-meta { font-size: 11px; color: var(--text3); }

/* ── Comments ── */
.comments-section { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 32px; }
.comments-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; color: var(--text2); margin-bottom: 20px; text-transform: uppercase; }
.comment-input-row { display: flex; gap: 10px; margin-bottom: 28px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text3); }
.comment-input-box { flex: 1; }
.comment-textarea { width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; color: var(--text); font-size: 13px; font-family: 'Noto Sans TC', sans-serif; resize: none; min-height: 64px; box-sizing: border-box; transition: border 0.15s; }
.comment-textarea:focus { outline: none; border-color: var(--border2); }
.comment-textarea::placeholder { color: var(--text3); }
.comment-submit-row { display: flex; justify-content: flex-end; margin-top: 6px; }
.comment-submit-btn { background: var(--c-brand); color: #fff; border: none; border-radius: 5px; padding: 6px 16px; font-size: 12px; cursor: pointer; font-family: 'Noto Sans TC', sans-serif; }
.comment-submit-btn:hover { opacity: 0.85; }
.comment-lock { text-align: center; padding: 16px; font-size: 12px; color: var(--text3); background: var(--bg2); border-radius: 8px; margin-bottom: 24px; border: 1px solid var(--border); }
.comment-lock span { color: var(--c-brand); cursor: pointer; }
.comment-list { display: flex; flex-direction: column; gap: 0; }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-name { font-size: 12px; font-weight: 600; color: var(--text); }
.comment-time { font-size: 11px; color: var(--text3); margin-left: auto; }
.comment-body { font-size: 13px; color: var(--text2); line-height: 1.7; padding-left: 42px; }
.comment-actions { padding-left: 42px; margin-top: 6px; display: flex; gap: 12px; }
.comment-action-btn { font-size: 11px; color: var(--text3); background: none; border: none; cursor: pointer; padding: 0; font-family: 'Noto Sans TC', sans-serif; }
.comment-action-btn:hover { color: var(--text2); }
.comment-replies { padding-left: 42px; margin-top: 10px; border-left: 2px solid var(--border); }
.comment-reply-item { padding: 10px 0 10px 14px; }
.reply-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.reply-name { font-size: 11px; font-weight: 600; color: var(--text); }
.reply-time { font-size: 10px; color: var(--text3); margin-left: auto; }
.reply-body { font-size: 12px; color: var(--text2); line-height: 1.6; }
.reply-input-area { padding-left: 42px; margin-top: 8px; display: none; }
.reply-input-area.open { display: block; }
.reply-textarea { width: 100%; background: var(--bg2); border: 1px solid var(--border); border-radius: 5px; padding: 8px 10px; color: var(--text); font-size: 12px; font-family: 'Noto Sans TC', sans-serif; resize: none; min-height: 52px; box-sizing: border-box; }
.reply-textarea:focus { outline: none; border-color: var(--border2); }
.reply-submit-row { display: flex; justify-content: flex-end; margin-top: 4px; gap: 6px; }
.reply-cancel-btn { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; font-size: 11px; color: var(--text3); cursor: pointer; }
.reply-post-btn { background: var(--c-brand); color: #fff; border: none; border-radius: 4px; padding: 4px 12px; font-size: 11px; cursor: pointer; }
.auth-perks { margin: 16px 0 20px; display: flex; flex-direction: column; gap: 7px; }
.auth-perk { font-size: 12px; color: var(--text2); padding: 6px 10px; background: var(--bg3); border-radius: 5px; border-left: 2px solid var(--c-brand); }

/* ── Concept sidebar sub-items ── */
.sidebar-concept-wrap { display: flex; flex-direction: column; }
.sub-toggle {
  margin-left: auto; font-size: 9px; color: var(--text3);
  padding: 2px 4px; cursor: pointer; transition: transform 0.15s, color 0.15s;
  flex-shrink: 0;
}
.sub-toggle:hover { color: var(--text2); }
.sub-toggle.open { transform: rotate(90deg); color: var(--text2); }
.sidebar-sub-list {
  padding: 2px 8px 6px 16px;
  border-left: 1px solid var(--border);
  margin-left: 12px;
  margin-bottom: 2px;
}
.sidebar-sub-item {
  padding: 5px 4px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s;
}
.sidebar-sub-item:hover { background: var(--bg3); }
.sub-key {
  font-size: 11px; font-weight: 500; display: block; margin-bottom: 1px;
}
.sub-desc {
  font-size: 10px; color: var(--text3); line-height: 1.4; display: block;
}

/* ── Sub-item detail view ── */
.sub-detail-breadcrumb { font-size: 11px; color: var(--text3); margin-bottom: 20px; display: flex; align-items: center; }
.sub-crumb-parent:hover { text-decoration: underline; }
.sub-detail-header { margin-bottom: 16px; }
.sub-detail-key { font-family: 'Noto Serif TC', serif; font-size: 28px; font-weight: 500; margin-bottom: 4px; }
.sub-detail-parent-tag { font-size: 11px; color: var(--text3); letter-spacing: 0.06em; }
.sub-detail-desc { font-size: 14px; color: var(--text2); line-height: 1.8; padding: 16px; background: var(--bg2); border-left: 2px solid currentColor; border-radius: 0 6px 6px 0; margin-bottom: 24px; }
.sub-detail-context { margin-top: 8px; }
.sub-detail-context-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.sub-detail-context-body { font-size: 13px; color: var(--text2); line-height: 1.8; }
.sub-back-btn { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 7px 14px; font-size: 12px; color: var(--text3); cursor: pointer; font-family: 'Noto Sans TC', sans-serif; transition: border-color 0.15s, color 0.15s; }
.sub-back-btn:hover { border-color: var(--text2); color: var(--text); }

/* ── Yogacara list formatting ── */
.yogacara-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.yogacara-list li { padding-left: 12px; border-left: 2px solid var(--border2); line-height: 1.8; }
.sub-key-link { font-weight: 600; cursor: pointer; border-bottom: 1px dotted currentColor; opacity: 0.9; }
.sub-key-link:hover { opacity: 1; }

.yogacara-source { font-size: 10px; color: var(--text3); padding: 6px 14px 10px; font-family: 'EB Garamond', serif; font-style: italic; letter-spacing: 0.03em; border-top: 1px solid var(--border); background: var(--bg2); }

/* ── Light mode graph fixes ── */
body.light .pcb-bg line { stroke: rgba(0,0,0,0.06) !important; }
body.light .pcb-bg circle { fill: rgba(0,0,0,0.1) !important; }
body.light .node-label { fill: rgba(0,0,0,0.55) !important; }
body.light .node-ring { stroke-opacity: 0.6 !important; }
body.light .node-core { fill-opacity: 0.85 !important; }

/* ── History Timeline ── */
.history-header { margin-bottom: 28px; }
.history-title { font-family: 'Noto Serif TC', serif; font-size: 26px; font-weight: 400; margin-bottom: 6px; }
.history-sub { font-size: 13px; color: var(--text3); letter-spacing: 0.05em; }
.history-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.history-left { min-width: 0; }
.history-right { position: sticky; top: 16px; }
.history-tree-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.history-tree-svg { width: 100%; height: 520px; background: var(--bg2); border-radius: 8px; border: 1px solid var(--border); display: block; }
.history-tree-note { font-size: 10px; color: var(--text3); margin-top: 6px; font-style: italic; }
.history-timeline { display: flex; flex-direction: column; gap: 0; }
.history-era { margin-bottom: 6px; }
.history-era-side { opacity: 0.85; }
.history-era-side .history-node-card { border-style: dashed; }
.history-era-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.history-era-dot { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.history-era-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.history-era-period { font-size: 11px; color: var(--text3); font-family: 'EB Garamond', serif; font-style: italic; }
.history-nodes { display: flex; flex-direction: column; padding-left: 20px; }
.history-node { display: flex; gap: 0; position: relative; padding-bottom: 8px; }
.history-node-line { width: 1px; margin-right: 14px; border-left: 1px dashed; flex-shrink: 0; margin-top: 6px; }
.history-node-card { flex: 1; padding: 8px 12px; background: var(--bg2); border-radius: 6px; margin-bottom: 4px; border: 1px solid var(--border); }
.history-node-side { background: color-mix(in srgb, var(--bg2) 80%, transparent); }
.history-node-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.history-node-name { font-size: 14px; font-weight: 600; font-family: 'Noto Serif TC', serif; }
.history-node-role { font-size: 10px; padding: 1px 6px; border-radius: 10px; border: 1px solid currentColor; opacity: 0.8; }
.history-node-dates { font-size: 11px; color: var(--text3); margin-left: auto; font-family: 'EB Garamond', serif; font-style: italic; }
.history-node-desc { font-size: 12px; color: var(--text2); line-height: 1.7; margin-bottom: 5px; }
.history-node-works { display: flex; flex-wrap: wrap; gap: 4px; }
.history-work { font-size: 10px; color: var(--text3); background: var(--bg3); padding: 2px 7px; border-radius: 3px; font-family: 'EB Garamond', serif; font-style: italic; }
.history-arrow { text-align: left; padding: 2px 0 2px 10px; font-size: 16px; opacity: 0.4; }

.history-era-overview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.history-era-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; border: 1px solid; font-size: 12px; cursor: default; }
.h-chip-dot { width: 7px; height: 7px; border-radius: 1px; flex-shrink: 0; }
.h-chip-count { font-size: 10px; opacity: 0.6; margin-left: 2px; }

/* ── Mobile RWD ─────────────────────────────────────── */
@media (max-width: 768px) {
  /* 隱藏桌機專用元素 */
  #sidebar { display: none; }
  #map-panel { display: none !important; }
  #map-resizer { display: none; }
  #brand span { display: none; }

  /* Topbar 重排 */
  #topbar {
    padding: 0 10px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  #mode-tabs {
    gap: 1px;
    padding: 2px;
  }
  .mode-tab {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* 修復 overflow 讓頁面可以捲動 */
  html, body { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
  #main { overflow: visible; }

  /* Center 全寬 */
  #center {
    width: 100% !important;
    padding: 16px 16px 80px;
    overflow-y: visible;
  }

  /* 首頁 */
  #home-view { padding: 0 16px 80px; }
  .home-inner { padding-top: 32px; }
  .home-seasons {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .home-ctas { flex-direction: column; }
  .cta-primary, .cta-secondary { width: 100%; text-align: center; }

  /* 文章閱讀 */
  .article-text {
    font-size: 15px;
    line-height: 1.85;
    max-width: 100%;
  }
  .article-detail-title { font-size: 18px; }
  .article-hook-inline { font-size: 14px; }

  /* 概念條目 */
  .dual-col { grid-template-columns: 1fr; }
  .entry-vernacular { font-size: 26px; }
  #entry { padding: 16px 4px; }

  /* Mode landing */
  .mode-landing { padding: 24px 0 60px; }

  /* 其他 */
  .concept-detail-grid { grid-template-columns: 1fr; }
}

