/* ============================================================
 * Zio's Blog · Jitter 风格设计系统
 * 参考：jitter.video —— motion-first 官网
 *  - 白底 + 墨黑文字，唯一交互色为黑（暗面反转为白）
 *  - 大标题 Inter 700 + 极紧字距，居中 hero + 三列 marquee
 *  - 卡片即动效：hover 渐变位移、封面字弹起、轻阴影
 *  - 黑色 pill 按钮，按下 scale(0.95)
 * ============================================================ */

/* ---------------- 设计令牌 ---------------- */

:root {
  --header-h: 52px;

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 表面 */
  --bg: #fbfbfa;
  --bg-alt: #f7f7f8;
  --card: #ffffff;
  --muted-bg: #f5f5f6;

  /* 文字 */
  --text-1: #111111;
  --text-2: #3f3f46;
  --text-3: #6f6f76;

  /* 线 */
  --border: #e8e8ea;
  --border-soft: #f0f0f1;

  /* 交互：墨黑（暗面反转为白） */
  --accent: #111111;
  --accent-strong: #2f2f2f;
  --accent-soft: rgba(17, 17, 17, 0.06);
  --link: #111111;
  --focus-ring: #0066cc;

  /* 点睛渐变（句点 / 贴纸等小面积装饰，颜色可在后台自定义） */
  --grad-1: #0a84ff;
  --grad-2: #7c3aed;
  --grad-3: #ec4899;
  --brand-grad: linear-gradient(120deg, var(--grad-1), var(--grad-2) 48%, var(--grad-3));

  /* 代码块 */
  --code-bg: #17171a;
  --code-ink: #ececf0;

  --product-shadow: 3px 5px 30px rgba(0, 0, 0, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --nav-ink: rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e10;
  --bg-alt: #161618;
  --card: #1a1a1c;
  --muted-bg: #232326;
  --text-1: #f5f5f6;
  --text-2: #c9c9ce;
  --text-3: #8b8b92;
  --border: #2a2a2e;
  --border-soft: #222225;
  --accent: #ffffff;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --link: #f5f5f6;
  --focus-ring: #409cff;
  --code-bg: #17171a;
  --nav-ink: rgba(255, 255, 255, 0.8);
}

/* ---------------- 基础重置 ---------------- */

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;             /* DESIGN.md：正文 17px，而非 16px */
  line-height: 1.65;           /* 中文适配：略高于拉丁 1.47 */
  letter-spacing: -0.011em;    /* body 的 -0.374px ≈ 17px 下的 -0.022em，中文取半 */
  color: var(--text-1);
  background: var(--bg);
  background-image: linear-gradient(rgba(17,17,17,.026) 1px, transparent 1px), linear-gradient(90deg, rgba(17,17,17,.026) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;            /* Apple：标题一律 600，而非 700 */
  line-height: 1.1;
  letter-spacing: -0.02em;     /* display 尺寸的负字距 */
  color: var(--text-1);
  margin: 0;
}

p { margin: 0; }
img { max-width: 100%; }
button { font-family: inherit; letter-spacing: inherit; }
input, textarea, select { letter-spacing: inherit; }

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

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::-webkit-scrollbar-track { background: transparent; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;                 /* 硬编码大负值：任何字号下都完全藏在屏幕外 */
  z-index: 600;
  background: var(--text-1);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 0 0 10px 10px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* JS 用 hidden 属性控制显隐，防止组件的 display 规则覆盖它 */
[hidden] { display: none !important; }

/* ---------------- 布局工具 ---------------- */

.container {
  max-width: 980px;            /* DESIGN.md：文字型区域最大宽度 */
  margin-inline: auto;
  padding-inline: clamp(20px, 4.5vw, 32px);
}

.section { padding-block: 56px 0; }

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

.section-title {
  font-size: clamp(28px, 4vw, 34px);   /* display-md */
  line-height: 1.15;
}

.page-head { padding-block: 64px 4px; }
.page-head h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.08; }
.page-head .page-desc {
  margin-top: 12px;
  font-size: 21px;             /* tagline */
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-3);
}

/* ---------------- 按钮体系 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.24;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease-out, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
/* 系统级按压反馈（pointer-down 即生效） */
.btn:active { transform: scale(0.95); }

.btn-primary {
  background: var(--accent);        /* 亮面：墨黑；暗面自动反转为白 */
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); }
html[data-theme="dark"] .btn-primary:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-1);
}
.btn-ghost:hover { border-color: var(--text-3); background: var(--muted-bg); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;           /* configurator-option-chip */
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-1);
  font-size: 14px;             /* caption */
  letter-spacing: -0.016em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.12s ease-out;
}
.chip:hover { border-color: var(--text-3); }
.chip:active { transform: scale(0.95); }
/* 选中态：墨黑描边（暗面为白描边） */
.chip.active {
  border: 2px solid var(--accent);
  padding: 7px 15px;
  color: var(--text-1);
  font-weight: 600;
}
.chip-count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.chip.active .chip-count { color: var(--text-3); }

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--muted-bg);
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: -0.01em;
  transition: color 0.2s ease, background-color 0.2s ease;
}
a.tag-chip:hover, .tag-link:hover { background: var(--accent-soft); color: var(--accent); }
.tag-link { cursor: pointer; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}
.filter-notice a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.empty {
  padding: 72px 0;
  text-align: center;
  color: var(--text-3);
}

/* ---------------- 顶部导航（Jitter 式悬浮圆角条） ---------------- */

html { scroll-padding-top: calc(var(--header-h) + 44px); }

.site-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  width: min(100% - 32px, 1180px);
  max-width: 1180px;
  margin: 18px auto 0;
  transition: width .48s cubic-bezier(.22, 1, .36, 1),
    max-width .48s cubic-bezier(.22, 1, .36, 1),
    margin .48s cubic-bezier(.22, 1, .36, 1);
}
/* 背景条独立成 ::before，滚动收缩时对其 left 做过渡（宽度平滑动画） */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(17, 17, 17, 0.09), 0 2px 8px rgba(17,17,17,.04);
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease, background-color 0.25s ease;
}
html[data-theme="dark"] .site-header::before {
  background: rgba(26, 26, 28, 0.86);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}
.site-header.scrolled::before { box-shadow: 0 14px 44px rgba(17, 17, 17, 0.12); }
html[data-theme="dark"] .site-header.scrolled::before { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6); }
/* 复刻 Jitter：下滚后白条收缩为只包住右侧按钮组的胶囊分区 */
.site-header.nav-compact { margin-left: auto; margin-right: 16px; }
.site-header.nav-compact {
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-left: auto;
  margin-right: 16px;
}
.site-header.nav-compact::before {
  left: 0;
  right: 0;
}

.header-inner { position: relative; z-index: 1; }

/* 滚动动效（复刻 Jitter）：下滚收起左侧 logo 与菜单、只留右侧操作区，上滚自然恢复 */
.header-inner > .brand,
.header-inner > .site-nav {
  transition: opacity .42s cubic-bezier(.22, 1, .36, 1),
    transform .48s cubic-bezier(.22, 1, .36, 1),
    width .48s cubic-bezier(.22, 1, .36, 1),
    margin .48s cubic-bezier(.22, 1, .36, 1);
}
.site-header.nav-compact .brand {
  opacity: 0;
  width: 0;
  margin-right: -16px;
  transform: translateX(-18px) scale(.92);
  pointer-events: none;
  overflow: hidden;
}
.site-header.nav-compact .site-nav {
  opacity: 0;
  width: 0;
  margin-right: -16px;
  transform: translateX(-24px) scale(.96);
  pointer-events: none;
  overflow: hidden;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 58px;
  padding-inline: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-1);
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: url("../assets/icon-128.png") center / cover no-repeat; /* 站点图标（后台可换图） */
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand:hover .brand-mark { transform: rotate(180deg) scale(1.08); }
.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; }
.nav-link {
  position: relative;
  padding: 9px 13px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.25s ease, background-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
/* 导航使用胶囊选中态，不再显示文字下划线 */
.nav-link::after {
  display: none;
}
.nav-link:hover { color: var(--text-1); background: var(--muted-bg); transform: translateY(-1px); box-shadow: none; }
.nav-link.active { color: var(--text-1); font-weight: 700; background: var(--muted-bg); border-color: var(--border-soft); box-shadow: none; }
.nav-chevron { display: inline-block; margin-left: 3px; font-size: 12px; transition: transform .25s ease; }
.nav-home.mega-host .nav-chevron { transform: rotate(-45deg); }

.header-actions { display: flex; align-items: center; gap: 5px; padding: 4px; border-radius: 999px; background: transparent; border: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.12s ease-out;
}
.icon-btn:hover { color: var(--text-1); background: var(--card); box-shadow: 0 5px 15px rgba(17,17,17,.09); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn .icon-close { display: none; }
.icon-btn.open .icon-close { display: block; }
.icon-btn.open .icon-menu { display: none; }

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

.nav-toggle { display: none; }

/* 导航中的黑色 CTA（Jitter 式 Sign up 位） */
.nav-cta { display: inline-flex; align-items: center; gap: 7px; padding: 11px 17px; font-size: 13px; font-weight: 700; border-radius: 999px; background: var(--accent); color: var(--bg); transition: transform .2s ease, box-shadow .2s ease; }
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(17,17,17,.16); color: var(--bg); }
@media (max-width: 767px) {
  .nav-cta { display: none; }
}

/* ---------------- Mega menu（1:1 复刻 jitter.video 产品面板） ---------------- */

.mega {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  right: auto;
  width: min(920px, calc(100vw - 32px));
  transform: translate(-50%, -10px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}
.mega.open { opacity: 1; visibility: visible; transform: translateY(0); }

.mega-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 40px 90px rgba(17, 17, 17, 0.16);
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 22px;
}
html[data-theme="dark"] .mega-inner { box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6); }

.mega-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 138px;
  gap: 14px;
}
.mega-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.mega-card.tall { grid-row: span 2; justify-content: flex-end; }
.mega-card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: 0 20px 42px rgba(17, 17, 17, 0.18); }

.mc-blue { background: linear-gradient(160deg, #38b6ff, #0a84ff); }
.mc-purple { background: linear-gradient(160deg, #a78bfa, #7c3aed); }
.mc-gray { background: var(--muted-bg); color: var(--text-1); border: 1px solid var(--border-soft); }

.mega-icon {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 54px;
  height: 54px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.mc-gray .mega-icon { box-shadow: none; border: 1px solid var(--border); }
.mega-icon img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; }
.mega-card:hover .mega-icon { transform: scale(1.06) rotate(-3deg); }

.mega-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.mega-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  opacity: 0.85;
}
.mega-cta svg { transition: transform 0.2s ease; }
.mega-card:hover .mega-cta svg { transform: translateX(3px); }

/* 打开时的卡片 stagger 入场（1:1 复刻 Jitter 面板动效） */
.mega.open .mega-card {
  animation: megaIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms + 70ms);
}
.mega.open .mega-side > * {
  animation: megaIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms + 200ms);
}
@keyframes megaIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.mega-side { display: flex; flex-direction: column; gap: 4px; }
.mega-side-title { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.mega-recent { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.mega-recent a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-soft);
  transition: color 0.2s ease;
}
.mega-recent li:last-child a { border-bottom: none; }
.mega-recent a:hover { color: var(--text-1); }
.mega-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--muted-bg);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.mega-more:hover { background: var(--accent-soft); transform: translateY(-1px); }
.mega-more svg { transition: transform 0.2s ease; }
.mega-more:hover svg { transform: translateX(3px); }

@media (max-width: 899px) {
  .mega { display: none; }
}

/* marquee 容器（比正文更宽，接近通栏） */
.marquee-wrap { max-width: 1160px; }

/* ---------------- 公告条 ---------------- */

.announce {
  background: var(--accent);      /* 亮面墨黑 / 暗面白 */
  color: var(--bg);
  font-size: 13px;
  text-align: center;
  padding: 9px 16px;
  letter-spacing: -0.005em;
}
.announce a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.announce a:hover { opacity: 0.8; }

/* ---------------- 首页英雄区（居中 + 入场动画） ---------------- */

.hero { background: var(--bg); }
.hero-inner {
  padding-block: clamp(86px, 11vw, 132px) clamp(40px, 5vw, 56px);
  text-align: center;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
.hero-inner > * { animation: rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.hero-inner > .hero-kicker { animation-delay: 0.05s; }
.hero-inner > .hero-title { animation-delay: 0.12s; }
.hero-inner > .hero-desc { animation-delay: 0.22s; }
.hero-inner > .hero-actions { animation-delay: 0.32s; }
.hero-inner > .hero-stats { animation-delay: 0.42s; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}
.hero-kicker .kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-grad);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}

.hero-title {
  max-width: 900px;
  margin: 16px auto 0;
  font-size: clamp(46px, 8vw, 92px);
  font-weight: 700;
  line-height: 1.12;            /* 留足下降部（j/y/g）空间，避免被下一行裁切 */
  letter-spacing: -0.035em;
}
.hero-line { display: block; padding-bottom: 0.04em; }
.hero-title .accent {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title .dot {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 640px;
  margin: 22px auto 0;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}
.hero-actions .btn-primary { padding: 14px 28px; font-size: 16.5px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(32px, 5vw, 60px);
  margin: 56px 0 0;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
}
.stat-label { font-size: 13px; color: var(--text-3); }

/* ---------------- 三列 marquee（标志性动效） ---------------- */

.marquee {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-height: 620px;
  overflow: hidden;
  padding: 8px 0;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;                /* 防止列内容把网格撑出横向滚动 */
  animation: marquee-up var(--marquee-dur, 46s) linear infinite;
}
.marquee-col.reverse { animation-name: marquee-down; }
.marquee:hover .marquee-col,
.marquee:focus-within .marquee-col { animation-play-state: paused; }

@keyframes marquee-up {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-50% - 10px)); }
}
@keyframes marquee-down {
  from { transform: translateY(calc(-50% - 10px)); }
  to { transform: translateY(0); }
}

.marquee .post-card { border-radius: var(--radius-lg); }
.marquee .cover { aspect-ratio: 16 / 10; }

/* 网址收藏胶囊卡（marquee 中列） */
.link-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text-1);
  text-decoration: none;
  min-width: 0;                /* 作为网格项时不被长域名撑大 */
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}
.link-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.1);
  border-color: #d2d2d7;
}
html[data-theme="dark"] .link-pill:hover { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
.link-dot {
  flex: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--lc, var(--brand-grad));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
}
/* 网站真实 favicon：加载成功淡入盖住字母圆点，失败自动回退 */
.link-dot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 5px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.link-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.link-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-host { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-arrow {
  flex: none;
  color: var(--text-3);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}
.link-pill:hover .link-arrow { transform: translate(2px, -2px); color: var(--text-1); }

/* 查看更多按钮行 */
.more-row { display: flex; justify-content: center; margin-top: 26px; }

/* 网址收藏一览（最新文章下方） */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.links-grid .link-pill { padding: 13px 18px; }

/* 逐字动画的字符单元 */
.char { display: inline-block; white-space: pre; will-change: transform, opacity; }

/* ---------------- 页面切换过渡（View Transitions + 入场兜底） ---------------- */

@view-transition { navigation: auto; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
body { animation: pageIn 0.4s ease both; }

@media (max-width: 900px) {
  .marquee { grid-template-columns: repeat(2, 1fr); max-height: 520px; }
}
@media (max-width: 560px) {
  /* 手机沿用平板竖屏的两列滚动墙，卡片 UI 整体缩小（字号不变） */
  .marquee { grid-template-columns: repeat(2, 1fr); gap: 12px; max-height: 440px; }
  .marquee-col { gap: 12px; }
  .marquee .post-card { border-radius: 13px; }
  .marquee .cover { aspect-ratio: 16 / 11; }
  .marquee .card-body { padding: 12px 14px 14px; gap: 5px; }
  .marquee .card-title { font-size: 15.5px; }
  .marquee .card-meta { font-size: 11.5px; gap: 4px 10px; }

  .link-pill { padding: 9px 13px; gap: 10px; }
  .link-dot { width: 32px; height: 32px; font-size: 13px; }
  .link-dot img { padding: 4px; }
  .link-name { font-size: 13.5px; }
  .link-host { font-size: 11px; }
  .link-arrow { width: 13px; height: 13px; }

  /* 网址一览紧凑两列胶囊 */
  .links-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .links-grid .link-pill { padding: 10px 12px; }
}

/* ---------------- 文章卡片（store-utility-card：白底 hairline 18px） ---------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 22px;
}

.post-card,
.featured-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}
.post-card:hover,
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.1);
}
html[data-theme="dark"] .post-card:hover,
html[data-theme="dark"] .featured-card:hover { box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55); }

.card-title-link { color: inherit; }
.card-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card-title-link:hover { color: var(--accent); }

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

.card-cover { aspect-ratio: 16 / 9; border-bottom: 1px solid var(--border-soft); }

.cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cover-from), var(--cover-to));
  background-size: 200% 200%;
  background-position: 0% 0%;
  transition: background-position 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.post-card:hover .cover,
.featured-card:hover .cover { background-position: 100% 100%; }
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.3) 0, transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(0, 0, 0, 0.2) 0, transparent 42%);
}
.cover::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 132px;
  height: 132px;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
}
.cover-letter {
  position: absolute;
  bottom: -0.24em;
  right: 14px;
  font-family: var(--font-display);
  font-size: 104px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.92);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.post-card:hover .cover-letter,
.featured-card:hover .cover-letter { transform: translateY(-9px) rotate(-4deg); }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
  font-size: 13px;
  letter-spacing: -0.008em;
  color: var(--text-3);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
}
.meta-item svg { opacity: 0.8; flex: none; }
.meta-cat { text-decoration: none; }

.card-title {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.018em;
  transition: color 0.2s ease;
}
.post-card:hover .card-title { color: var(--accent); }

.card-excerpt {
  font-size: 14px;
  letter-spacing: -0.008em;
  color: var(--text-3);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* 精选文章（左侧封面 + 右侧内容） */
.featured-card { display: flex; flex-direction: row; margin-bottom: 22px; }
.featured-cover { flex: 1 1 46%; aspect-ratio: auto; min-height: 300px; border-bottom: none; border-right: 1px solid var(--border-soft); }
.featured-card .card-body { flex: 1 1 54%; padding: 32px 36px; justify-content: center; gap: 11px; }
.featured-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}
.featured-title { font-size: clamp(24px, 3vw, 30px); line-height: 1.15; transition: color 0.2s ease; }
.featured-card:hover .featured-title,
.featured-card .card-title-link:hover { color: var(--accent); }
.featured-card .card-excerpt { -webkit-line-clamp: 3; }
.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  color: var(--accent);
}
.featured-cta svg { transition: transform 0.2s ease; }
.featured-card:hover .featured-cta svg { transform: translateX(3px); }

.section-foot { margin-top: 40px; text-align: center; }

/* kicker + 大标题的 section 节奏（Jitter 式） */
.section-kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: -0.005em;
  margin-bottom: 10px;
}
.section-head .section-title,
.standalone-title {
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.section-head .section-sub {
  font-size: 17px;
  color: var(--text-3);
  margin-top: 10px;
}

/* 引用卡（quote card） */
.quote-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--muted-bg);
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
}
.quote-card blockquote {
  margin: 0 auto;
  max-width: 660px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-1);
}
.quote-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.quote-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}
.quote-name { font-size: 14px; font-weight: 600; color: var(--text-1); text-align: left; }
.quote-name small { display: block; font-weight: 400; color: var(--text-3); }
.quote-sticker {
  position: absolute;
  right: clamp(16px, 5vw, 56px);
  top: clamp(16px, 5vw, 48px);
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  transform: rotate(8deg);
  animation: sway 5s ease-in-out infinite;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.18);
}
@keyframes sway {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50% { transform: rotate(10deg) translateY(-8px); }
}

/* 大 CTA 区（Try Jitter today 式） */
.cta-band { text-align: center; padding-block: clamp(64px, 8vw, 96px) 0; }
.cta-band .cta-title {
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.cta-band .cta-desc {
  margin: 18px auto 0;
  max-width: 520px;
  font-size: 17px;
  color: var(--text-3);
}
.cta-band .hero-actions { margin-top: 30px; }

/* ---------------- 文章页 ---------------- */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  height: 3px;
  width: 0;
  background: var(--accent);
  transition: width 0.08s linear;
}

.post-container { max-width: 1040px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 32px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span[aria-hidden] { color: var(--border); }
.breadcrumb .crumb-current {
  overflow: hidden;
  max-width: 320px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-header { padding: 28px 0 0; }
.post-title {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.022em;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-3);
}

/* 封面：全宽 21:9 矩形 + 系统唯一的产品阴影 */
.post-cover { aspect-ratio: 21 / 9; border-radius: 0; margin-top: 28px; box-shadow: var(--product-shadow); }
.post-cover .cover-letter { font-size: 150px; }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 40px;
}

/* 目录（桌面侧栏） */
.toc {
  display: none;
  position: sticky;
  top: calc(var(--header-h) + 36px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow-y: auto;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}
.toc-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.toc-link {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -19px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-link:hover { color: var(--text-1); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); }
.toc-sub { padding-left: 26px; margin-left: -19px; }

@media (min-width: 1200px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 216px; gap: 56px; }
  .toc { display: block; }
  .toc-collapse { display: none; }
}

/* 目录（窄屏折叠面板） */
.toc-collapse {
  margin: 0 0 28px;
  padding: 4px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.toc-collapse summary {
  padding: 10px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toc-collapse summary::-webkit-details-marker { display: none; }
.toc-collapse summary::after { content: "+"; font-size: 18px; color: var(--text-3); }
.toc-collapse[open] summary::after { content: "−"; }
.toc-collapse .toc-link { border-left: none; margin-left: 0; padding-left: 0; }
.toc-collapse .toc-sub { padding-left: 18px; }
.toc-collapse .toc-link.active { color: var(--accent); }

/* 正文排版（SF Pro Text 17px） */
.prose {
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  color: var(--text-2);
  min-width: 0;
}
.prose > p { margin: 0 0 1.25em; }

.prose h2 {
  margin: 2.2em 0 0.8em;
  font-size: 30px;
  line-height: 1.12;
  scroll-margin-top: calc(var(--header-h) + 28px);
}
.prose h3 {
  margin: 1.9em 0 0.6em;
  font-size: 21px;
  line-height: 1.2;
  scroll-margin-top: calc(var(--header-h) + 28px);
}
.prose h2:first-child { margin-top: 0; }

.prose strong { color: var(--text-1); font-weight: 600; }
.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 102, 204, 0.35);
  text-underline-offset: 3px;
}
html[data-theme="dark"] .prose a { text-decoration-color: rgba(41, 151, 255, 0.4); }
.prose a:hover { text-decoration-color: currentColor; }

.prose blockquote {
  margin: 1.5em 0;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  background: var(--muted-bg);   /* 用表面色差代替装饰 */
  color: var(--text-1);
  font-size: 18px;
  line-height: 1.55;
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 0.6em; }

.prose ul, .prose ol { margin: 0 0 1.25em; padding-left: 1.5em; }
.prose li { margin: 0.4em 0; }
.prose li::marker { color: var(--accent); }

.prose img {
  display: block;
  margin: 1.6em auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--product-shadow);
}

.prose hr {
  margin: 2.6em 0;
  border: none;
  height: 1px;
  background: var(--border);
}

.prose .table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}
.prose th {
  padding: 11px 16px;
  background: var(--muted-bg);
  color: var(--text-1);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.prose td { padding: 11px 16px; border-top: 1px solid var(--border); }

.prose .code-inline,
.code-inline {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--muted-bg);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.82em;
  letter-spacing: 0;
}

/* 代码块（近黑 tile，恒深色） */
.code-block {
  margin: 1.7em 0;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #86868b;
}
.code-copy {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #a1a1a6;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.12s ease-out;
}
.code-copy:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.code-copy:active { transform: scale(0.95); }
.code-block pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-ink);
  background: transparent;
  padding: 0;
}

/* 高亮令牌 */
.tok-comment { color: #86868b; font-style: italic; }
.tok-string { color: #8ed07f; }
.tok-keyword { color: #c792ea; }
.tok-literal { color: #79c0ff; }
.tok-number { color: #f0a860; }
.tok-fn { color: #6fb3f2; }
.tok-property { color: #6fb3f2; }
.tok-tag { color: #ff7b72; }
.tok-attr { color: #fac346; }
.tok-punct { color: #98a0ad; }

/* 文章页脚 */
.post-footer { margin-top: 56px; }
.post-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.post-tags-row .card-tags { gap: 8px; }
.copy-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.12s ease-out;
}
.copy-link:hover { border-color: var(--text-3); color: var(--text-1); }
.copy-link:active { transform: scale(0.95); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: inherit;
  transition: border-color 0.2s ease;
}
.post-nav-link:hover { border-color: #d2d2d7; }
.post-nav-link:hover .post-nav-title { color: var(--accent); }
.post-nav-link.next { text-align: right; align-items: flex-end; }
.post-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text-3);
}
.post-nav-title { font-weight: 600; font-size: 15px; line-height: 1.4; transition: color 0.2s ease; }
.post-nav-placeholder { min-height: 1px; }

.related-section { margin-top: 56px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

/* ---------------- 评论 ---------------- */

.comments { margin-top: 56px; }
.comments-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  margin-bottom: 6px;
}
.comments-count {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}
.comments-note { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }

.comment-list { list-style: none; margin: 0; padding: 0; }
.comment {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.comment-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 15px;
  background: hsl(var(--hue, 210) 24% 92%);
  color: hsl(var(--hue, 210) 40% 36%);
}
html[data-theme="dark"] .comment-avatar {
  background: hsl(var(--hue, 210) 18% 26%);
  color: hsl(var(--hue, 210) 70% 74%);
}
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; }
.comment-name { font-weight: 600; font-size: 15px; }
.comment-time { font-size: 12px; color: var(--text-3); }
.comment-text { margin-top: 4px; font-size: 15px; line-height: 1.6; color: var(--text-2); overflow-wrap: break-word; }
.comment-del {
  flex: none;
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.comment:hover .comment-del { opacity: 1; }
.comment-del:hover { color: #e30000; }
.comments-empty { padding: 24px 0; color: var(--text-3); font-size: 14px; }

.comment-form { margin-top: 20px; display: grid; gap: 12px; }
.comment-form .form-row { display: grid; gap: 12px; grid-template-columns: minmax(0, 240px) 1fr; }
.comment-form input,
.comment-form textarea {
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text-1);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.comment-form textarea { resize: vertical; min-height: 88px; }
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-form .btn { justify-self: start; }

/* ---------------- 归档页 ---------------- */

.archive-year { margin-top: 48px; }
.year-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 30px;
}
.year-count { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }

.timeline {
  list-style: none;
  margin: 24px 0 0;
  padding: 0 0 0 30px;
  border-left: 1px solid var(--border);
}
.timeline-item { position: relative; padding: 0 0 30px 26px; }
.timeline-item:last-child { padding-bottom: 6px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.timeline-item:hover::before { background: var(--accent); transform: scale(1.2); }

.timeline-date {
  display: inline-block;
  min-width: 88px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text-3);
}
.timeline-body { display: inline; }
.timeline-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-1);
}
.timeline-title:hover { color: var(--accent); }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------------- 标签页 ---------------- */

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.category-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: inherit;
  transition: border-color 0.2s ease;
}
.category-card:hover { border-color: #d2d2d7; }
.category-name { display: block; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; transition: color 0.2s ease; }
.category-card:hover .category-name { color: var(--accent); }
.category-count { display: block; margin-top: 4px; font-size: 13px; color: var(--text-3); }
.category-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--w, 50%);
  background: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 22px;
  padding: 12px 0;
}
.cloud-tag {
  color: var(--text-2);
  font-weight: 400;
  line-height: 1.4;
  transition: color 0.2s ease;
}
.cloud-tag sup {
  margin-left: 3px;
  font-size: 11px;
  color: var(--text-3);
}
.cloud-tag:hover { color: var(--accent); }

/* ---------------- 关于页 ---------------- */

.about-profile {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}
.about-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--muted-bg);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.about-name { font-size: 28px; }
.about-bio { margin-top: 6px; color: var(--text-2); font-size: 17px; }
.about-stats-inline { margin-top: 8px; font-size: 13px; color: var(--text-3); }

.about-section { margin-top: 52px; }
.about-section > h2 { font-size: 26px; margin-bottom: 18px; }

.about-text p { margin-bottom: 1em; color: var(--text-2); line-height: 1.65; }

.milestones {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
}
.milestones li {
  position: relative;
  padding: 0 0 22px 26px;
  border-left: 1px solid var(--border);
}
.milestones li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.milestone-year { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; color: var(--text-3); }
.milestone-text { display: block; margin-top: 2px; color: var(--text-2); font-size: 15px; }

.skill-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chips .tag-chip { font-size: 13px; padding: 6px 14px; }

.contact-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.12s ease-out;
}
.contact-card:hover { border-color: var(--accent); color: var(--accent); }
.contact-card:active { transform: scale(0.95); }

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-item { border-bottom: 1px solid var(--border); }
.recent-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 14px 0;
  color: inherit;
}
.recent-title { font-weight: 600; font-size: 16px; }
.recent-item a:hover .recent-title { color: var(--accent); }
.recent-meta { font-size: 13px; color: var(--text-3); }

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

.notfound { text-align: center; padding-block: 96px 64px; }
.notfound-code {
  font-family: var(--font-display);
  font-size: clamp(72px, 14vw, 120px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-1);
}
.notfound h1 { font-size: 26px; margin-top: 12px; }
.notfound p { margin: 12px auto 28px; color: var(--text-3); max-width: 420px; }

/* ---------------- 搜索弹层 ---------------- */

.search-overlay { position: fixed; inset: 0; z-index: 300; display: none; }
.search-overlay.open { display: block; }
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease;
}
.search-panel {
  position: relative;
  max-width: 640px;
  margin: 13vh auto 0;
  width: calc(100% - 40px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: panelIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } }

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
}
.search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-1);
  font-family: inherit;
  font-size: 17px;
  letter-spacing: -0.011em;
}
.search-input-row input::placeholder { color: var(--text-3); }
.search-input-row kbd {
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.search-results { max-height: 46vh; overflow-y: auto; padding: 8px; }
.search-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: inherit;
}
.search-item.active, .search-item:hover { background: var(--muted-bg); }
.search-item-title { display: block; font-weight: 600; font-size: 15px; }
.search-item-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.search-item-snippet {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}
.search-item mark { background: transparent; color: var(--accent); font-weight: 600; }
.search-empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 14px; }
.search-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ---------------- 回到顶部 / Toast ---------------- */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;                 /* button-icon-circular：44px 圆形 */
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--text-1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
}
html[data-theme="dark"] .back-to-top { background: rgba(42, 42, 44, 0.72); }
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }
.back-to-top:active { transform: scale(0.92); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 400;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  background: rgba(29, 29, 31, 0.92);   /* dark-utility 按钮 */
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 页脚（Jitter 式大 footer：品牌 + 订阅 + 多列） ---------------- */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.8fr 0.9fr;
  gap: 40px;
  padding: 56px 0 40px;
}
.footer-brand .brand { color: var(--text-1); }
.footer-tagline { margin-top: 12px; font-size: 14px; color: var(--text-3); max-width: 300px; }

.footer-news-note { margin-top: 10px; font-size: 12px; color: var(--text-3); }
.footer-news-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-news-note a:hover { color: var(--text-1); }

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 12px;
  color: var(--text-1);
}
.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-3);
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--text-1); }
.footer-social { display: flex; align-items: center; gap: 8px; }
.footer-social .icon-btn {
  position: relative;          /* 图标绝对定位强制居中，不受基线影响 */
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  color: var(--text-2);
  background: var(--card);
  flex: none;
}
.footer-social .icon-btn svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
.footer-social .icon-btn:hover { border-color: var(--text-1); color: var(--text-1); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.footer-bottom a { color: inherit; }
.footer-bottom a:hover { color: var(--text-1); text-decoration: underline; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------------- 入场动画 ---------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 20px 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(17, 17, 17, 0.12);
  }
  html[data-theme="dark"] .site-nav { background: rgba(26, 26, 28, 0.98); }
  .site-nav.open { display: flex; }
  .nav-link { padding: 11px 14px; border-radius: 10px; font-size: 15px; }

  .hero-stats { gap: 28px; }
  .featured-card { flex-direction: column; }
  .featured-cover { aspect-ratio: 16 / 9; min-height: 0; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .featured-card .card-body { padding: 24px; }

  .post-nav { grid-template-columns: 1fr; }
  .comment-form .form-row { grid-template-columns: 1fr; }
  .about-profile { flex-direction: column; align-items: flex-start; }
  .breadcrumb .crumb-current { max-width: 160px; }
  .post-cover { aspect-ratio: 16 / 9; }
  .post-cover .cover-letter { font-size: 96px; }
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .post-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1; }
  .subscribe-card { padding: 28px 24px; }
}

/* ---------------- 无障碍 ---------------- */

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

/* 透明度减弱：毛玻璃变实底 */
@media (prefers-reduced-transparency: reduce) {
  .site-header, .site-nav.open { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .back-to-top { background: var(--muted-bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .search-backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
  #toast { backdrop-filter: none; }
  .marquee-col { animation: none; }
  .marquee { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
