:root {
  color-scheme: light;
  --ink: #211f1c;
  --muted: #615a52;
  --paper: #f7f5f1;
  --line: #e3ddd5;
  --accent: #973e2d;
  --dark: #181817;
  --serif: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 3px solid #b45942; outline-offset: 3px; }
.wrap { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.top, footer { background: var(--dark); color: #f5efe7; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; gap: 9px; align-items: center; font-weight: 700; white-space: nowrap; letter-spacing: .09em; }
.mark { color: #eca986; font-size: 1.45rem; line-height: 1; }
nav { display: flex; align-items: center; gap: 30px; font-size: .94rem; }
nav a { color: #ded8d0; padding-block: 12px; }
nav a[aria-current="page"] { color: #ffc3a6; }
.hero { color: #fff; background: #272a25 url('/hero.jpg') center 55% / cover; position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #191714dd, #1c1a1691 37%, #1b1a1518 75%), linear-gradient(0deg, #1b18155e, transparent 65%); z-index: -1; }
.hero-inner { min-height: clamp(470px, 43vw, 630px); display: flex; align-items: end; padding-block: clamp(55px, 7vw, 104px); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.hero-link { padding-block: 12px; text-decoration: underline; text-underline-offset: 5px; }
.eyebrow, .kicker { font-weight: 700; font-size: .82rem; letter-spacing: .18em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #ffe6d4; margin: 0 0 18px; }
.eyebrow span { background: #eca986; width: 24px; height: 2px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.hero h1 { font-family: var(--serif); font-size: clamp(4rem, 8.2vw, 7.7rem); letter-spacing: .025em; line-height: 1.08; margin: 0; }
.hero-copy > p:not(.eyebrow) { font-size: clamp(1rem, 1.8vw, 1.15rem); line-height: 1.9; color: #faf1e8; margin: 18px 0 24px; }
.button { border: 1px solid transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 17px; font-weight: 650; background: var(--accent); color: white; }
.button:hover:not(:disabled) { filter: brightness(1.12); }
.button.light { color: #241d17; background: #fff1e3; padding-inline: 20px; }
.button.secondary { color: var(--accent); background: #fff; border-color: var(--line); }
.gallery, .inner { padding-block: clamp(48px, 6vw, 84px) 76px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 25px; }
.gallery-count { margin: 8px 0 0; color: var(--muted); font-size: .88rem; }
.kicker { color: var(--accent); margin: 0 0 9px; }
.section-head h2, .inner > h1 { font: 700 clamp(2.3rem, 4.4vw, 3.7rem) / 1.12 var(--serif); margin: 0; }
.rule, .intro, .optional, small { color: var(--muted); }
.rule { margin: 0; font-size: .9rem; }
.intro { line-height: 1.7; margin: 14px 0 27px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-block: 1px solid var(--line); padding-block: 9px; margin-bottom: 24px; }
.filters { display: flex; align-items: center; gap: 5px; }
.filter { min-height: 44px; padding: 6px 16px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; }
.filter:hover { background: #eee8e0; }
.filter[aria-pressed="true"] { color: #fff; background: var(--dark); }
select { min-height: 44px; color: var(--ink); background: #fffdf9; border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; }
.pagination { justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.empty { grid-column: 1 / -1; border: 1px dashed #c7bdb1; background: #f0ebe4; padding: 40px 18px; border-radius: 12px; text-align: center; }
.empty h3 { margin: 0; font-size: 1.15rem; }
.empty p { color: var(--muted); margin: 9px 0 0; }
.card, .panel { background: #fffdf9; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.card { display: flex; flex-direction: column; box-shadow: 0 5px 15px #3a2a1910; }
.card-visual { position: relative; background: var(--dark); }
.media-type { position: absolute; top: 12px; left: 12px; padding: 4px 8px; border-radius: 4px; color: #fff; background: #201c19db; font-size: .84rem; pointer-events: none; }
.card-media { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--dark); object-fit: cover; }
.media-button { display: block; width: 100%; border: 0; padding: 0; }
.card-copy { padding: 18px; }
.card > .card-copy { display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 5px; font: 700 1.27rem / 1.4 var(--serif); }
.entry-title { appearance: none; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: start; }
.entry-title:hover { text-decoration: underline; text-underline-offset: 4px; }
.meta, .card-copy p { color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vote-actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.vote-total { display: inline-flex; align-items: baseline; gap: 5px; color: var(--muted); }
.vote-total strong { color: var(--ink); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.vote-button { min-width: 102px; }
.panel { padding: clamp(16px, 4vw, 28px); max-width: 585px; }
#admin-list > .panel { grid-column: 1 / -1; width: 100%; }
.form { display: grid; gap: 15px; }
.form h2 { margin: 0; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form input, .form textarea { width: 100%; border: 1px solid #bdc4b7; border-radius: 7px; padding: 10px 11px; color: var(--ink); background: #fff; }
.form textarea { resize: vertical; }
.form small { font-size: .875rem; font-weight: 400; }
.form .button { justify-self: start; }
.file { border: 1px dashed #adb7a6; padding: 12px; border-radius: 8px; }
.list-title { margin-block: 32px 14px; }
.account-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; overflow-wrap: anywhere; }
.feedback { color: #38562f; margin: 0 0 12px; line-height: 1.5; }
.feedback:empty { display: none; }
.feedback.error { color: #963929; }
.footer { display: grid; place-items: center; min-height: 72px; font-size: .89rem; color: #dfd6cc; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
dialog { width: min(760px, calc(100% - 28px)); max-height: 90vh; overflow: auto; padding: 0; border: 0; border-radius: 12px; }
dialog::backdrop { background: #101610b8; }
#confirm { width: min(400px, calc(100% - 28px)); }
.confirm { padding: 24px; }
.confirm h2 { margin: 0; }
.confirm p { line-height: 1.6; }
.confirm .actions { justify-content: end; }
#preview { inset: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; background: #131211; color: #fff8f0; overflow: hidden; }
.viewer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.viewer-header, .viewer-info { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px clamp(16px, 4vw, 56px); background: #201d1a; }
.viewer-header { border-bottom: 1px solid #ffffff1d; padding-top: max(12px, env(safe-area-inset-top)); }
.viewer-heading { min-width: 0; }
.viewer-heading h2 { margin: 0; font: 700 clamp(1.05rem, 2.7vw, 1.55rem) / 1.35 var(--serif); }
.viewer-heading p { margin: 4px 0 0; font-size: .875rem; color: #d8ccc0; }
.viewer-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.viewer-control { min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid #ffffff40; border-radius: 6px; color: inherit; background: #ffffff0a; white-space: nowrap; }
.viewer-control:hover { background: #ffffff20; }
.viewer-close { font-size: 1.6rem; line-height: 1; }
.viewer-stage { display: flex; min-height: 0; overflow: hidden; }
.preview-media { display: block; flex: none; width: 100%; height: 100%; object-fit: contain; }
.viewer-stage.zoomed { overflow: auto; overscroll-behavior: contain; }
.viewer-stage.zoomed img { width: 155%; height: auto; align-self: start; }
.viewer-info { justify-content: end; border-top: 1px solid #ffffff1d; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.viewer-info p { margin: 0 auto 0 0; max-height: min(20dvh, 120px); overflow: auto; color: #e6dbce; font-size: .9rem; line-height: 1.55; }
.viewer-info .button { flex: none; min-width: 92px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
  .wrap { width: calc(100% - 36px); }
  .nav { min-height: 58px; }
  nav { gap: 11px; font-size: .875rem; }
  .brand { gap: 5px; letter-spacing: .02em; }
  .hero { background-position: 60% center; }
  .hero::before { background: linear-gradient(0deg, #181512ef 5%, #1b181576 58%, #1b181517 100%); }
  .hero-inner { min-height: 418px; padding-block: 36px; }
  .hero h1 { font-size: clamp(3rem, 13vw, 4.25rem); }
  .gallery, .inner { padding-block: 36px 48px; }
  .section-head { align-items: start; flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .filter { padding-inline: 10px; }
  .viewer-header, .viewer-info { gap: 10px; }
  .viewer-controls { gap: 5px; }
}
