* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f1e8;
  min-height: 100vh;
  overflow-x: hidden;
  color: #2c2416;
}
body.exporting *,
body.exporting *::before,
body.exporting *::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
body.exporting .legend,
body.exporting .export-btn {
  display: none !important;
}

/* 卷轴容器 */
.scroll-container {
  display: flex;
  height: 100vh;
  position: relative;
}

/* 竖置标题区域 */
.vertical-header {
  width: 80px;
  background: linear-gradient(to bottom, #fff9f0, #fef6ed);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  border-right: 2px solid #d4a574;
  box-shadow: 2px 0 8px rgba(139, 69, 19, 0.1);
}

.vertical-header h1 {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 1.8em;
  color: #8b4513;
  font-weight: 700;
  letter-spacing: 8px;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.vertical-header .subtitle {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.85em;
  color: #a0826d;
  font-weight: 400;
  margin-top: 30px;
  letter-spacing: 3px;
}

/* 卷轴边缘装饰 - 现代化简约边框 */
.scroll-edge {
  width: 3px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(212, 165, 116, 0.4) 20%,
    rgba(212, 165, 116, 0.6) 50%,
    rgba(212, 165, 116, 0.4) 80%,
    transparent
  );
  position: relative;
  z-index: 10;
}

.scroll-edge.left {
  display: none;
}

.scroll-edge.right {
  margin-left: 20px;
}

.scroll-rod {
  display: none;
}

/* 主内容区域 */
.main-content {
  flex: 1;
  background: linear-gradient(135deg, #fef9f3 0%, #fdf6ed 50%, #fcf3e8 100%);
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scroll-behavior: smooth;
  box-shadow: inset 0 0 50px rgba(139, 69, 19, 0.03);
  /* 纸质纹理效果 */
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(139, 69, 19, 0.02) 2px,
      rgba(139, 69, 19, 0.02) 4px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(139, 69, 19, 0.02) 2px,
      rgba(139, 69, 19, 0.02) 4px
    );
}

/* 导出按钮 */
.export-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d4a574;
  color: #8b4513;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.export-btn svg {
  stroke-width: 1.8;
  width: 20px;
  height: 20px;
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 69, 19, 0.25);
  background: #8b4513;
  color: #fff;
  border-color: #8b4513;
}

.export-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
}

/* 图例 - 已隐藏，领域信息显示在背景色带上 */
.legend {
  display: none;
  position: fixed;
  top: 50%;
  right: 30px; /* 右侧悬浮 */
  bottom: auto;
  left: auto;
  transform: translateY(-50%); /* 垂直居中 */
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 2px solid #e8dcc8;
  backdrop-filter: blur(10px);
  z-index: 50;
  display: flex;
  flex-direction: column; /* 垂直排列 */
  align-items: stretch;
  gap: 15px;
  max-height: 80vh;
  overflow-y: auto;
}

.legend-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #5d3a1a;
  padding-right: 0;
  padding-bottom: 12px;
  border-right: none;
  border-bottom: 2px solid #e8dcc8; /* 改为底部底边框 */
  writing-mode: horizontal-tb;
  white-space: nowrap;
  text-align: center;
}

.legend-items {
  display: flex;
  flex-direction: column; /* 垂直列表 */
  gap: 12px;
  align-items: flex-start;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.legend-item:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid;
  flex-shrink: 0;
}

.legend-label {
  font-size: 0.9em;
  color: #5d3a1a;
  font-weight: 500;
  white-space: nowrap;
}

/* 图例颜色 - Updated Palette */
.legend-amo .legend-color {
  background: linear-gradient(135deg, #f5ecfa, #ebe3f2);
  border-color: #9b59b6;
}

.legend-particle .legend-color {
  background: linear-gradient(135deg, #ebf5fb, #d6eaf8);
  border-color: #3498db;
}

.legend-astrophysics .legend-color {
  background: linear-gradient(135deg, #eaecee, #d5d8dc);
  border-color: #2c3e50;
}

.legend-nuclear .legend-color {
  background: linear-gradient(135deg, #fdedec, #fadbd8);
  border-color: #e74c3c;
}

.legend-condensed .legend-color {
  background: linear-gradient(135deg, #eafaf1, #d5f5e3);
  border-color: #27ae60;
}

.legend-complex .legend-color {
  background: linear-gradient(135deg, #fef9e7, #fdebd0);
  border-color: #f1c40f;
}

/* 时间轴包装器 - D3容器 */
.timeline-wrapper {
  position: relative;
  height: 100vh;
  /* 删除 width: 100% 限制，或者改为允许内容撑开 */
  min-width: 100%;
  width: fit-content;
  overflow: visible; /* 允许内部 timeline 撑开 */
  background: transparent;
}

/* 时间轴中线 */
.timeline-axis {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    to right,
    rgba(139, 69, 19, 0) 0%,
    rgba(139, 69, 19, 0.8) 10%,
    rgba(139, 69, 19, 0.8) 90%,
    rgba(139, 69, 19, 0) 100%
  );
  z-index: 0;
  box-shadow: 0 0 10px rgba(139, 69, 19, 0.2);
}

/* D3生成的卡片 */
.card {
  position: absolute;
  width: 100px;
  height: 130px;
  border-radius: 6px;
  background-size: cover !important; /* 强制覆盖可能被后续简写属性重置的值 */
  background-position: center top !important;
  background-repeat: no-repeat !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  border: 2px solid #fff;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  overflow: hidden;
  z-index: 10;
}

/* 图片缺失时的占位样式 */
.card.no-image {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card.no-image::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 40px;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,0.4)'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
}

.card:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

/* 卡片右上角国旗 */
.card-flag {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

/* 卡片遮罩与信息 */
.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.7) 60%,
    rgba(0, 0, 0, 0.9) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px;
  color: white;
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

.card-name {
  font-size: 12px;
  font-weight: bold;
  line-height: 1.25; /* 稍微增加行高以容纳可能的对齐 */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap; /* 强制不换行 */
  transform-origin: left bottom; /* 为可能的JS缩放做准备 */
}

/* 不再使用的样式保留以兼容 */
.card-year {
  display: none;
}

.card-country {
  display: none;
}

.card-line {
  position: absolute;
  width: 2px;
  background-color: rgba(139, 69, 19, 0.4);
  pointer-events: none;
  z-index: 1;
}

/* 时间轴折叠断裂标记 - 高清SVG波浪 */
.axis-break-marker {
  position: absolute;
  width: 40px;
  height: 20px;
  transform: translate(-50%, -25%); /* 别动这里 */
  z-index: 21; /* 提高层级 */
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cpath d='M0,10 L40,10' stroke='%23fdf6ed' stroke-width='6' /%3E%3Cpath d='M-2,10 L5,2 L12,18 L19,2 L26,18 L33,2 L42,10' stroke='%23fdf6ed' stroke-width='8' fill='none' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M-2,10 L5,2 L12,18 L19,2 L26,18 L33,2 L42,10' stroke='%238b4513' stroke-width='2.5' fill='none' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.axis-break-marker::before,
.axis-break-marker::after,
.break-line-1,
.break-line-2 {
  display: none;
}

/* 连接点 */
.timeline-dot {
  position: absolute; /* Relative to wrapper if wrapper used, but code used absolute directly */
  /* Remove absolute here if wrapping, but let's see implementation */
  width: 12px;
  height: 12px;
  background: #8b4513;
  border-radius: 50%;
  /* top/left will be handled by JS or parent */
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow:
    0 0 0 2px #fff,
    0 0 4px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* 交互式轴标记组 */
.axis-marker-group {
  cursor: pointer;
  z-index: 20;
  transition: transform 0.3s ease;
}

.axis-marker-group:hover {
  transform: scale(1.1);
}

.axis-marker-group:hover .timeline-dot {
  box-shadow:
    0 0 0 4px #fff,
    0 0 8px rgba(0, 0, 0, 0.4);
}

.axis-marker-group:hover .year-label {
  color: #d4a574 !important;
  text-shadow: 0 0 1px rgba(139, 69, 19, 0.5);
}

/* 隐藏原有时间轴样式 */
.timeline {
  display: block; /* 覆盖 flex */
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible; /* 允许内容超出，由外层scroll-container滚动 */
}

.timeline-item,
.timeline-dot,
.year-label,
.laureates {
  /* 之前的样式不再需要，或者会被D3生成的DOM取代 */
}

/* 卡片 - 旧样式已移除 */

/* AMO - Purple */
.card-amo {
  background: linear-gradient(135deg, #faf7fc, #f5f0f9);
  border-color: #c8b3dc;
}
.timeline-item:hover .card-amo {
  border-color: #9b59b6;
}

/* Particle - Blue */
.card-particle {
  background: linear-gradient(135deg, #f7fbff, #f0f7fd);
  border-color: #a9cce3;
}
.timeline-item:hover .card-particle {
  border-color: #3498db;
}

/* Astrophysics - Deep Dark Blue Theme */
.card-astrophysics {
  background: linear-gradient(135deg, #f8f9f9, #f2f3f4);
  border-color: #abb2b9;
}
.timeline-item:hover .card-astrophysics {
  border-color: #2c3e50;
}

/* Nuclear - Red */
.card-nuclear {
  background: linear-gradient(135deg, #fffaf9, #fdedec);
  border-color: #f5b7b1;
}
.timeline-item:hover .card-nuclear {
  border-color: #e74c3c;
}

/* Condensed - Green */
.card-condensed {
  background: linear-gradient(135deg, #f4fcf7, #eafaf1);
  border-color: #a9dfbf;
}
.timeline-item:hover .card-condensed {
  border-color: #27ae60;
}

/* Complex - Gold */
.card-complex {
  background: linear-gradient(135deg, #fefbf0, #fef9e7);
  border-color: #f9e79f;
}
.timeline-item:hover .card-complex {
  border-color: #f1c40f;
}

.laureates {
  margin: 20px 0;
}

.laureate {
  padding: 14px 16px;
  margin: 10px 0;
  border-radius: 8px;
  border-left: 4px solid;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
}

.laureate-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 15px;
  border: 2px solid rgba(212, 165, 116, 0.6);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.laureate-info {
  display: flex;
  flex-direction: column;
}

.laureate:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.laureate-name {
  font-weight: 600;
  font-size: 1.1em;
  margin-bottom: 6px;
}

.laureate-country {
  font-size: 0.9em;
  opacity: 0.8;
}

.laureate-bio {
  margin-top: 8px;
  font-size: 0.9em;
  color: #555;
  line-height: 1.5;
}

/* AMO */
.laureate-amo {
  background: linear-gradient(135deg, #f5ecfa, #ebe3f2);
  border-left-color: #9b59b6;
}
.laureate-amo:hover {
  background: linear-gradient(135deg, #f0e5f7, #e5dcef);
}
.laureate-amo .laureate-name {
  color: #5a2d7a;
}
.laureate-amo .laureate-country {
  color: #7a5094;
}

/* Particle */
.laureate-particle {
  background: linear-gradient(135deg, #ebf5fb, #d6eaf8);
  border-left-color: #3498db;
}
.laureate-particle:hover {
  background: linear-gradient(135deg, #e0f0f9, #d0e5f4);
}
.laureate-particle .laureate-name {
  color: #21618c;
}
.laureate-particle .laureate-country {
  color: #2e86c1;
}

/* Astrophysics */
.laureate-astrophysics {
  background: linear-gradient(135deg, #eaecee, #d5d8dc);
  border-left-color: #2c3e50;
}
.laureate-astrophysics:hover {
  background: linear-gradient(135deg, #e2e4e6, #ced2d6);
}
.laureate-astrophysics .laureate-name {
  color: #17202a;
}
.laureate-astrophysics .laureate-country {
  color: #566573;
}

/* Nuclear */
.laureate-nuclear {
  background: linear-gradient(135deg, #fdedec, #fadbd8);
  border-left-color: #e74c3c;
}
.laureate-nuclear:hover {
  background: linear-gradient(135deg, #fceceb, #f9d2ce);
}
.laureate-nuclear .laureate-name {
  color: #922b21;
}
.laureate-nuclear .laureate-country {
  color: #cb4335;
}

/* Condensed */
.laureate-condensed {
  background: linear-gradient(135deg, #eafaf1, #d5f5e3);
  border-left-color: #27ae60;
}
.laureate-condensed:hover {
  background: linear-gradient(135deg, #e3f7eb, #cef2de);
}
.laureate-condensed .laureate-name {
  color: #145a32;
}
.laureate-condensed .laureate-country {
  color: #1e8449;
}

/* Complex */
.laureate-complex {
  background: linear-gradient(135deg, #fef9e7, #fdebd0);
  border-left-color: #f1c40f;
}
.laureate-complex:hover {
  background: linear-gradient(135deg, #fdf6df, #fce6c5);
}
.laureate-complex .laureate-name {
  color: #7d6608;
}
.laureate-complex .laureate-country {
  color: #9a7d0a;
}

.achievement {
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 22px;
  line-height: 1.8;
  font-size: 1.15em;
  border: 3px solid;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Achievement Colors */
.achievement-amo {
  background: linear-gradient(135deg, #f5ecfa, #ebe3f2);
  color: #5a2d7a;
  border-color: #9b59b6;
}

.achievement-particle {
  background: linear-gradient(135deg, #ebf5fb, #d6eaf8);
  color: #21618c;
  border-color: #3498db;
}

.achievement-astrophysics {
  background: linear-gradient(135deg, #eaecee, #d5d8dc);
  color: #17202a;
  border-color: #2c3e50;
}

.achievement-nuclear {
  background: linear-gradient(135deg, #fdedec, #fadbd8);
  color: #922b21;
  border-color: #e74c3c;
}

.achievement-condensed {
  background: linear-gradient(135deg, #eafaf1, #d5f5e3);
  color: #145a32;
  border-color: #27ae60;
}

.achievement-complex {
  background: linear-gradient(135deg, #fef9e7, #fdebd0);
  color: #7d6608;
  border-color: #f1c40f;
}

.read-more {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #d4a574, #c69768);
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

.read-more:hover {
  background: linear-gradient(135deg, #c69768, #b8956a);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
  transform: translateY(-2px);
}

/* 人物详情弹窗样式 */
.detail-header-person {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 30px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 20px;
}

.person-image-container {
  flex-shrink: 0;
  width: 150px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 4px solid #fff;
}

.person-large-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 10px;
}

.person-name {
  font-size: 2.2em;
  color: #2c2416;
  margin-bottom: 10px;
  line-height: 1.1;
}

.person-country {
  font-size: 1em;
  color: #666;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.person-prize-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9em;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.switch-view-btn {
  margin-top: 25px;
  background: transparent;
  border: 2px solid #aec0d6;
  color: #5d6d7e;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch-view-btn:hover {
  background: #f0f4f8;
  border-color: #8fa0b5;
  color: #2c3e50;
}

/* Badge Colors */
.bg-amo {
  background: #9b59b6;
}
.bg-particle {
  background: #3498db;
}
.bg-astrophysics {
  background: #2c3e50;
}
.bg-nuclear {
  background: #e74c3c;
}
.bg-condensed {
  background: #27ae60;
}
.bg-complex {
  background: #f1c40f;
}

/* Detail Panel Styles */
.detail-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow:
    0 20px 60px rgba(139, 69, 19, 0.25),
    0 8px 24px rgba(139, 69, 19, 0.15);
  z-index: 100;
  border: 3px solid #d4a574;
  animation: slideIn 0.3s ease;
  color: #2c2416;
  background-image:
    radial-gradient(
      circle at 20% 30%,
      rgba(255, 250, 240, 0.9),
      transparent 60%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(255, 250, 240, 0.9),
      transparent 60%
    );
}

.detail-panel-amo {
  border-color: #9b59b6;
}
.detail-panel-particle {
  border-color: #3498db;
}
.detail-panel-astrophysics {
  border-color: #2c3e50;
}
.detail-panel-nuclear {
  border-color: #e74c3c;
}
.detail-panel-condensed {
  border-color: #27ae60;
}
.detail-panel-complex {
  border-color: #f1c40f;
}

/* Detail Titles */
.detail-title {
  margin-bottom: 20px;
  font-size: 2em;
  padding-bottom: 15px;
  border-bottom: 3px solid;
}
.detail-title-amo {
  color: #5a2d7a;
  border-bottom-color: #9b59b6;
}
.detail-title-particle {
  color: #21618c;
  border-bottom-color: #3498db;
}
.detail-title-astrophysics {
  color: #17202a;
  border-bottom-color: #2c3e50;
}
.detail-title-nuclear {
  color: #922b21;
  border-bottom-color: #e74c3c;
}
.detail-title-condensed {
  color: #145a32;
  border-bottom-color: #27ae60;
}
.detail-title-complex {
  color: #7d6608;
  border-bottom-color: #f1c40f;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.detail-panel.hidden {
  display: none;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #e8776f, #d96459);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(217, 100, 89, 0.3);
}

.close-btn:hover {
  background: linear-gradient(135deg, #d96459, #ca5349);
  box-shadow: 0 4px 12px rgba(217, 100, 89, 0.4);
  transform: scale(1.1);
}

/* 年份导航 */
.year-nav {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow:
    0 4px 20px rgba(139, 69, 19, 0.15),
    0 2px 8px rgba(139, 69, 19, 0.1);
  backdrop-filter: blur(20px);
  border: 2px solid #e8dcc8;
  z-index: 50;
  max-width: 90%;
  overflow-x: auto;
}

.year-nav-content {
  display: flex;
  gap: 8px;
  align-items: center;
}

.year-nav-item {
  padding: 8px 16px;
  background: #fef9f3;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 0.85em;
  border: 1px solid #e8dcc8;
  color: #6d5d4f;
}

.year-nav-item:hover {
  background: #fdf6ed;
  color: #8b4513;
  border-color: #d4a574;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
}

.year-nav-item.active {
  background: linear-gradient(135deg, #d4a574, #c69768);
  color: #ffffff;
  border-color: #c69768;
  box-shadow: 0 2px 10px rgba(139, 69, 19, 0.25);
  font-weight: 600;
}

/* 滚动条样式 */
.main-content::-webkit-scrollbar {
  height: 10px;
}

.main-content::-webkit-scrollbar-track {
  background: rgba(232, 220, 200, 0.3);
  border-radius: 5px;
}

.main-content::-webkit-scrollbar-thumb {
  background: linear-gradient(to right, #d4a574, #c69768);
  border-radius: 5px;
  border: 2px solid #fef9f3;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to right, #c69768, #b8956a);
}

/* 控制按钮区域 - 已移除 */
.controls {
  display: none;
}

/* 版权页脚 */
.copyright-footer {
  position: fixed;
  bottom: 10px;
  right: 20px;
  text-align: right;
  font-size: 0.8em;
  color: #8b4513;
  opacity: 0.7;
  z-index: 40;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.copyright-footer a {
  color: #8b4513;
  text-decoration: none;
  border-bottom: 1px dotted #8b4513;
  pointer-events: auto;
}

.copyright-footer a:hover {
  border-bottom-style: solid;
  opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .vertical-header {
    width: 60px;
    padding: 30px 15px;
  }

  .vertical-header h1 {
    font-size: 1.4em;
    letter-spacing: 6px;
  }

  .vertical-header .subtitle {
    font-size: 0.7em;
    letter-spacing: 2px;
  }

  .timeline-item {
    min-width: 280px;
  }

  .detail-panel {
    padding: 25px;
    max-width: 90%;
  }

  .export-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }

  .legend {
    bottom: 10px;
    left: 50%;
    top: auto;
    right: auto;
    transform: translateX(-50%);
    padding: 10px 16px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 90%;
  }

  .legend-title {
    font-size: 0.9em;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: none;
    border-bottom: 2px solid #e8dcc8;
  }

  .legend-items {
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .legend-color {
    width: 20px;
    height: 20px;
  }

  .legend-label {
    font-size: 0.75em;
  }

  .controls {
    top: auto;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
  }

  .copyright-footer {
    display: none; /* 移动端隐藏以节省空间 */
  }
}

/* 加载动画 */
.loading {
  text-align: center;
  padding: 50px;
  font-size: 1.5em;
  color: #8b4513;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 165, 116, 0.3);
  border-radius: 50%;
  border-top-color: #d4a574;
  animation: spin 1s linear infinite;
}
