:root {
  --page-bg: #f5f5f7;
  --paper: #ffffff;
  --ink: #1d1d1f;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.05);
  --line-strong: rgba(0, 0, 0, 0.12);
  --chip-bg: rgba(0, 0, 0, 0.04);
  --rail-width: 108px;
  --reader-gap: 24px;
  --reading-measure: 92ch;
  --reader-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --reading-summary-size: 0.95rem;
  --reading-body-size: 1rem;
  --reading-line-height: 1.7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--reader-font-family);
}

body.font-notion {
  --reader-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

body.reading-compact {
  --reading-summary-size: 0.84rem;
  --reading-body-size: 0.88rem;
  --reading-line-height: 1.82;
}

body.reading-default {
  --reading-summary-size: 0.9rem;
  --reading-body-size: 0.94rem;
  --reading-line-height: 1.9;
}

body.reading-comfortable {
  --reading-summary-size: 0.98rem;
  --reading-body-size: 1.04rem;
  --reading-line-height: 2;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

code {
  padding: 0.08em 0.3em;
  border-radius: 6px;
  background: rgba(27, 28, 31, 0.06);
  font-family: "SFMono-Regular", "Roboto Mono", "Liberation Mono", monospace;
  font-size: 0.92em;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.compact-shell {
  width: min(1240px, calc(100% - 32px));
}

@keyframes fadeUpIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: fadeUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  margin: -24px -24px 24px -24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  background: rgba(245, 245, 247, 0.65);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.tab-button {
  appearance: none;
  padding: 6px 12px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.tab-button.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.reader-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  margin-right: calc(100% - var(--rail-width) - var(--reader-gap) - var(--reading-measure));
}

.font-size-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.04);
}

.font-size-button {
  appearance: none;
  min-width: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  transition: all 0.2s ease;
}

.font-size-button:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.font-size-button.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 1px rgba(0, 0, 0, 0.04);
}

.reader-layout {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  gap: var(--reader-gap);
  margin-top: 18px;
  align-items: start;
}

.timeline-rail {
  position: sticky;
  top: 60px;
  min-width: 0;
  padding-top: 10px;
}

.timeline-track {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 14px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 4px;
  width: 1px;
  background: var(--line);
}

.date-node {
  appearance: none;
  position: relative;
  width: 100%;
  padding: 6px 6px 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.25;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.date-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  transform: translateY(-50%);
  transition: all 0.2s ease;
}

.date-node:hover {
  color: var(--ink);
}

.date-node.is-active {
  color: var(--ink);
  font-weight: 600;
}

.date-node.is-active::before {
  background: var(--ink);
}

.reader-document {
  min-width: 0;
  padding-top: 8px;
}

.reader-head {
  width: min(100%, var(--reading-measure));
}

.reader-head h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 2.8vw, 1.95rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.doc-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.report-content {
  width: min(100%, var(--reading-measure));
  padding-top: 14px;
  font-size: var(--reading-body-size);
  line-height: var(--reading-line-height);
  letter-spacing: 0.01em;
}

.report-content> :first-child {
  margin-top: 0;
}

.report-content h2,
.report-content h3,
.report-content h4 {
  color: var(--ink);
}

.report-content h2 {
  margin: 2.5rem 0 1.2rem;
  font-size: clamp(1.5rem, 2.2vw, 1.8rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.report-content h3 {
  margin: 1.8rem 0 0.75rem;
  font-size: clamp(1.24rem, 1.7vw, 1.46rem);
  line-height: 1.28;
}

.report-content h4 {
  margin: 1rem 0 0.4rem;
  font-size: 1.18rem;
  line-height: 1.34;
}

.report-content .topic-heading {
  margin-top: 1.75rem;
  font-size: clamp(1.16rem, 1.45vw, 1.32rem);
  line-height: 1.3;
}

.report-content .entry-heading {
  margin-top: 0.82rem;
  font-size: 1.1rem;
  line-height: 1.3;
}

.report-content .entry-meta-inline {
  color: var(--muted);
  font-size: 0.84em;
  font-weight: 400;
  white-space: nowrap;
}

.report-content p,
.report-content ul,
.report-content ol,
.report-content blockquote {
  margin: 0 0 0.92em;
}

.report-content strong {
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.005em;
  font-synthesis: weight;
}

html[lang|="zh"] .report-content strong {
  font-weight: 780;
  font-synthesis-weight: auto;
}

.report-content .entry-heading+p,
.report-content .entry-heading+ul,
.report-content .entry-heading+ol {
  margin-top: 0.2rem;
}

.report-content p,
.report-content li,
.report-content ul,
.report-content ol,
.report-content blockquote {
  max-width: 100%;
}

.report-content ul,
.report-content ol {
  padding-left: 1.35em;
  margin-bottom: 0.72em;
  line-height: 1.54;
}

.report-content li+li {
  margin-top: 0.22em;
}

.report-content li {
  line-height: 1.5;
}

.report-content blockquote {
  padding-left: 1em;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}

.report-content hr {
  margin: 1.15rem 0 0.95rem;
  border: 0;
  border-top: 1px solid var(--line);
}

.report-content .source-note {
  color: rgba(93, 85, 72, 0.68);
  font-size: 0.86em;
}

.report-content .source-note a,
.report-content .inline-source a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.report-content .inline-source {
  color: rgba(93, 85, 72, 0.72);
  font-size: 0.82em;
  white-space: normal;
}

.table-wrap {
  width: 100%;
  margin: 1rem 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
}

.table-wrap table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.92em;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap thead th {
  background: rgba(27, 28, 31, 0.04);
  font-weight: 600;
}

.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.hero,
.hero-panel,
.archive-card,
.detail-article {
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.02);
  box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.03), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  border-radius: 20px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding: 28px;
  border-radius: 18px;
}

.hero-copy,
.detail-article,
.detail-sidebar {
  min-width: 0;
}

.eyebrow,
.panel-label,
.section-kicker {
  margin: 0;
  color: var(--muted);
  font-family: "SFMono-Regular", "Roboto Mono", "Liberation Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero h1 {
  margin: 12px 0 16px;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.8vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-text,
.jump-empty,
.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.back-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-panel {
  padding: 20px;
  border-radius: 16px;
}

.hero-panel h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.2;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill,
.source-chip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 0.82rem;
}

.source-chip {
  word-break: break-all;
}

.jump-list,
.timeline-list {
  display: grid;
  gap: 12px;
}

.jump-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  margin-top: 22px;
}

.detail-article {
  padding: 22px;
  border-radius: 16px;
}

.detail-sidebar {
  display: grid;
  gap: 22px;
  align-content: start;
}

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

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 6px 0 0;
  font-size: 1.55rem;
}

.timeline-item {
  display: block;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fcfcfc;
  color: inherit;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.015);
}

.timeline-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
  background: #ffffff;
}

.timeline-item.is-active {
  border-color: rgba(0, 0, 0, 0.05);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.timeline-item .date {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-item h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.timeline-item p:last-child {
  margin-top: 10px;
}

.sticky-card {
  position: sticky;
  top: 24px;
}

.empty-state {
  padding: 24px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: #faf7f0;
  color: var(--muted);
}

.compact-empty {
  padding: 12px 14px;
}

.site-updated-stamp {
  position: fixed;
  right: 10px;
  bottom: 8px;
  margin: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(247, 244, 238, 0.75);
  color: rgba(93, 85, 72, 0.62);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

@media (max-width: 1100px) {

  .hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }
}

@media (max-width: 980px) {
  .reader-topbar {
    padding: 12px 20px;
    margin: -24px -20px 24px -20px;
  }

  .page-shell,
  .compact-shell {
    width: min(100%, calc(100% - 20px));
  }

  .reader-topbar {
    position: static;
    display: block;
  }

  .reader-tools {
    margin-top: 10px;
    margin-right: 0;
    justify-content: flex-start;
  }

  .reader-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .timeline-rail {
    position: static;
    top: auto;
    padding-top: 0;
  }

  .timeline-track {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .timeline-track::before {
    display: none;
  }

  .date-node {
    flex: 0 0 auto;
    width: auto;
    min-width: 84px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    scroll-snap-align: center;
  }

  .date-node::before {
    display: none;
  }

  .reader-head,
  .report-content {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 700px) {
  .tab-strip {
    gap: 14px;
  }

  .tab-button {
    padding-bottom: 8px;
  }

  .font-size-button {
    min-width: 32px;
    padding: 5px 6px;
  }

  .reader-head h1 {
    font-size: clamp(1.4rem, 6vw, 1.7rem);
  }

  .hero {
    padding: 20px;
  }

  .detail-article,
  .archive-card {
    padding: 18px;
  }

  .site-updated-stamp {
    right: 8px;
    bottom: 6px;
    font-size: 10px;
    opacity: 0.85;
  }
}