:root {
  --red-950: #2a0606;
  --red-900: #3d0909;
  --red-800: #5a0e0e;
  --red-700: #7a1414;
  --gold: #e3b54f;
  --gold-soft: #f1d58e;
  --ink: #fbf3e4;
  --muted: #d9c3a3;
  --line: rgba(227, 181, 79, 0.28);
  --serif: "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}
* { box-sizing: border-box; }
html { background: var(--red-950); }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, var(--red-700), transparent 70%),
    linear-gradient(var(--red-900), var(--red-950) 60%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold-soft); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h2 {
  font: 600 clamp(22px, 2.6vw, 30px)/1.2 var(--serif);
  color: var(--gold);
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}
section, .hero, footer { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: min(88vh, 860px);
  padding-block: clamp(40px, 8vw, 96px);
}
.kicker { margin: 0 0 18px; color: var(--muted); letter-spacing: 0.06em; font-size: 15px; }
h1 { margin: 0; line-height: 1; }
h1 .zh {
  display: block;
  font: 700 clamp(56px, 8.4vw, 132px)/1 var(--serif);
  white-space: nowrap;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
h1 .en {
  display: block;
  margin-top: 22px;
  font: 500 clamp(26px, 3.4vw, 40px)/1.15 var(--serif);
  color: var(--ink);
}
.honoree { margin: 22px 0 6px; font: 600 clamp(20px, 2.2vw, 26px)/1.3 var(--serif); color: var(--gold-soft); }
.date { margin: 0; color: var(--muted); font-size: 16px; letter-spacing: 0.08em; }
.hero-photo {
  margin: 0;
  justify-self: end;
  width: min(100%, 420px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.hero-photo img { border-radius: 3px; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* Gallery */
.gallery { padding-block: clamp(32px, 6vw, 72px); border-top: 1px solid var(--line); }
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
}
.tile {
  position: relative; display: block; width: 100%;
  padding: 0; border: 1px solid var(--line); border-radius: 4px;
  background: var(--red-900); cursor: zoom-in; overflow: hidden;
}
.tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform 0.4s ease; }
.tile:hover img { transform: scale(1.03); }
.tile .num {
  position: absolute; left: 8px; bottom: 8px;
  padding: 2px 8px; border-radius: 3px;
  background: rgba(42, 6, 6, 0.78); color: var(--gold-soft);
  font: 12px/1.6 var(--mono);
}

/* Note */
.note {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(40px, 7vw, 88px);
  border-top: 1px solid var(--line);
}
.note h2 { margin-bottom: 6px; font-family: var(--mono); font-weight: 600; }
.note-title { margin: 0 0 22px; font: 500 20px/1.3 var(--serif); color: var(--gold-soft); }
dl { margin: 0 0 26px; display: grid; gap: 10px; }
dl div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 14px; }
dd { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { width: 120px; height: auto; border-radius: 2px; image-rendering: auto; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 4px;
  background: var(--gold); color: var(--red-950); font-weight: 600; text-decoration: none; font-size: 15px;
}
.btn:hover { background: var(--gold-soft); }
.note-frame {
  height: 830px; width: 100%;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: var(--red-950); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.note-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Ledger */
.ledger { padding-block: clamp(32px, 6vw, 72px); border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.id a { font-family: var(--mono); font-size: 13px; }

footer { padding-block: 40px 56px; color: var(--muted); font-size: 13px; text-align: center; border-top: 1px solid var(--line); }
footer p { margin: 0; letter-spacing: 0.1em; }

/* Viewer */
dialog {
  padding: 0; border: 0; background: transparent; color: var(--ink);
  max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0;
}
dialog::backdrop { background: rgba(20, 3, 3, 0.97); }
dialog[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
#v-img { max-width: min(92vw, 720px); max-height: calc(100vh - 110px); width: auto; height: auto; border-radius: 4px; box-shadow: 0 20px 70px rgba(0, 0, 0, 0.6); }
.v-bar { display: flex; align-items: center; gap: 14px; }
.v-bar button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--gold-soft);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.v-bar button:hover { background: rgba(227, 181, 79, 0.15); }
#v-num { color: var(--gold-soft); font-size: 14px; min-width: 110px; text-align: center; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero-photo { justify-self: center; width: min(100%, 340px); order: -1; }
  .note { grid-template-columns: 1fr; }
  .note-frame { height: 800px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  dl div { grid-template-columns: 90px 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } }
