:root {
  --bg-top: #f5efe4;
  --bg-bottom: #f8f5ef;
  --paper: rgba(255, 252, 247, 0.9);
  --paper-strong: #fffaf2;
  --text: #2f241e;
  --muted: #7d6a5f;
  --accent: #a6633c;
  --accent-soft: rgba(166, 99, 60, 0.12);
  --line: rgba(120, 93, 77, 0.18);
  --shadow: 0 22px 60px rgba(104, 80, 65, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 244, 220, 0.9), transparent 28%),
    radial-gradient(circle at top right, rgba(244, 226, 211, 0.85), transparent 32%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 48%, #f3efe8 100%);
  font-family: "PingFang SC", "Noto Serif SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.timeline-page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 24px;
}

.timeline-hero,
.story-card,
.timeline-shell,
.source-shell {
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.timeline-hero {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 24px;
  border-radius: 28px;
  padding: 28px;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.timeline-hero h1,
.timeline-shell h2,
.source-shell h2,
.story-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  letter-spacing: 0.01em;
}

.timeline-hero h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.08;
}

.hero-subtitle {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip,
.tag-chip,
.highlight-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1;
}

.meta-chip {
  border: 1px solid rgba(122, 95, 79, 0.18);
  background: rgba(255, 248, 240, 0.92);
  color: #6d5647;
}

.tag-chip {
  background: var(--accent-soft);
  color: #8d5030;
  border: 1px solid rgba(166, 99, 60, 0.12);
}

.hero-visual {
  display: grid;
  align-items: stretch;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border-radius: 24px;
  border: 1px solid rgba(160, 129, 110, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 248, 241, 0.96), rgba(246, 237, 227, 0.96)),
    repeating-linear-gradient(45deg, rgba(173, 133, 103, 0.04), rgba(173, 133, 103, 0.04) 10px, transparent 10px, transparent 20px);
}

.cover-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(114, 85, 66, 0.72);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.narrative-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 18px;
}

.story-card {
  border-radius: 22px;
  padding: 22px;
}

.story-card-wide {
  grid-column: span 1;
}

.body-text {
  margin: 10px 0 0;
  color: #473831;
  line-height: 1.85;
  white-space: pre-wrap;
}

.muted {
  color: var(--muted);
}

.highlight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.highlight-pill {
  border: 1px dashed rgba(166, 99, 60, 0.25);
  background: rgba(255, 250, 242, 0.95);
  color: #7c4b31;
}

.timeline-shell,
.source-shell {
  border-radius: 28px;
  padding: 24px;
}

.timeline-shell-head,
.source-shell-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.timeline-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-stream {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline-stream::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 26px;
  width: 2px;
  background: linear-gradient(180deg, rgba(166, 99, 60, 0.3), rgba(166, 99, 60, 0.06));
}

.timeline-card {
  position: relative;
  margin-left: 0;
  padding-left: 66px;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(166, 99, 60, 0.3);
  background: #fff8ef;
  box-shadow: 0 0 0 6px rgba(166, 99, 60, 0.08);
}

.timeline-card-inner {
  border: 1px solid rgba(126, 98, 82, 0.14);
  background: rgba(255, 252, 248, 0.95);
  border-radius: 22px;
  padding: 18px;
}

.timeline-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.timeline-card-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.timestamp-label {
  display: inline-flex;
  margin-top: 8px;
  color: #7b604f;
  background: rgba(236, 223, 211, 0.55);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

.anchor-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.timeline-card-text {
  margin: 14px 0 0;
  color: #44362f;
  line-height: 1.8;
}

.timeline-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.timeline-media-item {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(126, 98, 82, 0.12);
  background: #f8f1e7;
  min-height: 112px;
}

.timeline-media-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.timeline-media-empty {
  display: grid;
  place-items: center;
  color: #9a8373;
  font-size: 13px;
}

.timeline-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.memory-chip {
  border: 1px solid rgba(122, 95, 79, 0.16);
  background: rgba(255, 248, 243, 0.92);
  color: #71594a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.raw-details {
  border: 1px solid rgba(126, 98, 82, 0.12);
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.86);
  overflow: hidden;
}

.raw-details summary {
  cursor: pointer;
  padding: 16px 18px;
  color: #6d5647;
  font-weight: 600;
}

.code {
  margin: 0;
  padding: 18px;
  overflow: auto;
  max-height: 420px;
  border-top: 1px solid rgba(126, 98, 82, 0.08);
  background: rgba(248, 244, 238, 0.9);
  color: #40322c;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 920px) {
  .timeline-hero,
  .narrative-grid {
    grid-template-columns: 1fr;
  }

  .timeline-page {
    width: min(100% - 20px, 1160px);
    padding: 18px 0 32px;
  }

  .timeline-shell-head,
  .source-shell-head,
  .timeline-card-head {
    flex-direction: column;
    align-items: start;
  }
}
