@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mute: #585858;
  --hair: #e3e3e3;
  --serif: 'Playfair Display', 'Times New Roman', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --gut: clamp(1.15rem, 4.5vw, 2.5rem);
  --max: 1200px;
  --r: 18px;
}

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

body {
  margin: 0;
  padding: 0 0 78px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.66;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

p { margin: 0 0 1rem; }
a { color: inherit; }
img { max-width: 100%; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(3rem, 9vw, 6rem) var(--gut) clamp(5rem, 11vw, 8rem);
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(24px, 4vw, 48px);
  background: var(--ink);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.hero-copy {
  max-width: 36ch;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5.6vw, 4rem);
  margin-bottom: 1.1rem;
}

.hero-desc {
  margin: 0 auto;
  max-width: 34ch;
  color: var(--mute);
}

.hero-fig {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--r);
  background: #f4f4f4;
  box-shadow: 0 22px 50px -32px rgba(0, 0, 0, 0.5);
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  will-change: transform;
}

.hero-fill {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(#000, #000) 50% 50% / 1px 100% no-repeat,
    linear-gradient(#000, #000) 50% 50% / 100% 1px no-repeat,
    #fff;
}

/* ---------- 正文与侧栏 ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut) clamp(3rem, 8vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.prose { min-width: 0; }

.prose > div {
  padding-block: clamp(2.2rem, 6vw, 4rem);
  border-top: 1px solid var(--hair);
  scroll-margin-top: 1.5rem;
}

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

.prose h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  margin: 0 0 0.85rem;
}

.prose h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin: 1.7rem 0 0.5rem;
}

.prose h2 span, .prose h3 span { display: inline-block; }

.prose p {
  max-width: 66ch;
  color: #1a1a1a;
  margin: 0 0 1.05rem;
}

.prose ul, .prose ol {
  max-width: 66ch;
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
}

.prose li { margin-bottom: 0.45rem; }

.prose a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 2px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
}

.prose figure {
  margin: 1.5rem 0;
  border-radius: var(--r);
  overflow: hidden;
}

.prose img {
  display: block;
  border-radius: var(--r);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.prose th, .prose td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--hair);
  text-align: left;
}

.toc {
  position: sticky;
  top: 1.6rem;
  align-self: start;
  border-left: 1px solid var(--ink);
  padding-left: 1.05rem;
}

.toc h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin: 0 0 0.7rem;
}

.toc h2 span { display: block; }

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.62rem;
  min-height: 40px;
  padding: 0.45rem 0;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
}

.toc a:hover { border-bottom-color: var(--ink); }

.toc-n {
  flex: none;
  font-size: 0.78rem;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

/* ---------- 页脚 ---------- */
.foot {
  max-width: var(--max);
  margin: 0 auto;
  border-top: 1px solid var(--ink);
  padding: clamp(2rem, 5vw, 3.4rem) var(--gut) clamp(2.4rem, 5vw, 3.4rem);
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem 2rem;
}

.foot-nav .foot-h {
  grid-column: 1 / -1;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  margin: 0 0 0.25rem;
}

.foot-h span { display: block; }

.foot-nav dl {
  margin: 0;
  display: grid;
  align-content: start;
  gap: 0.05rem;
}

.foot-nav dt, .foot-nav dd { margin: 0; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-nav a:hover { border-bottom-color: var(--ink); }

.foot-brand {
  display: inline-block;
  margin: clamp(2rem, 5vw, 3rem) 0 0.8rem;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 10.5vw, 6.5rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.foot-legal {
  margin: 0;
  font-size: 0.92rem;
  color: var(--mute);
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  padding: 0.4rem var(--gut) calc(0.4rem + env(safe-area-inset-bottom));
}

.dock-brand {
  font-family: var(--serif);
  font-size: 1.02rem;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.7rem 0.1rem;
}

.dock-nav {
  flex: 1;
  display: flex;
  gap: 0.1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.dock-nav::-webkit-scrollbar { display: none; }

.dock-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.62rem;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.dock-link:hover, .dock-link:focus-visible, .dock-link.is-on {
  background: var(--ink);
  color: var(--paper);
}

.dock-ic {
  flex: none;
  width: 11px;
  height: 11px;
  opacity: 0.75;
}

.dock-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.55rem;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  border-left: 1px solid var(--hair);
}

/* ---------- 动效 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.2, 0.65, 0.3, 1);
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; }
  .toc {
    position: static;
    order: 2;
    margin-top: 1rem;
    border-left: 0;
    border-top: 1px solid var(--ink);
    padding: 1.2rem 0 0;
  }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: clamp(1.6rem, 7vw, 2.6rem);
    padding-bottom: clamp(3.4rem, 10vw, 4.8rem);
  }
  .hero-copy { order: 1; max-width: 30ch; }
  .hero-fig { order: 2; aspect-ratio: 16 / 11; margin-top: 0.4rem; }
  .foot-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .dock-top { display: none; }
  .dock-brand { font-size: 0.97rem; }
  .dock-link { padding: 0.5rem 0.52rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero-img { transform: none !important; }
  .dock-link { transition: none; }
}

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