@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Noto+Serif+SC:wght@400;600;700&family=ZCOOL+XiaoWei&display=swap");

:root {
  --ink: #1b1b1b;
  --ink-soft: #3a3a3a;
  --rule: #cfc6b4;
  --rule-strong: #b9ae98;
  --paper: #f4ead8;
  --stage: #2c2a27;
  --stage-2: #1f1d1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Serif SC", "Songti SC", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 20% -10%, #3a3530 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 100%, #3f3328 0%, transparent 50%),
    var(--stage-2);
}

.wrap {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 42px;
  color: #efe7d8;
}

.kicker {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
  color: #cbbfa8;
  margin: 0 0 12px;
}

h1 {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 54px;
  line-height: 1.12;
  font-weight: 400;
  margin: 0 0 14px;
}

.lead {
  max-width: 640px;
  font-size: 16px;
  line-height: 1.85;
  color: #d8d0c2;
  margin: 0;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #cfc4b0;
  text-align: right;
}

.meta b {
  color: #f3eadc;
  font-weight: 600;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 28px;
  align-items: center;
}

.toolbar button {
  appearance: none;
  border: 1px solid #8a7f6d;
  background: transparent;
  color: #efe7d8;
  font-family: "Noto Serif SC", serif;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}

.toolbar button.active,
.toolbar button:hover {
  background: #efe7d8;
  color: #1b1b1b;
}

.unit-edit {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cfc4b0;
  font-size: 13px;
}

.unit-edit input {
  width: 180px;
  border: 1px solid #8a7f6d;
  background: transparent;
  color: #efe7d8;
  font-family: "Noto Serif SC", serif;
  font-size: 13px;
  padding: 8px 10px;
}

.unit-edit input:focus {
  outline: 1px solid #efe7d8;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.caption {
  color: #c9bfae;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.page {
  position: relative;
  width: 100%;
  aspect-ratio: 148 / 210;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 18%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      var(--rule) 27px,
      var(--rule) 28px
    );
  background-position: 0 86px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(90, 74, 52, 0.12);
  overflow: hidden;
}

.page.dots {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 18%),
    radial-gradient(circle, var(--rule-strong) 0.7px, transparent 0.8px);
  background-size: auto, 14px 14px;
  background-position: 0 0, 22px 92px;
}

.page.blank {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 18%);
}

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(160, 130, 90, 0.08), transparent 40%),
    radial-gradient(80% 60% at 0% 100%, rgba(80, 60, 40, 0.08), transparent 45%);
}

.head {
  position: relative;
  z-index: 2;
  padding: 16px 18px 8px;
}

.brand {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.unit {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 18px;
  letter-spacing: 0.18em;
}

.unit small {
  display: block;
  margin-top: 4px;
  font-family: "Cormorant Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.folio {
  font-family: "Cormorant Garamond", serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  text-align: right;
}

.rules {
  margin-top: 8px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 6px 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.4fr;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-soft);
}

.rules span {
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
}

.margin {
  position: absolute;
  top: 86px;
  bottom: 28px;
  left: 34px;
  width: 1px;
  background: #c4a090;
  opacity: 0.55;
  z-index: 2;
}

.ornament {
  position: absolute;
  right: 14px;
  bottom: 22px;
  width: 108px;
  height: 82px;
  z-index: 3;
  opacity: 0.82;
  pointer-events: none;
}

.ornament.tall {
  width: 76px;
  height: 100px;
}

.ornament.wide {
  width: 124px;
  height: 70px;
}

.ornament.dense {
  width: 86px;
  height: 86px;
  opacity: 0.58;
}

.ornament svg,
.ornament img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: right bottom;
  mix-blend-mode: multiply;
}

.plate {
  position: absolute;
  right: 16px;
  bottom: 10px;
  z-index: 3;
  font-family: "Cormorant Garamond", serif;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #7d7466;
}

.stamp {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
  height: 36px;
  z-index: 3;
  opacity: 0.72;
}

.foot-note {
  margin-top: 36px;
  color: #b7ad9c;
  font-size: 13px;
  line-height: 1.8;
}

@media (max-width: 980px) {
  .hero,
  .gallery {
    grid-template-columns: 1fr;
  }

  .meta {
    text-align: left;
  }

  h1 {
    font-size: 40px;
  }

  .unit-edit {
    margin-left: 0;
  }
}

@media print {
  body {
    background: white;
  }

  .hero,
  .toolbar,
  .caption,
  .foot-note {
    display: none;
  }

  .wrap {
    width: auto;
    padding: 0;
  }

  .gallery {
    display: block;
  }

  .sheet {
    break-after: page;
  }

  .page {
    width: 148mm;
    height: 210mm;
    box-shadow: none;
  }
}
