/* ===== 页面布局 ===== */
.page-header { text-align: center; padding: 60px 24px 30px; }
.page-header h1 { font-size: 2.2rem; color: var(--accent); margin-bottom: 8px; }
.page-header p { color: var(--muted); }

.timeline-toolbar {
  max-width: 1200px; margin: 0 auto 20px; padding: 0 24px;
  display: flex; gap: 12px; align-items: center;
}
.timeline-toolbar input {
  flex: 1; padding: 10px 16px; background: var(--card-bg);
  border: 1px solid rgba(201, 162, 39, 0.3); border-radius: 6px;
  color: var(--text-color); font-size: 1rem; outline: none;
}
.timeline-toolbar input:focus { border-color: var(--accent); }
.timeline-toolbar button {
  padding: 10px 20px; background: transparent; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 6px; cursor: pointer; transition: 0.2s;
}
.timeline-toolbar button:hover { background: var(--accent); color: #14141a; }

/* ===== 核心视口 ===== */
.timeline-viewport {
  width: 100%; 
  /* 【调整高度】根据实际需要，把视口高度压低，避免大片空白 */
  height: 420px; 
  overflow: auto; position: relative;
  background: #0e0e12;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  scrollbar-width: none;
}
.timeline-viewport::-webkit-scrollbar { display: none; }

.timeline-canvas {
  position: relative; 
  height: 100%;
  transition: width 0.2s ease-out;
  overflow: hidden;
}

/* ===== 轴与刻度 ===== */
.timeline-axis-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
}
/* 【调整轴线】让轴线靠近底部一点，把上面的空间留给卡片 */
.axis-line {
  position: absolute; bottom: 40px; left: 0; width: 100%; height: 2px;
  background: rgba(201, 162, 39, 0.5);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.2);
}
.axis-tick {
  position: absolute; bottom: 40px; transform: translateX(-50%);
}
.axis-tick .tick-mark {
  width: 2px; background: rgba(201, 162, 39, 0.4); margin: 0 auto;
}
.axis-tick.major .tick-mark { background: var(--accent); }
.axis-tick span {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  color: var(--muted); font-family: "Constantia", monospace;
  font-size: 0.8rem; white-space: nowrap;
}

/* ===== 事件卡片 ===== */
.tl-card {
  position: absolute; width: 160px; background: var(--card-bg);
  border: 1px solid rgba(201, 162, 39, 0.4); border-radius: 8px; padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6); transform: translateX(-50%);
  cursor: pointer; z-index: 5;
  
  /* 【核心调整】卡片底部贴着轴线，也就是距离底部 40px */
  bottom: 40px; 
}
.tl-card:hover {
  border-color: var(--accent); z-index: 10;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.4);
}

/* 从卡片底部连到轴线的竖线 */
.tl-line {
  position: absolute; bottom: 40px; width: 1px; height: 0px; /* 默认没线，有需要加 */
  background: rgba(201, 162, 39, 0.3); transform: translateX(-50%); z-index: 1;
}

/* 轴线上的发光点 */
.tl-dot {
  position: absolute; bottom: 36px; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 0 12px var(--accent); z-index: 2;
}

/* 卡片内部文字 */
.tl-year { color: var(--accent); font-family: "Constantia", monospace; font-size: 0.8rem; font-weight: bold; margin-bottom: 4px; }
.tl-title { font-size: 0.85rem; color: var(--text-color); margin-bottom: 4px; line-height: 1.4; }
.tl-desc { font-size: 0.7rem; color: var(--muted); }

/* ===== 当前时间指示线 ===== */
.tl-now-line {
  position: absolute;
  bottom: 0; height: 100%; width: 1px;
  background: #ff5e5e; transform: translateX(-50%);
  z-index: 3; pointer-events: none;
}
.tl-now-label {
  position: absolute; top: 20px; left: 0;
  transform: translateX(-50%);
  background: #ff5e5e; color: #fff;
  padding: 4px 10px; border-radius: 4px;
  font-size: 0.8rem; font-weight: bold; white-space: nowrap;
}
.tl-now-dot {
  position: absolute; bottom: 36px; width: 10px; height: 10px;
  background: #ff5e5e; border-radius: 50%;
  transform: translateX(-50%); z-index: 4;
  animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 94, 94, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(255, 94, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 94, 94, 0); }
}

/* ===== 悬浮缩放条 ===== */
.zoom-control {
  position: fixed; bottom: 30px; right: 30px;
  display: flex; align-items: center;
  background: rgba(30, 30, 40, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 8px; padding: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  z-index: 9999; transition: border-color 0.2s;
}
.zoom-control:hover { border-color: var(--accent); }
.zoom-control button {
  background: transparent; border: none; color: var(--accent);
  font-size: 1.2rem; width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: 0.2s;
}
.zoom-control button:hover { background: rgba(201, 162, 39, 0.15); color: #fff; }
.zoom-control input {
  width: 48px; height: 32px; background: transparent; border: none;
  color: var(--text-color); font-family: "Constantia", monospace;
  font-size: 0.95rem; text-align: right; outline: none;
  appearance: textfield; -moz-appearance: textfield;
}
.zoom-control input::-webkit-outer-spin-button,
.zoom-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.zoom-control span { color: var(--muted); font-size: 0.85rem; margin-right: 8px; margin-left: 2px; }