/* ==========================================================================
   HHX — Java & AI Notes
   视觉语言参考 apple.com：系统字体、大留白、极细分割线、克制的动效
   ========================================================================== */

:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, 0.12);
  --line-soft: rgba(0, 0, 0, 0.07);
  --paper: #ffffff;
  --paper-2: #f5f5f7;
  --night: #000000;
  --night-ink: #f5f5f7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --shadow-hover: 0 22px 50px rgba(0, 0, 0, 0.08);
  --code-bg: rgba(0, 0, 0, 0.055);
  --pre-bg: #15151a;
  --pre-border: transparent;
  --next-hover-bg: #eeeef1;
  --tile-java: linear-gradient(158deg, #e7effc 0%, #f4f8fe 58%, #ffffff 100%);
  --tile-ai: linear-gradient(158deg, #eee8fd 0%, #f6f2fe 58%, #ffffff 100%);
  --tile-fe: linear-gradient(158deg, #fde8ef 0%, #fdf4f7 58%, #ffffff 100%);
  --cal-dot: #0071e3;
  --cal-cell: #f5f5f7;
  --overlay: rgba(0, 0, 0, 0.32);
  --headline-grad: linear-gradient(96deg, #0071e3 0%, #4b6bfb 55%, #6e5bd8 100%);
  --nav-h: 48px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* 暗色令牌：手动切换与系统偏好共用同一套值 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #8a8a8f;
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --paper: #000000;
  --paper-2: #161617;
  --nav-bg: rgba(0, 0, 0, 0.72);
  --shadow-hover: 0 22px 50px rgba(0, 0, 0, 0.6);
  --code-bg: rgba(255, 255, 255, 0.1);
  --pre-bg: #101012;
  --pre-border: rgba(255, 255, 255, 0.08);
  --next-hover-bg: #1c1c1f;
  --tile-java: linear-gradient(158deg, #1c1c1f 0%, #121214 100%);
  --tile-ai: linear-gradient(158deg, #1c1c1f 0%, #121214 100%);
  --tile-fe: linear-gradient(158deg, #1c1c1f 0%, #121214 100%);
  --cal-dot: #0a84ff;
  --cal-cell: #161617;
  --overlay: rgba(0, 0, 0, 0.62);
  --headline-grad: linear-gradient(96deg, #3d9bff 0%, #7a8dff 55%, #a58bff 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #8a8a8f;
    --line: rgba(255, 255, 255, 0.16);
    --line-soft: rgba(255, 255, 255, 0.09);
    --paper: #000000;
    --paper-2: #161617;
    --nav-bg: rgba(0, 0, 0, 0.72);
    --shadow-hover: 0 22px 50px rgba(0, 0, 0, 0.6);
    --code-bg: rgba(255, 255, 255, 0.1);
    --pre-bg: #101012;
    --pre-border: rgba(255, 255, 255, 0.08);
    --next-hover-bg: #1c1c1f;
    --tile-java: linear-gradient(158deg, #1c1c1f 0%, #121214 100%);
    --tile-ai: linear-gradient(158deg, #1c1c1f 0%, #121214 100%);
    --tile-fe: linear-gradient(158deg, #1c1c1f 0%, #121214 100%);
    --cal-dot: #0a84ff;
    --cal-cell: #161617;
    --overlay: rgba(0, 0, 0, 0.62);
    --headline-grad: linear-gradient(96deg, #3d9bff 0%, #7a8dff 55%, #a58bff 100%);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease);
}

a:hover {
  text-decoration: none;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

/* ---------- 导航 ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}

.nav-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
}

.nav-links a {
  font-size: 12px;
  color: var(--ink);
  opacity: 0.82;
  letter-spacing: 0;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a.is-active {
  opacity: 1;
  font-weight: 500;
}

.nav-cta {
  font-size: 12px;
  color: #fff;
  background: var(--blue);
  padding: 6px 14px;
  border-radius: 980px;
  opacity: 1 !important;
}

.nav-cta:hover {
  background: var(--blue-hover);
}

/* ---------- 首屏 ---------- */

.hero {
  padding: calc(var(--nav-h) + 92px) 24px 84px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -180px;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(
    closest-side,
    rgba(0, 113, 227, 0.09),
    rgba(0, 113, 227, 0)
  );
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0;
  margin: 0 0 18px;
}

.hero h1 {
  margin: 0 auto 26px;
  font-size: clamp(42px, 7.4vw, 92px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 15em;
}

.grad {
  background: var(--headline-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: 0 auto;
  max-width: 620px;
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: 0;
}

.cta-row {
  margin-top: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  padding: 12px 26px;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
}

.link-arrow {
  font-size: 17px;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-arrow span {
  transition: transform 0.3s var(--ease);
  display: inline-block;
}

.link-arrow:hover span {
  transform: translateX(3px);
}

/* ---------- 通用区块 ---------- */

.section {
  padding: 100px 24px;
}

.section--tight {
  padding: 60px 24px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.028em;
  font-weight: 700;
}

.section-head p {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 17px;
}

.section-head .link-arrow {
  font-size: 15px;
  white-space: nowrap;
  padding-bottom: 6px;
}

/* ---------- 精选大卡 ---------- */

.feature {
  max-width: var(--maxw);
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  background: #0b0b0f;
  color: #fff;
  isolation: isolate;
}

.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      120% 90% at 78% 8%,
      rgba(10, 132, 255, 0.55),
      transparent 60%
    ),
    radial-gradient(90% 80% at 12% 92%, rgba(255, 59, 127, 0.34), transparent 62%),
    linear-gradient(160deg, #141420 0%, #05050a 72%);
  z-index: -2;
}

.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
      rgba(255, 255, 255, 0.55) 1px,
      transparent 1px
    );
  background-size: 34px 34px;
  opacity: 0.09;
  mask-image: linear-gradient(to top, #000 10%, transparent 62%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 62%);
  z-index: -1;
}

.feature-body {
  padding: 56px 56px 60px;
  max-width: 660px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 18px;
}

.feature h3 {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.026em;
  font-weight: 700;
}

.feature p {
  margin: 0 0 28px;
  font-size: 19px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.feature .btn {
  background: #fff;
  color: #0b0b0f;
}

.feature .btn:hover {
  background: #ededf2;
}

/* 精选卡右侧的检索示意 */
.feature-art {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  width: 296px;
  z-index: 1;
  pointer-events: none;
}

.fa-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  padding: 20px 22px;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
  animation: floaty 8s ease-in-out infinite;
}

.fa-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 18px;
}

.fa-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a84ff;
  box-shadow: 0 0 12px #0a84ff;
}

.fa-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}

.fa-row:last-child {
  margin-bottom: 0;
}

.fa-score {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.46);
  width: 28px;
  flex: none;
}

.fa-bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.fa-bar i {
  display: block;
  height: 100%;
  width: var(--w, 60%);
  border-radius: 99px;
  background: linear-gradient(90deg, #0a84ff, #6e5be6);
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

/* ---------- 专题磁贴 ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.tile {
  position: relative;
  border-radius: 22px;
  padding: 36px 32px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--paper-2);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.tile-num {
  position: absolute;
  top: 28px;
  left: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.tile h3 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.tile p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  min-height: 3em;
}

.tile .count {
  font-size: 13px;
  color: var(--ink-3);
}

.tile--java {
  background: var(--tile-java);
}

.tile--ai {
  background: var(--tile-ai);
}

.tile--fe {
  background: var(--tile-fe);
}

/* ---------- 文章列表 ---------- */

.posts {
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid var(--line-soft);
}

.post-row {
  display: grid;
  grid-template-columns: 132px 1fr 92px;
  gap: 32px;
  align-items: baseline;
  padding: 30px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  transition: background 0.35s var(--ease);
}

.post-row:hover {
  background: var(--paper-2);
}

.post-date {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.post-title {
  font-size: 22px;
  line-height: 1.32;
  letter-spacing: -0.018em;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.post-title .dot {
  flex: none;
  transform: translateY(-3px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.post-row:hover .post-title {
  color: var(--blue);
}

.post-row:hover .dot {
  opacity: 1;
}

.post-excerpt {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-top: 8px;
  max-width: 620px;
}

.post-cat {
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}

/* ---------- 引文 ---------- */

.quote {
  background: var(--night);
  color: var(--night-ink);
  padding: 140px 24px;
  text-align: center;
}

.quote blockquote {
  margin: 0 auto;
  max-width: 900px;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.24;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.quote cite {
  display: block;
  margin-top: 28px;
  font-size: 15px;
  font-style: normal;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0;
}

/* ---------- 订阅 ---------- */

.subscribe {
  text-align: center;
}

.subscribe h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.2vw, 50px);
  letter-spacing: -0.028em;
  line-height: 1.08;
}

.subscribe p {
  margin: 0 auto 34px;
  max-width: 520px;
  color: var(--ink-2);
  font-size: 19px;
}

.mail-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.mail-form input {
  flex: 1 1 240px;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 13px 18px;
  border-radius: 980px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.mail-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.mail-form button {
  font: inherit;
  font-size: 15px;
  padding: 13px 24px;
  border: 0;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s var(--ease);
}

.mail-form button:hover {
  background: var(--blue-hover);
}

.form-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- 页脚 ---------- */

.footer {
  background: var(--paper-2);
  padding: 64px 24px 40px;
  font-size: 12px;
  color: var(--ink-2);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 9px;
}

.footer-col a {
  color: var(--ink-2);
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-3);
}

.footer-bottom a {
  color: var(--ink-3);
}

/* ---------- 滚动揭示 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 文章页 ---------- */

.article-hero {
  padding: calc(var(--nav-h) + 88px) 24px 56px;
  text-align: center;
}

.article-hero .cat {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-hero h1 {
  margin: 16px auto 22px;
  max-width: 800px;
  font-size: clamp(31px, 4.6vw, 54px);
  line-height: 1.14;
  letter-spacing: -0.028em;
  font-weight: 700;
}

.article-meta {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.article-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  opacity: 0.6;
}

.progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 2px;
  width: 0;
  background: var(--blue);
  z-index: 101;
  transition: width 0.1s linear;
}

.prose {
  max-width: 692px;
  margin: 0 auto;
  padding: 0 24px 40px;
  font-size: 19px;
  line-height: 1.72;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.prose > p:first-of-type {
  font-size: 21px;
  line-height: 1.6;
  color: var(--ink-2);
}

.prose h2 {
  margin: 56px 0 18px;
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: -0.024em;
  font-weight: 700;
}

.prose h3 {
  margin: 40px 0 12px;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.018em;
  font-weight: 600;
}

.prose p {
  margin: 0 0 24px;
}

.prose ul,
.prose ol {
  margin: 0 0 24px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 9px;
}

.prose a {
  border-bottom: 1px solid rgba(0, 113, 227, 0.32);
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0;
}

.prose pre {
  background: var(--pre-bg);
  border: 1px solid var(--pre-border);
  color: #f2f2f7;
  border-radius: 18px;
  padding: 24px 26px;
  overflow-x: auto;
  margin: 0 0 30px;
  font-size: 13.5px;
  line-height: 1.75;
  letter-spacing: 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.prose blockquote {
  margin: 0 0 28px;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--blue);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1.6;
}

.prose img {
  border-radius: 16px;
  margin: 0 0 30px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 44px 0;
}

.article-foot {
  max-width: 692px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-2);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 980px;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
}

.next-post {
  display: block;
  max-width: 692px;
  margin: 0 auto 96px;
  padding: 32px;
  border-radius: 20px;
  background: var(--paper-2);
  color: var(--ink);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}

.next-post:hover {
  transform: translateY(-2px);
  background: var(--next-hover-bg);
}

.next-post span {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.next-post h4 {
  margin: 10px 0 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* ---------- 关于页 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  max-width: var(--maxw);
  margin: 0 auto;
  align-items: start;
}

.about-grid p {
  font-size: 19px;
  line-height: 1.68;
  color: var(--ink-2);
  margin: 0 0 22px;
}

.about-grid strong {
  color: var(--ink);
  font-weight: 600;
}

.stack-card {
  border-radius: 22px;
  background: var(--paper-2);
  padding: 32px;
}

.stack-card h3 {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 600;
}

.stack-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.stack-item:last-child {
  border-bottom: 0;
}

.stack-item span:last-child {
  color: var(--ink-3);
}

/* ---------- 响应式 ---------- */

@media (max-width: 1000px) {
  .tiles {
    grid-template-columns: 1fr;
  }

  .tile {
    min-height: 240px;
  }

  .feature-art {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 860px) {
  .nav-links {
    gap: 18px;
  }

  .nav-links a:not(.nav-cta):nth-child(2) {
    display: none;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 64px);
    padding-bottom: 72px;
  }

  .section,
  .section--tight {
    padding: 76px 20px;
  }

  .feature-body {
    padding: 36px 28px 40px;
  }

  .feature {
    min-height: 420px;
    border-radius: 20px;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 4px;
  }

  .post-cat {
    text-align: left;
    order: -1;
  }

  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .prose {
    font-size: 18px;
  }

  .prose > p:first-of-type {
    font-size: 19px;
  }

  .quote {
    padding: 88px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   实用功能：主题切换 / 搜索面板 / 写作日历 / 目录 / 代码复制 / 回到顶部
   ========================================================================== */

/* ---------- 导航图标按钮 ---------- */

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.25s var(--ease), background 0.25s var(--ease);
}

.icon-btn:hover {
  opacity: 1;
  background: rgba(127, 127, 127, 0.14);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

.icon-btn .i-moon {
  display: none;
}

:root[data-theme="dark"] .icon-btn .i-sun {
  display: none;
}

:root[data-theme="dark"] .icon-btn .i-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun {
    display: none;
  }

  :root:not([data-theme="light"]) .icon-btn .i-moon {
    display: block;
  }
}

/* ---------- 首屏状态条 ---------- */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 46px auto 0;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0;
}

.statusbar b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.statusbar i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

/* ---------- 写作日历 ---------- */

.cal-wrap {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 32px;
  align-items: start;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}

.cal-nav button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.25s var(--ease);
}

.cal-nav button:hover {
  background: var(--paper-2);
}

.cal-label {
  min-width: 7.6em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  letter-spacing: 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day {
  position: relative;
  height: 62px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  cursor: default;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
    transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.cal-day.is-out {
  opacity: 0.26;
}

.cal-day.is-today {
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
}

.cal-day.has-post {
  background: var(--cal-cell);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}

.cal-day.has-post:hover {
  border-color: var(--line);
  transform: translateY(-1px);
}

.cal-day.has-post::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--cal-dot);
}

.cal-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 18px;
  background: var(--paper-2);
}

.cal-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.cal-stat:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.cal-stat b {
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.cal-stat span {
  font-size: 12px;
  color: var(--ink-3);
}

.cal-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ---------- 搜索面板 ---------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 20px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.search-panel {
  width: 100%;
  max-width: 600px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transform: translateY(-10px) scale(0.99);
  transition: transform 0.28s var(--ease);
}

.search-overlay.is-open .search-panel {
  transform: none;
}

.search-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.search-top svg {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  flex: none;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.search-input::placeholder {
  color: var(--ink-3);
}

.search-results {
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
}

.search-item {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
}

.search-item.is-active {
  background: var(--paper-2);
}

.search-item-title {
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.search-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0;
}

.search-item mark {
  background: rgba(0, 113, 227, 0.18);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.search-empty {
  padding: 30px 14px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}

.search-foot {
  display: flex;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0;
}

.search-foot kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--ink-2);
}

body.no-scroll {
  overflow: hidden;
}

/* ---------- 文章目录 ---------- */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 692px) 190px;
  gap: 60px;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

.article-layout .prose {
  max-width: none;
  padding: 0 0 40px;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  align-self: start;
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0;
}

.toc-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--line-soft);
  color: var(--ink-3);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.toc a:hover {
  color: var(--ink);
}

.toc a.is-active {
  color: var(--blue);
  border-left-color: var(--blue);
}

.toc a.lvl-3 {
  padding-left: 24px;
  font-size: 12px;
}

/* ---------- 代码复制 ---------- */

.prose pre {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.prose pre:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn.is-done {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.45);
  opacity: 1;
}

/* ---------- 回到顶部 ---------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.to-top.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: minmax(0, 692px);
    gap: 0;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 1000px) {
  .cal-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cal-side {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px;
    padding: 18px 20px;
  }

  .cal-stat {
    flex: 1 1 120px;
    border-bottom: 0;
    padding-bottom: 0;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 2px;
  }

  .cal-hint {
    flex-basis: 100%;
  }
}

@media (max-width: 600px) {
  .cal-day {
    height: 46px;
    font-size: 12px;
    border-radius: 10px;
  }

  .cal-day.has-post::after {
    bottom: 6px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
  }

  .statusbar {
    gap: 10px;
    font-size: 11px;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* ==========================================================================
   订阅页
   ========================================================================== */

.sub-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 44px 40px;
  border-radius: 22px;
  border: 1px solid var(--line-soft);
  background: var(--paper-2);
}

.sub-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -0.022em;
  font-weight: 600;
}

.sub-desc {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

.feed-url {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.feed-url code {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.feed-url code::-webkit-scrollbar {
  display: none;
}

.feed-copy {
  flex: none;
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.feed-copy:hover {
  background: var(--paper-2);
}

.feed-copy.is-done {
  color: #1d9b52;
  border-color: rgba(29, 155, 82, 0.45);
}

.sub-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.sub-actions .btn {
  font-size: 15px;
  padding: 10px 20px;
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--paper);
  color: var(--blue);
}

.sub-actions .link-arrow {
  font-size: 14px;
}

.sub-note {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.sub-note h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sub-note h3 + p,
.sub-note p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}

.sub-note ul {
  margin: 0 0 20px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

.sub-note li {
  margin-bottom: 4px;
}

.sub-note strong {
  color: var(--ink);
  font-weight: 600;
}

.sub-note code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
}

.sub-note pre {
  margin: 0;
  background: var(--pre-bg);
  border: 1px solid var(--pre-border);
  color: #f2f2f7;
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
}

.sub-note pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .sub-card {
    padding: 28px 20px 26px;
    border-radius: 18px;
  }

  .sub-card h2 {
    font-size: 22px;
  }

  .sub-actions {
    gap: 10px;
  }

  .sub-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
