/**
 * 宗派之树 - 样式表
 * 装饰艺术/凯尔经风格
 */

/* ========== CSS Variables ========== */
:root {
  /* 羊皮纸色系 */
  --parchment-light: #faf6ed;
  --parchment: #f4e4bc;
  --parchment-dark: #d4c4a0;
  --parchment-darker: #b4a080;

  /* 墨水与文字 */
  --ink: #2a1810;
  --ink-light: #4a3828;
  --ink-lighter: #6a5848;

  /* 金色装饰 */
  --gold: #d4a547;
  --gold-light: #e8c874;
  --gold-glow: #ffd700;
  --gold-dark: #8b6914;
  --gold-darker: #5c4610;

  /* 树枝 */
  --branch-dark: #2d1f14;
  --branch: #3d2914;
  --branch-light: #5a3d20;
  --branch-highlight: #7a5d40;

  /* 功能色 */
  --orthodox-blue: #1e4d6b;
  --catholic-purple: #6b3a5c;
  --success: #2d5a3d;
  --warning: #8b6914;

  /* 尺寸 */
  --header-height: 80px;
  --node-size: 80px;
  --node-size-large: 120px;
  --portrait-size: 60px;

  /* 动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s ease;
  --transition-slow: 0.8s ease;
  --transition-tree: 1.5s ease-out;
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Serif SC', 'Cinzel', Georgia, serif;
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== 羊皮纸背景纹理 ========== */
.parchment-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.parchment-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 248, 232, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(180, 160, 128, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment) 50%, var(--parchment-dark) 100%);
}

.parchment-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.06;
  mix-blend-mode: multiply;
}

/* 边缘烧焦效果 */
.burned-edges {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow:
    inset 0 0 100px rgba(42, 24, 16, 0.3),
    inset 0 0 200px rgba(42, 24, 16, 0.15),
    inset 0 0 300px rgba(42, 24, 16, 0.1);
}

/* ========== 滚动叙事容器 ========== */
.scroll-container {
  position: relative;
  z-index: 10;
}

/* 章节 */
.chapter {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
}

.chapter-content {
  max-width: 800px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.chapter.active .chapter-content {
  opacity: 1;
  transform: translateY(0);
}

/* 章节标题 */
.chapter-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.chapter-subtitle {
  font-family: 'MedievalSharp', 'Noto Serif SC', serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--ink-light);
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
}

.chapter-description {
  font-size: 1.125rem;
  line-height: 2;
  color: var(--ink);
  max-width: 600px;
  margin: 0 auto;
}

/* 装饰分隔线 */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.ornament-line {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.ornament-symbol {
  font-size: 1.5rem;
  color: var(--gold);
}

/* ========== 树容器 ========== */
.tree-viewport {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.tree-viewport.interactive {
  pointer-events: auto;
  overflow: auto;
}

.tree-canvas {
  position: relative;
  width: 3000px;
  height: 3000px;
  margin: 0 auto;
  transform-origin: center bottom;
  will-change: transform;
}

/* 探索模式下 - 无 transition 以保持即时响应 */
.tree-viewport.interactive .tree-canvas {
  /* 不使用 transition，直接响应触控板 */
}

/* ========== 浮动时间轴 ========== */
.floating-timeline {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 150px;
  pointer-events: none;
  z-index: 50;
  background: linear-gradient(to right, rgba(244, 228, 188, 0.98) 0%, rgba(244, 228, 188, 0.9) 60%, rgba(244, 228, 188, 0.5) 85%, transparent 100%);
  transition: width 0.1s ease;
}

/* 时间线拖动手柄 */
.timeline-drag-handle {
  position: absolute;
  right: -8px;
  top: 0;
  bottom: 0;
  width: 16px;
  cursor: ew-resize;
  pointer-events: auto;
  z-index: 51;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-drag-handle::before {
  content: '';
  width: 4px;
  height: 40px;
  background: var(--gold);
  border-radius: 2px;
  opacity: 0.3;
  transition: opacity 0.2s, height 0.2s;
}

.timeline-drag-handle:hover::before {
  opacity: 0.8;
  height: 60px;
  background: var(--gold-dark);
}

.floating-timeline.dragging {
  transition: none;
}

.floating-timeline.dragging .timeline-drag-handle::before {
  opacity: 1;
  height: 80px;
  background: var(--primary);
}

.timeline-track {
  position: relative;
  height: 100%;
  padding-left: 12px;
  /* 添加垂直刻度线 */
  border-right: 3px solid var(--gold-dark);
  margin-right: 20px;
}

/* 主刻度标记 */
.timeline-marker {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease, flex-direction 0.2s ease;
}

.timeline-marker.visible {
  opacity: 1;
}

/* 紧凑模式：时代标签在年份上方 */
.timeline-marker.compact {
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 2px;
}

/* 主刻度横线 */
.timeline-marker::after {
  content: '';
  position: absolute;
  right: -23px;
  width: 18px;
  height: 3px;
  background: var(--gold-dark);
  border-radius: 1px;
}

.marker-year {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-dark);
  min-width: 55px;
  text-align: right;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: font-size 0.2s ease, min-width 0.2s ease;
}

.marker-era {
  font-family: 'Noto Serif SC', serif;
  font-size: 0.75rem;
  color: var(--ink);
  white-space: nowrap;
  padding: 3px 8px;
  background: var(--gold);
  border-radius: 4px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: font-size 0.2s ease, padding 0.2s ease;
}

/* 紧凑模式下的时代标签样式 */
.timeline-marker.compact .marker-era {
  font-size: 0.55rem;
  padding: 1px 4px;
  border-radius: 2px;
}

.marker-line {
  position: absolute;
  left: 70px;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, var(--gold-dark), transparent);
}

/* 子刻度 - 在主刻度之间显示 */
.timeline-subtick {
  position: absolute;
  right: -15px;
  width: 10px;
  height: 2px;
  background: var(--gold);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s ease;
}

.timeline-subtick.visible {
  opacity: 0.6;
}

/* 旧版时间轴（画布内）- 隐藏 */
.timeline {
  display: none;
}

/* ========== SVG 树枝 ========== */
.tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 树枝基础样式 */
.branch {
  fill: none;
  stroke: var(--branch);
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#branch-texture);
}

/* 树枝生长动画 */
.branch-animated {
  stroke-dasharray: var(--branch-length, 1000);
  stroke-dashoffset: var(--branch-length, 1000);
  transition: stroke-dashoffset var(--transition-tree);
}

.branch-animated.grown {
  stroke-dashoffset: 0;
}

/* 树枝高光 */
.branch-highlight {
  fill: none;
  stroke: var(--branch-highlight);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
}

/* 金色发光效果 */
.branch-glow {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  filter: url(#glow);
  transition: opacity var(--transition-normal);
}

/* 阿民念主义影响线 - 橙色虚线 */
.arminian-influence-line {
  fill: none;
  stroke: #e67e22;
  stroke-linecap: round;
  filter: none;
}

.tree-node:hover ~ .tree-svg .branch-glow {
  opacity: 0.5;
}

/* ========== 树节点 ========== */
.tree-node {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 20;
  opacity: 0;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.tree-node.visible {
  opacity: 1;
}

.tree-node:hover {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 25;
}

.node-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* 节点圆形徽章 */
.node-badge {
  position: relative;
  width: var(--node-size);
  height: var(--node-size);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--parchment-light), var(--parchment-dark));
  border: 3px solid var(--gold-dark);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px var(--ink),
    inset 0 2px 10px rgba(255, 255, 255, 0.4);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.tree-node:hover .node-badge {
  border-color: var(--gold);
  box-shadow:
    0 8px 30px rgba(212, 165, 71, 0.4),
    0 0 40px rgba(255, 215, 0, 0.2),
    0 0 0 1px var(--gold),
    inset 0 2px 10px rgba(255, 255, 255, 0.5);
}

/* 旋转金色边框动画 */
.node-badge::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    transparent,
    var(--gold-glow),
    transparent,
    var(--gold-glow),
    transparent
  );
  animation: rotate 10s linear infinite;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tree-node:hover .node-badge::before {
  opacity: 0.4;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

.node-badge::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--parchment-light), var(--parchment-dark));
  z-index: 1;
}

/* 头像 */
.node-portrait {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  z-index: 2;
  overflow: hidden;
  background: var(--parchment-dark);
}

.node-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(30%) contrast(1.1);
  transition: filter var(--transition-normal);
}

.tree-node:hover .node-portrait img {
  filter: sepia(10%) contrast(1.05);
}

/* 年份标签 */
.node-year {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-dark);
  color: var(--parchment-light);
  font-family: 'Cinzel', serif;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 3;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 节点名称标签 */
.node-label {
  background: linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment) 100%);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--gold-dark);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-align: center;
  max-width: 140px;
  transition: all var(--transition-normal);
}

.tree-node:hover .node-label {
  background: linear-gradient(135deg, #fff8e8 0%, var(--parchment-light) 100%);
  box-shadow:
    0 5px 20px rgba(212, 165, 71, 0.3),
    0 0 20px rgba(255, 215, 0, 0.1);
  border-color: var(--gold);
}

.node-name {
  font-family: 'Cinzel', 'Noto Serif SC', serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.node-subtitle {
  font-size: 0.6875rem;
  color: var(--ink-light);
  margin-top: 0.125rem;
  font-style: italic;
}

/* 根节点特殊样式 */
.tree-node.root .node-badge {
  width: var(--node-size-large);
  height: var(--node-size-large);
  border-width: 4px;
  background: radial-gradient(circle at 30% 30%, #fff8e8, var(--gold-dark));
  border-color: var(--gold);
}

.tree-node.root .node-year {
  font-size: 0.75rem;
  padding: 3px 12px;
}

.tree-node.root .node-label {
  padding: 0.75rem 1.25rem;
  max-width: 180px;
}

.tree-node.root .node-name {
  font-size: 1rem;
}

/* 时代节点 */
.tree-node.era .node-badge {
  width: 100px;
  height: 100px;
}

/* 收起的分支节点 */
.tree-node.collapsed .node-badge {
  border-style: dashed;
  opacity: 0.7;
}

.tree-node.collapsed .node-label::after {
  content: '(点击展开)';
  display: block;
  font-size: 0.625rem;
  color: var(--ink-lighter);
  margin-top: 0.25rem;
}

/* 神学影响线节点（虚线连接） */
.tree-node.influence .node-badge {
  border-style: dotted;
  border-color: var(--gold);
}

/* 阿民念主义特殊样式 - 橙色主题 */
.tree-node.arminian .node-badge {
  border-color: #e67e22;
  background: radial-gradient(circle at 30% 30%, #fff3e6, #f5c89a);
  border-style: dashed;
}

.tree-node.arminian:hover .node-badge {
  border-color: #f39c12;
  box-shadow:
    0 8px 30px rgba(230, 126, 34, 0.4),
    0 0 40px rgba(243, 156, 18, 0.2),
    0 0 0 1px #f39c12,
    inset 0 2px 10px rgba(255, 255, 255, 0.5);
}

.tree-node.arminian .node-year {
  background: #e67e22;
}

.tree-node.arminian .node-label {
  border-color: #e67e22;
}

.tree-node.arminian:hover .node-label {
  border-color: #f39c12;
  box-shadow:
    0 5px 20px rgba(230, 126, 34, 0.3),
    0 0 20px rgba(243, 156, 18, 0.1);
}

/* 跨宗派运动节点 */
.tree-node.movement .node-badge {
  background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--gold-dark));
}

/* ========== 凯尔特结装饰 ========== */
.celtic-knot {
  position: absolute;
  width: 40px;
  height: 40px;
  opacity: 0.6;
  pointer-events: none;
}

.celtic-knot svg {
  width: 100%;
  height: 100%;
  fill: var(--gold-dark);
}

/* ========== 魔法书详情面板 ========== */
.grimoire-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 5, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
  backdrop-filter: blur(4px);
}

.grimoire-overlay.active {
  opacity: 1;
  visibility: visible;
}

.grimoire {
  width: min(900px, 92vw);
  max-height: 90vh;
  background:
    linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment) 50%, var(--parchment-dark) 100%);
  border-radius: 8px;
  position: relative;
  box-shadow:
    0 0 0 4px var(--gold-dark),
    0 0 0 8px var(--branch),
    0 0 60px rgba(0, 0, 0, 0.8),
    0 0 120px rgba(212, 165, 71, 0.2);
  transform: scale(0.85) rotateX(8deg);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.grimoire-overlay.active .grimoire {
  transform: scale(1) rotateX(0);
}

/* 装饰角 */
.grimoire-corner {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid var(--gold);
  opacity: 0.5;
  pointer-events: none;
}

.grimoire-corner.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.grimoire-corner.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.grimoire-corner.bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.grimoire-corner.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

/* 关闭按钮 */
.grimoire-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  background: var(--parchment);
  border: 2px solid var(--gold-dark);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--ink);
  transition: all var(--transition-fast);
  z-index: 10;
}

.grimoire-close:hover {
  background: var(--gold);
  transform: rotate(90deg);
}

/* 内容区域 */
.grimoire-content {
  padding: 2.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

/* 头部 */
.grimoire-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gold-dark);
  position: relative;
}

.grimoire-header::after {
  content: '✦';
  position: absolute;
  bottom: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--parchment);
  padding: 0 0.75rem;
  color: var(--gold);
  font-size: 1.25rem;
}

.grimoire-portrait {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 3px solid var(--gold-dark);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.grimoire-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(20%);
}

.grimoire-era {
  font-family: 'MedievalSharp', serif;
  font-size: 0.8125rem;
  color: var(--gold-dark);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.grimoire-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--ink);
  margin-bottom: 0.25rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.grimoire-dates {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--ink-light);
}

/* 章节 */
.grimoire-section {
  margin-bottom: 2rem;
}

.grimoire-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gold-dark);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.grimoire-section-title::before,
.grimoire-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}

/* 正文 */
.grimoire-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  text-align: justify;
}

.grimoire-text p {
  text-indent: 2em;
  margin-bottom: 1.25rem;
}

.grimoire-text p:last-child {
  margin-bottom: 0;
}

/* 人物卡片 */
.figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.figure-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.5), rgba(212,196,160,0.4));
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  padding: 1.25rem;
  position: relative;
  transition: all var(--transition-fast);
}

.figure-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.figure-card::before {
  content: '§';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  background: var(--parchment);
  padding: 0 0.4rem;
  color: var(--gold);
  font-size: 1.125rem;
}

.figure-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.125rem;
}

.figure-dates {
  font-size: 0.75rem;
  color: var(--gold-dark);
  margin-bottom: 0.625rem;
  font-style: italic;
}

.figure-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-light);
}

/* 教义列表 */
.doctrines-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.doctrine-item {
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(212, 165, 71, 0.1), transparent);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
}

.doctrine-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-bottom: 0.375rem;
}

.doctrine-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink);
}

/* 引言 */
.grimoire-quote {
  margin: 2rem 0;
  padding: 1.75rem;
  background: linear-gradient(135deg, rgba(107, 74, 124, 0.08), rgba(74, 124, 155, 0.08));
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  position: relative;
}

.grimoire-quote::before {
  content: '"';
  position: absolute;
  top: -0.25rem;
  left: 1.25rem;
  font-family: 'Cinzel Decorative', serif;
  font-size: 3.5rem;
  color: var(--gold);
  line-height: 1;
  opacity: 0.5;
}

.quote-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.quote-author {
  font-family: 'Cinzel', serif;
  font-size: 0.8125rem;
  color: var(--gold-dark);
  text-align: right;
}

/* 关联导航 */
.grimoire-related {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gold-dark);
}

.related-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8125rem;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-link {
  background: var(--parchment);
  border: 1px solid var(--gold-dark);
  border-radius: 4px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.related-link:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

/* 标签 */
.grimoire-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 1rem;
}

.tag {
  background: var(--gold-dark);
  color: var(--parchment-light);
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== 详情页新增模块样式 ========== */

/* 神学立场模块 */
.theology-section {
  margin-top: 2rem;
}

.theology-topics {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theology-topic {
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(212, 165, 71, 0.15), transparent);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.topic-header:hover {
  background: linear-gradient(90deg, rgba(212, 165, 71, 0.25), rgba(212, 165, 71, 0.1));
}

.topic-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.topic-toggle {
  color: var(--gold-dark);
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.theology-topic.expanded .topic-toggle {
  transform: rotate(180deg);
}

.topic-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.theology-topic.expanded .topic-content {
  max-height: none;
  padding: 1.25rem;
  border-top: 1px solid var(--gold-dark);
}

.topic-content p {
  font-size: 0.9375rem;
  line-height: 1.9;
  margin-bottom: 1rem;
  text-align: justify;
}

.topic-content p:last-child {
  margin-bottom: 0;
}

.topic-content h5 {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 1.5rem 0 0.75rem 0;
}

.topic-content h5:first-child {
  margin-top: 0;
}

.topic-content strong {
  color: var(--ink);
  font-weight: 600;
}

.topic-content ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.topic-content li {
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

/* 历史发展模块 */
.history-section {
  margin-top: 2rem;
}

.history-narrative {
  margin-bottom: 2rem;
}

.history-narrative p {
  font-size: 0.9375rem;
  line-height: 1.9;
  margin-bottom: 1rem;
  text-align: justify;
}

.history-narrative h5 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 1.75rem 0 0.875rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212, 165, 71, 0.3);
}

.history-narrative h5:first-child {
  margin-top: 0;
}

.history-timeline {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(212, 165, 71, 0.1) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1.5rem;
  position: relative;
}

.timeline-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
  position: relative;
}

.timeline-subtitle::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  margin: 0.75rem auto 0;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 2rem;
}

/* vertical timeline track */
.timeline-list::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--gold-dark), var(--gold-light));
  border-radius: 2px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  align-items: start;
  position: relative;
  border-left: 3px solid var(--gold-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* timeline dot marker */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--gold-dark);
  border: 3px solid var(--parchment);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(212, 165, 71, 0.3);
}

.timeline-year {
  font-family: 'Cinzel', serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: rgba(212, 165, 71, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-event {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.timeline-significance {
  font-size: 0.875rem;
  color: var(--ink-light);
  font-style: italic;
  line-height: 1.5;
}

/* dynamic spacing classes based on time gaps */
.timeline-item.gap-small {
  margin-top: 0.75rem;
}

.timeline-item.gap-medium {
  margin-top: 1.5rem;
}

.timeline-item.gap-large {
  margin-top: 2.5rem;
}

.timeline-item.gap-huge {
  margin-top: 4rem;
}

.timeline-item:first-child {
  margin-top: 0;
}

/* gap indicator for large time jumps */
.timeline-gap-indicator {
  position: relative;
  text-align: center;
  color: var(--ink-light);
  font-size: 0.8rem;
  font-style: italic;
  padding: 0.5rem 0;
  margin-left: -2rem;
}

.timeline-gap-indicator::before {
  content: '···';
  display: block;
  letter-spacing: 0.5em;
  color: var(--gold-dark);
  font-size: 1.5rem;
}

/* 神学影响模块 */
.influences-section {
  margin-top: 2rem;
}

.influences-group {
  margin-bottom: 1.5rem;
}

.influences-group:last-child {
  margin-bottom: 0;
}

.influences-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--gold);
}

.influences-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.influence-item {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(212, 196, 160, 0.3));
  border: 1px solid rgba(212, 165, 71, 0.4);
  border-radius: 6px;
}

.influence-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gold-dark);
  display: block;
  margin-bottom: 0.5rem;
}

.influence-name a {
  color: var(--gold-dark);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.influence-name a:hover {
  color: var(--gold);
}

.influence-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--gold-dark);
  vertical-align: top;
}

.comparison-table th {
  background: var(--gold-dark);
  color: var(--parchment-light);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-table td {
  background: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
}

.comparison-table .topic-cell {
  font-weight: 600;
  color: var(--gold-dark);
  background: rgba(212, 165, 71, 0.1);
}

.comparison-table tr:hover td {
  background: rgba(212, 165, 71, 0.15);
}

/* 实践特色模块 */
.practices-section {
  margin-top: 2rem;
}

.practices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.practice-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(212, 196, 160, 0.3));
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  overflow: hidden;
}

.practice-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(212, 165, 71, 0.2), rgba(212, 165, 71, 0.1));
  border-bottom: 1px solid var(--gold-dark);
}

.practice-icon {
  font-size: 1.25rem;
}

.practice-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.practice-content {
  padding: 1.25rem;
}

.practice-content p {
  font-size: 0.875rem;
  line-height: 1.8;
  margin-bottom: 0.875rem;
  text-align: justify;
}

.practice-content p:last-child {
  margin-bottom: 0;
}

.practice-content h5 {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 1.25rem 0 0.625rem 0;
}

.practice-content h5:first-child {
  margin-top: 0;
}

.practice-content ul {
  margin: 0.625rem 0;
  padding-left: 1.25rem;
}

.practice-content li {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0.375rem;
}

/* 经典文献模块 */
.documents-section {
  margin-top: 2rem;
}

.documents-group {
  margin-bottom: 1.75rem;
}

.documents-group:last-child {
  margin-bottom: 0;
}

.documents-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.document-item {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(212, 165, 71, 0.4);
  border-radius: 6px;
}

.document-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.document-name {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.document-year,
.document-meta {
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-style: italic;
}

.document-desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin: 0;
}

.recommended-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.recommended-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.recommended-level {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--parchment-light);
  background: var(--gold-dark);
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.recommended-books {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink);
}

/* 新格式推荐阅读（带书名、作者、描述） */
.recommended-item.recommended-book {
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(212, 165, 71, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--gold-dark);
}

.recommended-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.recommended-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.recommended-author {
  font-size: 0.875rem;
  color: var(--ink-light);
}

.recommended-author::before {
  content: '—';
  margin-right: 0.25rem;
}

.recommended-year {
  font-size: 0.8rem;
  color: var(--gold-dark);
  font-weight: 500;
}

.recommended-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-light);
  margin: 0;
}

/* 简单字符串格式的推荐阅读 */
.recommended-item.recommended-simple {
  padding: 0.75rem 1rem;
  background: rgba(212, 165, 71, 0.06);
  border-radius: 4px;
  border-left: 2px solid var(--gold);
}

.recommended-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
}

/* 当代状况模块 */
.contemporary-section {
  margin-top: 2rem;
}

.contemporary-group {
  margin-bottom: 1.75rem;
}

.contemporary-group:last-child {
  margin-bottom: 0;
}

.contemporary-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--gold);
}

.distribution-content p,
.challenges-content p,
.outlook-content p {
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 0.875rem;
}

.distribution-content h5,
.challenges-content h5 {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.25rem 0 0.625rem 0;
}

.distribution-content ul,
.challenges-content ul {
  margin: 0.625rem 0;
  padding-left: 1.25rem;
}

.distribution-content li,
.challenges-content li {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0.375rem;
}

.denominations-list,
.institutions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.denomination-item,
.institution-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(212, 165, 71, 0.4);
  border-radius: 6px;
}

.denomination-name,
.institution-name {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.denomination-members,
.institution-type {
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-style: italic;
  display: block;
  margin: 0.25rem 0 0.5rem 0;
}

.denomination-desc,
.institution-desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-light);
  margin: 0;
}

/* 在中国大陆模块 */
.china-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--gold-dark);
}

.china-section .grimoire-section-title {
  color: #c41e3a;
}

.china-section .grimoire-section-title::before,
.china-section .grimoire-section-title::after {
  background: linear-gradient(90deg, transparent, #c41e3a, transparent);
}

.china-group {
  margin-bottom: 1.75rem;
}

.china-group:last-child {
  margin-bottom: 0;
}

.china-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #c41e3a;
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid #c41e3a;
}

.china-content p {
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 0.875rem;
}

.china-content h5 {
  font-family: 'Cinzel', serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.25rem 0 0.625rem 0;
}

.china-content ul {
  margin: 0.625rem 0;
  padding-left: 1.25rem;
}

.china-content li {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0.375rem;
}

.resources-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.resource-item {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(196, 30, 58, 0.05), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(196, 30, 58, 0.3);
  border-radius: 6px;
}

.resource-name {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.resource-type {
  font-size: 0.6875rem;
  color: #c41e3a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin: 0.25rem 0 0.5rem 0;
}

.resource-desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-light);
  margin: 0;
}

/* ========== 控制面板 ========== */
.controls {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.control-btn {
  width: 44px;
  height: 44px;
  background: var(--parchment);
  border: 2px solid var(--gold-dark);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
  background: var(--gold);
  transform: scale(1.1);
}

/* ========== 小地图 ========== */
.minimap {
  position: fixed;
  bottom: 2rem;
  right: 2rem; /* 移到右下角 */
  width: 180px;
  height: 140px;
  background: var(--parchment);
  border: 3px solid var(--gold-dark);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.minimap.visible {
  opacity: 1;
  pointer-events: auto;
}

.minimap-title {
  position: absolute;
  top: 0.25rem;
  left: 0.5rem;
  font-family: 'MedievalSharp', serif;
  font-size: 0.5625rem;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.minimap-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.minimap-viewport {
  position: absolute;
  border: 2px solid var(--gold);
  background: rgba(212, 165, 71, 0.2);
  pointer-events: none;
}

/* ========== 导航提示 ========== */
.nav-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.nav-hint.visible {
  opacity: 1;
}

.nav-hint-text {
  font-family: 'MedievalSharp', serif;
  font-size: 0.875rem;
  color: var(--ink-light);
  background: var(--parchment);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--gold-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== 滚动指示器 ========== */
.scroll-indicator {
  position: fixed;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator-text {
  font-family: 'MedievalSharp', serif;
  font-size: 0.75rem;
  color: var(--ink-light);
  letter-spacing: 0.1em;
}

.scroll-indicator-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ========== 进度条 ========== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--parchment-dark);
  z-index: 1000;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  width: 0%;
  transition: width 0.1s ease;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  :root {
    --node-size: 60px;
    --node-size-large: 90px;
    --portrait-size: 45px;
  }

  /* 隐藏小地图 */
  .minimap {
    display: none;
  }

  /* 移动端控制按钮 - 显示并优化 */
  .controls {
    display: flex;
    flex-direction: row;
    bottom: 1.5rem;
    right: 1rem;
    gap: 0.75rem;
  }

  .control-btn {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  .control-btn:active {
    transform: scale(0.95);
    background: var(--gold);
  }

  /* 浮动时间轴移动端适配 */
  .floating-timeline {
    width: 80px !important;
  }

  .timeline-drag-handle {
    display: none;
  }

  .marker-year {
    font-size: 0.8rem;
    min-width: 35px;
  }

  .marker-era {
    font-size: 0.5rem;
    padding: 2px 4px;
  }

  .timeline-marker::after {
    width: 10px;
    right: -13px;
  }

  /* 导航提示移动端适配 */
  .nav-hint {
    bottom: 5rem;
  }

  .nav-hint-text {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  .chapter {
    padding: 3rem 1.5rem;
  }

  .grimoire-content {
    padding: 1.75rem;
  }

  .grimoire-portrait {
    width: 80px;
    height: 80px;
  }

  .figures-grid {
    grid-template-columns: 1fr;
  }

  /* 禁用浏览器触摸动作，让我们自己处理 */
  .tree-viewport {
    touch-action: none;
    -webkit-overflow-scrolling: auto;
  }
}

@media (max-width: 480px) {
  .chapter-title {
    font-size: 2rem;
  }

  .grimoire-title {
    font-size: 1.5rem;
  }

  .node-label {
    max-width: 100px;
    padding: 0.375rem 0.625rem;
  }

  .node-name {
    font-size: 0.6875rem;
  }

  /* 超小屏幕控制按钮 */
  .controls {
    bottom: 1rem;
    right: 0.75rem;
    gap: 0.5rem;
  }

  .control-btn {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }

  /* 超小屏幕时间轴 */
  .floating-timeline {
    width: 60px !important;
  }

  .marker-year {
    font-size: 0.7rem;
    min-width: 28px;
  }

  .marker-era {
    display: none;
  }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--parchment-dark);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--gold-dark), var(--branch));
  border-radius: 5px;
  border: 2px solid var(--parchment-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}

/* ========== 打印样式 ========== */
@media print {
  .parchment-bg,
  .burned-edges,
  .controls,
  .minimap,
  .nav-hint,
  .scroll-indicator,
  .progress-bar {
    display: none !important;
  }

  body {
    background: white;
  }

  .tree-viewport {
    position: relative;
    overflow: visible;
  }
}
