/* ============================================================
   步哥看天下 ･ 「天中通史」时间轴（timeline.html 专用）
   一、时期锚点条  二、竖向时间轴与期次头  三、节点卡  四、手机版
   配色只取 style.css 的变量（ink / paper / surface / acid / line），深浅模式通用。
   手机版（≤760px）：单列、轴线内收、锚点条取消吸顶。
   ============================================================ */

/* ---------- 一、时期锚点条 ---------- */
.wb-tl-nav {
  position: sticky;
  top: 70px;
  z-index: 40;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--wb-line);
  background: color-mix(in srgb, var(--wb-paper) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  scrollbar-width: none;
}
.wb-tl-nav::-webkit-scrollbar { display: none; }

.wb-tl-nav__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--wb-line);
  background: var(--wb-surface);
  color: var(--wb-muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.wb-tl-nav__chip b { font-family: var(--wb-pixel); font-size: 12px; color: var(--wb-label); }
.wb-tl-nav__chip:hover { border-color: var(--wb-ink); color: var(--wb-ink); }
.wb-tl-nav__chip.is-active {
  border-color: var(--wb-ink);
  background: var(--wb-acid);
  color: var(--wb-on-acid, var(--wb-ink));
  font-weight: 700;
}
.wb-tl-nav__chip.is-active b { color: var(--wb-ink); }

/* ---------- 二、时间轴与期次头 ---------- */
.wb-tl { position: relative; }

.wb-tl-era {
  position: relative;
  padding-left: 52px;
  padding-bottom: 40px;
}
.wb-tl-era:last-child { padding-bottom: 0; }

.wb-tl-era::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: var(--wb-line);
}
.wb-tl-era:last-child::before { display: none; }

.wb-tl-era__mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--wb-ink);
  background: var(--wb-acid);
  font-family: var(--wb-pixel);
  font-size: 12px;
  color: var(--wb-on-acid, var(--wb-ink));
}

.wb-tl-era__head { margin-bottom: 16px; }
.wb-tl-era__name {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
/* 时期名分隔点：CSS 实心小方块，不依赖字体（U+00B7 在部分电脑字体下显示为豆腐块） */
.wb-tl-sep {
  display: inline-block;
  width: .34em;
  height: .34em;
  margin: 0 .42em;
  background: currentColor;
  vertical-align: .12em;
}
.wb-tl-era__range {
  display: block;
  margin: 5px 0 0;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--wb-label);
}
.wb-tl-era__desc {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--wb-muted);
}

/* ---------- 三、节点卡 ---------- */
.wb-tl-nodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wb-tl-node {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--wb-ink);
  background: var(--wb-surface);
  color: inherit;
  text-decoration: none;
}

.wb-tl-node__col {
  padding: 3px 7px;
  border: 1px solid var(--wb-line);
  font-size: 12px;
  line-height: 1.3;
  color: var(--wb-muted);
  white-space: nowrap;
}

.wb-tl-node__body { min-width: 0; }
.wb-tl-node__body b { display: block; font-size: 15px; line-height: 1.4; }
.wb-tl-node__note {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--wb-muted);
}

.wb-tl-node__go { color: var(--wb-muted); flex: 0 0 auto; }
.wb-tl-node:hover { border-color: var(--wb-ink); }
.wb-tl-node:hover .wb-tl-node__go { color: var(--wb-acid-strong, var(--wb-ink)); }
.wb-tl-node:hover .wb-tl-node__body b { text-decoration: underline; text-underline-offset: 3px; }

/* 期次尾部的「看全部」链接 */
.wb-tl-era__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--wb-muted);
  text-decoration: none;
}
.wb-tl-era__more:hover { color: var(--wb-ink); }
.wb-tl-era__more:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 四、深色模式 ---------- */
html.dark .wb-tl-era__mark,
html.dark .wb-tl-nav__chip.is-active { color: var(--wb-on-accent); }
html.dark .wb-tl-nav__chip.is-active b { color: var(--wb-on-accent); }

/* ---------- 五、手机版（≤760px） ---------- */
@media (max-width: 760px) {
  .wb-tl-nav {
    position: static;
    top: auto;
    padding: 10px 0;
    margin-bottom: 22px;
    background: none;
    backdrop-filter: none;
  }
  .wb-tl-era { padding-left: 40px; padding-bottom: 30px; }
  .wb-tl-era::before { left: 13px; top: 30px; }
  .wb-tl-era__mark { width: 28px; height: 28px; }
  .wb-tl-era__name { font-size: 20px; }
  .wb-tl-era__desc { font-size: 13.5px; }
  .wb-tl-nodes { grid-template-columns: 1fr; gap: 10px; }
  .wb-tl-node { padding: 11px 12px; gap: 10px; }
  .wb-tl-node__body b { font-size: 15px; }
  .wb-tl-era { scroll-margin-top: 78px; }

  /* 页头标签：手机版只留「TIMELINE / 通史 ･ TIANZHONG」 */
  .tl-lb-tail { display: none; }

  /* 清单区页眉（学打卡天中 / 群英传）：手机端只留像素标签，标题与描述隐藏 */
  #timelineContent .wb-section__heading h2,
  #timelineContent > .wb-section__heading > p { display: none; }
}

/* ---------- 六、锚点滚动 ---------- */
html { scroll-behavior: smooth; }
.wb-tl-era { scroll-margin-top: 104px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
