/* =========================================================
   AI 技术交流 · aikfagent.com
   样式表：无任何外部依赖，仅使用系统字体，适配国内网络环境
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  color-scheme: dark;

  /* 叠加墨色：深色主题为白，浅色主题翻转为深，所有 rgb(var(--ink) / a) 随之切换 */
  --ink: 255 255 255;

  /* 暗色专用面板色（浅色主题会覆盖） */
  --chrome: rgba(6, 9, 16, 0.74);
  --nav-bg: rgba(7, 10, 18, 0.97);
  --float-bg: rgba(10, 14, 24, 0.82);
  --panel-solid: #0a0e17;
  --card-bg: rgba(7, 10, 18, 0.5);
  --stat-bg: rgba(8, 11, 19, 0.62);

  /* 强调色文本（浅色主题需要更深的蓝以保证对比度） */
  --accent-text: #a9c4ff;
  --code-fg: #bfd4ff;
  --tag-fg: #9aa7c2;
  --ok-fg: #7ee0a8;
  --bg: #05070c;
  --bg-2: #070a12;
  --surface: rgb(var(--ink) / 0.032);
  --surface-2: rgb(var(--ink) / 0.055);
  --line: rgb(var(--ink) / 0.085);
  --line-2: rgb(var(--ink) / 0.16);

  --text: #e9edf6;
  --text-2: #a4adc0;
  --text-3: #737d8e;

  --brand: #5b8cff;
  --brand-2: #22d3ee;
  --brand-3: #a78bfa;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --container: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(91, 140, 255, 0.16), transparent 62%),
    radial-gradient(900px 540px at 6% 6%, rgba(34, 211, 238, 0.1), transparent 58%),
    radial-gradient(800px 700px at 50% 108%, rgba(167, 139, 250, 0.11), transparent 62%),
    var(--bg);
}

/* 笔记弹窗打开时锁定页面滚动 */
body.is-locked {
  overflow: hidden;
}

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

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

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.28;
  letter-spacing: -0.015em;
  font-weight: 650;
}

p {
  margin: 0;
}

ul, ol, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.42em;
  border-radius: 5px;
  background: rgba(91, 140, 255, 0.12);
  border: 1px solid rgba(91, 140, 255, 0.18);
  color: var(--code-fg);
  white-space: nowrap;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* =========================================================
   顶部导航
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
    backdrop-filter 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: var(--chrome);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 配色切换按钮 */
.theme-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgb(var(--ink) / 0.06);
  cursor: pointer;
  transition: color 0.22s var(--ease), background 0.22s var(--ease),
    border-color 0.22s var(--ease), transform 0.22s var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.55);
  background: rgb(var(--ink) / 0.1);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: none;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .ic-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .ic-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .ic-moon {
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-text em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

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

.nav a {
  position: relative;
  padding: 8px 13px;
  font-size: 14.5px;
  color: var(--text-2);
  border-radius: 9px;
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

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

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 2px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
}

.nav .nav-cta {
  margin-left: 8px;
  padding: 8px 17px;
  color: #0a0f1a;
  font-weight: 600;
  background: linear-gradient(135deg, #7dd3fc, #6f9bff 55%, #b192ff);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.nav .nav-cta:hover {
  color: #0a0f1a;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -10px rgba(111, 155, 255, 0.9);
}

.nav .nav-cta::after {
  display: none;
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.6px) rotate(-45deg);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 168px 0 96px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 460px;
  height: 460px;
  top: -160px;
  right: -80px;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.55), transparent 68%);
}

.orb-2 {
  width: 380px;
  height: 380px;
  top: 120px;
  left: -140px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.4), transparent 68%);
  animation-delay: -6s;
}

.orb-3 {
  width: 420px;
  height: 420px;
  bottom: -220px;
  left: 42%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.38), transparent 68%);
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -26px, 0); }
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(var(--ink) / 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(var(--ink) / 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 30%, #000 32%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 30%, #000 32%, transparent 78%);
}

.hero-inner {
  max-width: 940px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px 6px 11px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--ink) / 0.03);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero h1 {
  font-size: clamp(2.35rem, 5.6vw, 4.05rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.03em;
  margin-bottom: 26px;
}

.grad {
  background: linear-gradient(100deg, #7dd3fc 0%, #8ea8ff 38%, #c4a2ff 74%, #7dd3fc 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 12s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

.lede {
  max-width: 720px;
  font-size: clamp(1rem, 1.35vw, 1.115rem);
  color: var(--text-2);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 550;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.28s var(--ease),
    background 0.22s var(--ease), border-color 0.22s var(--ease);
}

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

.btn-primary {
  color: #08101f;
  background: linear-gradient(135deg, #86dcff, #7d9bff 58%, #bda4ff);
  box-shadow: 0 14px 34px -16px rgba(125, 155, 255, 0.95);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px -16px rgba(125, 155, 255, 1);
}

.btn-primary svg {
  transition: transform 0.22s var(--ease);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line-2);
  background: rgb(var(--ink) / 0.032);
}

.btn-ghost:hover {
  background: rgb(var(--ink) / 0.07);
  border-color: rgb(var(--ink) / 0.26);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 9px 17px;
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: 720px;
  margin-top: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.stat {
  padding: 22px 20px;
  background: var(--stat-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.stat-num {
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff, #9fb3d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* =========================================================
   技术栈条
   ========================================================= */
.stack-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgb(var(--ink) / 0.014);
}

.stack-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-top: 20px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}

.stack-label {
  flex: 0 0 auto;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.stack-list li {
  padding: 5px 13px;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--ink) / 0.022);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.stack-list li:hover {
  color: var(--text);
  border-color: rgba(91, 140, 255, 0.45);
}

/* =========================================================
   通用段落
   ========================================================= */
.section {
  padding: 104px 0;
}

.section-alt {
  position: relative;
  background: linear-gradient(180deg, rgb(var(--ink) / 0.014), transparent 24%);
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section-kicker {
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.section-title {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 680;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}

.section-desc {
  font-size: 15.6px;
  color: var(--text-2);
  line-height: 1.85;
}

/* =========================================================
   技术方向卡片
   ========================================================= */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(296px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  padding: 30px 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgb(var(--ink) / 0.045), rgb(var(--ink) / 0.012) 60%);
  overflow: hidden;
  transition: transform 0.32s var(--ease), border-color 0.32s var(--ease),
    box-shadow 0.32s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 18% 0%, rgba(91, 140, 255, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgb(var(--ink) / 0.2);
  box-shadow: 0 26px 50px -34px rgba(0, 0, 0, 0.95);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 13px;
  color: var(--accent-text);
  border: 1px solid rgba(91, 140, 255, 0.28);
  background: linear-gradient(150deg, rgba(91, 140, 255, 0.2), rgba(34, 211, 238, 0.07));
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card h3 {
  font-size: 17.5px;
  font-weight: 640;
  margin-bottom: 11px;
}

.card p {
  font-size: 14.6px;
  line-height: 1.82;
  color: var(--text-2);
}

/* =========================================================
   项目实践
   ========================================================= */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 32px 30px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(165deg, rgb(var(--ink) / 0.05), rgb(var(--ink) / 0.012) 55%),
    var(--card-bg);
  transition: transform 0.34s var(--ease), border-color 0.34s var(--ease),
    box-shadow 0.34s var(--ease);
}

.project:hover {
  transform: translateY(-4px);
  border-color: rgb(var(--ink) / 0.19);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 1);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.03em;
  border-radius: 999px;
  border: 1px solid transparent;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.chip-live {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.26);
  background: rgba(16, 185, 129, 0.1);
}

.chip-ok {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.26);
  background: rgba(59, 130, 246, 0.1);
}

.chip-wip {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.24);
  background: rgba(245, 158, 11, 0.1);
}

.project-idx {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.project h3 {
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -0.02em;
  margin-bottom: 9px;
}

.project-sub {
  font-size: 14.2px;
  font-weight: 550;
  color: var(--accent-text);
  margin-bottom: 16px;
}

.project-desc {
  font-size: 14.6px;
  line-height: 1.85;
  color: var(--text-2);
  margin-bottom: 22px;
}

.keypoints {
  display: grid;
  gap: 11px;
  margin-bottom: 26px;
}

.keypoints li {
  position: relative;
  padding-left: 22px;
  font-size: 14.2px;
  line-height: 1.8;
  color: var(--text-2);
}

.keypoints li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  border: 1.4px solid var(--brand-2);
  opacity: 0.75;
  transform: rotate(45deg);
}

.keypoints strong {
  color: var(--text);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.tags li {
  padding: 4px 11px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tag-fg);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(var(--ink) / 0.022);
}

/* 请求链路 */
.flow-wrap {
  margin-top: 26px;
  padding: 38px 38px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 300px at 92% -10%, rgba(34, 211, 238, 0.09), transparent 70%),
    var(--card-bg);
}

.flow-head h3 {
  font-size: 18.5px;
  font-weight: 640;
  margin-bottom: 10px;
}

.flow-head p {
  font-size: 14.4px;
  color: var(--text-2);
  max-width: 780px;
  margin-bottom: 30px;
}

.flow {
  display: grid;
  gap: 0;
}

.flow-item {
  position: relative;
  padding: 0 0 26px 58px;
}

.flow-item:last-child {
  padding-bottom: 0;
}

.flow-item::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.55), rgba(91, 140, 255, 0.08));
}

.flow-item:last-child::before {
  display: none;
}

.flow-no {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-text);
  border: 1px solid rgba(91, 140, 255, 0.32);
  border-radius: 11px;
  background: rgba(91, 140, 255, 0.11);
}

.flow-body h4 {
  font-size: 15.6px;
  font-weight: 620;
  margin-bottom: 6px;
}

.flow-body p {
  font-size: 14.2px;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 820px;
}

/* =========================================================
   技术笔记
   ========================================================= */
.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.note {
  display: flex;
  flex-direction: column;
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--ink) / 0.024);
  cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}

.note:hover,
.note:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(91, 140, 255, 0.42);
  background: rgba(91, 140, 255, 0.055);
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 12px;
  color: var(--text-3);
}

.note-meta span:first-child {
  padding: 2px 9px;
  color: var(--accent-text);
  border: 1px solid rgba(91, 140, 255, 0.26);
  border-radius: 6px;
  background: rgba(91, 140, 255, 0.1);
}

.note-meta time,
.note-meta span:last-child {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.note-meta span:last-child::before {
  content: "·";
  margin-right: 8px;
  color: var(--text-3);
  opacity: 0.6;
}

.note h3 {
  font-size: 16.5px;
  font-weight: 630;
  line-height: 1.55;
  margin-bottom: 12px;
}

.note p {
  font-size: 14.2px;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 20px;
}

.note-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--accent-text);
  background: none;
  border: 0;
  cursor: pointer;
}

.note-more span {
  transition: transform 0.24s var(--ease);
}

.note:hover .note-more span {
  transform: translateX(4px);
}

/* =========================================================
   关于本站
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.about-main .section-title {
  margin-bottom: 22px;
}

.about-main p {
  font-size: 15.4px;
  line-height: 1.9;
  color: var(--text-2);
  margin-bottom: 16px;
}

.about-main strong {
  color: var(--text);
  font-weight: 620;
}

.about-contact {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.about-contact h3 {
  font-size: 16px;
  font-weight: 620;
  margin-bottom: 10px;
}

.about-contact p {
  margin-bottom: 14px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-note {
  font-size: 13px;
  color: var(--text-3) !important;
  margin-top: 14px;
}

.about-side {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--ink) / 0.026);
}

.side-title {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.side-list {
  display: grid;
  gap: 0;
}

.side-list > div {
  display: flex;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed rgb(var(--ink) / 0.07);
  font-size: 14px;
}

.side-list > div:last-child {
  border-bottom: 0;
}

.side-list dt {
  flex: 0 0 72px;
  color: var(--text-3);
}

.side-list dd {
  flex: 1 1 auto;
  color: var(--text);
  line-height: 1.6;
}

.side-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-3);
}

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  padding: 68px 0 34px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(var(--ink) / 0.016), rgba(0, 0, 0, 0.24));
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

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

.footer-tagline {
  font-size: 13.5px;
  color: var(--text-3);
}

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

.footer-links h4 {
  font-size: 13px;
  font-weight: 620;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.footer-links a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--text);
}

/* --- 备案信息 --- */
.filing {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(var(--ink) / 0.024);
}

.filing-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.filing-title svg {
  width: 17px;
  height: 17px;
  color: var(--ok-fg);
}

.filing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
}

.filing-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.filing-label {
  padding: 2px 9px;
  font-size: 11.5px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.filing-list a {
  color: var(--text-2);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.filing-list a:hover {
  color: var(--accent-text);
  border-bottom-color: rgba(169, 196, 255, 0.55);
}

.filing-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgb(var(--ink) / 0.07);
  font-size: 12.8px;
  line-height: 1.75;
  color: var(--text-3);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.8px;
  color: var(--text-3);
}

.footer-legal {
  color: var(--text-3);
}

/* =========================================================
   返回顶部
   ========================================================= */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--float-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease),
    visibility 0.28s var(--ease), color 0.2s var(--ease);
}

.to-top svg {
  width: 16px;
  height: 16px;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  color: var(--text);
  border-color: rgb(var(--ink) / 0.3);
}

/* =========================================================
   笔记弹窗
   ========================================================= */
.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(84vh, 900px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  color: var(--text);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(2, 4, 8, 0.76);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal[open] {
  animation: modalIn 0.26s var(--ease);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-card {
  position: relative;
  max-height: min(84vh, 900px);
  overflow-y: auto;
  padding: 40px 44px 44px;
  overscroll-behavior: contain;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(var(--ink) / 0.045);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.modal-close:hover {
  color: var(--text);
  background: rgb(var(--ink) / 0.1);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-body {
  max-width: 640px;
}

.modal-kicker {
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--brand-2);
}

.modal-body h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.72rem);
  font-weight: 660;
  line-height: 1.42;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
  padding-right: 40px;
}

.modal-body h3 {
  font-size: 16px;
  font-weight: 630;
  margin: 30px 0 12px;
  color: var(--text);
}

.modal-body p {
  font-size: 15px;
  line-height: 1.92;
  color: var(--text-2);
  margin-bottom: 15px;
}

.modal-body ul {
  display: grid;
  gap: 9px;
  margin: 4px 0 18px;
  padding-left: 0;
}

.modal-body ul li {
  position: relative;
  padding-left: 20px;
  font-size: 14.6px;
  line-height: 1.85;
  color: var(--text-2);
}

.modal-body ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
  opacity: 0.8;
}

.modal-body strong {
  color: var(--text);
  font-weight: 620;
}

/* =========================================================
   滚动显隐
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-side {
    order: -1;
  }

  .projects {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 22px;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.26s var(--ease), transform 0.26s var(--ease),
      visibility 0.26s var(--ease);
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    padding: 13px 14px;
    font-size: 15.5px;
    border-radius: 10px;
  }

  .nav a.is-active::after {
    display: none;
  }

  .nav a.is-active {
    color: var(--accent-text);
    background: rgba(91, 140, 255, 0.1);
  }

  .nav .nav-cta {
    margin: 8px 0 0;
    padding: 13px 18px;
    text-align: center;
  }

  .hero {
    padding: 132px 0 76px;
  }

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

  .section {
    padding: 76px 0;
  }

  .section-head {
    margin-bottom: 40px;
  }

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

  .flow-wrap {
    padding: 30px 24px 28px;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .modal-card {
    padding: 34px 24px 34px;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 20px;
  }

  .header-inner {
    height: 64px;
  }

  .nav {
    top: 64px;
  }

  .brand-text em {
    display: none;
  }

  .hero {
    padding: 116px 0 64px;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .lede {
    font-size: 15px;
  }

  .hero-actions {
    margin-top: 30px;
  }

  .btn {
    flex: 1 1 auto;
    padding: 12px 20px;
  }

  .stats {
    margin-top: 46px;
  }

  .stat {
    padding: 18px 16px;
  }

  .card {
    padding: 26px 22px 28px;
  }

  .project {
    padding: 26px 22px 26px;
  }

  .project h3 {
    font-size: 19px;
  }

  .flow-item {
    padding-left: 50px;
  }

  .flow-item::before {
    left: 15px;
  }

  .flow-no {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .about-side {
    padding: 24px 20px;
  }

  .side-list dt {
    flex-basis: 64px;
  }

  .footer-links {
    gap: 18px;
  }

  .filing {
    padding: 20px 18px;
  }

  .filing-list {
    flex-direction: column;
    gap: 12px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
  }

  .modal-card {
    padding: 30px 20px 30px;
  }

  .modal-body h2 {
    padding-right: 34px;
  }
}

/* =========================================================
   无障碍：尊重减少动效偏好
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* 打印 */
@media print {
  .site-header,
  .to-top,
  .modal,
  .hero-bg {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }
}

/* =========================================================
   浅色主题
   ---------------------------------------------------------
   切换方式：<html data-theme="light">，变量整体翻转，
   少数不能用变量的地方（渐变文字、主按钮、卡片底色、
   状态徽标、阴影、装饰光斑）在此单独覆盖。
   ========================================================= */
html[data-theme="light"] {
  color-scheme: light;

  /* 叠加墨色翻转为深蓝黑 */
  --ink: 15 23 42;

  --bg: #f4f6fb;
  --bg-2: #eaeef7;

  --text: #0f172a;
  --text-2: #45526b;
  --text-3: #6b7a91;

  --brand: #2563eb;
  --brand-2: #0891b2;
  --brand-3: #7c3aed;

  --chrome: rgba(255, 255, 255, 0.86);
  --nav-bg: rgba(255, 255, 255, 0.98);
  --float-bg: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.86);
  --stat-bg: rgba(255, 255, 255, 0.8);

  --accent-text: #2563eb;
  --code-fg: #1d4ed8;
  --tag-fg: #475569;
  --ok-fg: #15803d;
}

/* ---------- 背景与装饰 ---------- */
html[data-theme="light"] body::before {
  background:
    radial-gradient(1000px 560px at 78% -12%, rgba(37, 99, 235, 0.1), transparent 62%),
    radial-gradient(820px 500px at 4% 4%, rgba(8, 145, 178, 0.08), transparent 58%),
    radial-gradient(760px 640px at 50% 106%, rgba(124, 58, 237, 0.07), transparent 62%),
    var(--bg);
}

html[data-theme="light"] .orb {
  opacity: 0.3;
}

html[data-theme="light"] .orb-1 {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.5), transparent 68%);
}

html[data-theme="light"] .orb-2 {
  background: radial-gradient(circle, rgba(8, 145, 178, 0.45), transparent 68%);
}

html[data-theme="light"] .orb-3 {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.4), transparent 68%);
}

html[data-theme="light"] .grid-lines {
  background-image:
    linear-gradient(to right, rgb(var(--ink) / 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(var(--ink) / 0.06) 1px, transparent 1px);
}

/* ---------- 渐变文字 ---------- */
html[data-theme="light"] .grad {
  background: linear-gradient(100deg, #1d4ed8 0%, #4338ca 38%, #7c3aed 74%, #1d4ed8 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .stat-num {
  background: linear-gradient(180deg, #0f172a, #475569);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 主按钮 ---------- */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .nav .nav-cta {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #4f46e5 58%, #8b5cf6);
  box-shadow: 0 14px 30px -18px rgba(37, 99, 235, 0.6);
}

html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .nav .nav-cta:hover {
  color: #ffffff;
  box-shadow: 0 20px 38px -18px rgba(37, 99, 235, 0.7);
}

html[data-theme="light"] .btn-ghost {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .btn-ghost:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.35);
}

/* ---------- 卡片与面板 ---------- */
html[data-theme="light"] .card,
html[data-theme="light"] .note,
html[data-theme="light"] .about-side,
html[data-theme="light"] .filing,
html[data-theme="light"] .project,
html[data-theme="light"] .flow-wrap {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .flow-wrap {
  background:
    radial-gradient(700px 300px at 92% -10%, rgba(8, 145, 178, 0.07), transparent 70%),
    #ffffff;
}

html[data-theme="light"] .card:hover,
html[data-theme="light"] .note:hover,
html[data-theme="light"] .note:focus-visible,
html[data-theme="light"] .project:hover {
  border-color: rgba(37, 99, 235, 0.26);
  box-shadow: 0 22px 40px -32px rgba(15, 23, 42, 0.55);
}

html[data-theme="light"] .note:hover,
html[data-theme="light"] .note:focus-visible {
  background: #ffffff;
}

html[data-theme="light"] .card-icon {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(150deg, rgba(37, 99, 235, 0.1), rgba(8, 145, 178, 0.05));
}

html[data-theme="light"] .eyebrow {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .stack-band {
  background: rgba(15, 23, 42, 0.022);
}

html[data-theme="light"] .stack-list li,
html[data-theme="light"] .tags li {
  background: #ffffff;
}

html[data-theme="light"] .section-alt {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.022), transparent 24%);
}

html[data-theme="light"] .side-list > div {
  border-bottom-color: rgba(15, 23, 42, 0.07);
}

html[data-theme="light"] .filing-note {
  border-top-color: rgba(15, 23, 42, 0.07);
}

/* ---------- 状态徽标 ---------- */
html[data-theme="light"] .chip-live {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.22);
  background: rgba(16, 185, 129, 0.1);
}

html[data-theme="light"] .chip-ok {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.2);
  background: rgba(37, 99, 235, 0.08);
}

html[data-theme="light"] .chip-wip {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.22);
  background: rgba(245, 158, 11, 0.13);
}

/* ---------- 代码与链接强调色 ---------- */
html[data-theme="light"] code {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.16);
}

html[data-theme="light"] .note-meta span:first-child {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}

/* ---------- 页脚 ---------- */
html[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.045));
}

/* ---------- 弹窗 ---------- */
html[data-theme="light"] .modal {
  box-shadow: 0 40px 80px -40px rgba(15, 23, 42, 0.55);
}

html[data-theme="light"] .modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

/* ---------- 悬浮返回顶部按钮 ---------- */
html[data-theme="light"] .to-top {
  box-shadow: 0 8px 20px -14px rgba(15, 23, 42, 0.6);
}