@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --ink: #111013;
  --paper: #F4EFE6;
  --paper-deep: #E9E1D2;
  --wine: #A6313A;
  --wine-soft: #C9717A;
  --line: rgba(17, 16, 19, 0.14);
  --line-soft: rgba(17, 16, 19, 0.07);
  --muted: #57535C;
  --glass: rgba(255, 255, 255, 0.42);
  --shadow: 0 24px 50px -34px rgba(17, 16, 19, 0.6);
}

*,
*::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: 'Source Serif 4', Georgia, 'Songti SC', 'Noto Serif CJK SC', serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.004em;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* 顶部细条 */
.ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.3rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: none;
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wine-soft);
  flex: 0 0 auto;
}

.ticker-rule {
  width: 46px;
  height: 1px;
  background: rgba(244, 239, 230, 0.4);
  flex: 0 0 auto;
}

/* 页头 */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem clamp(0.9rem, 4vw, 2.5rem);
  background: rgba(244, 239, 230, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--wine);
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.mark:hover {
  border-color: var(--wine);
  transform: translateY(-1px);
}

.mark-img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.mark-glyph {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--paper);
}

.anchors {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.anchors::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 26px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(244, 239, 230, 0), rgba(244, 239, 230, 0.95));
}

.anchor-track {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.anchor-track::-webkit-scrollbar {
  display: none;
}

.anchor-track a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  border-radius: 999px;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.anchor-track a:hover,
.anchor-track a:focus-visible {
  background: rgba(166, 49, 58, 0.1);
  color: var(--wine);
}

/* 首屏 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: clamp(2rem, 7vw, 5rem) clamp(1.15rem, 5vw, 4rem);
  background:
    linear-gradient(162deg, #EEE6D7 0%, var(--paper) 52%, #E8DFCF 100%);
  border-bottom: 1px solid var(--line);
}

.hero-dots {
  position: absolute;
  inset: -22% -12%;
  background-image: radial-gradient(rgba(17, 16, 19, 0.2) 1px, transparent 1px);
  background-size: 19px 19px;
  opacity: 0.6;
  will-change: transform;
  pointer-events: none;
}

.hero-wash {
  position: absolute;
  top: -14vw;
  right: -10vw;
  width: 62vw;
  height: 62vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(166, 49, 58, 0.24) 0%, rgba(166, 49, 58, 0) 66%);
  filter: blur(6px);
  will-change: transform;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  width: 100%;
  max-width: 1060px;
  margin-left: auto;
  justify-content: flex-end;
}

.hero-mark {
  flex: 0 0 auto;
  width: clamp(66px, 9vw, 116px);
  height: auto;
  color: var(--wine);
  opacity: 0.85;
}

.hero-copy {
  text-align: right;
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, 'Songti SC', serif;
  font-weight: 900;
  font-size: clamp(2.35rem, 7.2vw, 5.3rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  text-align: right;
  text-wrap: balance;
}

.hero-lead {
  margin: 1.15rem 0 0 auto;
  max-width: 44ch;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--muted);
}

/* 主栅格 */
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.15rem, 4vw, 2.5rem) clamp(3rem, 8vw, 6rem);
}

.story {
  min-width: 0;
}

.story > div {
  scroll-margin-top: 124px;
  padding-top: clamp(1.9rem, 4.5vw, 3rem);
  border-top: 1px solid var(--line);
}

.story > div + div {
  margin-top: clamp(1.9rem, 4.5vw, 3.2rem);
}

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

.story h2 {
  margin: 0 0 0.8rem;
  font-family: 'Playfair Display', Georgia, 'Songti SC', serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.story h2::before {
  content: '';
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 0.85rem;
  background: var(--wine);
  border-radius: 2px;
}

.story h3 {
  margin: 1.9rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.story p {
  margin: 0 0 1.1rem;
  max-width: 68ch;
}

.story a {
  color: var(--wine);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.story a:hover {
  color: var(--ink);
}

.story ul,
.story ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
  max-width: 66ch;
}

.story li {
  margin: 0 0 0.4rem;
}

.story strong {
  font-weight: 600;
}

.story blockquote {
  margin: 1.5rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;
  border-left: 3px solid var(--wine);
  color: var(--muted);
  font-style: italic;
}

.story figure {
  margin: 1.5rem 0;
}

.story figcaption {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--muted);
}

.story img {
  border-radius: 22px;
  border: 1px solid var(--line-soft);
}

.story code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.94em;
  background: rgba(17, 16, 19, 0.06);
  padding: 0.1em 0.36em;
  border-radius: 6px;
}

.story pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(17, 16, 19, 0.92);
  color: var(--paper);
}

.story pre code {
  background: none;
  padding: 0;
}

.story hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* 右侧栏 */
.rail {
  position: sticky;
  top: 78px;
  padding: 1.35rem 1.2rem 1.1rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.rail h2 {
  margin: 0 0 0.3rem;
  font-family: 'Playfair Display', Georgia, 'Songti SC', serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rail .subtitle {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.rail-nav {
  display: flex;
  flex-direction: column;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.15rem 0.1rem;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.rail-nav a:last-child {
  border-bottom: 0;
}

.rail-nav a:hover {
  color: var(--wine);
  padding-left: 0.3rem;
}

/* 页脚 */
.foot {
  margin-top: clamp(1.5rem, 5vw, 3rem);
  background: var(--ink);
  color: var(--paper);
}

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.6rem 2.2rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.4rem) clamp(1.15rem, 4vw, 2.5rem);
}

.foot-mark {
  flex: 0 0 auto;
  font-family: 'Playfair Display', Georgia, 'Songti SC', serif;
  font-weight: 900;
  font-size: clamp(1.9rem, 5.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--paper);
  text-decoration: none;
}

.foot-mark:hover {
  color: var(--wine-soft);
}

.foot-nav {
  flex: 1 1 260px;
  max-width: 560px;
}

.foot-nav dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.6rem;
  margin: 0;
}

.foot-nav dt {
  margin: 0;
  font-size: 1rem;
}

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

.foot-nav dt a:hover {
  color: var(--wine-soft);
  border-color: var(--wine-soft);
}

.foot-nav dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(244, 239, 230, 0.6);
}

.foot-copy {
  flex: 0 0 auto;
  margin: 0;
  align-self: flex-end;
  font-size: 1rem;
  color: rgba(244, 239, 230, 0.66);
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: clamp(0.75rem, 3vw, 1.5rem);
  bottom: 1rem;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.05rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 16px 28px -18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* 滚动触发 */
.will-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.will-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    margin-top: 2.4rem;
  }

  .hero {
    min-height: 62vh;
  }

  .hero-inner {
    flex-direction: column;
    align-items: flex-end;
    gap: 1.1rem;
  }

  .hero-lead {
    margin-left: auto;
  }

  .anchors::after {
    width: 18px;
  }
}

@media (max-width: 560px) {
  .ticker {
    letter-spacing: 0.1em;
  }

  .ticker-rule {
    width: 24px;
  }

  .foot-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .foot-nav {
    width: 100%;
  }

  .foot-nav dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-copy {
    align-self: flex-start;
  }

  .to-top {
    bottom: 0.75rem;
  }
}

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

  .will-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .to-top {
    transition: none;
  }
}

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