:root {
  --bg: #07111f;
  --bg-elevated: #0b1829;
  --surface: rgba(13, 28, 47, 0.82);
  --surface-solid: #0e1c2f;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --text: #edf5ff;
  --muted: #91a3b9;
  --faint: #5f728b;
  --line: rgba(167, 196, 228, 0.15);
  --line-strong: rgba(167, 196, 228, 0.3);
  --blue: #4c8dff;
  --cyan: #38d6d1;
  --pink: #fb7299;
  --code: #081320;
  --header: rgba(7, 17, 31, 0.74);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
  --radius: 22px;
  --content: 1180px;
}

:root[data-theme='light'] {
  --bg: #f5f4ef;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-soft: rgba(9, 31, 55, 0.045);
  --text: #112338;
  --muted: #5e7083;
  --faint: #8090a0;
  --line: rgba(18, 47, 75, 0.18);
  --line-strong: rgba(18, 47, 75, 0.35);
  --blue: #246ee8;
  --cyan: #078e91;
  --code: #102238;
  --header: rgba(245, 244, 239, 0.88);
  --shadow: 0 10px 30px rgba(18, 47, 75, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg);
  background-size: 68px 68px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  transition: color 0.25s ease, background-color 0.25s ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, transparent 0, var(--bg) 76%);
  content: "";
  pointer-events: none;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

::selection {
  color: #06101d;
  background: var(--cyan);
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  opacity: 0.16;
  filter: blur(110px);
  pointer-events: none;
}

.page-glow--one {
  top: -260px;
  right: -100px;
  background: var(--blue);
}

.page-glow--two {
  top: 560px;
  left: -360px;
  background: var(--cyan);
}

.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  height: 2px;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--pink));
  transform: scaleX(0);
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(20px) saturate(140%);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(calc(100% - 48px), var(--content));
  min-height: 72px;
  margin: 0 auto;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  justify-self: start;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.wordmark span {
  font-weight: 850;
}

.wordmark i {
  margin: 0 8px;
  color: var(--cyan);
  font-style: normal;
}

.wordmark strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.main-nav a {
  position: relative;
  padding: 24px 0 22px;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--cyan);
  content: "";
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
}

.main-nav a.is-active::after,
.main-nav a:hover::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.social-link,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-link {
  padding: 0 12px;
}

.social-link span {
  margin-left: 5px;
  font-size: 12px;
}

.social-link:hover,
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.social-link--bilibili:hover {
  border-color: var(--pink);
}

.theme-toggle {
  width: 34px;
  padding: 0;
  cursor: pointer;
}

.site-main {
  width: min(calc(100% - 48px), var(--content));
  margin: 0 auto;
}

.home-shell {
  padding: 64px 0 88px;
}

.posts-page-shell,
.projects-page-shell,
.videos-page-shell {
  padding: 56px 0 88px;
}

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

.page-title {
  margin: 0 0 10px;
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.page-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  max-width: 680px;
}

.posts-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  min-height: auto;
  padding-bottom: 40px;
}

.home-readme {
  min-width: 0;
}

.readme-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.25;
  color: var(--text);
}

.readme-quote {
  margin: 14px 0 20px;
  padding: 12px 18px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.readme-quote p {
  margin: 0;
}

.readme-quote strong {
  color: var(--text);
}

.readme-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 22px;
  align-items: center;
}

.readme-badges img {
  display: inline-block;
  vertical-align: middle;
  border-radius: 4px;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 22px;
  align-items: center;
}

.badge-group img {
  display: inline-block;
  vertical-align: middle;
  border-radius: 4px;
}

.readme-heading {
  margin: 26px 0 12px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
}

.readme-subheading {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.05em;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.readme-divider {
  height: 1px;
  margin: 28px 0;
  border: 0;
  background: var(--line);
}

.readme-table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.readme-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
}

.readme-table th,
.readme-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.readme-table th {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.readme-table td code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.readme-table tr:last-child td {
  border-bottom: none;
}

.readme-table tr:hover td {
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}

.readme-quote-footer {
  text-align: center;
  color: var(--faint);
  font-size: 15px;
  margin: 24px 0 30px;
  font-family: Georgia, Cambria, serif;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  transition: all 0.2s ease;
}

.home-btn--primary {
  background: var(--cyan);
  color: #07111f;
  border: 1px solid var(--cyan);
}

.home-btn--primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--cyan) 35%, transparent);
}

.home-btn--secondary {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.home-btn--secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.home-btn--ghost {
  color: var(--muted);
  border: 1px solid transparent;
  padding: 10px 16px;
}

.home-btn--ghost:hover {
  color: var(--text);
  border-color: var(--line);
}

.intro-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 42px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.intro-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--pink);
}

.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.profile-card::before {
  position: absolute;
  top: 54px;
  right: -80px;
  width: 210px;
  height: 210px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  content: "";
}

.profile-card__topline {
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.profile-avatar {
  position: relative;
  display: block;
  width: 168px;
  height: 168px;
  margin: 34px auto 26px;
  border: 8px solid var(--surface-solid);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-strong), 0 18px 50px rgba(0, 0, 0, 0.22);
}

.profile-card__body {
  padding: 0 28px 26px;
}

.profile-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.profile-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 16%, transparent);
  animation: pulse-op 2.4s ease-in-out infinite;
}

@keyframes pulse-op {
  0%, 100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 25%, transparent), 0 0 10px var(--cyan);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--cyan) 6%, transparent), 0 0 3px var(--cyan);
  }
}

.profile-card h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.profile-card__body > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.profile-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.profile-links a {
  display: flex;
  justify-content: space-between;
  padding: 15px 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  transition: color 0.2s ease, background 0.2s ease;
}

.profile-links a + a {
  border-left: 1px solid var(--line);
}

.profile-links a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.profile-links b {
  color: var(--cyan);
}

.projects-section {
  padding-top: 72px;
  border-top: 1px solid var(--line-strong);
  margin-bottom: 24px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-top: 18px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.32), 0 0 35px color-mix(in srgb, var(--cyan) 14%, transparent);
}

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.project-card__gh-link {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.project-card__gh-link:hover {
  color: var(--text);
  border-color: var(--blue);
  transform: scale(1.1);
}

.project-card__title {
  margin: 0 0 12px;
  font-size: clamp(20px, 2.2vw, 24px);
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.project-card__title a {
  color: var(--text);
  transition: color 0.2s ease;
}

.project-card__title a:hover {
  color: var(--blue);
}

.project-card__desc {
  flex-grow: 1;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.project-card__tags span {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--surface-soft);
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.project-btn--primary {
  color: #07111f;
  background: var(--cyan);
  border: 1px solid var(--cyan);
}

.project-btn--primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--cyan) 35%, transparent);
}

.project-btn--secondary {
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.project-btn--secondary:hover {
  color: var(--text);
  border-color: var(--blue);
  transform: translateY(-1px);
}

/* 视频页样式 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.video-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.32), 0 0 35px color-mix(in srgb, var(--cyan) 14%, transparent);
}

.video-player-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 标准比例 */
  height: 0;
  background: #000;
  border-bottom: 1px solid var(--line);
}

.video-player-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-player-hint {
  display: none;
}

.video-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 24px;
}

.video-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.video-card__tag-bvid {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--pink);
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.video-card__duration {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
}

.video-card__title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.video-card__title a {
  color: var(--text);
  transition: color 0.2s ease;
}

.video-card__title a:hover {
  color: var(--cyan);
}

.video-card__desc {
  flex-grow: 1;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.video-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.video-card__tags span {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--surface-soft);
}

.video-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.video-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: color 0.2s ease;
}

.video-link-btn:hover {
  color: var(--pink);
}

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

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.section-heading h2,
.page-heading h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.text-link,
.back-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.text-link span {
  display: inline-block;
  margin-left: 8px;
  color: var(--cyan);
  transition: transform 0.2s ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

.posts-page-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.post-box {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.post-box:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.32), 0 0 35px color-mix(in srgb, var(--cyan) 14%, transparent);
}

.post-box__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px;
}

.post-box__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.post-box__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.post-box__cat {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--cyan);
  background: var(--surface-soft);
  font-weight: 700;
}

.post-box__number {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.post-box__title {
  margin: 0 0 12px;
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.2s ease;
}

.post-box:hover .post-box__title {
  color: var(--cyan);
}

.post-box__desc {
  flex-grow: 1;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.post-box__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.post-box__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-box__tags span {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--surface-soft);
}

.post-box__btn {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.post-box:hover .post-box__btn {
  transform: translateX(4px);
}

.post-list {
  border-top: 1px solid var(--line-strong);
}

.post-card {
  border-bottom: 1px solid var(--line);
}

.post-card__link {
  display: grid;
  grid-template-columns: 60px 1fr 42px;
  gap: 24px;
  align-items: start;
  padding: 34px 18px;
  transition: background 0.25s ease, padding 0.25s ease;
}

.post-card__link:hover {
  padding-right: 26px;
  padding-left: 26px;
  background: var(--surface-soft);
}

.post-card__number {
  padding-top: 3px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.post-card__meta {
  display: flex;
  gap: 15px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.post-card__meta span::before {
  margin-right: 15px;
  color: var(--pink);
  content: "/";
}

.post-card h3 {
  margin: 9px 0 8px;
  font-size: clamp(21px, 2.5vw, 28px);
  letter-spacing: -0.035em;
  line-height: 1.35;
}

.post-card__content > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.post-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: var(--surface-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.post-card__link:hover .post-tag {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.post-card__arrow {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--cyan);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.post-card__link:hover .post-card__arrow {
  color: #07111f;
  background: var(--cyan);
  transform: rotate(8deg);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 38px;
}

.pagination .page-number,
.pagination .extend,
.pagination .space {
  display: inline-grid;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.pagination .current,
.pagination a:hover {
  color: var(--bg);
  background: var(--cyan);
}

.article-shell,
.archive-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 78px 0 110px;
}

.article-header {
  max-width: 900px;
  margin: 0 auto 64px;
}

.back-link {
  display: inline-block;
  margin-bottom: 55px;
}

.back-link:hover {
  color: var(--cyan);
}

.article-kicker {
  display: flex;
  gap: 18px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.article-kicker time::before {
  margin-right: 18px;
  color: var(--pink);
  content: "/";
}

.article-header h1 {
  max-width: 900px;
  margin: 16px 0 20px;
  font-size: clamp(26px, 3.6vw, 38px);
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.article-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  color: var(--muted);
  font-size: 12px;
}

.article-stats span + span::before {
  margin-right: 20px;
  color: var(--faint);
  content: "·";
}

.article-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 820px);
  gap: 34px;
  justify-content: center;
}

.article-rail {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 15px;
  padding-top: 9px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
}

.article-rail i {
  width: 1px;
  height: 90px;
  background: linear-gradient(var(--cyan), transparent);
}

.article-rail b {
  color: var(--cyan);
  font-weight: 700;
}

.prose {
  min-width: 0;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 1.95;
}

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

.prose > :last-child {
  margin-bottom: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  margin: 2.2em 0 0.85em;
  color: var(--text);
  letter-spacing: -0.035em;
  line-height: 1.35;
}

.prose h1 {
  font-size: 2.15em;
}

.prose h2 {
  padding-bottom: 0.45em;
  border-bottom: 1px solid var(--line);
  font-size: 1.72em;
}

.prose h2::before {
  margin-right: 0.55em;
  color: var(--cyan);
  content: "#";
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65em;
}

.prose h3 {
  font-size: 1.36em;
}

.prose p,
.prose li {
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
}

.prose a {
  padding-bottom: 2px;
  color: var(--cyan);
  border-bottom: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent);
}

.prose a:hover {
  border-bottom-color: var(--cyan);
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 18px 22px;
  border-left: 3px solid var(--cyan);
  background: var(--surface-soft);
  color: var(--muted);
}

.prose blockquote p {
  margin: 0;
}

.prose code {
  padding: 0.16em 0.42em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--pink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.prose pre,
.prose .highlight {
  overflow-x: auto;
  margin: 1.8em 0;
  border: 1px solid rgba(148, 181, 216, 0.16);
  border-radius: 14px;
  background: var(--code);
  color: #d9e8f6;
  line-height: 1.7;
}

.prose pre {
  padding: 20px 22px;
}

.prose pre code,
.prose .highlight code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}

.prose .highlight table {
  width: 100%;
  margin: 0;
  border: 0;
}

.prose .highlight td {
  padding: 18px 0;
  border: 0;
}

.prose .highlight .gutter {
  width: 48px;
  padding-right: 12px;
  color: #52667b;
  text-align: right;
  user-select: none;
}

.prose .highlight .code {
  padding-right: 22px;
  padding-left: 16px;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 12px;
}

.prose video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000;
  box-shadow: var(--shadow);
}

.prose .video-container,
.prose .bilibili-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 比例自适应 */
  height: 0;
  margin: 2em 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.prose .video-container iframe,
.prose .bilibili-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--surface-soft);
}

.prose hr {
  height: 1px;
  margin: 3em 0;
  border: 0;
  background: var(--line-strong);
}

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 926px;
  margin: 30px auto 0;
}

.post-navigation a {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.post-navigation a:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.post-navigation small {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
}

.post-navigation span {
  font-size: 13px;
  font-weight: 700;
}

.post-navigation__next {
  text-align: right;
}

.archive-shell {
  max-width: 900px;
}

.page-heading {
  margin-bottom: 58px;
}

.page-heading > p:last-child {
  margin: 16px 0 0;
  color: var(--muted);
}

.archive-list {
  border-top: 1px solid var(--line-strong);
}

.archive-year {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 36px 0 14px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.archive-year i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.archive-item {
  display: grid;
  grid-template-columns: 74px 1fr 30px;
  gap: 18px;
  align-items: center;
  padding: 23px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding 0.2s ease;
}

.archive-item:hover {
  padding-right: 22px;
  padding-left: 22px;
  background: var(--surface-soft);
}

.archive-item time {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.archive-item strong {
  font-size: 16px;
}

.archive-item > span {
  color: var(--cyan);
}

.standalone-prose {
  max-width: 820px;
  margin: 0 auto;
}

@media (max-width: 880px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .intro-panel {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .profile-card {
    width: min(100%, 430px);
    transform: none;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-rail {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    background-size: 44px 44px;
  }

  .header-inner,
  .site-main {
    width: min(calc(100% - 28px), var(--content));
  }

  .header-inner {
    min-height: 64px;
  }

  .wordmark strong,
  .social-link--github {
    display: none;
  }

  .wordmark i {
    margin-right: 0;
  }

  .social-link {
    padding: 0 10px;
  }

  .home-shell,
  .article-shell,
  .archive-shell {
    padding-top: 48px;
    padding-bottom: 72px;
  }

  .intro-panel {
    gap: 46px;
    padding-bottom: 66px;
  }

  .intro-copy h1 {
    font-size: clamp(42px, 13vw, 62px);
  }

  .intro-lead {
    margin-top: 22px;
  }

  .intro-meta {
    flex-wrap: wrap;
    margin-top: 30px;
  }

  .profile-card {
    width: 100%;
  }

  .projects-section {
    padding-top: 52px;
    margin-bottom: 12px;
  }

  .project-grid,
  .video-grid,
  .post-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-card,
  .video-card__body,
  .post-box__link {
    padding: 20px;
  }

  .writing-section {
    padding-top: 52px;
  }

  .section-heading {
    align-items: flex-start;
    gap: 18px;
  }

  .post-card__link {
    grid-template-columns: 38px 1fr;
    gap: 12px;
    padding: 26px 4px;
  }

  .post-card__link:hover {
    padding-right: 8px;
    padding-left: 8px;
  }

  .post-card__arrow {
    display: none;
  }

  .post-card h3 {
    font-size: 21px;
  }

  .article-header {
    margin-bottom: 38px;
  }

  .back-link {
    margin-bottom: 36px;
  }

  .article-header h1 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .article-stats span + span::before {
    margin-right: 10px;
  }

  .prose {
    margin-right: -8px;
    margin-left: -8px;
    padding: 24px 20px;
    border-radius: 16px;
    font-size: 15px;
  }

  .prose pre {
    padding: 16px;
  }

  .post-navigation {
    grid-template-columns: 1fr;
  }

  .archive-item {
    grid-template-columns: 56px 1fr 20px;
    gap: 10px;
    padding-right: 4px;
    padding-left: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Video card & Player styles */
.video-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.video-player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  overflow: hidden;
}

.video-player-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.25s ease;
}

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

.video-cover-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease;
}

.video-cover-overlay:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  background: rgba(0, 161, 214, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 3;
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: none;
}

.video-cover-overlay:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
  background: #00b5e5;
}

.video-play-btn svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  margin-left: 3px;
}

.video-card__body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Header MAIL Button */
.social-link--mail {
  color: var(--cyan);
  border-color: color-mix(in srgb, var(--cyan) 30%, transparent);
}

.social-link--mail:hover {
  color: var(--text);
  border-color: var(--cyan);
  box-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 25%, transparent);
}

.social-link--mail span {
  font-size: 13px;
  margin-left: 4px;
}

/* Comments & Interactions Section */
.comments-section {
  max-width: 926px;
  margin: 50px auto 0;
  padding-top: 36px;
  border-top: 1px solid var(--line-strong);
}

.comments-header {
  margin-bottom: 24px;
}

.comments-title {
  margin: 4px 0 0;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.03em;
  color: var(--text);
}

.giscus {
  min-height: 180px;
}
