/* 芽起一名个人小站 · 版式与动效 */

:root {
  --paper:    #f6f7ef;
  --card:     #fbfcf6;
  --card-2:   #f2f4ea;
  --ink:      #222c25;
  --ink-2:    #4d5b50;
  --muted:    #8b9a8d;
  --faint:    #a9b5ab;
  --line:     #e3e7da;
  --line-2:   #d3dac9;
  --leaf:     #8fbd3b;
  --leaf-deep:#4f7d2b;
  --star:     #f7c34a;

  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Times New Roman", Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { 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(--sans);
  font-size: 15.5px;
  line-height: 1.9;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 页面顶部一层极淡的暖光，让纸感不那么平 */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 620px;
  background: radial-gradient(120% 80% at 50% -10%, #fffef7 0%, rgba(255, 254, 247, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

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

::selection { background: rgba(143, 189, 59, .28); }

/* ── 顶部导航 ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(20px, 5vw, 48px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease), backdrop-filter .4s var(--ease);
}

.nav.is-stuck {
  background: rgba(246, 247, 239, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--line);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .14em;
  color: var(--ink);
  white-space: nowrap;
}

.nav__brand .logo { --logo-size: 22px; }

.nav__links {
  margin-left: auto;
  display: flex;
  gap: clamp(14px, 2.6vw, 30px);
  font-size: 13px;
  color: var(--muted);
}

.nav__links a {
  position: relative;
  padding: 4px 0;
  transition: color .3s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--leaf-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--leaf-deep); }
.nav__links a.is-active::after,
.nav__links a:hover::after { transform: scaleX(1); }

@media (max-width: 760px) { .nav__links { display: none; } }

/* ── 通用容器 ─────────────────────────────────────── */
.wrap {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px);
  position: relative;
  z-index: 1;
}

.kicker {
  font: 11px/1 Georgia, var(--serif);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── 首屏 ─────────────────────────────────────────── */
.hero {
  min-height: min(94vh, 860px);
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 120px clamp(20px, 5vw, 32px) 90px;
  position: relative;
  z-index: 1;
}

.hero__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 216px;
  height: 216px;
}

.hero__glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 400px; height: 400px;
  margin: -200px 0 0 -200px;   /* 居中交给 margin，transform 留给动画 */
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 189, 59, .18) 0%, rgba(247, 195, 74, .12) 42%, rgba(247, 195, 74, 0) 68%);
  filter: blur(4px);
  opacity: 0;
  animation: glow-in 1.6s var(--ease) .1s forwards, glow-breathe 7s ease-in-out 1.7s infinite;
}

@keyframes glow-in   { to { opacity: 1; } }
@keyframes glow-breathe {
  0%, 100% { transform: scale(.94); opacity: .82; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.hero__mark .logo {
  --logo-size: 168px;
  position: relative;
}

.hero__title {
  margin: 26px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 8.4vw, 58px);
  letter-spacing: .2em;
  text-indent: .2em;      /* 抵消末字右侧的字距，保证视觉居中 */
  color: #2f4536;
  line-height: 1.2;
}

.hero__title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: letter-in .95s var(--ease) forwards;
}

/* 首屏文字的时间轴，接在 LOGO 三段式生长（约 0.2→2.0s）之后：
 * 芽瓣 → 短竖线 → 星芒 → 字 → 句，一口气排下来，不留空档。 */
.hero__title span:nth-child(1) { animation-delay: 1.35s; }
.hero__title span:nth-child(2) { animation-delay: 1.45s; }
.hero__title span:nth-child(3) { animation-delay: 1.55s; }
.hero__title span:nth-child(4) { animation-delay: 1.65s; }

@keyframes letter-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero__rule {
  width: 0;
  height: 1px;
  margin: 22px 0 20px;
  background: linear-gradient(90deg, transparent, var(--line-2) 30%, var(--line-2) 70%, transparent);
  animation: rule-in 1.1s var(--ease) 1.78s forwards;
}

@keyframes rule-in { to { width: 168px; } }

.hero__tagline {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(17px, 3.4vw, 21px);
  letter-spacing: .1em;
  color: #3c5b46;
  opacity: 0;
  animation: fade-up .9s var(--ease) 1.9s forwards;
}

.hero__desc {
  max-width: 33em;
  margin: 0 auto;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 2.05;
  text-align: left;
  opacity: 0;
  animation: fade-up .9s var(--ease) 2.04s forwards;
}

.hero__meta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  opacity: 0;
  animation: fade-up .9s var(--ease) 2.2s forwards;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
}

.chip i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--leaf);
  flex: none;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 章节 ─────────────────────────────────────────── */
.section {
  padding: clamp(56px, 9vw, 96px) 0;
  scroll-margin-top: 84px;
  border-top: 1px solid var(--line);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 30px;
}

.section__num {
  font: 12px/1 Georgia, var(--serif);
  letter-spacing: .18em;
  color: var(--faint);
  padding-top: 4px;
}

.section h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 4.6vw, 27px);
  letter-spacing: .1em;
  color: #2f4536;
}

.section p {
  margin: 0 0 15px;
  color: var(--ink-2);
}

.section p:last-child { margin-bottom: 0; }

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

.lead {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 2.1;
  color: #40564a;
  padding-left: 17px;
  border-left: 2px solid var(--leaf);
}

/* ── 工序列表 ─────────────────────────────────────── */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 20px 0 20px 54px;
  border-top: 1px solid var(--line);
}

.steps li:first-child { border-top: 0; }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 22px;
  font: 12px/1 Georgia, var(--serif);
  letter-spacing: .1em;
  color: var(--leaf-deep);
  padding-top: 3px;
}

.steps h3 {
  margin: 0 0 5px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink);
}

.steps p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ── 架构图 ───────────────────────────────────────── */
.arch {
  display: block;
  width: 100%;
  height: auto;
  margin: 6px 0 0;
  overflow: visible;
}

.arch__box { fill: var(--card); stroke: var(--line-2); stroke-width: 1; }
.arch__label { fill: var(--ink); font: 13px var(--sans); letter-spacing: .04em; }
.arch__sub { fill: var(--muted); font: 11px var(--sans); }
.arch__tag { fill: var(--leaf-deep); font: 10px Georgia, var(--serif); letter-spacing: .14em; }

.arch__link {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1.2;
  stroke-dasharray: 5 7;
  animation: arch-flow 1.6s linear infinite;
}

@keyframes arch-flow { to { stroke-dashoffset: -24; } }

.arch__dot {
  fill: var(--leaf);
  animation: arch-dot 2.6s var(--ease) infinite;
}

.arch__dot:nth-of-type(2) { animation-delay: .85s; }
.arch__dot:nth-of-type(3) { animation-delay: 1.7s; }

@keyframes arch-dot {
  0%       { transform: translateX(0); opacity: 0; }
  12%      { opacity: 1; }
  88%      { opacity: 1; }
  100%     { transform: translateX(38px); opacity: 0; }
}

.arch-caption {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: .02em;
}

/* ── 技术要点 ─────────────────────────────────────── */
.notes {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.notes li {
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink-2);
}

.notes b {
  display: block;
  margin-bottom: 3px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .03em;
}

.notes code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--card-2);
  color: var(--leaf-deep);
}

/* ── 开发手记 ─────────────────────────────────────── */
.log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.log__item {
  position: relative;
  padding: 0 0 30px 26px;
  border-left: 1px solid var(--line);
}

.log__item:last-child { padding-bottom: 0; border-left-color: transparent; }

.log__item::before {
  content: "";
  position: absolute;
  left: -4px; top: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 3px var(--paper);
}

.log__date {
  font: 11px/1 Georgia, var(--serif);
  letter-spacing: .16em;
  color: var(--faint);
  margin-bottom: 7px;
}

.log__item h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--ink);
  line-height: 1.6;
}

.log__item p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ── 关于本站 ─────────────────────────────────────── */
.about {
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 14px;
  color: var(--ink-2);
}

.about p:last-child { margin-bottom: 0; }

/* ── 页脚 ─────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  font-size: 12.5px;
  color: var(--faint);
  position: relative;
  z-index: 1;
}

.foot__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  letter-spacing: .14em;
  color: var(--ink-2);
}

.foot__brand .logo { --logo-size: 18px; }

.foot__note { margin: 12px 0 0; line-height: 1.9; }
.foot a:hover { color: var(--leaf-deep); }

.foot__note a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}

.foot__note a:hover {
  color: var(--leaf-deep);
  border-bottom-color: currentColor;
}

/* 公安联网备案 + ICP 备案：同一行，编号前带警徽（图标略大于文字） */
.foot__filings {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 26px;
}

.foot__beian {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  border-bottom: 0 !important;
}

.foot__beian img {
  display: block;
  width: auto;
  height: 15px;   /* 正文 12.5px，图标略大一点即可，过大反而失衡 */
  flex: none;
}

/* ── 滚动进场 ─────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero__title span,
  .hero__tagline,
  .hero__desc,
  .hero__meta,
  .hero__glow {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__rule { animation: none !important; width: 168px; }
  .arch__link, .arch__dot { animation: none !important; }
}
