/* ==========================================================================
   HHX — Java & AI Notes
   视觉语言参考 apple.com：系统字体、大留白、极细分割线、克制的动效
   ========================================================================== */

:root {
  --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-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;
}

* {
  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: rgba(255, 255, 255, 0.72);
  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: linear-gradient(96deg, #0071e3 0%, #4b6bfb 55%, #6e5bd8 100%);
  -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: 0 22px 50px rgba(0, 0, 0, 0.08);
}

.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: linear-gradient(158deg, #e7effc 0%, #f4f8fe 58%, #ffffff 100%);
}

.tile--ai {
  background: linear-gradient(158deg, #eee8fd 0%, #f6f2fe 58%, #ffffff 100%);
}

.tile--fe {
  background: linear-gradient(158deg, #fde8ef 0%, #fdf4f7 58%, #ffffff 100%);
}

/* ---------- 文章列表 ---------- */

.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: rgba(0, 0, 0, 0.055);
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0;
}

.prose pre {
  background: #15151a;
  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: #eeeef1;
}

.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;
  }
}

/* ---------- 暗色模式 ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #86868b;
    --line: rgba(255, 255, 255, 0.16);
    --line-soft: rgba(255, 255, 255, 0.09);
    --paper: #000000;
    --paper-2: #161617;
  }

  .nav {
    background: rgba(0, 0, 0, 0.72);
  }

  .tile--java,
  .tile--ai,
  .tile--fe {
    background: linear-gradient(160deg, #1c1c1f 0%, #121214 100%);
  }

  .tile:hover {
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6);
  }

  .next-post:hover {
    background: #1c1c1f;
  }

  .prose code {
    background: rgba(255, 255, 255, 0.1);
  }

  .prose pre {
    background: #101012;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .feature .btn {
    background: #fff;
    color: #0b0b0f;
  }
}
