/* 我家小记 — 公共样式
 * 设计基调：米白纸感背景 + 暖陶土主色，细边框卡片，克制的动效。 */

@font-face {
  font-family: "site-serif";
  font-display: swap;
  src: local("Songti SC"), local("SimSun");
}

:root {
  --bg: #f7f3ec;
  --bg-soft: #fffdf8;
  --surface: #ffffff;
  --ink: #2e2a25;
  --ink-2: #5c554c;
  --ink-3: #8b8377;
  --line: #e4dccd;
  --line-strong: #d3c7b2;
  --brand: #b9563c;
  --brand-soft: #f3e2da;
  --brand-ink: #8f3f2b;
  --green: #4f7f52;
  --green-soft: #e6efe4;
  --gold: #b8862f;
  --gold-soft: #f6ecd8;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(46, 42, 37, .05), 0 2px 8px rgba(46, 42, 37, .04);
  --shadow-md: 0 2px 6px rgba(46, 42, 37, .06), 0 12px 32px rgba(46, 42, 37, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "site-serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 细腻的纸纹，避免大块纯色发闷 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(185, 86, 60, .045), transparent 42%),
    radial-gradient(circle at 85% 8%, rgba(79, 127, 82, .05), transparent 38%),
    radial-gradient(circle at 60% 90%, rgba(184, 134, 47, .04), transparent 45%);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}

p { margin: 0; }

::selection { background: var(--brand-soft); color: var(--brand-ink); }

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

/* ---------- 布局 ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c9664a, #a3492f);
  color: #fff;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color .18s ease, background .18s ease;
}

.nav a:hover { color: var(--ink); background: rgba(185, 86, 60, .07); }

.nav a[aria-current="page"] {
  color: var(--brand-ink);
  font-weight: 600;
  background: var(--brand-soft);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .2s ease;
}

.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

/* ---------- 通用组件 ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(185, 86, 60, .22);
}

.btn-primary:hover { background: var(--brand-ink); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink-3); background: #fff; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 31px);
  margin-top: 10px;
}

.section-head p {
  color: var(--ink-2);
  font-size: 14.5px;
  max-width: 46ch;
}

.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.tag-light { background: var(--green-soft); border-color: #cfe0cb; color: #3d6540; }
.tag-medium { background: var(--gold-soft); border-color: #ead8b4; color: #8a6420; }
.tag-hard { background: var(--brand-soft); border-color: #e8c7bb; color: var(--brand-ink); }

.tag-brand { background: var(--brand-soft); border-color: #e8c7bb; color: var(--brand-ink); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, .6);
  position: relative;
  z-index: 1;
}

.footer-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 22px 0;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .01em;
}

.footer-legal a {
  color: var(--ink-3);
  transition: color .18s ease;
  font-variant-numeric: tabular-nums;
}

.footer-legal a:hover { color: var(--brand); }

/* 分隔点：仅在两项之间出现 */
.footer-legal > * + *::before {
  content: "·";
  margin-right: 10px;
  color: var(--line-strong);
}

/* ---------- 入场动效 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s cubic-bezier(.22, .61, .36, 1), transform .6s cubic-bezier(.22, .61, .36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

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

@media (max-width: 820px) {
  .wrap { padding: 0 18px; }
  .header-inner { height: 60px; }
  .nav-toggle { display: inline-flex; }

  .nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 18px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  .nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav a { padding: 12px 14px; font-size: 15.5px; }

  .site-footer { margin-top: 64px; }
  .footer-legal { padding: 18px 0; font-size: 12px; }
}
