/* ==========================================================================
   LeleBlog — 现代卡片 · 深色优先
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #08090e;
  --bg-soft: #0c0e15;
  --surface: #11131c;
  --surface-2: #151824;
  --surface-glass: rgba(17, 19, 28, 0.72);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef0f7;
  --text-strong: #ffffff;
  --text-soft: #c3c7d6;
  --muted: #949ab0;
  --muted-2: #6f768c;
  --accent: #8b8bff;
  --accent-strong: #b18cff;
  --accent-soft: rgba(139, 139, 255, 0.12);
  --pink: #ff7ab8;
  --gradient: linear-gradient(115deg, #6f6ff5 0%, #a678ff 52%, #ff7ab8 100%);
  --gradient-soft: linear-gradient(140deg, rgba(111, 111, 245, 0.22), rgba(255, 122, 184, 0.12));
  --shadow-card: 0 20px 50px -30px rgba(0, 0, 0, 0.9);
  --shadow-accent: 0 24px 60px -28px rgba(112, 108, 255, 0.55);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1160px;
  --header-height: 72px;
  --font-sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f7f8fd;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --border: #e6e8f1;
  --border-strong: #d5d9e6;
  --text: #14161f;
  --text-strong: #0a0b10;
  --text-soft: #333747;
  --muted: #6c7182;
  --muted-2: #8d93a5;
  --accent: #5b5bd6;
  --accent-strong: #7c4dff;
  --accent-soft: rgba(91, 91, 214, 0.09);
  --pink: #e8579a;
  --gradient: linear-gradient(115deg, #5b5bd6 0%, #8b5cf6 52%, #ec6ba6 100%);
  --gradient-soft: linear-gradient(140deg, rgba(111, 111, 245, 0.12), rgba(255, 122, 184, 0.08));
  --shadow-card: 0 20px 45px -30px rgba(26, 31, 64, 0.35);
  --shadow-accent: 0 24px 55px -30px rgba(91, 91, 214, 0.35);
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(111, 111, 245, 0.20), transparent 62%),
    radial-gradient(760px 460px at 92% -12%, rgba(255, 122, 184, 0.12), transparent 60%),
    radial-gradient(900px 600px at 50% 115%, rgba(111, 111, 245, 0.08), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="light"] body {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(111, 111, 245, 0.14), transparent 62%),
    radial-gradient(760px 460px at 92% -12%, rgba(255, 122, 184, 0.10), transparent 60%),
    var(--bg);
}

body.has-site-bg {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(8, 9, 14, var(--bg-overlay)), rgba(8, 9, 14, var(--bg-overlay))),
    radial-gradient(900px 520px at 12% -8%, rgba(111, 111, 245, 0.18), transparent 62%),
    var(--bg-image);
  background-size: cover, auto, cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

[data-theme="light"] body.has-site-bg {
  background-image:
    linear-gradient(rgba(246, 247, 251, var(--bg-overlay)), rgba(246, 247, 251, var(--bg-overlay))),
    radial-gradient(900px 520px at 12% -8%, rgba(111, 111, 245, 0.12), transparent 62%),
    var(--bg-image);
}

::selection {
  background: rgba(139, 139, 255, 0.32);
  color: var(--text-strong);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}

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

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-main {
  flex: 1;
}

.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

.container--narrow {
  width: min(820px, 100% - 48px);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

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

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 4px rgba(139, 139, 255, 0.12), 0 0 18px rgba(167, 139, 250, 0.55);
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  transition: color 0.18s ease, background 0.18s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .nav-link:hover {
  background: rgba(20, 22, 31, 0.05);
}

.nav-link.is-active {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .nav-link.is-active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(20, 22, 31, 0.08);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 9px 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.search-trigger:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.search-trigger svg {
  width: 15px;
  height: 15px;
}

.search-kbd {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.4;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

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

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: inline-flex;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

.nav-toggle {
  display: none;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.68fr);
  gap: 56px;
  align-items: center;
  padding: 76px 0 56px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

.kicker-divider {
  color: var(--muted-2);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.hero-title {
  font-size: clamp(54px, 7vw, 88px);
  font-weight: 800;
  line-height: 1.12;
  padding-bottom: 0.2em;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, var(--text-strong) 35%, var(--accent) 135%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.hero-lede {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--gradient);
  color: #ffffff;
  box-shadow: 0 14px 34px -18px rgba(122, 108, 255, 0.85);
}

.btn-primary:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 18px 38px -16px rgba(122, 108, 255, 0.9);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
}

.btn-ghost:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.profile-card {
  position: relative;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 55%),
    var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 139, 255, 0.18), transparent 65%);
  pointer-events: none;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: var(--gradient);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 12px 28px -12px rgba(122, 108, 255, 0.8);
  flex: none;
}

.profile-name {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.profile-role {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-stat dt {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.profile-stat dd {
  margin: 4px 0 0;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.profile-stat dd span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.profile-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.profile-action-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: none;
}

.profile-action-icon svg {
  width: 100%;
  height: 100%;
}

.profile-action:hover {
  color: var(--text-strong);
  border-color: rgba(139, 139, 255, 0.4);
  background: var(--accent-soft);
}

.profile-action.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.profile-action.is-disabled:hover {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.025);
}

/* ---------- sections ---------- */

.section {
  padding: 38px 0 8px;
}

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

.section-title {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.section-desc {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14.5px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.section-link svg {
  width: 13px;
  height: 13px;
}

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

/* ---------- post cards ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 139, 255, 0.38);
  box-shadow: var(--shadow-accent);
}

.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.post-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 9, 14, 0.35));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.post-card:hover .post-card-media::after {
  opacity: 1;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.post-card:hover .post-card-media img {
  transform: scale(1.04);
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 13.5px;
}

.post-card-cat {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.post-card-cat:hover {
  color: var(--accent-strong);
}

.post-card-title {
  font-size: 25px;
  line-height: 1.45;
  letter-spacing: -0.018em;
  margin-bottom: 10px;
}

.post-card-title a {
  color: var(--text-strong);
}

.post-card-title a:hover {
  color: var(--accent);
}

.post-card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
  margin-bottom: 20px;
}

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

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 20px;
}

.post-card-time {
  color: var(--muted-2);
  font-size: 13px;
  white-space: nowrap;
}

.post-grid--solo .post-card--solo {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-column: 1 / -1;
}

.post-card--solo .post-card-body {
  justify-content: center;
  padding: 40px;
}

.post-card--solo .post-card-title {
  font-size: 30px;
  line-height: 1.35;
}

.post-card--solo .post-card-summary {
  -webkit-line-clamp: 4;
  font-size: 15px;
}

.post-card--solo .post-card-media {
  aspect-ratio: auto;
  height: 100%;
  min-height: 300px;
}

/* ---------- tags ---------- */

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

[data-theme="light"] .tag-chip {
  background: #ffffff;
}

.tag-chip:hover {
  color: var(--accent);
  border-color: rgba(139, 139, 255, 0.42);
  background: var(--accent-soft);
}

.tag-chip--small {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.045);
}

[data-theme="light"] .tag-chip--small {
  background: #f3f4fa;
}

.tag-chip-count {
  color: var(--muted-2);
  font-size: 11.5px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud .tag-chip {
  padding: 8px 15px;
  font-size: 14px;
}

/* ---------- page head ---------- */

.page-head {
  padding: 62px 0 34px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}

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

.page-title {
  font-size: clamp(42px, 5.2vw, 58px);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.page-desc {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12.5px;
}

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

/* ---------- reading surfaces ---------- */

body.has-site-bg .article .container,
body.page-about.has-site-bg .container--narrow,
body.page-archive.has-site-bg .site-main > .container {
  margin-top: 32px;
  padding: 4px 28px 12px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

body.has-site-bg .article .container {
  width: min(1120px, 100% - 48px);
}

body.page-about.has-site-bg .container--narrow {
  width: min(880px, 100% - 48px);
}

body.has-site-bg .site-footer {
  background: var(--surface);
}

/* ---------- article ---------- */

.article-head {
  padding: 60px 0 40px;
}

.article-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.article-categories a {
  color: var(--muted);
}

.article-categories a:hover {
  color: var(--accent);
}

.category-separator {
  color: var(--muted-2);
  opacity: 0.6;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.article-title {
  font-size: clamp(40px, 5.4vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 15px;
}

.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.avatar--tiny {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  box-shadow: none;
}

.article-cover {
  margin: 0 0 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.article-cover img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
}

.article .container {
  width: min(1080px, 100% - 48px);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 780px) 210px;
  justify-content: space-between;
  gap: 40px;
  align-items: start;
}

.article-layout--single {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
}

.article-layout--single .prose {
  max-width: 780px;
}

.prose {
  min-width: 0;
  color: var(--text-soft);
  font-size: 18.5px;
  line-height: 1.95;
}

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

.prose p {
  margin: 0 0 22px;
}

.prose h1 {
  margin: 42px 0 18px;
  font-size: 36px;
  line-height: 1.3;
}

.prose h2 {
  position: relative;
  margin: 54px 0 18px;
  padding-left: 18px;
  font-size: 32px;
  line-height: 1.35;
}

.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 4px;
  height: 1.05em;
  border-radius: 4px;
  background: var(--gradient);
}

.prose h3 {
  margin: 38px 0 12px;
  font-size: 25px;
}

.prose h4 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.prose a {
  color: var(--accent);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(139, 139, 255, 0.35);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose strong {
  color: var(--text-strong);
  font-weight: 650;
}

.prose ul,
.prose ol {
  margin: 0 0 22px;
  padding-left: 26px;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--accent);
}

.prose blockquote {
  margin: 26px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  color: var(--muted);
}

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

.prose hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose img {
  margin: 10px auto 26px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.prose figure {
  margin: 0 0 26px;
}

.prose figcaption {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}

.prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(139, 139, 255, 0.12);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

[data-theme="light"] .prose code {
  background: #eef0fb;
  color: #4f46c8;
}

.prose pre {
  position: relative;
  margin: 0 0 26px;
  padding: 40px 20px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0b0d14;
  color: #d7dbea;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.78;
}

[data-theme="light"] .prose pre {
  background: #14161f;
  color: #d7dbea;
  border-color: transparent;
}

.prose pre::before {
  content: attr(data-lang);
  position: absolute;
  top: 12px;
  left: 18px;
  color: #7c849c;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #8a92a8;
  font-family: var(--font-sans);
  font-size: 10.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.prose pre:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  color: #e6e9f5;
  border-color: rgba(255, 255, 255, 0.24);
}

.code-copy svg {
  width: 12px;
  height: 12px;
}

.prose table {
  width: 100%;
  margin: 0 0 26px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.7;
}

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

.prose th {
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
}

.prose tbody tr:nth-child(2n) {
  background: rgba(255, 255, 255, 0.018);
}

[data-theme="light"] .prose tbody tr:nth-child(2n) {
  background: #fafbfe;
}

.prose .math-display {
  margin: 28px 0;
  padding: 6px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.prose .katex-display {
  margin: 0;
}

.prose .katex {
  font-size: 1.3em;
}

.prose .math-display .katex {
  font-size: 1.38em;
}

/* ---------- toc ---------- */

.article-toc {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  max-height: calc(100vh - var(--header-height) - 56px);
  overflow-y: auto;
  padding: 2px 10px 2px 0;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.toc-title {
  margin-bottom: 14px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toc-list,
.toc-sublist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list {
  position: relative;
}

.toc-list::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--border);
}

.toc-item {
  position: relative;
  margin: 0;
}

.toc-link {
  position: relative;
  display: block;
  padding: 6px 0 6px 24px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  transition: color 0.2s ease, transform 0.2s ease;
}

.toc-link::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 13px;
  height: 1px;
  background: var(--border);
  transition: background 0.2s ease;
}

.toc-dot {
  position: absolute;
  left: 3.5px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.toc-sublist {
  position: relative;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.toc-sublist .toc-link {
  padding: 5px 0 5px 10px;
  font-size: 13.5px;
  color: var(--muted-2);
}

.toc-sublist .toc-link::before {
  left: -12px;
  width: 22px;
}

.toc-sublist .toc-dot {
  left: -17.5px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
}

.toc-link:hover {
  color: var(--text);
}

.toc-link:hover::before {
  background: var(--accent);
}

.toc-link.is-active {
  color: var(--accent);
  font-weight: 600;
  transform: translateX(2px);
}

.toc-link.is-active::before {
  background: var(--accent);
}

.toc-link.is-active .toc-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 139, 255, 0.16);
  transform: scale(1.1);
}

/* ---------- post nav ---------- */

.article-comments {
  max-width: 780px;
  margin: 48px auto 24px;
}

.article-comments h2 {
  margin-bottom: 16px;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 52px 0 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.post-nav-link:hover {
  border-color: rgba(139, 139, 255, 0.4);
  transform: translateY(-2px);
  color: var(--text);
}

.post-nav-link--next {
  text-align: right;
  align-items: flex-end;
}

.post-nav-label {
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.post-nav-link strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.post-nav-empty {
  display: block;
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 44px 0 84px;
}

.pagination-arrow {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.pagination-arrow.is-disabled {
  opacity: 0.35;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
}

.pagination-link:hover {
  border-color: var(--border);
  color: var(--text);
}

.pagination-link.is-current {
  background: var(--gradient);
  color: #ffffff;
  font-weight: 600;
}

.pagination-gap {
  color: var(--muted-2);
  padding: 0 4px;
}

/* ---------- tags index ---------- */

.tag-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-bottom: 80px;
}

.tag-index-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.tag-index-card:hover {
  border-color: rgba(139, 139, 255, 0.4);
  transform: translateY(-2px);
}

.tag-index-name {
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 600;
}

.tag-index-count {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- categories ---------- */

.category-index {
  margin-bottom: 80px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.category-tree {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tree .category-tree {
  margin: 4px 0 6px 16px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.category-node {
  position: relative;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.category-link:hover {
  color: var(--text-strong);
  background: var(--surface);
  border-color: var(--border);
}

.category-name {
  font-size: 16px;
  font-weight: 600;
}

.category-count {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(139, 139, 255, 0.1);
  color: var(--accent);
  font-size: 12px;
}

.category-children {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 28px;
}

/* ---------- archive ---------- */

.archive {
  padding-bottom: 80px;
}

.archive-group {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}

.archive-year {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.archive-year span {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
}

.archive-item + .archive-item {
  border-top: 1px dashed var(--border);
}

.archive-item time {
  color: var(--muted-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.archive-link {
  color: var(--text);
  font-size: 16.5px;
}

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

.archive-tag {
  color: var(--muted-2);
  font-size: 11px;
}

/* ---------- about ---------- */

.about-prose {
  padding-bottom: 10px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 34px 0 80px;
}

/* ---------- empty / 404 ---------- */

.empty-state {
  padding: 56px 24px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.empty-title {
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 600;
}

.empty-desc {
  max-width: 460px;
  margin: 8px auto 18px;
  color: var(--muted);
  font-size: 13px;
}

.notfound {
  padding: 110px 0 120px;
  text-align: center;
}

.notfound-code {
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.notfound-title {
  margin: 18px 0 10px;
  font-size: 28px;
}

.notfound-desc {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

.notfound .hero-actions {
  justify-content: center;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
}

[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, transparent, rgba(20, 22, 31, 0.02));
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.9fr);
  gap: 48px;
  padding: 56px 0 40px;
}

.brand--footer {
  margin-bottom: 14px;
}

.footer-desc {
  max-width: 380px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.footer-note {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 13px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.social-link:hover {
  color: var(--accent);
  border-color: rgba(139, 139, 255, 0.4);
}

.social-link svg {
  width: 13px;
  height: 13px;
}

.footer-title {
  margin-bottom: 14px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list li {
  margin-bottom: 9px;
}

.footer-list a {
  color: var(--muted);
  font-size: 14px;
}

.footer-list a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 26px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 13px;
}

.footer-bottom-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-bottom-meta .icp {
  color: var(--muted-2);
}

/* ---------- search ---------- */

.search-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 9vh 20px 20px;
}

.search-layer[hidden] {
  display: none;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 9, 0.78);
}

.search-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: search-in 0.18s ease;
}

@keyframes search-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.search-field > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 18px;
  outline: none;
}

.search-field input::placeholder {
  color: var(--muted-2);
}

.search-close {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.search-close:hover {
  color: var(--text);
}

.search-close svg {
  width: 14px;
  height: 14px;
}

.search-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.search-empty {
  padding: 34px 22px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.search-result {
  display: block;
  padding: 13px 15px;
  border-radius: 11px;
  color: var(--text);
}

.search-result:hover,
.search-result.is-active {
  background: rgba(139, 139, 255, 0.1);
  color: var(--text);
}

.search-result-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
}

.search-result mark {
  background: rgba(139, 139, 255, 0.28);
  color: var(--text-strong);
  border-radius: 3px;
  padding: 0 2px;
}

.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.search-result-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12px;
}

.search-count b {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    justify-items: center;
  }

  .article-toc {
    display: none;
  }

  body.has-site-bg .article .container,
  body.page-about.has-site-bg .container--narrow,
  body.page-archive.has-site-bg .site-main > .container {
    padding: 2px 20px 10px;
    border-radius: 22px;
  }

  .article-layout--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose {
    width: 100%;
    max-width: 780px;
    margin: 0;
  }

  .article-head {
    max-width: 780px;
    margin: 0 auto;
    padding-bottom: 28px;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding: 56px 0 40px;
  }

  .profile-card {
    max-width: 420px;
  }

  .post-card--solo {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .post-card--solo .post-card-media {
    order: -1;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .post-card--solo .post-card-body {
    padding: 26px;
  }

  .post-card--solo .post-card-title {
    font-size: 23px;
  }

  .archive-group {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    right: 18px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .search-kbd {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  body {
    font-size: 16.5px;
  }

  .container {
    width: min(var(--container), 100% - 36px);
  }

  .header-inner {
    gap: 12px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    right: 18px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 16px;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .search-kbd {
    display: none;
  }

  .hero {
    padding: 42px 0 34px;
  }

  .hero-title {
    font-size: clamp(42px, 13vw, 56px);
  }

  .hero-lede {
    font-size: 17px;
  }

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

  .page-head {
    padding: 42px 0 26px;
    margin-bottom: 26px;
  }

  .article-head {
    padding: 40px 0 30px;
  }

  .article-title {
    font-size: clamp(34px, 9.5vw, 48px);
  }

  .article-cover {
    margin-bottom: 32px;
    border-radius: 18px;
  }

  .prose {
    font-size: 18px;
    line-height: 1.9;
  }

  body.has-site-bg .article .container,
  body.page-about.has-site-bg .container--narrow,
  body.page-archive.has-site-bg .site-main > .container {
    padding: 2px 14px 8px;
    border-radius: 18px;
  }

  .prose p,
  .prose li {
    overflow-x: auto;
  }

  .prose .katex {
    font-size: 1.12em;
  }

  .prose .math-display .katex {
    font-size: 1.28em;
  }

  .prose h2 {
    margin-top: 40px;
    font-size: 25px;
  }

  .prose h3 {
    font-size: 21px;
  }

  .prose pre {
    padding: 38px 16px 16px;
    font-size: 13.5px;
  }

  .post-nav {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 60px;
  }

  .post-nav-link--next {
    text-align: left;
    align-items: flex-start;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 40px 0 30px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-bottom-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .archive-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .archive-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .archive-tag {
    display: none;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .search-layer {
    padding: 0;
    align-items: stretch;
  }

  .search-panel {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .search-field {
    padding: 16px;
  }

  .search-footer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  body.has-site-bg {
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  .search-trigger-text {
    display: none;
  }

  .search-trigger {
    padding: 0 10px;
  }

  .profile-stats {
    gap: 4px;
  }

  .hero-actions .btn {
    flex: 1;
  }
}

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