:root {
  color-scheme: light;
  --bg: #fbfcfe;
  --paper: #ffffff;
  --text: #101828;
  --muted: #667085;
  --line: #d8e1ec;
  --accent: #0ea5e9;
  --accent-strong: #0369a1;
  --accent-soft: #e0f2fe;
  --warm: #f59e0b;
  --code: #0b1020;
  --code-line: #111a2e;
  --code-text: #dbeafe;
  --max: 1120px;
  --read: 1040px;
  --article: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #ffffff 0, #fbfcfe 420px),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
}

a {
  color: inherit;
  text-decoration-color: rgba(37, 99, 235, 0.32);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.site-header,
.site-main,
.site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

nav a {
  padding: 2px 0;
  text-decoration: none;
}

nav a:hover {
  color: var(--accent-strong);
}

.site-main {
  padding: 64px 0;
}

.intro {
  margin-bottom: 72px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 18px;
  padding: 3px 10px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  max-width: 680px;
  font-size: clamp(2.1rem, 6vw, 4rem);
}

.intro h1 {
  max-width: none;
  white-space: nowrap;
}

.lead {
  max-width: var(--read);
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.topic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.topic-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #344054;
  font-size: 0.94rem;
  font-weight: 650;
  box-shadow: 0 8px 26px rgba(16, 24, 40, 0.05);
}

.section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 1.25rem;
}

.section-head a {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-list,
.archive-list {
  display: grid;
  gap: 4px;
}

.post-item,
.archive-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.post-item time,
.archive-item time,
.post-header time {
  color: var(--muted);
  font-size: 0.88rem;
}

.post-item h3 {
  margin-top: 4px;
  font-size: 1.28rem;
}

.post-item h3 a {
  text-decoration: none;
}

.post-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.archive-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: baseline;
}

.archive-item a {
  font-weight: 650;
  text-decoration: none;
}

.page-title {
  margin-bottom: 36px;
}

.page-title h1,
.post-header h1 {
  font-size: clamp(2.15rem, 4.7vw, 3.65rem);
}

.page-title p,
.post-header p {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.post {
  max-width: var(--article);
  margin: 0 auto;
}

.post-header {
  max-width: var(--read);
  margin: 0 auto 42px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.09);
}

.post-header h1 {
  max-width: none;
  margin-top: 10px;
  font-weight: 780;
  line-height: 1.16;
  color: #0b1220;
}

.post-header time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 3px 9px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 999px;
  background: rgba(224, 242, 254, 0.7);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.post-content > * {
  max-width: var(--read);
  margin-right: auto;
  margin-left: auto;
  margin-top: 0;
  margin-bottom: 1.1em;
}

.post-content pre,
.post-content table,
.post-content figure,
.post-content p:has(> img) {
  max-width: 100%;
}

.post-content pre {
  max-width: var(--read);
}

.post-content p:has(> img) {
  margin-top: 2.2rem;
  margin-bottom: 2.2rem;
}

.post-content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(14, 165, 233, 0.14);
  box-shadow: 0 20px 60px rgba(16, 24, 40, 0.12);
}

.post-content h2 {
  position: relative;
  margin-top: 2.5em;
  margin-bottom: 0.85em;
  padding-top: 0.75em;
  border-top: 1px solid var(--line);
  font-size: 1.62rem;
  line-height: 1.38;
}

.post-content h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 72px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--warm));
}

.post-content h3 {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  font-size: 1.18rem;
}

.post-content p,
.post-content li {
  color: #24292f;
  font-size: 1.04rem;
}

.post-content blockquote {
  margin-top: 1.6em;
  margin-bottom: 1.8em;
  padding: 20px 24px;
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #ecfeff);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.post-content blockquote p {
  margin: 0;
  color: #1f2937;
  font-size: 1.08rem;
  font-weight: 650;
}

.post-content code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: #e0f2fe;
  color: #075985;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.post-content pre {
  position: relative;
  overflow-x: auto;
  padding: 54px 22px 22px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 8px;
  background: var(--code);
  box-shadow: 0 20px 52px rgba(8, 47, 73, 0.24);
  line-height: 1.72;
}

.post-content pre::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 36px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.12);
  border-radius: 8px 8px 0 0;
  background:
    radial-gradient(circle at 18px 18px, #f87171 0 5px, transparent 6px),
    radial-gradient(circle at 36px 18px, #fbbf24 0 5px, transparent 6px),
    radial-gradient(circle at 54px 18px, #34d399 0 5px, transparent 6px),
    var(--code-line);
}

.post-content pre::after {
  content: "CODE";
  position: absolute;
  top: 8px;
  right: 16px;
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.post-content pre code {
  padding: 0;
  background: transparent;
  color: var(--code-text);
  font-size: 0.93rem;
}

.post-floating-actions {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 28px;
  display: grid;
  gap: 10px;
}

.post-floating-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 92px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(14px);
}

.post-floating-action:hover {
  border-color: rgba(14, 165, 233, 0.5);
  background: var(--accent);
  color: #ffffff;
}

.post-floating-action span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  font-size: 1.08rem;
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.graph-shell {
  width: min(1180px, calc(100vw - 40px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.graph-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.graph-topbar h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.graph-topbar p:not(.eyebrow) {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.graph-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 10px;
  min-width: 320px;
}

.graph-stats span {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.graph-stats strong {
  display: block;
  color: var(--text);
  font-size: 1.45rem;
}

.graph-stage {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(34, 34, 34, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.62)),
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.14), transparent 34%),
    radial-gradient(circle at 78% 22%, rgba(14, 165, 233, 0.14), transparent 34%);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.08);
}

.graph-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 34, 34, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 34, 34, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 92%);
  pointer-events: none;
}

.graph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graph-toolbar {
  position: absolute;
  z-index: 3;
  top: 18px;
  left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(620px, calc(100% - 36px));
}

.graph-toolbar button {
  border: 1px solid rgba(34, 34, 34, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #3a3a3a;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 7px 12px;
  backdrop-filter: blur(10px);
}

.graph-toolbar button:hover,
.graph-toolbar button.is-active {
  border-color: rgba(37, 99, 235, 0.42);
  background: var(--accent);
  color: #ffffff;
}

.graph-panel {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100% - 36px));
  padding: 20px;
  border: 1px solid rgba(34, 34, 34, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
}

.panel-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.graph-panel h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.35;
}

.graph-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.graph-panel a {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.graph-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--dot) 16%, transparent);
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-main {
    padding-top: 52px;
  }

  .intro {
    margin-bottom: 56px;
  }

  .intro h1 {
    white-space: normal;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .graph-shell {
    width: min(100%, calc(100vw - 24px));
  }

  .graph-topbar {
    grid-template-columns: 1fr;
  }

  .graph-stats {
    grid-template-columns: repeat(3, 1fr);
    min-width: 0;
  }

  .graph-stage {
    min-height: 680px;
  }

  .graph-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 16px;
  }

  .post-floating-actions {
    right: 12px;
    bottom: 14px;
    gap: 8px;
  }

  .post-floating-action {
    min-width: 76px;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 0.84rem;
  }
}
