/* ============================
   高晓庄 札记 - 时间图（timeline）样式
   ============================ */

.timeline-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 4px 24px;
}

/* ---------- 顶部贡献热图 ---------- */
.contribution-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e3e4e6);
  border-radius: 12px;
  padding: 18px 18px 16px;
  margin: 0 0 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.contribution-card .contrib-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color, #24292f);
  margin: 0 0 4px;
}

.contribution-card .contrib-sub {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 14px;
}

.contrib-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

.contrib-stats b {
  color: var(--text-color, #24292f);
  font-weight: 600;
  margin-right: 4px;
}

.contribution-graph-wrap {
  overflow-x: auto;
  padding: 4px 2px 2px;
}

.contribution-graph-wrap svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- 时间轴本体 ---------- */
.timeline {
  position: relative;
  padding: 8px 0 0 8px;
  margin: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--theme-color, #4361ee) 0%,
    rgba(67, 97, 238, .12) 100%
  );
}

.timeline-year {
  position: relative;
  margin: 26px 0 10px 24px;
}

.timeline-year:first-child {
  margin-top: 6px;
}

.timeline-year-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--theme-color, #4361ee);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border-radius: 12px;
  margin-left: -8px;
  box-shadow: 0 1px 3px rgba(67,97,238,.25);
}

.timeline-year-stat {
  display: inline-block;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-left: 8px;
  font-weight: normal;
}

.timeline-month {
  position: relative;
  margin: 18px 0 12px 24px;
}

.timeline-month-tag {
  display: inline-block;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--theme-color, #4361ee);
  color: var(--theme-color, #4361ee);
  padding: 2px 10px;
  font-weight: 600;
  font-size: 12px;
  border-radius: 10px;
  margin-left: -8px;
}

.timeline-item {
  position: relative;
  margin: 0 0 14px 24px;
  padding: 10px 14px 10px 16px;
  background: var(--card-bg, #fff);
  border-radius: 8px;
  border: 1px solid var(--card-border, #e8e8e8);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 16px;
  width: 10px;
  height: 10px;
  background: var(--card-bg, #fff);
  border: 2.5px solid var(--theme-color, #4361ee);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(67,97,238,.10);
}

.timeline-item:hover {
  transform: translateX(2px);
  border-color: var(--theme-color, #4361ee);
  box-shadow: 0 2px 8px rgba(67,97,238,.10);
}

.timeline-item:hover::before {
  background: var(--theme-color, #4361ee);
}

.timeline-item-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--theme-color, #4361ee);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

.timeline-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color, #24292f);
  line-height: 1.5;
  text-decoration: none;
  transition: color .15s ease;
}

.timeline-item-title:hover {
  color: var(--theme-color, #4361ee);
}

.timeline-item-cat {
  display: inline-block;
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
  background: rgba(67,97,238,.08);
  padding: 1px 7px;
  border-radius: 6px;
  margin-left: 6px;
  font-weight: 500;
}

.timeline-empty {
  margin-left: 24px;
  font-size: 12px;
  color: var(--text-secondary, #9ca3af);
  font-style: italic;
  padding: 8px 0;
}

.timeline-note {
  margin: 30px 0 0 24px;
  padding: 12px 16px;
  background: rgba(67,97,238,.04);
  border-left: 3px solid var(--theme-color, #4361ee);
  border-radius: 0 6px 6px 0;
  font-size: 12.5px;
  color: var(--text-secondary, #6b7280);
  line-height: 1.7;
}

.timeline-note a {
  color: var(--theme-color, #4361ee);
  text-decoration: none;
  border-bottom: 1px dashed var(--theme-color, #4361ee);
}

.timeline-note a:hover {
  border-bottom-style: solid;
}

/* ---------- 移动端 ---------- */
@media (max-width: 680px) {
  .timeline-page { padding: 4px; }
  .contribution-card { padding: 14px 12px 12px; }
  .contrib-stats { gap: 12px; }
  .timeline { padding-left: 4px; }
  .timeline::before { left: 6px; }
  .timeline-item { margin-left: 18px; padding: 9px 10px; }
  .timeline-item::before { left: -19px; }
  .timeline-year, .timeline-month { margin-left: 18px; }
  .timeline-note { margin-left: 18px; }
}

/* ---------- 暗色主题适配 ---------- */
[data-theme="dark"] .contribution-card,
[data-theme="dark"] .timeline-item {
  background: #1f2228;
  border-color: #30363d;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}

[data-theme="dark"] .contribution-card .contrib-title,
[data-theme="dark"] .timeline-item-title {
  color: #e6edf3;
}

[data-theme="dark"] .timeline-month-tag {
  background: #1f2228;
}

[data-theme="dark"] .timeline-item::before {
  background: #1f2228;
}

[data-theme="dark"] .timeline-note {
  background: rgba(110, 130, 246, .08);
}
