:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --page: #100f0e;
  --bar: #181613;
  --surface: #1c1915;
  --line: #554631;
  --faint-line: #382f24;
  --gold: #edc98f;
  --text: #f0e6d7;
  --muted: #c6baa7;
  --app-width: 34rem;
  --gutters: clamp(14px, 4vw, 22px);
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0 auto;
  max-width: var(--app-width);
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, a { touch-action: manipulation; }
main { padding: 14px var(--gutters) calc(82px + env(safe-area-inset-bottom)); }
.detail-active main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.topbar, .bottom-nav {
  background: var(--bar);
  width: min(100%, var(--app-width));
  z-index: 2;
}
.topbar {
  display: grid;
  place-items: center;
  position: sticky;
  top: 0;
  min-height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 58px 0;
  border-bottom: 1px solid #24201a;
  font-weight: 600;
  color: #f6f0e7;
  text-align: center;
}
.icon-button, .button-text, .bottom-nav button, .mine-tabs button {
  border: 0;
  background: transparent;
  color: inherit;
}
.icon-button { display: inline-grid; place-items: center; min-width: 42px; min-height: 42px; padding: 0; color: var(--gold); border-radius: 8px; }
.icon-button:disabled { opacity: .46; }
.icon-button svg, .bottom-nav svg, .map-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-button { position: absolute; bottom: 2px; left: 7px; }
a[data-xunzhen] { text-decoration: none; }
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  display: flex;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1;
  min-height: 62px;
  padding: 8px 0 7px;
  display: flex;
  gap: 3px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.bottom-nav button[aria-current="page"] { color: var(--gold); font-weight: 700; }
.bottom-nav button:focus-visible { outline-offset: -4px; }
.hero {
  display: block;
  width: 100%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1.67;
  border: 1px solid #69553a;
  border-radius: 13px;
  background: #272016;
  margin-bottom: 8px;
}
.hero-image, .hero-copy { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { object-fit: cover; }
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 13px clamp(18px, 5vw, 32px);
  background: linear-gradient(90deg, #100e0bdb 0%, #100e0b88 34%, transparent 93%);
}
.hero-mark {
  padding: 2px 6px 2px 7px;
  border: 1px solid #c9a66e;
  border-radius: 2px;
  color: #edd3a4;
  font: 600 12px var(--serif);
  letter-spacing: 2px;
}
.hero-title { color: #f4dfb5; font: 700 clamp(36px, 11vw, 60px)/1.16 var(--serif); margin: 15px 0 6px; letter-spacing: .045em; }
.hero-subtitle { color: #dbc7a2; font-size: 14px; letter-spacing: .15em; }
.hero-caption { color: var(--muted); margin: 0 2px 20px; font-size: 12px; }
.section-title { font: 600 22px/1.35 var(--serif); color: var(--gold); }
.page-title { font: 700 27px/1.35 var(--serif); color: var(--gold); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-section > h2, .section-heading { margin-bottom: 10px; }
.calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px 9px 9px;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gold);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { text-align: center; color: var(--muted); font-size: 12px; padding: 1px 0 3px; }
.calendar-cell, .day { min-height: 35px; }
.calendar-cell { display: grid; place-items: center; }
.day {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: center;
  padding: 0 0 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
span.day { display: grid; place-items: center; color: #a19381; }
.day--event::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  left: calc(50% - 2px);
  bottom: 4px;
  background: var(--gold);
  border-radius: 50%;
}
.day--closed { color: #b3a595; }
.day--closed::after { background: #90816d; }
.day[aria-pressed="true"] { background: #e4bc83; color: #21180f; font-weight: 700; }
.day[aria-pressed="true"]::after { background: #624723; }
.day--closed[aria-pressed="true"] { color: #f2e8d9; background: #514a42; }
.day--closed[aria-pressed="true"]::after { background: #e4d6c5; }
.calendar-actions { display: flex; justify-content: center; margin-top: 3px; }
.button-primary, .button-secondary, .button-subtle, .button-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 13px;
  border-radius: 8px;
  min-height: 42px;
  line-height: 1.3;
  font-weight: 600;
  text-decoration: none;
}
.button-primary { color: #21180f; background: #e4bc83; border: 1px solid #e4bc83; }
.button-primary:disabled, .button-secondary:disabled { opacity: .65; }
.button-secondary { color: var(--gold); background: #272118; border: 1px solid #6a563b; }
.button-subtle { color: var(--gold); background: #2b241b; border: 0; min-height: 32px; font-size: 13px; }
.button-text { color: var(--gold); padding-inline: 4px; }
.full-width { width: 100%; }
.events-section { margin-top: 24px; }
.event-list { display: grid; gap: 12px; }
.event-card, .mine-card, .detail-card, .verification-panel, .empty {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(120deg, #242019, #191715);
}
.event-card { overflow: hidden; }
.event-art { display: block; width: 100%; padding: 0; border: 0; background: var(--surface); }
.event-poster { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.event-body { padding: 13px 14px 11px; cursor: pointer; }
.event-title-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  width: 100%;
  gap: 8px;
  border: 0;
  color: var(--text);
  background: transparent;
  padding: 0;
  font-weight: 700;
  font-size: 17px;
  min-height: 28px;
  overflow-wrap: anywhere;
}
.event-title-button::after { content: '›'; color: var(--gold); font-size: 24px; line-height: 1; }
.event-time { color: #dfc399; font-variant-numeric: tabular-nums; margin-top: 3px; }
.event-time, .event-place, .event-summary, .event-meta { font-size: 13px; }
.event-place, .event-summary, .event-meta { color: var(--muted); overflow-wrap: anywhere; }
.event-summary { margin-top: 7px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.event-place { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.map-link { min-height: 37px; }
.map-link svg { width: 16px; height: 16px; }
.event-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 0 12px; margin: 0 14px; border-top: 1px solid var(--line); }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.state-pill { display: inline-block; color: #ecd4aa; background: #332b21; border-radius: 5px; padding: 4px 8px; font-size: 12px; font-weight: 600; }
.state-pill--success { color: #daf0d7; background: #2b3a2b; }
.state-pill--closed { color: var(--muted); background: #302b25; }
.state-pill--action { min-height: 44px; padding-inline: 12px; border: 1px solid var(--line); cursor: pointer; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.feedback { color: var(--gold); line-height: 1.5; font-size: 14px; margin: 9px 0; overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.empty { color: var(--muted); padding: 25px 14px; text-align: center; background: var(--surface); }
.mine-tabs { display: flex; gap: 4px; border: 1px solid var(--line); padding: 4px; border-radius: 10px; background: var(--surface); margin: 16px 0; }
.mine-tabs button { flex: 1; border-radius: 7px; padding: 8px 4px; min-height: 42px; color: var(--muted); }
.mine-tabs button[aria-pressed="true"] { background: #e4bc83; color: #21180f; font-weight: 700; }
.timeline-item { position: relative; margin-left: 4px; padding: 0 0 16px 14px; border-left: 1px dashed #776044; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { position: absolute; left: -4px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); content: ""; }
.timeline-date { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0 0 7px; font-size: 13px; color: var(--muted); }
.mine-card { padding: 13px; }
.mine-card h3 { font-size: 16px; overflow-wrap: anywhere; }
.mine-card .event-footer { margin: 10px 0 0; padding: 10px 0 0; justify-content: flex-start; }
.xunzhen-promo { display: grid; place-items: center; width: 100%; padding: 0; margin-top: 16px; color: var(--gold); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.xunzhen-promo img { display: block; width: 100%; height: auto; }
.xunzhen-promo span { padding: 9px; font-weight: 600; }
.back-button { margin-bottom: 7px; }
.detail-card { overflow: hidden; padding: 15px; }
.detail-card h1 { font: 700 25px/1.35 var(--serif); color: var(--gold); overflow-wrap: anywhere; }
.detail-poster { width: 100%; display: block; aspect-ratio: 1.8; object-fit: cover; border-radius: 8px; margin-top: 12px; }
.detail-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-section h2 { color: var(--gold); font-size: 16px; margin-bottom: 5px; }
.detail-section p { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-item { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.detail-item dt { color: var(--muted); }
.detail-item dd { overflow-wrap: anywhere; }
.detail-card > button { width: 100%; margin-top: 15px; }
.payment-qr { display: block; margin: 10px auto; width: min(220px, 100%); aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
dialog {
  color: var(--text);
  border: 1px solid #846a46;
  background: #211c16;
  padding: 16px;
}
dialog::backdrop { background: #080706a8; }
.sheet {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(100%, var(--app-width));
  max-width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 10px 17px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #30261bea 0%, #211c16f5 45%, #181614fa 100%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.sheet[open] { animation: sheet-rise .24s ease-out both; }
@keyframes sheet-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-header h2 { font: 700 23px/1.4 var(--serif); color: var(--gold); }
.dialog-header button { font-size: 26px; }
.signup-event { color: var(--muted); margin: 3px 0 13px; overflow-wrap: anywhere; }
label { display: block; min-width: 0; margin: 9px 0 0; font-weight: 550; }
input, textarea, select {
  display: block;
  width: 100%;
  min-height: 43px;
  margin: 4px 0 0;
  padding: 7px 10px;
  border: 1px solid #69553a;
  background: #151310;
  color: var(--text);
  border-radius: 8px;
  font-size: 16px;
}
input::placeholder, textarea::placeholder { color: #b0a18c; opacity: 1; }
textarea { resize: vertical; min-height: 65px; }
.optional { color: var(--muted); font-weight: 400; }
.region-inputs { border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 10px 0 0; padding: 0; }
.region-inputs legend { padding: 0; font-weight: 550; }
.region-inputs label { margin-top: 5px; color: var(--muted); font-size: 13px; }
.region-inputs select { padding-inline: 7px; }
.region-inputs select:disabled { opacity: .58; }
.sms-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: end; gap: 7px; }
.sms-row button { min-height: 43px; }
#confirm { margin-top: 8px; }
#verify-home #verify { border: 1px solid var(--line); padding: 12px; border-radius: 12px; background: var(--surface); }
#verify-signup .form-heading { display: none; }
#verify-signup #verify { margin-bottom: 10px; }
#form > button[type="submit"] { margin-top: 12px; }
.form-heading { color: var(--gold); font-size: 16px; }
.ticket-dialog { border-radius: 14px; width: min(315px, calc(100% - 28px)); text-align: center; }
.ticket-dialog img { background: #fff; width: min(100%, 250px); height: auto; aspect-ratio: 1; display: block; margin: 0 auto; border-radius: 4px; }
.ticket-note { margin-top: 9px; color: var(--muted); }
.map-dialog { width: min(350px, calc(100% - 28px)); border-radius: 14px; }
.map-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 36rem) {
  html { background: #0b0a09; }
  body { box-shadow: 0 0 0 1px #252019; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet[open] { animation: none; }
}
