:root {
  --bg: #eef2f6;
  --bg-deep: #e3e9f0;
  --surface: rgba(255, 255, 255, 0.78);
  --ink: #1a2433;
  --ink-soft: #4a5568;
  --muted: #6b778a;
  --line: rgba(26, 36, 51, 0.1);
  --accent: #2f6f6a;
  --accent-soft: #d7ebe8;
  --accent-deep: #1f4f4b;
  --shadow: 0 18px 50px rgba(26, 36, 51, 0.08);
  --radius: 18px;
  --max: 980px;
  --font-display: "Fraunces", "Noto Serif SC", serif;
  --font-body: "Manrope", "Noto Sans SC", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9ece9 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d7e3f4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  line-height: 1.75;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(26, 36, 51, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 36, 51, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(238, 242, 246, 0.78);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  color: inherit;
  text-decoration: none;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand span {
  font-size: 0.78rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.hero {
  padding: 4.5rem 0 2.5rem;
  animation: rise 0.7s ease both;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 1.1rem 0 0;
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.7rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.section {
  padding: 1.5rem 0 3rem;
  animation: rise 0.8s ease 0.08s both;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 650;
}

.section-head p,
.lead {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
}

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

.note-list {
  display: grid;
  gap: 0.85rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem;
  backdrop-filter: blur(10px);
}

.panel h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 650;
}

.panel p {
  margin: 0;
  color: var(--ink-soft);
}

.panel .meta {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.note-link {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.note-link:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 106, 0.35);
  background: rgba(255, 255, 255, 0.92);
}

.note-link h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.note-link p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.tag {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.78rem;
}

.article {
  padding: 2.5rem 0 3rem;
  animation: rise 0.7s ease both;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-header .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.article-header h1 {
  margin: 0.4rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.25;
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.prose h2 {
  margin: 1.6rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

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

.prose p,
.prose ul,
.prose ol {
  color: var(--ink-soft);
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose code,
.prose pre {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

.prose code {
  background: #e8eef4;
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.prose pre {
  overflow-x: auto;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: #182230;
  color: #e7eef7;
  line-height: 1.55;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.callout {
  margin: 1.2rem 0;
  padding: 0.95rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.notice {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px dashed rgba(47, 111, 106, 0.35);
  border-radius: 12px;
  background: rgba(215, 235, 232, 0.45);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.footer-inner {
  padding: 1.6rem 0 1.9rem;
  text-align: center;
}

.footer-inner p {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.beian a {
  color: var(--muted);
  text-decoration: none;
}

.beian a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 3rem;
  }

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

/* —— 主页背景特效 —— */
body.home {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

body.home::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 20% 20%, rgba(47, 111, 106, 0.14), transparent 60%),
    radial-gradient(ellipse 45% 35% at 80% 10%, rgba(90, 130, 180, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 45% at 70% 80%, rgba(47, 111, 106, 0.1), transparent 60%);
  animation: home-wash 18s ease-in-out infinite alternate;
}

.home-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.home-fx__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  will-change: transform;
}

.home-fx__orb--a {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  top: 8%;
  left: -6%;
  background: radial-gradient(circle at 35% 35%, #b9e0da 0%, rgba(185, 224, 218, 0) 70%);
  animation: home-drift-a 22s ease-in-out infinite alternate;
}

.home-fx__orb--b {
  width: min(48vw, 520px);
  height: min(48vw, 520px);
  top: -8%;
  right: -10%;
  background: radial-gradient(circle at 40% 40%, #c5d6ef 0%, rgba(197, 214, 239, 0) 72%);
  animation: home-drift-b 26s ease-in-out infinite alternate;
}

.home-fx__orb--c {
  width: min(36vw, 380px);
  height: min(36vw, 380px);
  bottom: 12%;
  left: 35%;
  background: radial-gradient(circle at 50% 40%, #d5e8e0 0%, rgba(213, 232, 224, 0) 70%);
  animation: home-drift-c 20s ease-in-out infinite alternate;
}

.home-fx__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

@keyframes home-wash {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(3%, 2%, 0) scale(1.06);
  }
}

@keyframes home-drift-a {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(12%, 18%, 0) scale(1.12);
  }
}

@keyframes home-drift-b {
  from {
    transform: translate3d(0, 0, 0) scale(1.05);
  }
  to {
    transform: translate3d(-14%, 10%, 0) scale(0.95);
  }
}

@keyframes home-drift-c {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-8%, -16%, 0) scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home::after,
  .home-fx__orb {
    animation: none !important;
  }

  .home-fx__canvas {
    display: none;
  }
}
