/* ============================================================
   知行札记 · 个人博客样式
   品牌调性：暖米白底 + 陶土橙强调色，编辑感排版
   ============================================================ */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --ink: #141413;
  --mid: #6b6862;
  --muted: #b0aea5;
  --line: #e8e6dc;
  --accent: #d97757;
  --accent-ink: #b85a3c;
  --container: 1180px;
  --radius: 18px;
  --shadow: 0 18px 40px -24px rgba(20, 20, 19, 0.35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Lora", Georgia, "Songti SC", serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .eyebrow, .btn, .nav__brand, .tag, .stats strong {
  font-family: "Poppins", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(250, 249, 245, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav__links { display: flex; gap: 30px; }
.nav__links a {
  font-size: 0.95rem;
  color: var(--mid);
  transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(217, 119, 87, 0.8);
}
.btn--primary:hover { background: var(--accent-ink); }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; overflow: hidden; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-ink);
  margin: 0 0 18px;
}
.hero__title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 22px;
}
.hero__lead {
  font-size: 1.12rem;
  color: var(--mid);
  max-width: 52ch;
  margin: 0 0 32px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__media { position: relative; display: flex; justify-content: center; }
.hero__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  z-index: 2;
}
.hero__badge {
  position: absolute;
  bottom: -16px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.hero__pattern {
  position: absolute;
  top: -40px; right: -30px;
  width: 220px; height: 220px;
  opacity: 0.6;
  z-index: 1;
}

/* ---------- 通用 section ---------- */
.section { padding: 84px 0; }
.section--alt { background: #f3efe6; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__label {
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-ink);
  margin: 0 0 10px;
}
.section__title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 40px;
}

/* ---------- 关于 ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 48px;
  align-items: start;
}
.about__bio { font-size: 1.08rem; color: var(--mid); margin: 0; max-width: 60ch; }
.stats {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 18px;
}
.stats li {
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--accent);
  padding-top: 10px;
}
.stats strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.stats span { font-size: 0.9rem; color: var(--muted); }

/* ---------- 文章列表 ---------- */
.posts { list-style: none; margin: 0; padding: 0; }
.post { border-top: 1px solid var(--line); }
.post:last-child { border-bottom: 1px solid var(--line); }
.post a {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 26px 8px;
  transition: padding-left 0.25s var(--ease), background 0.25s var(--ease);
}
.post a:hover { padding-left: 18px; background: rgba(217, 119, 87, 0.05); }
.post time { font-family: "Poppins", sans-serif; font-size: 0.85rem; color: var(--muted); }
.post__body h3 { margin: 0 0 6px; font-size: 1.22rem; letter-spacing: -0.01em; font-weight: 600; }
.post__body p { margin: 0; color: var(--mid); font-size: 0.98rem; max-width: 64ch; }
.tag {
  font-family: "Poppins", sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: rgba(217, 119, 87, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.posts__more { margin-top: 34px; }

/* ---------- 项目 ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(217,119,87,0.4); }
.project h3 { margin: 0 0 10px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.project p { margin: 0 0 18px; color: var(--mid); font-size: 0.96rem; }
.project__meta { display: flex; align-items: center; justify-content: space-between; }
.project__meta a { font-family: "Poppins", sans-serif; font-size: 0.85rem; color: var(--accent-ink); font-weight: 600; }

/* ---------- CTA ---------- */
.section--cta { background: var(--ink); color: var(--bg); }
.cta__inner { text-align: center; max-width: 620px; margin: 0 auto; }
.cta__inner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; margin: 0 0 14px; font-weight: 700; }
.cta__inner p { color: var(--muted); margin: 0 0 28px; }

/* ---------- 页脚 ---------- */
.footer { background: #100f0e; color: var(--muted); padding: 30px 0; }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer__copy { margin: 0; font-size: 0.88rem; }
.footer__beian a {
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid rgba(176, 174, 165, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer__beian a:hover { color: var(--bg); border-color: var(--accent); }

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__media { order: -1; }
  .about__grid { grid-template-columns: 1fr; gap: 28px; }
  .projects { grid-template-columns: 1fr; }
  .nav__links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .nav__links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav__toggle { display: flex; }
  .post a { grid-template-columns: 1fr; gap: 8px; }
  .post .tag { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .project, .post a { transition: none; }
}
