/* 私护手记 · 杂志式单页版式，黑白纸面 */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --ash: #6f6f6f;
  --line: #e4e4e4;
  --tint: #f5f5f5;
  --radius: 28px;
  --shadow: 0 26px 52px -34px rgba(0, 0, 0, 0.55);
  --edge: clamp(16px, 4vw, 52px);
  --font-display: "Outfit", "Work Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Work Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

img { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0;
}

p { margin: 0 0 1em; }

menu { margin: 0; padding: 0; list-style: none; }

/* ---------- 报头 ---------- */

.masthead {
  position: relative;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px var(--edge) 12px;
}

.topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.brand {
  grid-column: 2;
  justify-self: center;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.masthead-contact {
  grid-column: 3;
  justify-self: end;
  margin: 0;
}

.masthead-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.masthead-contact a:hover,
.masthead-contact a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 折叠菜单 ---------- */

.menu-shell { margin-top: 10px; }

.menu-shell > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: pointer;
  list-style: none;
}

.menu-shell > summary::-webkit-details-marker { display: none; }

.menu-shell > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
}

.menu-shell[open] > summary::after { transform: rotate(225deg) translateY(-1px); }

.menu-shell > menu { display: none; }

.menu-shell[open] > menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: 6px var(--edge) 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  box-shadow: var(--shadow);
}

.menu-shell > menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 6px 2px;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.menu-shell > menu a:hover,
.menu-shell > menu a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- 首屏 ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.6vw, 26px);
  min-height: 70vh;
  padding: clamp(30px, 7vw, 78px) var(--edge) 0;
  text-align: center;
}

.kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--ash);
}

.hero-title {
  font-size: clamp(2.05rem, 7.2vw, 4.6rem);
  letter-spacing: -0.045em;
  max-width: 18ch;
  text-wrap: balance;
}

.hero-figure {
  width: min(1080px, 100%);
  margin: clamp(16px, 3.6vw, 38px) 0 0;
  min-height: clamp(150px, 30vh, 300px);
  background: var(--tint);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slash {
  height: clamp(34px, 6vw, 66px);
  background: var(--ink);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* ---------- 栏与正文 ---------- */

.spread {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 44px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(26px, 4.5vw, 58px) var(--edge) clamp(52px, 8vw, 100px);
}

.rail { min-width: 0; }

.rail > small {
  display: block;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.3em;
  color: var(--ash);
  margin-bottom: 10px;
}

.rail-title {
  font-size: clamp(1.35rem, 2.4vw, 1.72rem);
  margin-bottom: 16px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rail;
}

.rail-list li {
  counter-increment: rail;
  border-top: 1px solid var(--line);
}

.rail-list li::before {
  content: counter(rail, decimal-leading-zero);
  display: block;
  padding-top: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ash);
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 0 10px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  text-decoration: none;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.prose {
  min-width: 0;
  max-width: 70ch;
  font-size: clamp(16.5px, 0.4vw + 15px, 18px);
  overflow-wrap: break-word;
}

.prose > article {
  padding-block: clamp(24px, 4vw, 46px);
  scroll-margin-top: 26px;
}

.prose > article:first-child { padding-top: 0; }

.prose > article + article { border-top: 1px solid var(--line); }

.prose h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.5em;
}

.prose h3 {
  font-size: clamp(1.15rem, 2vw, 1.42rem);
  margin: 1.5em 0 0.5em;
}

.prose h4 {
  font-size: 1.05rem;
  margin: 1.3em 0 0.4em;
}

.prose small {
  display: block;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.28em;
  color: var(--ash);
  margin-bottom: 0.65em;
}

.prose > article > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.1em;
  font-weight: 600;
  line-height: 0.86;
  padding: 0.04em 0.12em 0 0;
}

.prose a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.prose strong { font-weight: 600; }

.prose ul,
.prose ol {
  margin: 0 0 1.25em;
  padding-left: 1.2em;
}

.prose li { margin: 0.4em 0; }

.prose li::marker { color: var(--ink); }

.prose blockquote {
  margin: clamp(22px, 3.4vw, 38px) 0;
  padding: clamp(22px, 3.4vw, 38px);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 2.2vw, 1.55rem);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.015em;
  box-shadow: var(--shadow);
}

.prose blockquote::before {
  content: "“";
  display: block;
  font-size: 2.2em;
  line-height: 0.7;
  opacity: 0.55;
  margin-bottom: 0.22em;
}

.prose blockquote p { margin: 0 0 0.6em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote a { color: var(--paper); }

.prose figure {
  margin: 0 0 1.4em;
}

.prose figure img,
.prose p img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.prose figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ash);
}

.prose aside {
  margin: 1.4em 0;
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--tint);
  border-radius: var(--radius);
  font-size: 0.96em;
}

.prose aside > :last-child { margin-bottom: 0; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.2em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94em;
  margin: 0 0 1.4em;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--tint);
}

.prose code {
  font-size: 0.9em;
  background: var(--tint);
  padding: 2px 6px;
  border-radius: 6px;
}

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

.colophon {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(34px, 5.5vw, 70px) var(--edge) 24px;
}

.cta {
  padding-bottom: clamp(26px, 4vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.cta-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(10px, 2.2vw, 22px);
  color: var(--paper);
  text-decoration: none;
}

.cta-brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8.4vw, 5.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.cta-word {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 20px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  letter-spacing: 0.3em;
  transition: background 0.25s ease, color 0.25s ease;
}

.cta-link:hover .cta-word,
.cta-link:focus-visible .cta-word {
  background: var(--paper);
  color: var(--ink);
}

.footrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  padding-top: 20px;
  font-size: 13px;
}

.foot-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.05em;
  color: var(--paper);
  text-decoration: none;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.copyright {
  margin: 0 0 0 auto;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- 动效 ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.62s ease var(--d, 0ms), transform 0.62s cubic-bezier(0.2, 0.7, 0.3, 1) var(--d, 0ms);
  will-change: opacity, transform;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 宽屏 ---------- */

@media (min-width: 900px) {
  .masthead {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.94);
  }

  .menu-shell {
    display: flex;
    justify-content: center;
    margin-top: 12px;
  }

  .menu-shell > summary { display: none; }

  .menu-shell > menu,
  .menu-shell[open] > menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 1.7vw, 26px);
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .menu-shell > menu a,
  .menu-shell[open] > menu a {
    min-height: 44px;
    padding: 6px 8px;
    font-size: 14.5px;
    letter-spacing: 0.03em;
    border-bottom: 1px solid transparent;
  }

  .menu-shell > menu a:hover,
  .menu-shell > menu a:focus-visible {
    border-bottom-color: var(--ink);
    text-decoration: none;
  }

  .spread {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(30px, 5vw, 76px);
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 160px;
  }

  .prose > article { scroll-margin-top: 160px; }

  .hero-title { padding-bottom: 4px; }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 899px) {
  .rail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    counter-reset: none;
  }

  .rail-list li {
    border-top: 0;
    counter-increment: none;
  }

  .rail-list li::before { display: none; }

  .rail-list a {
    min-height: 44px;
    padding: 6px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
  }

  .copyright { margin-left: 0; }

  .prose > article > p:first-of-type::first-letter { font-size: 2.7em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
