:root {
  --paper: #f2ead9;
  --paper-2: #ece1cd;
  --card: #f7f0e3;
  --ink: #2c2824;
  --muted: #7c756d;
  --line: #d4cdbd;
  --accent: #9a5b56;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Static memory articles share the exact default reading face used by the
   appreciation articles. Other reader-selected font modes continue to come
   from responsive.css through the inherited --reading-cn variable. */
html:not([data-reading-font]) body,
html[data-reading-font="serif"] body {
  --reading-cn: "Songti SC", "STSong", "Jianshang Appreciation Serif", "Jianshang Serif", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --reading-weight: 400;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--reading-cn, "Songti SC", "STSong", "Jianshang Appreciation Serif", "Jianshang Serif", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif);
  font-size: 18px;
  line-height: 1.95;
  letter-spacing: .015em;
  animation: gentle-enter 280ms var(--ease) both;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

.brand { color: var(--ink); font-weight: 650; text-decoration: none; }
.topbar button {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 11px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.article {
  width: min(100% - 48px, 760px);
  margin: auto;
  padding: clamp(62px, 9vw, 110px) 0 100px;
}

.masthead {
  margin: 0 auto 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}
.masthead h1 {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  text-align: center;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: .08em;
}
.deck {
  margin: 19px auto 0;
  width: fit-content;
  max-width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

/* The embedded serif's quotation marks have asymmetric side bearings at
   display sizes. Apply a small desktop-only optical correction so the large
   title and its smaller deck share the same visible centre line. */
@media (min-width: 761px) {
  .masthead h1,
  .masthead .deck { transform: translateX(.36em); }
}
.subtitle {
  margin: 18px auto 0;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-size: 12px;
  letter-spacing: .04em;
}
.rule { width: 42px; height: 1px; margin: 27px auto 0; background: var(--accent); }
p { margin: 0 0 1.52em; }
.lead::first-letter {
  float: left;
  margin: .12em .12em 0 0;
  color: var(--accent);
  font-size: 3.45em;
  line-height: .8;
  font-weight: 500;
}

@keyframes gentle-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

body.night {
  --paper: #1b1a18;
  --paper-2: #24211d;
  --card: #24211d;
  --ink: #ece7de;
  --muted: #b7afa4;
  --line: #565047;
  --accent: #d38a83;
}

/* QQ and other embedded WebViews should only darken the page after a reader
   explicitly selects night mode. */
html { color-scheme: light; background: var(--paper); }
html:has(body.night) { color-scheme: dark; }

@media (max-width: 700px) {
  body { font-size: 17px; line-height: 1.92; }
  .article { width: min(100% - 38px, 760px); padding-top: 58px; }
  .masthead { margin-bottom: 50px; }
  .masthead h1 { font-size: clamp(35px, 11vw, 48px); }
  .deck { font-size: 15px; }
  .subtitle { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
