:root {
  --paper: #f8f2ea;
  --paper-soft: #fffaf3;
  --ink: #17120f;
  --ink-soft: rgba(23, 18, 15, 0.68);
  --ink-faint: rgba(23, 18, 15, 0.44);
  --plum: #3f263a;
  --moss: #526f62;
  --clay: #bf765e;
  --sky: #86b9c8;
  --butter: #f3d693;
  --rose: #d9aca5;
  --line: rgba(23, 18, 15, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 18, 15, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(23, 18, 15, 0.03) 1px, transparent 1px) 0 0 / 28px 28px,
    #e9ded0;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
summary {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.phone-safe {
  position: relative;
  width: min(393px, 100vw);
  height: min(852px, 100vh);
  overflow: hidden;
  border: 12px solid #0d0a08;
  border-radius: 46px;
  background:
    radial-gradient(circle at 74% 6%, rgba(134, 185, 200, 0.28), transparent 23%),
    radial-gradient(circle at 10% 26%, rgba(217, 172, 165, 0.2), transparent 26%),
    var(--paper);
  box-shadow: 0 28px 80px rgba(33, 24, 18, 0.18);
}

.phone-safe::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 5;
  width: 118px;
  height: 32px;
  border-radius: 0 0 18px 18px;
  background: #0d0a08;
  transform: translateX(-50%);
}

.topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  padding: 20px 22px 0;
}

.topbar span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.link-button {
  border: 0;
  padding: 8px 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.view {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: calc(min(852px, 100vh) - 86px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 22px 24px 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 8vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
}

.lead {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.68;
}

.visual {
  position: relative;
  flex: 0 0 auto;
}

.visual-ticket {
  height: 196px;
  margin-top: 18px;
}

.ticket-card {
  position: absolute;
  left: 0;
  top: 28px;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: 208px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 250, 243, 0.78);
  box-shadow: 0 14px 36px rgba(23, 18, 15, 0.1);
}

.ticket-card .mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 38%, var(--paper) 0 4px, transparent 5px),
    linear-gradient(135deg, var(--moss), var(--plum));
}

.ticket-card small,
.info-stack span,
.visit-pass span,
.session-card span,
.persona-hero span {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.text-action {
  width: max-content;
  border: 0;
  padding: 0;
  color: var(--moss);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.art-orb {
  position: absolute;
  right: -22px;
  top: 0;
  width: 202px;
  height: 182px;
  border: 2px solid rgba(23, 18, 15, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(117deg, transparent 0 34%, rgba(23, 18, 15, 0.2) 35% 37%, transparent 38%),
    linear-gradient(66deg, transparent 0 47%, rgba(23, 18, 15, 0.22) 48% 50%, transparent 51%),
    radial-gradient(circle at 54% 45%, rgba(248, 242, 234, 0.8) 0 18%, rgba(63, 38, 58, 0.22) 19% 29%, transparent 30%),
    linear-gradient(145deg, #183f37, #d69a61 52%, #20314b);
}

.visual-manual {
  height: 226px;
  margin-top: 22px;
}

.manual-card {
  position: absolute;
  left: 50%;
  top: 20px;
  z-index: 2;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  border: 1px solid rgba(23, 18, 15, 0.18);
  border-radius: 34px;
  color: var(--paper);
  background:
    radial-gradient(circle at 76% 22%, rgba(243, 214, 147, 0.4), transparent 28%),
    linear-gradient(145deg, #263a34, var(--plum));
  box-shadow: 0 24px 52px rgba(23, 18, 15, 0.18);
  transform: translateX(-50%) rotate(-4deg);
}

.manual-card span {
  align-self: end;
  color: rgba(248, 242, 234, 0.64);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.manual-card strong {
  align-self: start;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 68px;
  line-height: 0.9;
}

.manual-line {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 112px;
  height: 56px;
  border-top: 1px solid rgba(23, 18, 15, 0.18);
  border-bottom: 1px solid rgba(23, 18, 15, 0.12);
  transform: rotate(8deg);
}

.ticket-entry-form {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.ticket-entry-form label {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-entry-form input {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(23, 18, 15, 0.18);
  border-radius: 20px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 250, 243, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-size: 16px;
  font-weight: 800;
  outline: 0;
}

.ticket-entry-form input:focus {
  border-color: rgba(82, 111, 98, 0.72);
  box-shadow: 0 0 0 4px rgba(82, 111, 98, 0.13);
}

.info-stack {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.info-stack article,
.visit-pass,
.content-card,
.review-card,
.ready-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 250, 243, 0.66);
  box-shadow: 0 16px 36px rgba(23, 18, 15, 0.07);
}

.info-stack article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.info-stack b {
  font-size: 14px;
  line-height: 1.42;
}

.consent-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.consent-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}

.primary-action,
.secondary-action,
.ghost-action {
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 900;
}

.primary-action {
  margin-top: 20px;
  border: 0;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 18px 36px rgba(23, 18, 15, 0.2);
}

.secondary-action {
  margin-top: auto;
  border: 1px solid rgba(23, 18, 15, 0.18);
  color: var(--ink);
  background: rgba(255, 250, 243, 0.58);
}

.ghost-action {
  margin-top: 10px;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.visual-location {
  height: 238px;
  margin-top: 28px;
  border-radius: 42px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 28%, var(--butter) 0 9%, transparent 10%),
    radial-gradient(circle at 30% 60%, var(--rose) 0 8%, transparent 9%),
    linear-gradient(135deg, rgba(82, 111, 98, 0.26), rgba(134, 185, 200, 0.32));
}

.visual-location::before,
.visual-location::after {
  content: "";
  position: absolute;
  inset: 38px;
  border: 1px solid rgba(23, 18, 15, 0.18);
  border-radius: 50%;
}

.visual-location::after {
  inset: 74px 48px;
  transform: rotate(-22deg);
}

.visual-location span {
  position: absolute;
  z-index: 2;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
}

.visual-location span:nth-child(1) {
  left: 76px;
  top: 86px;
}

.visual-location span:nth-child(2) {
  right: 84px;
  top: 70px;
}

.visual-location span:nth-child(3) {
  left: 178px;
  bottom: 58px;
}

.rule-list {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.rule-list article {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}

.rule-list span {
  color: var(--ink-soft);
  font-size: 13px;
}

.success-seal {
  display: grid;
  width: 138px;
  height: 138px;
  place-items: center;
  margin: 42px auto 8px;
  border-radius: 50%;
  color: var(--paper);
  background: linear-gradient(140deg, var(--moss), var(--plum));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 900;
  box-shadow: 0 24px 48px rgba(23, 18, 15, 0.22);
}

.session-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-radius: 28px;
  padding: 22px;
  color: var(--paper);
  background: linear-gradient(145deg, var(--plum), #1b2522);
}

.session-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

.session-card small {
  color: rgba(248, 242, 234, 0.72);
}

.ready-card {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 15px;
}

.ready-card span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--moss);
}

.ready-card p {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.visual-quiet {
  height: 250px;
  margin-top: 24px;
}

.visual-quiet::before {
  content: "";
  position: absolute;
  inset: 0 42px 20px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(160deg, rgba(82, 111, 98, 0.86), rgba(63, 38, 58, 0.92));
}

.visual-quiet::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 82px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(248, 242, 234, 0.72);
  transform: translateX(-50%);
}

.visual-quiet span {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 152px;
  height: 76px;
  border-radius: 50%;
  background: rgba(191, 118, 94, 0.34);
  transform: translateX(-50%);
}

.visit-pass {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
}

.visit-pass strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.visit-pass small {
  color: var(--ink-soft);
  line-height: 1.45;
}

.centered-view,
.state-view {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: calc(min(852px, 100vh) - 130px);
  text-align: center;
}

.loading-rings {
  position: relative;
  width: 238px;
  height: 238px;
  margin-bottom: 22px;
}

.loading-rings span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(23, 18, 15, 0.16);
  border-radius: 50%;
}

.loading-rings span:nth-child(1) {
  background: radial-gradient(circle, rgba(243, 214, 147, 0.58), transparent 56%);
}

.loading-rings span:nth-child(2) {
  inset: 34px;
  border-color: rgba(82, 111, 98, 0.5);
}

.loading-rings span:nth-child(3) {
  inset: 78px;
  background: var(--ink);
}

.loading-line {
  width: 78%;
  height: 8px;
  margin-top: 28px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 18, 15, 0.1);
}

.loading-line span {
  display: block;
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, var(--moss), var(--clay), var(--sky));
}

.loading-copy {
  margin-top: 18px;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 900;
}

.persona-hero {
  border-radius: 34px;
  padding: 20px;
  color: var(--paper);
  background:
    radial-gradient(circle at 85% 12%, rgba(243, 214, 147, 0.46), transparent 26%),
    linear-gradient(150deg, var(--plum), #152622 58%, #223b42);
  box-shadow: 0 24px 54px rgba(23, 18, 15, 0.22);
}

.persona-hero.is-fallback {
  background:
    radial-gradient(circle at 80% 15%, rgba(134, 185, 200, 0.46), transparent 25%),
    linear-gradient(150deg, #536a5a, #182522 64%, #3f263a);
}

.persona-hero h1 {
  margin-top: 8px;
  font-size: 42px;
}

.persona-hero p {
  margin-top: 10px;
  color: rgba(248, 242, 234, 0.8);
  font-size: 13px;
  line-height: 1.58;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row b {
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--ink);
  background: rgba(248, 242, 234, 0.78);
  font-size: 12px;
}

.content-card,
.review-card {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 14px;
}

.content-card p,
.review-card p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.evidence-grid article {
  display: grid;
  gap: 5px;
  min-height: 58px;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(82, 111, 98, 0.15);
}

.evidence-grid article:nth-child(2n) {
  background: rgba(191, 118, 94, 0.18);
}

.evidence-grid span {
  color: var(--ink-soft);
  font-size: 12px;
}

.review-card summary {
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
}

.persona-hero + .content-card h2 {
  font-size: 15px;
}

.review-card .primary-action,
.persona-hero ~ .primary-action {
  min-height: 48px;
}

.state-mark {
  display: grid;
  width: 142px;
  height: 142px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  color: var(--paper);
  background: linear-gradient(145deg, var(--sky), var(--moss));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 46px;
  font-weight: 900;
}

.state-mark.error {
  background: linear-gradient(145deg, var(--clay), var(--plum));
}

.state-mark.expired {
  font-size: 34px;
  background: linear-gradient(145deg, #4f4b46, var(--ink));
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  width: min(340px, calc(100vw - 44px));
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--paper);
  background: rgba(23, 18, 15, 0.92);
  box-shadow: 0 20px 46px rgba(23, 18, 15, 0.24);
  font-size: 13px;
  line-height: 1.5;
  transform: translate(-50%, 150%);
  transition: transform 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
}

@media (max-width: 520px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .phone-safe {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-safe::before {
    display: none;
  }

  .view {
    height: calc(100vh - 62px);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}
