:root {
  --blotter: #6d8478;
  --blotter-deep: #55685e;
  --paper: #f6f3ea;
  --paper-rule: rgba(74, 92, 78, 0.11);
  --ink: #1d2a24;
  --ink-soft: #4e5f56;
  --spine: #3e6a58;
  --indigo: #2c4a62;
  --cinnabar: #b23a32;
  --cinnabar-soft: #c45c4a;
  --gold: #8a7344;
  --line: rgba(29, 42, 36, 0.14);
  --chip: #e7efe8;
  --font-zh: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC",
    "SimSun", serif;
  --font-en: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman",
    serif;
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei",
    "Segoe UI", sans-serif;
  --shadow: 0 18px 50px rgba(28, 40, 34, 0.28), 0 2px 0 rgba(255, 255, 255, 0.18) inset;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(180deg, var(--blotter) 0%, var(--blotter-deep) 100%);
  line-height: 1.6;
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 40px;
}

.preview-bar {
  width: min(720px, 100%);
  margin-bottom: 14px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: rgba(246, 243, 234, 0.88);
  border: 1px solid rgba(29, 42, 36, 0.12);
  font-size: 12px;
  color: var(--ink-soft);
}

.preview-bar[hidden] {
  display: none;
}

.preview-bar strong {
  font-weight: 600;
  color: var(--ink);
  margin-right: 4px;
}

.preview-bar button,
.preview-link {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  text-decoration: none;
}

.preview-bar button[aria-pressed="true"],
.preview-link.is-active,
.preview-link[aria-current="page"] {
  background: var(--indigo);
  color: #f4f7f2;
  border-color: var(--indigo);
}

.card {
  position: relative;
  width: min(720px, 100%);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 33px,
    var(--paper-rule) 33px,
    var(--paper-rule) 34px
  );
  background-position: 0 168px;
  box-shadow: var(--shadow);
  padding: 36px 40px 28px;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(180deg, #3e6a58, #2c4a62 70%);
}

.mast {
  position: relative;
  padding-bottom: 22px;
  padding-right: 96px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, var(--paper) 70%, transparent);
}

.kicker {
  margin: 0 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: none;
  color: var(--gold);
  font-family: var(--font-ui);
}

.kicker span[lang="en"] {
  letter-spacing: 0.14em;
  font-family: var(--font-en);
  font-style: italic;
  text-transform: lowercase;
}

.mast h1 {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: end;
  gap: 8px;
  font-weight: 600;
}

.mast h1 [lang="zh"] {
  font-family: var(--font-zh);
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  line-height: 1.05;
  letter-spacing: 0.12em;
}

.mast h1 [lang="en"] {
  font-family: var(--font-en);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  color: var(--indigo);
  letter-spacing: 0.01em;
}

html[data-bias="zh"] .mast h1 [lang="zh"] {
  letter-spacing: 0.18em;
}

html[data-bias="bilingual"] .mast h1 [lang="en"] {
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
}

.slash {
  justify-self: center;
  width: 1px;
  height: 3.2em;
  background: var(--spine);
  opacity: 0.7;
}

.lede {
  margin: 22px 0 0;
  max-width: 38em;
  font-family: var(--font-zh);
  font-size: 16px;
  color: var(--ink);
}

.lede-en {
  margin: 6px 0 0;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
}

.seal {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 84px;
  height: 84px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  padding: 10px 0 8px;
  color: var(--cinnabar);
  border: 3px solid var(--cinnabar);
  box-shadow: inset 0 0 0 1px var(--cinnabar);
  transform: rotate(-8deg);
  background: rgba(246, 243, 234, 0.72);
  pointer-events: none;
}

.seal::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--cinnabar-soft);
}

.seal span {
  position: relative;
  z-index: 1;
  font-family: var(--font-zh);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .seal {
    animation: stamp 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-11deg) scale(1.18) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: rotate(-11deg) scale(1) translateY(0);
  }
}

.topics {
  list-style: none;
  margin: 22px 0 0;
  padding: 8px 0 4px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.topics li {
  padding: 16px 12px 14px 0;
}

.topics li + li {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.topics b {
  display: block;
  font-family: var(--font-zh);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.topics > li > span {
  display: block;
  margin-top: 4px;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}

.blurb {
  margin: 10px 0 0;
  font-family: var(--font-zh);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

.blurb-en {
  margin: 4px 0 0;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
}

.about {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.about p,
.entry p {
  margin: 0;
  max-width: 38em;
  font-family: var(--font-zh);
  font-size: 16px;
  line-height: 1.8;
}

.about .en,
.entry .en {
  margin-top: 8px;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
}

.entries {
  margin-top: 8px;
}

.entry {
  padding: 18px 0;
  border-top: 1px dashed var(--line);
}

.entry .entry-meta {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-family: var(--font-ui);
}

.entry-meta span[lang="en"] {
  margin-left: 6px;
  font-family: var(--font-en);
  font-style: italic;
  letter-spacing: 0.02em;
}

.closing {
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-zh);
  font-size: 15px;
  color: var(--ink-soft);
}

.closing span[lang="en"] {
  display: block;
  margin-top: 4px;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 13px;
}

.foot-id {
  color: inherit;
  text-decoration: none;
  font-family: var(--font-ui);
}

.foot-id:hover {
  color: var(--ink);
  text-decoration: underline;
}

.note {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.note[hidden] {
  display: none;
}

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.colophon a {
  color: inherit;
  text-decoration: none;
}

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

.host-pill {
  font-family: var(--font-en);
  letter-spacing: 0.02em;
}

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

@media (max-width: 640px) {
  .card {
    padding: 28px 22px 22px;
  }

  .seal {
    width: 64px;
    height: 64px;
    top: 18px;
    right: 16px;
  }

  .seal span {
    font-size: 14px;
    letter-spacing: 0.18em;
  }

  .mast h1 {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-right: 72px;
  }

  .slash {
    width: 3.2em;
    height: 1px;
    justify-self: start;
  }

  .topics {
    grid-template-columns: 1fr;
  }

  .topics li + li {
    padding-left: 0;
    border-left: 0;
    border-top: 1px dashed var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .seal {
    animation: none;
  }
}

@media print {
  body {
    background: #fff;
  }

  .stage {
    padding: 0;
  }

  .preview-bar,
  .seal {
    display: none !important;
  }

  .card {
    width: 100%;
    box-shadow: none;
    background-image: none;
  }
}
