.timeline-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ===== Header ===== */
.tl-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) 0 0;
}

.tl-header-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 14px 20px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  justify-content: space-between;
}

.tl-back {
  display: inline-block;
  font-size: 0.86rem;
  color: var(--accent-strong);
  text-decoration: none;
  margin-bottom: 6px;
}
.tl-back:hover { text-decoration: underline; }

.tl-titles h1 {
  margin: 0;
  font-size: 1.32rem;
  letter-spacing: 0.01em;
}
.tl-sub {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.tl-sub strong { color: var(--accent-strong); font-weight: 600; }

.tl-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.tl-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.tl-switch input { accent-color: var(--accent); width: 16px; height: 16px; }

/* 「继续上次」按钮：与主站一致的胶囊风格。 */
.tl-resume {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--surface-soft);
  border: 1px solid var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tl-resume:hover { background: var(--accent); color: #fff8ef; }
.tl-resume:active { transform: translateY(1px); }

.tl-count { font-size: 0.78rem; color: var(--muted); }

.tl-nav {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 20px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: auto;
}
.tl-nav-link {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  white-space: nowrap;
}
.tl-nav-link:hover { color: var(--accent-strong); border-color: var(--accent); }

/* ===== Track ===== */
.tl-main {
  max-width: 940px;
  margin: 0 auto;
  padding: 18px 20px 80px;
}
.tl-track {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* 竖直主轴 */
.tl-track::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--line));
}

.tl-era {
  position: relative;
  margin: 26px 0 14px 0;
  padding-left: 44px;
}
.tl-era:first-child { margin-top: 4px; }
.tl-era-text {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
}

.tl-node {
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
}
.tl-dot {
  position: absolute;
  left: 7px;
  top: 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.tl-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.tl-date {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-strong);
  background: var(--surface-soft);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}
.tl-node-title {
  margin: 0;
  font-size: 1.06rem;
  flex: 1 1 auto;
}
.tl-node-count {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.tl-block {
  margin: 12px 0 0;
  font-size: 0.92rem;
  color: var(--text);
}
.tl-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  margin-right: 8px;
  vertical-align: 1px;
}
.tl-tag-event { color: var(--accent-strong); background: var(--surface-soft); }
.tl-tag-sig { color: var(--green); background: var(--green-soft); }
.tl-sig { color: var(--muted); }

/* 复习重点 */
.tl-points {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface));
  padding: 10px 12px 12px;
}
.tl-points-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.tl-points-title::before { content: "★ "; }
.tl-points-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-point {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.62;
}
.tl-point-label {
  flex: 0 0 auto;
  margin-top: 2px;
  min-width: 4.4em;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
.tl-point-text { flex: 1 1 auto; color: var(--text); }

@media (max-width: 560px) {
  .tl-point { flex-direction: column; gap: 3px; }
  .tl-point-label { min-width: 0; align-self: flex-start; }
}

/* ===== Questions ===== */
.tl-questions { margin-top: 14px; }
.tl-q-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.tl-q-toggle:hover { border-color: var(--accent); }

.tl-q-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-q-list.is-collapsed { display: none; }
.tl-q-empty { font-size: 0.84rem; color: var(--muted); margin: 4px 2px; }

.tl-q {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
}
.tl-q.is-web { border-style: dashed; }

.tl-q-head {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
}
.tl-q-type {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--accent);
  margin-top: 2px;
}
.tl-q-type.multi { background: var(--accent-strong); }
.tl-q-type.truefalse { background: var(--green); }
.tl-q-web {
  flex: 0 0 auto;
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0 6px;
  border-radius: var(--radius-pill);
  margin-top: 2px;
}
.tl-q-pill {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red);
  padding: 0 6px;
  border-radius: var(--radius-pill);
  margin-top: 2px;
}
.tl-q-stem { flex: 1 1 60%; color: var(--text); }

.tl-q-body { padding: 0 12px 12px; }

/* 可点击选项 */
.tl-q-options { display: flex; flex-direction: column; gap: 6px; }
.tl-opt-wrap { display: flex; flex-direction: column; }
.tl-opt {
  appearance: none;
  text-align: left;
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.tl-opt:disabled { cursor: default; }
@media (hover: hover) {
  .tl-opt:not(:disabled):hover { border-color: var(--accent); }
}
.tl-opt.is-picked { border-color: var(--accent); background: var(--surface-soft); }
.tl-opt.is-correct { border-color: var(--green); background: var(--green-soft); }
.tl-opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.tl-opt-key { font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.tl-opt.is-correct .tl-opt-key { color: var(--green); }
.tl-opt.is-wrong .tl-opt-key { color: var(--red); }
.tl-opt-text { flex: 1 1 auto; }
.tl-opt-mark { flex: 0 0 auto; font-weight: 700; }
.tl-opt.is-correct .tl-opt-mark::after { content: "✓"; color: var(--green); }
.tl-opt.is-wrong .tl-opt-mark::after { content: "✗"; color: var(--red); }
.tl-opt-note {
  margin: 4px 2px 2px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

.tl-q-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.tl-q-submit, .tl-q-retry, .tl-q-wrong, .tl-q-master {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff8ef;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
}
.tl-q-retry { background: var(--surface); color: var(--accent-strong); }
.tl-q-submit:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.tl-q-wrong {
  background: var(--surface);
  color: var(--red);
  border-color: rgba(211, 76, 76, 0.45);
}
.tl-q-wrong:hover { background: var(--red-soft); border-color: var(--red); }
.tl-q-master {
  background: var(--surface);
  color: var(--green);
  border-color: rgba(32, 164, 100, 0.45);
}
.tl-q-master:hover { background: var(--green-soft); border-color: var(--green); }
.tl-q-master.is-on {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
/* 已掌握的题目整体弱化标记 */
.tl-q.is-mastered { border-color: var(--green); }
.tl-q.is-mastered .tl-q-head { opacity: 0.78; }
@media (hover: hover) {
  .tl-q-retry:hover, .tl-q-wrong:hover, .tl-q-master:hover { transform: translateY(-1px); }
}

.tl-q-result { margin-top: 10px; }
.tl-q-verdict { font-size: 0.9rem; font-weight: 700; }
.tl-q-verdict.ok { color: var(--green); }
.tl-q-verdict.bad { color: var(--red); }
.tl-q-answer { margin-top: 6px; font-size: 0.86rem; color: var(--accent-strong); }

.tl-q-explain {
  margin-top: 8px;
  font-size: 0.86rem;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tl-q-explain-sum {
  cursor: pointer;
  list-style: none;
  padding: 7px 10px;
  font-weight: 700;
  color: var(--accent-strong);
}
.tl-q-explain-sum::-webkit-details-marker { display: none; }
.tl-q-explain-sum::before { content: "▸ "; }
.tl-q-explain[open] .tl-q-explain-sum::before { content: "▾ "; }
.tl-q-explain-body { padding: 0 10px 10px; color: var(--text); line-height: 1.65; }

@media (max-width: 560px) {
  .tl-header-inner { align-items: flex-start; }
  .tl-controls { align-items: flex-start; }
  .tl-node-title { font-size: 1rem; }
  .tl-main { padding: 14px 14px 60px; }
}
