:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --bg-soft: #ece9df;
  --page-dot: rgba(22, 37, 48, 0.045);
  --paper: #fbfaf6;
  --paper-2: #f2f0ea;
  --ink: #162530;
  --muted: #64737c;
  --blue: #1747ff;
  --agent-color: #cd6e58;
  --vllm-color: #30a2ff;
  --sglang-color: #a5300f;
  --cuda-color: #76b900;
  --line: #d9d8d2;
  --shadow: rgba(23, 29, 34, 0.18);
  --card-highlight: rgba(255, 255, 255, 0.78);
  --card-dot: rgba(22, 37, 48, 0.08);
  --nav: var(--ink);
  --footer: var(--muted);
  --code-bg: #ece9df;
  --pre-bg: #14191d;
  --pre-fg: #f7f7f0;
  --radius: 9px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f12;
  --bg-soft: #15191d;
  --page-dot: rgba(251, 250, 246, 0.07);
  --paper: #171c21;
  --paper-2: #222a31;
  --ink: #f3efe6;
  --muted: #9aa7b0;
  --agent-color: #e08a72;
  --vllm-color: #74c8ff;
  --sglang-color: #e46d35;
  --cuda-color: #95d83a;
  --line: #313b44;
  --shadow: rgba(0, 0, 0, 0.42);
  --card-highlight: rgba(255, 255, 255, 0.06);
  --card-dot: rgba(251, 250, 246, 0.06);
  --nav: var(--ink);
  --footer: var(--muted);
  --code-bg: #27313a;
  --pre-bg: #070a0d;
  --pre-fg: #f8f5ed;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-soft);
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, var(--page-dot) 1px, transparent 0) 0 0 / 28px 28px,
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  width: min(1120px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
}

.brand {
  color: var(--nav);
}

.avatar-brand {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}

.avatar-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.tools {
  display: flex;
  gap: 14px;
  align-items: center;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--nav);
  cursor: pointer;
}

.icon-button:hover,
.nav a:hover {
  color: var(--blue);
}

.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

main {
  flex: 0 0 auto;
  width: min(1120px, calc(100% - 40px));
  margin: 34px auto 0;
  padding-bottom: 44px;
}

.section-block + .section-block {
  margin-top: 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
  padding-top: 16px;
}

.window-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--card-highlight), transparent 34%),
    var(--paper);
  color: var(--ink);
  box-shadow:
    0 18px 48px var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

.window-card > * {
  position: relative;
  z-index: 1;
}

.window-card::after {
  position: absolute;
  z-index: 0;
  inset: auto 0 0;
  height: 34%;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 2px 2px, var(--card-dot) 1.2px, transparent 0) 0 0 / 17px 17px;
  mask-image: linear-gradient(transparent, #000);
  -webkit-mask-image: linear-gradient(transparent, #000);
}

.window-dots {
  position: absolute;
  top: 13px;
  left: 14px;
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b9c3ca;
}

.window-dots span:first-child {
  background: #526cff;
}

.hero-card {
  min-height: 0;
  padding: 0 58px 0 0;
}

.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-card h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 104px);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: 0;
}

.subtitle {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 21px;
  font-weight: 560;
}

.subtitle .tone-agent,
.subtitle .tone-vllm,
.subtitle .tone-cuda {
  font-weight: 760;
}

.subtitle .tone-agent {
  color: var(--agent-color);
}

.subtitle .tone-vllm {
  display: inline-block;
  background-image: linear-gradient(150deg, var(--vllm-color) 0 49%, var(--sglang-color) 50% 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle .tone-cuda {
  color: var(--cuda-color);
}

.hero-link {
  display: inline-flex;
  margin-top: 32px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 820;
}

.hero-scribble {
  display: block;
  width: 108px;
  height: 18px;
  margin-top: 2px;
  overflow: visible;
}

.hero-scribble path {
  fill: none;
  stroke: #f28c28;
  stroke-linecap: square;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.now-card {
  min-height: 0;
  padding: 64px 30px 34px;
}

.now-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
}

.now-card p:last-of-type {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.mini-line,
.blue-stroke {
  width: 46px;
  height: 5px;
  margin-top: 26px;
  border-radius: 999px;
  background: var(--blue);
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}

.section-title-plain {
  display: block;
}

.section-title-plain h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
}

.section-title span {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 830;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.topic-card {
  min-height: 230px;
  padding: 58px 26px 26px;
}

.topic-card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 58px var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

.topic-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.02;
}

.topic-card p:last-of-type {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.62;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.blog-index-shell {
  margin-top: 22px;
}

.blog-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.blog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 148px;
  padding: 28px;
}

.blog-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.05;
}

.blog-row p:not(.kicker) {
  margin: 10px 0 0;
  color: var(--muted);
}

.blog-row time {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
}

.footer {
  display: flex;
  justify-content: flex-start;
  width: min(1120px, calc(100% - 40px));
  margin: auto auto 0;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--footer);
  font-size: 14px;
}

.article-shell {
  margin-top: 22px;
}

.article-card {
  min-height: 0;
  padding: 44px 56px 54px;
}

.back-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  padding: 9px 12px;
}

.article-meta {
  margin-top: 26px;
  max-width: 780px;
}

.article-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.article-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.article-meta h1 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.article-meta p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 560;
}

.markdown-body {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.05em 0 0.38em;
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.08;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 46px;
}

.markdown-body h2 {
  font-size: 34px;
}

.markdown-body h3 {
  font-size: 26px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body pre,
.markdown-table-wrap {
  margin: 0.58em 0;
}

.markdown-body a {
  color: var(--blue);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body code {
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--ink);
  font-size: 0.92em;
  padding: 0.1em 0.35em;
}

.markdown-body pre {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pre-bg);
  color: var(--pre-fg);
  padding: 12px 14px;
}

.markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  white-space: pre;
}

.syntax-command {
  color: #61afef;
}

.syntax-env,
.syntax-variable {
  color: #c678dd;
}

.syntax-option {
  color: #e5c07b;
}

.syntax-string {
  color: #98c379;
}

.syntax-comment {
  color: #7f8a93;
  font-style: italic;
}

.syntax-operator {
  color: #56b6c2;
}

.syntax-path,
.syntax-link {
  color: #d19a66;
}

.syntax-number {
  color: #d19a66;
}

.markdown-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.markdown-body table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--muted);
}

.markdown-body th,
.markdown-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.markdown-body th {
  color: var(--ink);
  font-weight: 820;
}

.markdown-body th:first-child,
.markdown-body td:first-child {
  width: 24%;
  color: var(--ink);
  font-weight: 720;
}

.markdown-body td code {
  display: inline-block;
  margin: 2px 0;
  color: #9a7426;
  overflow-wrap: anywhere;
}

:root[data-theme="dark"] .markdown-body td code {
  color: #e8c36d;
}

.search-dialog {
  width: min(540px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: transparent;
}

.search-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.search-card {
  display: grid;
  gap: 16px;
  min-height: 0;
  margin: 0;
  padding: 58px 24px 24px;
}

.search-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-heading label {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
}

.search-heading button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

#site-search {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 14px;
}

.search-results {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.search-result {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--paper-2);
}

.is-hidden {
  display: none;
}

@media (max-width: 1080px) {
  .topbar {
    width: min(100% - 48px, 1120px);
  }

  main,
  .footer {
    width: min(100% - 48px, 1120px);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
  }

  .hero-card {
    padding-right: 24px;
  }

  .hero-card h1 {
    font-size: clamp(62px, 8.4vw, 88px);
  }

  .subtitle {
    max-width: 520px;
    font-size: 19px;
  }

  .now-card {
    padding: 58px 26px 30px;
  }

  .now-card h2 {
    font-size: 38px;
  }

  .article-card {
    padding: 42px 44px 46px;
  }
}

@media (max-width: 920px) {
  .topbar {
    gap: 20px;
  }

  main {
    margin-top: 28px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    padding: 0;
  }

  .now-card {
    width: min(100%, 380px);
    padding: 54px 26px 28px;
  }

  .topic-card {
    min-height: 210px;
  }

  .blog-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .blog-row time {
    justify-self: start;
  }

  .article-meta,
  .markdown-body {
    max-width: none;
  }

  .markdown-body table {
    min-width: 600px;
  }
}

@media (max-width: 640px) {
  .topbar,
  main,
  .footer {
    width: min(100% - 24px, 1120px);
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    height: 62px;
  }

  .avatar-brand {
    width: 36px;
    height: 36px;
  }

  .nav {
    gap: 13px;
    min-width: 0;
  }

  .nav a {
    font-size: 17px;
  }

  .tools {
    gap: 4px;
    justify-content: flex-end;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .icon-button svg {
    width: 20px;
    height: 20px;
  }

  main {
    margin-top: 20px;
    padding-bottom: 30px;
  }

  .hero-grid {
    padding-top: 8px;
    gap: 24px;
  }

  .hero-card {
    padding: 0;
  }

  .kicker {
    font-size: 11px;
  }

  .hero-card h1 {
    font-size: clamp(43px, 15.8vw, 64px);
    line-height: 0.94;
  }

  .subtitle {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.45;
  }

  .hero-link {
    margin-top: 24px;
  }

  .now-card {
    width: 100%;
    padding: 48px 20px 24px;
  }

  .now-card h2 {
    font-size: 34px;
  }

  .now-card p:last-of-type {
    font-size: 15px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-block + .section-block {
    margin-top: 34px;
  }

  .topic-card,
  .now-card {
    padding-right: 22px;
    padding-left: 22px;
  }

  .topic-card {
    min-height: 0;
    padding-top: 50px;
  }

  .topic-card h3,
  .blog-row h3 {
    font-size: 30px;
  }

  .blog-row {
    min-height: 0;
    padding: 24px 20px;
  }

  .section-title-plain h2 {
    font-size: 31px;
  }

  .footer {
    display: flex;
    padding-bottom: 24px;
  }

  .article-card {
    padding: 42px 16px 28px;
  }

  .article-meta {
    margin-top: 24px;
  }

  .article-meta h1 {
    font-size: clamp(42px, 16vw, 58px);
  }

  .article-meta p {
    font-size: 17px;
    line-height: 1.45;
  }

  .markdown-body {
    margin-top: 24px;
    font-size: 15.5px;
    line-height: 1.55;
  }

  .markdown-body h1 {
    font-size: 34px;
  }

  .markdown-body h2 {
    font-size: 29px;
  }

  .markdown-body h3 {
    font-size: 23px;
  }

  .markdown-body pre {
    padding: 11px 12px;
  }

  .markdown-body pre code {
    font-size: 0.9em;
  }

  .markdown-body table {
    min-width: 560px;
  }

  .markdown-body th,
  .markdown-body td {
    padding: 8px 10px;
  }
}

@media (max-width: 380px) {
  .nav {
    gap: 10px;
  }

  .nav a {
    font-size: 16px;
  }

  .tools {
    gap: 2px;
  }

  .icon-button {
    width: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
