:root {
  font-family:
    system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;
  color: #e9e1d5;
  background: #191516;
  --gold: #d4b982;
  --muted: #ad9f95;
  --panel: #251e1f;
  --line: #51403b;
  --accent: #563338;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
.capacity-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0;
  font-size: 13px;
}
.capacity-summary span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.support-entry {
  margin: 12px 0;
}
.support-image {
  display: block;
  max-width: min(100%, 360px);
  max-height: 420px;
  object-fit: contain;
  margin: 12px auto;
}
.support-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body {
  margin: 0;
}
a {
  color: var(--gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-block;
  border: 1px solid var(--line);
  background: #332829;
  color: #eee4d7;
  padding: 10px 16px;
  border-radius: 5px;
  cursor: pointer;
  min-height: 44px;
  text-align: center;
}
button:hover,
.button:hover {
  background: #4a3536;
  text-decoration: none;
}
button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #241a18;
  font-weight: 600;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.danger {
  color: #ffb5ae;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #191516;
  color: #eee4d7;
  padding: 11px;
  margin-top: 7px;
  min-height: 44px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
label {
  display: block;
  font-size: 14px;
  color: #d1c5b8;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0 7px 0 0;
  vertical-align: middle;
}
input[type="file"] {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid #e4c58e;
  outline-offset: 3px;
}
.top {
  display: flex;
  gap: 30px;
  align-items: center;
  max-width: 1280px;
  margin: auto;
  padding: 24px 32px;
}
.brand {
  font-family: serif;
  font-size: 27px;
  color: var(--gold);
  letter-spacing: 5px;
  white-space: nowrap;
}
.brand span {
  display: block;
  font-family: system-ui;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 4px;
}
nav {
  display: flex;
  gap: 24px;
  flex: 1;
  font-size: 14px;
}
nav a {
  color: #bcaea2;
}
nav a.active {
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}
#identity {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
#identity button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}
.mode {
  text-align: center;
  background: #302322;
  border-block: 1px solid #483431;
  color: #cdb49a;
  font-size: 12px;
  padding: 9px 12px;
}
main#app {
  max-width: 1216px;
  margin: auto;
  padding: 36px 24px 60px;
  min-height: 76vh;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 2px;
}
h2 {
  font-family: serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 22px;
}
h3 {
  font-size: 17px;
  font-weight: 500;
}
p {
  line-height: 1.9;
}
.muted,
small {
  color: var(--muted);
}
small {
  line-height: 1.7;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 14px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.heading h1 {
  margin-bottom: 7px;
}
.heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 25px;
  border-radius: 6px;
  min-width: 0;
}
.stack {
  display: grid;
  gap: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.spread {
  justify-content: space-between;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full {
  grid-column: 1/-1;
}
.form {
  display: grid;
  gap: 17px;
}
.badge {
  display: inline-flex;
  font-size: 11px;
  border: 1px solid #665644;
  border-radius: 20px;
  padding: 4px 10px;
  color: #d6bd90;
  white-space: nowrap;
}
.badge.gray {
  color: #bcaea2;
  border-color: var(--line);
}
.empty {
  text-align: center;
  padding: 38px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.notice {
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  background: #352924;
  color: #d0bd9e;
  font-size: 13px;
  line-height: 1.8;
}
.error {
  color: #ffb8ac;
}
.metric {
  font-size: 32px;
  font-family: Georgia, serif;
  color: var(--gold);
  margin: 10px 0 4px;
}
.metric small {
  font: 12px system-ui;
  margin-left: 10px;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  margin: 22px 0;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  font-size: 14px;
  padding: 14px 20px;
  color: var(--muted);
}
.tabs button.selected {
  border-color: var(--gold);
  color: var(--gold);
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
td,
th {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-weight: 400;
}
td.wrap {
  white-space: normal;
  min-width: 160px;
}
table button {
  padding: 6px 10px;
  min-height: 34px;
  font-size: 12px;
}
progress {
  width: 100%;
  height: 7px;
  accent-color: var(--gold);
  margin: 15px 0;
}
code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.login {
  max-width: 430px;
  margin: 30px auto;
}
.login h1 {
  font-family: serif;
}
.login .eyebrow {
  margin-top: 12px;
}
.login .notice {
  margin-bottom: 24px;
}
.hall-card {
  border-top: 2px solid #927659;
}
.hall-card h2 {
  margin-top: 18px;
}
.hall-card .row {
  margin-top: 16px;
}
.hall-card .button {
  font-size: 13px;
  flex: 1;
}
.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 26px;
}
.sidebar {
  align-self: start;
  position: sticky;
  top: 20px;
}
.sidebar h2 {
  font-size: 18px;
  margin-bottom: 15px;
}
.sidebar select {
  margin: 0 0 15px;
}
.sidebar button {
  display: block;
  text-align: left;
  border: none;
  width: 100%;
  background: none;
  font-size: 14px;
  color: var(--muted);
}
.sidebar button.selected {
  background: #3d2b2c;
  color: var(--gold);
  border-left: 2px solid var(--gold);
}
.album {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.media-card {
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 4px;
}
.media-card img,
.media-card video {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #181414;
  border-radius: 3px;
}
.media-card .row {
  margin-top: 12px;
}
.media-card button {
  font-size: 12px;
  padding: 7px 9px;
}
.media-wait {
  height: 160px;
  display: grid;
  place-content: center;
  color: var(--muted);
  font-size: 13px;
}
.entry {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child {
  border-bottom: 0;
}
.entry p {
  margin: 10px 0;
  white-space: pre-wrap;
  font-size: 14px;
}
.entry .reply {
  border-left: 2px solid #967b59;
  padding-left: 15px;
  color: #ccba9e;
}
.timeline {
  border-left: 1px solid #80694c;
  padding-left: 24px;
  margin-left: 5px;
}
.timeline .entry {
  position: relative;
}
.timeline .entry:before {
  content: "";
  position: absolute;
  left: -29px;
  top: 24px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 100%;
}
.timeline time {
  color: var(--gold);
  font-size: 13px;
}
.visit {
  max-width: 800px;
  margin: auto;
}
.sanctuary {
  background:
    radial-gradient(
      ellipse at 50% 30%,
      var(--hall-glow, #623c31),
      transparent 65%
    ),
    linear-gradient(140deg, var(--hall-bg, #281b1b), #171515);
  border: 1px solid #806749;
  padding: 40px 28px 28px;
  text-align: center;
  position: relative;
  isolation: isolate;
}
.sanctuary .eyebrow {
  letter-spacing: 6px;
  font-family: serif;
}
.sanctuary .portrait {
  width: 128px;
  height: 160px;
  margin: 25px auto 22px;
  border: 1px solid #ab8c61;
  padding: 6px;
  box-shadow: 0 0 0 6px #1a1515;
  display: grid;
  place-content: center;
  font-family: serif;
  font-size: 42px;
  color: #c9b992;
  background: #2f2725;
  overflow: hidden;
}
.portrait img {
  width: 114px;
  height: 146px;
  object-fit: cover;
  filter: grayscale(1);
}
.sanctuary h1 {
  font-family: serif;
  font-size: 32px;
  letter-spacing: 5px;
  margin-bottom: 14px;
}
.sanctuary .dates {
  font-family: Georgia, serif;
  letter-spacing: 2px;
  color: #c5b7a3;
  font-size: 15px;
}
.sanctuary .epitaph {
  color: #ded0b9;
  max-width: 480px;
  margin: 24px auto 0;
  font-family: serif;
  letter-spacing: 2px;
  font-size: 15px;
  line-height: 2;
}
.hall-tools {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 25px 0 0;
}
.hall-tools button {
  font-size: 12px;
  min-height: 36px;
  background: #241b1dcc;
}
.offering-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.offering-list button {
  padding: 18px 5px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  background: #2a2221;
}
.offering-list .offering-symbol {
  font-family: serif;
  font-size: 25px;
  color: var(--gold);
}
.offering-list small {
  font-size: 11px;
}
.entitlement {
  margin: 20px 0;
  padding: 13px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: #d6c19a;
  text-align: left;
  line-height: 2;
}
.tab-panel {
  padding: 25px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
}
.visit .tabs {
  margin-bottom: 0;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.theme-option {
  font-family: serif;
  min-height: 80px;
  border: 1px solid var(--line);
}
.theme-option.selected {
  border: 2px solid var(--gold);
}
.theme-0 {
  --hall-bg: #281b1b;
  --hall-glow: #623c31;
}
.theme-1 {
  --hall-bg: #1e1c19;
  --hall-glow: #625238;
}
.theme-2 {
  --hall-bg: #22201c;
  --hall-glow: #5a584b;
}
.theme-3 {
  --hall-bg: #20191c;
  --hall-glow: #5a3743;
}
.theme-4 {
  --hall-bg: #211b17;
  --hall-glow: #6c4e31;
}
.theme-5 {
  --hall-bg: #191d1c;
  --hall-glow: #3c5550;
}
.theme-6 {
  --hall-bg: #1e1d26;
  --hall-glow: #464052;
}
.theme-7 {
  --hall-bg: #211f1e;
  --hall-glow: #645d50;
}
.theme-8 {
  --hall-bg: #1a1a1a;
  --hall-glow: #4c4332;
}
.theme-option {
  background: linear-gradient(130deg, var(--hall-glow), var(--hall-bg));
}
.qr {
  max-width: 240px;
  background: white;
  padding: 8px;
  display: block;
  margin: 20px auto;
}
dialog {
  width: 560px;
  max-width: calc(100vw - 30px);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid #7d6549;
  border-radius: 7px;
  background: #251e1f;
  color: #e9e1d5;
  padding: 34px;
}
dialog::backdrop {
  background: #000a;
}
.close {
  position: absolute;
  right: 8px;
  top: 5px;
  border: 0;
  background: none;
  font-size: 24px;
  min-height: 32px;
  padding: 0 8px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: #e0c798;
  color: #2c201b;
  border-radius: 5px;
  max-width: 90vw;
  z-index: 20;
  display: none;
  font-size: 14px;
  box-shadow: 0 8px 30px #0005;
}
#toast.show {
  display: block;
}
.poster-canvas {
  width: 100%;
  height: auto;
}
.firecracker-effect {
  animation: glow 0.15s ease-in-out 8;
}
.prayer-active {
  animation: breathe 3s ease-in-out infinite;
}
@keyframes glow {
  50% {
    box-shadow: inset 0 0 60px #daa96477;
  }
}
@keyframes breathe {
  50% {
    box-shadow: inset 0 0 50px #cdb17933;
  }
}
footer {
  max-width: 1216px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 25px;
  color: #947f6e;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
button.link {
  border: 0;
  background: none;
  color: var(--gold);
  padding: 0;
  min-height: 30px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.chart-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  margin: 12px 0;
}
.chart-row meter {
  width: 100%;
  height: 16px;
}
.audio-note {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .sidebar .side-tabs {
    display: flex;
    overflow: auto;
  }
  .sidebar button {
    white-space: nowrap;
    width: auto;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .top {
    padding: 18px 22px;
    gap: 20px;
  }
  nav {
    gap: 14px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .top {
    padding: 16px;
    gap: 15px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 22px;
  }
  .brand span {
    font-size: 9px;
  }
  nav {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
    font-size: 12px;
  }
  #identity {
    margin-left: auto;
  }
  .mode {
    font-size: 10px;
  }
  main#app {
    padding: 22px 14px 36px;
  }
  h1 {
    font-size: 26px;
  }
  .heading {
    align-items: flex-start;
  }
  .heading .row {
    justify-content: flex-end;
  }
  .heading p {
    font-size: 12px;
  }
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .album {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .media-card img,
  .media-card video,
  .media-wait {
    height: 120px;
  }
  .tabs button {
    padding: 12px 16px;
  }
  .sanctuary {
    padding: 32px 16px 22px;
  }
  .sanctuary h1 {
    font-size: 29px;
  }
  .tab-panel {
    padding: 20px 16px;
  }
  .offering-list {
    gap: 7px;
  }
  .offering-list button {
    font-size: 12px;
  }
  .offering-list .offering-symbol {
    font-size: 22px;
  }
  .stat-grid {
    gap: 10px;
  }
  .stat-grid .card {
    padding: 17px;
  }
  .metric {
    font-size: 28px;
  }
  .field-grid .full {
    grid-column: auto;
  }
  .theme-options {
    gap: 7px;
  }
  .theme-option {
    padding: 10px 3px;
    font-size: 12px;
  }
  .hall-tools {
    gap: 7px;
  }
  .hall-tools button {
    padding: 8px 10px;
  }
  .sidebar {
    padding: 15px;
  }
  .notice {
    font-size: 12px;
  }
  .table-wrap {
    max-width: 100%;
  }
  footer {
    padding: 20px 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
.sanctuary {
  overflow: hidden;
  min-height: 610px;
  padding-top: 100px;
  background: #211816;
}
.sanctuary::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#15101044, #15101022 45%, #151010aa),
    url("/assets/shrine.png") center 42% / cover;
  z-index: -1;
  filter: var(--theme-filter, none);
}
.sanctuary.theme-1 {
  --theme-filter: saturate(0.45) brightness(0.8);
}
.sanctuary.theme-2 {
  --theme-filter: grayscale(1) brightness(1.25);
}
.sanctuary.theme-3 {
  --theme-filter: hue-rotate(325deg) saturate(0.65);
}
.sanctuary.theme-4 {
  --theme-filter: brightness(1.15) saturate(0.8);
}
.sanctuary.theme-5 {
  --theme-filter: hue-rotate(80deg) saturate(0.4);
}
.sanctuary.theme-6 {
  --theme-filter: hue-rotate(235deg) saturate(0.4);
}
.sanctuary.theme-7 {
  --theme-filter: sepia(0.5) saturate(0.35) brightness(1.1);
}
.sanctuary.theme-8 {
  --theme-filter: saturate(0.5) brightness(0.65);
}
.sanctuary .eyebrow,
.sanctuary h1,
.sanctuary p {
  text-shadow: 0 2px 10px #000;
}
.sanctuary .portrait {
  background: #221a16;
}
.theme-option {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(#221c16aa, #221c16cc), url("/assets/shrine.png");
  background-size: cover;
  background-position: center;
}
.sanctuary .hall-tools {
  margin-top: 35px;
}
@media (max-width: 580px) {
  .sanctuary {
    min-height: 560px;
    padding-top: 105px;
  }
  .sanctuary .portrait {
    width: 110px;
    height: 140px;
    margin-top: 22px;
    margin-bottom: 18px;
  }
  .portrait img {
    width: 96px;
    height: 126px;
  }
  .sanctuary .epitaph {
    font-size: 13px;
  }
  .sanctuary .hall-tools {
    margin-top: 30px;
  }
  .sanctuary .eyebrow {
    font-size: 9px;
    letter-spacing: 3px;
  }
}
@font-face {
  font-family: "Memorial Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/noto-serif-sc.woff2") format("woff2");
}
body {
  font-family:
    "Memorial Serif",
    system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;
}
.brand,
h2,
.sanctuary h1,
.sanctuary .eyebrow,
.sanctuary .epitaph,
.sanctuary .portrait,
.offering-symbol,
.theme-option,
.login h1 {
  font-family: "Memorial Serif", serif;
}
.offering-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.brand span,
.offering-list .offering-symbol {
  font-family: "Memorial Serif", serif;
}
.mode {
  font-family: "Memorial Serif", serif;
  font-size: 11px;
}
.card table + h2 {
  margin-top: 26px;
}

.legal-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.crackers {
  position: absolute;
  top: 10%;
  left: 8%;
  z-index: 8;
  width: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  pointer-events: none;
}
.crackers i {
  height: 24px;
  background: linear-gradient(#c9a351 15%, #9b2525 16% 85%, #c9a351 86%);
  border-radius: 3px;
  animation: crack 0.3s alternate 5;
}
.crackers i:nth-child(even) {
  animation-delay: 0.1s;
  transform: rotate(-22deg);
}
@keyframes crack {
  to {
    opacity: 0.25;
    box-shadow: 0 0 12px 6px #e7b151;
    transform: translateY(8px) rotate(20deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .crackers i {
    animation: none;
  }
}
