/* ========= 分类页时间线 ========= */

.type-category .layout.hide-aside {
  max-width: 1600px;
}

.timeline-container {
  position: relative;
  --tl-accent: #6fa1e0;
  --tl-accent-soft: rgba(111, 161, 224, 0.16);
  --tl-line: #aecdec;
  --tl-card-bg: #fff;
  --tl-ink: #33465c;
  --tl-muted: #5f7189;
  --tl-badge: #eef4fb;
  --tl-shadow: 0 10px 30px rgba(60, 90, 140, 0.12);
  --tl-border: rgba(140, 170, 210, 0.22);
}

[data-theme='dark'] .timeline-container {
  --tl-accent: #7fa6d9;
  --tl-accent-soft: rgba(127, 166, 217, 0.18);
  --tl-line: #3f5474;
  --tl-card-bg: #282e39;
  --tl-ink: #d9dfe8;
  --tl-muted: #8f9aac;
  --tl-badge: #2f3644;
  --tl-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  --tl-border: rgba(120, 150, 200, 0.16);
}

/* ---------- 头部 ---------- */

.tl-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 8px 12px;
}

.tl-header-badge {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--tl-accent);
  background: var(--tl-badge);
  border: 1px solid var(--tl-line);
}

.tl-header-main {
  flex: 1;
  min-width: 240px;
}

.tl-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--tl-muted);
  margin-bottom: 2px;
}

.tl-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--tl-ink);
}

.tl-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--tl-muted);
}

.tl-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--tl-muted);
  white-space: nowrap;
}

.tl-meta-rule {
  width: 64px;
  height: 1px;
  background: var(--tl-line);
}

/* ---------- 工具条 ---------- */

.tl-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 8px 14px;
  font-size: 12.5px;
  color: var(--tl-muted);
}

.tl-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 可拖拽视口与舞台 ---------- */

.tl-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.tl-viewport.is-dragging {
  cursor: grabbing;
}

.tl-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* ---------- 波浪线 ---------- */

.tl-wave {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.tl-wave-line {
  fill: none;
  stroke: var(--tl-line);
  stroke-width: 2;
  stroke-dasharray: 12 9;
  stroke-linecap: round;
  opacity: 0.9;
}

/* ---------- 年份水印(竖排,贴泳道左缘,避开卡片) ---------- */

.tl-year {
  position: absolute;
  left: 12px;
  z-index: 1;
  writing-mode: vertical-rl;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 10px;
  line-height: 1;
  color: var(--tl-accent);
  opacity: 0.16;
  pointer-events: none;
  animation: tl-fade 0.7s backwards;
}

/* ---------- 节点 / 连接线 / 日期 ---------- */

.tl-node {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tl-card-bg);
  border: 2.5px solid var(--tl-accent);
  box-shadow: 0 0 0 5px var(--tl-accent-soft);
  animation: tl-pop 0.5s backwards;
}

.tl-stem {
  position: absolute;
  z-index: 1;
  width: 2px;
  background: linear-gradient(180deg, var(--tl-line), var(--tl-accent-soft));
  opacity: 0.8;
  animation: tl-fade 0.6s backwards;
}

.tl-node-date {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--tl-muted);
  animation: tl-fade 0.6s backwards;
}

/* ---------- 卡片 ---------- */

.tl-card {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: var(--tl-card-bg);
  border: 1px solid var(--tl-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--tl-shadow);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: tl-fade-up 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.tl-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(60, 90, 140, 0.2);
  z-index: 6;
}

.tl-viewport.is-dragging .tl-card:hover {
  transform: none;
}

.tl-card-cover {
  position: relative;
  flex: none;
  height: 150px;
  overflow: hidden;
  background: var(--tl-badge);
}

.tl-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-card-date {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
  background: rgba(20, 30, 45, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tl-card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 12px;
}

.tl-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--tl-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--tl-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-card-foot {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed var(--tl-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tl-muted);
}

.tl-card-pv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-card-go {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--tl-accent);
  background: var(--tl-accent-soft);
}

.tl-card-go i {
  transform: rotate(-45deg);
}

/* ---------- 空状态 ---------- */

.tl-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--tl-muted);
}

/* ---------- 动画 ---------- */

@keyframes tl-fade-up {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

@keyframes tl-fade {
  from {
    opacity: 0;
  }
}

@keyframes tl-pop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-card,
  .tl-node,
  .tl-stem,
  .tl-node-date,
  .tl-year {
    animation: none !important;
  }
}

@media (max-width: 600px) {
  .tl-title {
    font-size: 24px;
  }

  .tl-header-badge {
    width: 46px;
    height: 46px;
    font-size: 17px;
  }
}
