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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --muted: #3c3c3c;
  --hair: #e3e3e3;
  --serif: 'Cinzel', 'Songti SC', 'Noto Serif CJK SC', 'Source Han Serif SC', Georgia, serif;
  --sans: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --pad: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.78;
  letter-spacing: 0.01em;
}

a { color: inherit; }

img { border: 0; }

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

/* 顶部细条 */
.ticker {
  margin: 0;
  padding: 9px var(--pad);
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 报头 */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 0;
  text-decoration: none;
  overflow: hidden;
}

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

.mono {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}

.caps {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 4px 0;
}

.caps::-webkit-scrollbar { display: none; }

.caps a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, letter-spacing 0.18s ease;
}

.caps a:hover,
.caps a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  letter-spacing: 0.06em;
}

/* 头图 */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(300px, 45vh, 470px);
  background: var(--ink);
  overflow: hidden;
}

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

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.2) 1px, transparent 0) 0 0 / 16px 16px,
    linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8));
}

.hero-bare .hero-veil {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.32) 1px, transparent 0) 0 0 / 14px 14px,
    linear-gradient(180deg, #000, #101010);
}

.hero-title {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 28px var(--pad);
  max-width: 20ch;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(2rem, 7.5vw, 4.4rem);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: 0.05em;
  text-align: center;
  text-wrap: balance;
}

/* 主区：不对称双栏 */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(30px, 6vw, 76px) var(--pad);
}

.col-main { max-width: 70ch; }

.col-main > article {
  scroll-margin-top: 108px;
}

.col-main > article + article {
  margin-top: clamp(30px, 5vw, 58px);
  padding-top: clamp(22px, 3.5vw, 40px);
  border-top: 1px solid var(--ink);
}

.col-main h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.col-main h3 {
  margin: 26px 0 10px;
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.col-main p { margin: 0 0 1em; }

.col-main strong { font-weight: 600; }

.col-main a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.col-main ul,
.col-main ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

.col-main li { margin-bottom: 0.4em; }

.col-main > article:first-child > p:first-of-type::first-letter {
  float: left;
  padding: 8px 12px 0 0;
  font-family: var(--serif);
  font-size: 4em;
  font-weight: 600;
  line-height: 0.82;
}

.col-main blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
}

.col-main blockquote p:last-child { margin-bottom: 0; }

.col-main figure { margin: 1.5em 0; }

.col-main img {
  display: block;
  max-width: 100%;
  height: auto;
}

.col-main figcaption {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--hair);
  font-size: 16px;
  color: var(--muted);
}

/* 右栏 */
.rail {
  order: -1;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.rail-title {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.34em;
  line-height: 1.4;
}

.subtitle {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.toc li { counter-increment: toc; }

.toc li + li { border-top: 1px solid var(--hair); }

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 4px;
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, padding-left 0.16s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.toc a:hover,
.toc a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  padding-left: 10px;
}

.toc a:hover::before,
.toc a:focus-visible::before { color: var(--paper); }

/* 页脚 */
.colophon {
  display: grid;
  grid-template-areas: "wall" "fnav" "base";
  margin-top: clamp(40px, 7vw, 90px);
  border-top: 2px solid var(--ink);
  padding: 0 var(--pad);
}

.wall {
  grid-area: wall;
  padding: 26px 0 6px;
  overflow: hidden;
}

.giant {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 9.6vw, 6.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.fnav {
  grid-area: fnav;
  padding: 12px 0 26px;
}

.fnav dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}

.fnav dt {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3em;
}

.fnav dd { margin: 0; }

.fnav dd a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--hair);
  font-size: 16px;
  text-decoration: none;
  transition: letter-spacing 0.16s ease;
}

.fnav dd a:hover,
.fnav dd a:focus-visible { letter-spacing: 0.08em; }

.base {
  grid-area: base;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 18px;
  padding: 14px 0 30px;
  border-top: 1px solid var(--ink);
}

.base p { margin: 0; }

.copy {
  font-size: 16px;
  letter-spacing: 0.12em;
}

.quick {
  display: flex;
  gap: 16px;
}

.quick a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* 回到顶部 */
.toTop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--paper);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* 滚动显现 */
.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.rv.in {
  opacity: 1;
  transform: none;
}

@media (min-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr) 286px;
    align-items: start;
  }

  .rail {
    order: 0;
    position: sticky;
    top: 96px;
  }

  .col-main > article:nth-child(even) {
    column-count: 2;
    column-gap: 2.6rem;
  }

  .col-main > article:nth-child(even) > h2,
  .col-main > article:nth-child(even) > h3 {
    column-span: all;
  }

  .colophon {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas:
      "wall fnav"
      "base base";
  }

  .fnav dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1180px) {
  .toTop { right: 28px; bottom: 28px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }

  .ticker { letter-spacing: 0.16em; }

  .masthead { padding-inline: 12px; }

  .hero-title { max-width: 14ch; }

  .giant { font-size: clamp(1.9rem, 10.4vw, 3rem); }
}

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

  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .caps a,
  .toc a,
  .fnav dd a { transition: none; }
}

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