@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --ash: #f5f5f5;
  --line: 2px solid #1f1f1f;
  --pad: clamp(16px, 4vw, 48px);
  --font: 'Space Grotesk', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  font-feature-settings: "kern" 1;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 顶栏 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--pad);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: var(--line);
  backdrop-filter: blur(6px);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border: var(--line);
  font-weight: 700;
  font-size: 20px;
}

.mark-img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.mast-nav { position: relative; }

.mast-nav summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 18px;
  background: var(--ash);
  border: var(--line);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.mast-nav summary::-webkit-details-marker { display: none; }

.mast-nav summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.mast-nav[open] summary { background: var(--ink); color: #fff; }
.mast-nav[open] summary::after { transform: rotate(-135deg) translateY(-2px); }

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(82vw, 330px);
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: var(--line);
  box-shadow: 10px 10px 0 rgba(31, 31, 31, 0.14);
}

.nav-menu li + li { margin-top: 2px; }

.nav-menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid #e4e4e4;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: var(--ash);
  border-bottom-color: var(--ink);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(30px, 5vw, 66px) var(--pad) clamp(56px, 9vw, 112px);
  border-bottom: var(--line);
  background: linear-gradient(180deg, var(--paper) 0%, var(--ash) 100%);
}

.hero-copy { min-width: 0; }

.hero h1 {
  margin: 0;
  font-size: clamp(2.15rem, 6vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 44ch;
  margin: 20px 0 0;
  font-size: 1.02rem;
  color: #3a3a3a;
}

.badge {
  position: absolute;
  z-index: 3;
  top: clamp(18px, 4vw, 46px);
  right: var(--pad);
  margin: 0;
  padding: 7px 15px;
  background: var(--ink);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  border: var(--line);
  animation: bob 6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-7px); }
}

.hero-figure {
  margin: 0;
  height: clamp(250px, 54vh, 560px);
  overflow: hidden;
  background: var(--ash);
  border: var(--line);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
  will-change: transform;
}

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

.stripes {
  display: block;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(-45deg, rgba(31, 31, 31, 0.9) 0 2px, rgba(31, 31, 31, 0) 2px 17px);
}

/* ---------- 正文 + 侧栏 ---------- */
.page-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(20px, 3vw, 40px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 76px) var(--pad);
}

.prose { min-width: 0; max-width: 770px; }

.prose div {
  position: relative;
  margin: 0 0 clamp(18px, 3vw, 30px);
  padding: clamp(18px, 3.2vw, 34px);
  background: #fff;
  border: var(--line);
  border-bottom-width: 6px;
  overflow-wrap: break-word;
}

.prose div:nth-child(even) { background: var(--ash); }
.prose div:last-child { margin-bottom: 0; }

main div[id] { scroll-margin-top: 96px; }

.prose h2 {
  margin: 0.1em 0 0.7em;
  font-size: clamp(1.38rem, 3vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.prose h2 > span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 4px solid var(--ink);
}

.prose h3 {
  margin: 1.1em 0 0.5em;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.35;
}

.prose h3 > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--ink);
}

.prose h4 { margin: 1em 0 0.4em; font-size: 1.02rem; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover { background: var(--ash); }

.prose ul,
.prose ol { padding-left: 1.35em; }
.prose li { margin: 0.35em 0; }

.prose blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  background: var(--ash);
  border-left: 6px solid var(--ink);
}

.prose figure { margin: 1.2em 0; }
.prose figure > img { width: 100%; height: auto; border: var(--line); }
.prose code { padding: 2px 5px; background: var(--ash); font-size: 0.94em; }
.prose hr { margin: 2em 0; border: 0; border-top: var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.prose th,
.prose td { padding: 8px; border: 1px solid #c9c9c9; text-align: left; }
.prose time { font-size: 0.86rem; letter-spacing: 0.08em; color: #555; }

.rail {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 16px;
  background: var(--ash);
  border: var(--line);
  border-bottom-width: 6px;
}

.rail-title {
  margin: 0 0 14px;
  font-size: 0.88rem;
  letter-spacing: 0.26em;
}

.rail-title > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--ink);
}

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

.rail-list li { counter-increment: rail; }

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 6px;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid #dcdcdc;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #6a6a6a;
}

.rail-list a:hover { background: #fff; }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: clamp(30px, 6vw, 70px);
  padding: clamp(28px, 5vw, 62px) var(--pad) 22px;
  background: var(--ink);
  color: #fff;
  border-top: var(--line);
}

.foot-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
  max-width: 1100px;
  margin: 0 auto;
}

.foot-brand {
  margin: 0;
  font-style: normal;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.foot-brand strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.foot-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.95rem;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid #454545;
}

.foot-links a:hover { background: #fff; color: var(--ink); }

.mega {
  max-width: 1100px;
  margin: clamp(26px, 5vw, 58px) auto 0;
  font-size: clamp(2.8rem, 15vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.05em;
  font-weight: 700;
  overflow: hidden;
}

.legal {
  max-width: 1100px;
  margin: 18px auto 0;
  padding-top: 14px;
  border-top: 1px solid #3d3d3d;
  text-align: center;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  color: #bcbcbc;
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  min-height: 46px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: #fff;
  border: var(--line);
  box-shadow: 6px 6px 0 rgba(31, 31, 31, 0.16);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.to-top.on { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-figure { will-change: auto; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    padding-top: 24px;
  }

  .badge {
    position: static;
    justify-self: start;
    margin-bottom: 12px;
    animation: none;
    transform: rotate(-2deg);
  }

  .hero-figure {
    height: clamp(200px, 38vh, 300px);
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
  }

  .page-body { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; order: -1; }
  .prose { max-width: none; }

  .foot-top { grid-template-columns: minmax(0, 1fr); }
  .mega { letter-spacing: -0.04em; }
}

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