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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mute: #5a5a5a;
  --line: #000000;
  --serif: "Newsreader", "Songti SC", "Source Han Serif SC", Georgia, serif;
  --sans: "Roboto", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --bar: 78px;
  --gut: 1.5rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  padding-bottom: var(--bar);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

/* ---------- 底部固定条 ---------- */
.masthead {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 1.25rem;
  background: var(--paper);
  border-top: 3px solid var(--ink);
}

.bar-nav {
  flex: 1 1 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.bar-nav::-webkit-scrollbar { display: none; }

.bar-nav p {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
}
.bar-nav--b p { justify-content: flex-end; }

.bar-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.bar-nav a::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.55rem;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bar-nav a:hover::after,
.bar-nav a[aria-current="true"]::after { transform: scaleX(1); }

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- 首屏 ---------- */
.hero {
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  background: var(--ink);
}

.hero-type {
  background: var(--paper);
  padding: 3.5rem var(--gut) 1.25rem;
  text-align: right;
}

.hero-title {
  font-size: clamp(2.6rem, 10vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  word-break: break-word;
}

.hero-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 34vh;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 74%);
}

.hero-media .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-title { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 版心 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.5rem var(--gut) 5.5rem;
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 3.5rem;
  align-items: start;
}

/* ---------- 正文 ---------- */
.prose { max-width: 70ch; min-width: 0; }

.prose > div {
  padding: 3rem 0 0.5rem;
  border-top: 2px solid var(--line);
  scroll-margin-top: 1.5rem;
}
.prose > div:first-child { border-top: 0; padding-top: 0; }

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

.prose h2 {
  font-size: clamp(1.85rem, 3.6vw, 2.9rem);
  letter-spacing: -0.05em;
  margin-top: 0.2rem;
}

.prose h3 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-top: 2rem;
}

.prose p {
  margin-top: 1.1rem;
  font-size: 1.0625rem;
  line-height: 1.85;
}

.prose .subtitle,
.prose p.subtitle {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--mute);
}

.prose ul, .prose ol { margin: 1.1rem 0 0; padding-left: 1.25rem; }
.prose li { margin-top: 0.55rem; line-height: 1.8; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
.prose a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
}

.prose strong { font-weight: 700; }

.prose figure { margin: 1.6rem 0; }
.prose figcaption { margin-top: 0.5rem; font-size: 0.9rem; color: var(--mute); }

.prose table {
  width: 100%;
  margin-top: 1.4rem;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.prose th, .prose td {
  border-bottom: 1px solid var(--ink);
  padding: 0.6rem 0.5rem;
  text-align: left;
}

/* ---------- 右侧栏 ---------- */
.rail {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  border-left: 2px solid var(--ink);
  padding-left: 1.4rem;
}

.rail h2 {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.rail .subtitle {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--mute);
}

.rail-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.rail-list li { border-bottom: 1px solid var(--ink); }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0;
  font-size: 0.98rem;
  text-decoration: none;
  transition: padding-left 0.22s ease, background 0.22s ease;
}
.rail-list a:hover {
  padding-left: 0.4rem;
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 页脚 ---------- */
.colophon {
  border-top: 3px solid var(--ink);
  padding: 4rem var(--gut) 3rem;
  display: grid;
  gap: 2.75rem;
}

.col-lead { display: grid; gap: 1.5rem; justify-items: start; }

.col-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 8.5vw, 5.5rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
  text-decoration: none;
  display: block;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 1.3rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
}
.to-top:hover { background: var(--paper); color: var(--ink); }

.foot-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.foot-nav a:hover { border-bottom-color: var(--ink); }

.col-copy {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ink);
  padding-top: 1.1rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--mute);
}

/* ---------- 滚动揭示 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (min-width: 760px) {
  .colophon {
    grid-template-columns: 1.35fr 1fr;
    align-items: end;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .wrap { padding-left: 2.5rem; padding-right: 2.5rem; }
  .hero-type { padding-left: 2.5rem; padding-right: 2.5rem; }
  .masthead { padding-left: 2.5rem; padding-right: 2.5rem; }
}

@media (max-width: 920px) {
  .content-shell { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
  .rail {
    position: static;
    border-left: 0;
    border-top: 2px solid var(--ink);
    padding-left: 0;
    padding-top: 1.4rem;
  }
  .rail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
  .rail-list li:nth-last-child(1) { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --bar: 118px; }
  .masthead {
    flex-wrap: wrap;
    gap: 0.1rem;
    padding: 0.35rem 0.6rem 0.45rem;
  }
  .brand {
    order: -1;
    flex: 1 0 100%;
    justify-content: center;
    min-height: 40px;
    font-size: 1.05rem;
  }
  .bar-nav { flex: 1 1 0; }
  .bar-nav a { min-height: 42px; padding: 0 0.42rem; font-size: 1rem; }
  .bar-nav a::after { bottom: 0.45rem; left: 0.42rem; right: 0.42rem; }
  .hero-type { padding-top: 2.5rem; }
  .prose h2 { font-size: 1.9rem; }
  .colophon { padding-top: 3rem; }
}

@media (max-width: 420px) {
  :root { --gut: 1.1rem; }
  .rail-list { grid-template-columns: 1fr; }
  .rail-list li:nth-last-child(1) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .rail-list a:hover { padding-left: 0; }
}

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