:root {
  --ink: #0c1210;
  --ink-2: #141c18;
  --moss: #1b3d32;
  --jade: #2f8f72;
  --gold: #e3b35a;
  --gold-2: #f0d39a;
  --cream: #f7f1e6;
  --paper: #fffaf2;
  --muted: #8b948c;
  --line: rgba(227, 179, 90, 0.24);
  --danger: #d4654a;
  --ok: #3d9b74;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #070b09;
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
a { color: inherit; }

.shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: clip;
  background:
    radial-gradient(120% 70% at 80% -10%, rgba(227, 179, 90, 0.16), transparent 46%),
    radial-gradient(90% 50% at 0% 10%, rgba(47, 143, 114, 0.16), transparent 42%),
    linear-gradient(180deg, #101814 0%, #0c1210 48%, #0a100e 100%);
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.home-hero {
  position: relative;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top)) 22px 28px;
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--gold-2);
  text-transform: uppercase;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.domain {
  font-size: 11px;
  color: var(--muted);
}

.landscape {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  pointer-events: none;
}

.landscape svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mist {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 18%;
  height: 90px;
  background: radial-gradient(ellipse at center, rgba(247, 241, 230, 0.16), transparent 70%);
  filter: blur(12px);
  animation: drift 9s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translateX(-6%); opacity: 0.45; }
  50% { transform: translateX(8%); opacity: 0.75; }
}

.hero-copy {
  position: relative;
  z-index: 2;
  margin-top: 72px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.28em;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 12vw, 58px);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.15;
}

.hero-copy h1 span {
  display: block;
  margin-top: 6px;
  font-size: 0.42em;
  letter-spacing: 0.34em;
  color: var(--gold-2);
  font-family: var(--sans);
  font-weight: 400;
}

.lead {
  margin: 18px 0 0;
  max-width: 18em;
  color: rgba(247, 241, 230, 0.78);
  font-size: 15px;
  line-height: 1.75;
}

.gold-line {
  width: 56px;
  height: 1px;
  margin: 22px 0 0;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-actions {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 24px;
}

.lookup {
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  border-radius: 22px;
  padding: 16px;
}

.lookup label {
  display: block;
  font-size: 12px;
  color: var(--gold-2);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.lookup-row {
  display: flex;
  gap: 8px;
}

.lookup input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 250, 242, 0.92);
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  height: 46px;
  padding: 0 16px;
  background: linear-gradient(180deg, #f0d39a, #d4a24a);
  color: #2a2110;
  font-weight: 650;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(212, 162, 74, 0.28);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.ghost {
  background: rgba(255, 250, 242, 0.08);
  color: var(--cream);
  box-shadow: none;
  border: 1px solid var(--line);
}

.btn.full { width: 100%; }
.btn.danger {
  background: linear-gradient(180deg, #e38a74, #c45a42);
  color: #fff8f5;
  box-shadow: none;
}

.home-rest {
  position: relative;
  z-index: 2;
  padding: 8px 22px calc(36px + env(safe-area-inset-bottom));
}

.section-title {
  margin: 28px 0 14px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.12em;
}

.cards {
  display: grid;
  gap: 12px;
}

.feature {
  padding: 16px 16px 15px;
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.05);
  border: 1px solid rgba(255, 250, 242, 0.06);
}

.feature b {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.home-foot {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.page-cx {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(12, 18, 16, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(227, 179, 90, 0.12);
}

.topbar-slim {
  padding-bottom: 12px;
}

.who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.who .name {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.08em;
}

.who .meta {
  font-size: 11px;
  color: var(--muted);
}

.who-slim {
  margin-bottom: 0;
}

.who-slim .name {
  font-size: 16px;
}

.content-compact {
  padding-top: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.06);
}

.tab {
  height: 38px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.tab.active {
  background: linear-gradient(180deg, #f0d39a, #d4a24a);
  color: #2a2110;
}

.content {
  flex: 1;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

.panel { display: none; }
.panel.active { display: block; }

.ticket-card,
.guide-card,
.scenic-card,
.empty-card,
.upload-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.ticket-card {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 12px;
}

.ticket-card::after,
.ticket-card::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #0c1210;
  border-radius: 50%;
  top: 118px;
}

.ticket-card::before { left: -9px; }
.ticket-card::after { right: -9px; }

.ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.ticket-head small {
  color: #7a7368;
  letter-spacing: 0.16em;
  font-size: 10px;
}

.ticket-head b {
  display: block;
  margin-top: 2px;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #efe4cc;
  color: #6a5420;
  font-weight: 650;
}

.qr-well {
  margin: 4px 0 8px;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed rgba(42, 33, 16, 0.12);
}

.qr-well img {
  width: min(100%, 196px);
  margin: 0 auto;
  border-radius: 6px;
  background: #fff;
}

.ticket-card .actions { margin-top: 2px; }
.ticket-card .btn.full { height: 40px; font-size: 13px; }

.qr-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: #8a8173;
}

.dash {
  height: 1px;
  margin: 18px 0 14px;
  background-image: linear-gradient(90deg, #d8d0c2 60%, transparent 0);
  background-size: 10px 1px;
}

.scenic-card {
  margin-top: 14px;
  overflow: hidden;
}

.scenic-card .cover {
  width: 100%;
  height: 168px;
  object-fit: cover;
  background: #e8e0d2;
}

.scenic-body { padding: 16px; }

.scenic-body .guest,
.guest-alone {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.guest-alone {
  margin: 14px 4px 0;
  color: var(--cream);
}

.scenic-body h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.scenic-body .loc {
  margin: 0 0 12px;
  color: #7a7368;
  font-size: 13px;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.kv div {
  background: #f4eee3;
  border-radius: 14px;
  padding: 10px 12px;
}

.kv small {
  display: block;
  color: #8a8173;
  font-size: 11px;
  margin-bottom: 3px;
}

.kv b { font-size: 15px; }

.desc {
  margin: 12px 0 0;
  color: #4d4a43;
  font-size: 14px;
  line-height: 1.75;
}

.facts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.facts .row {
  background: #f4eee3;
  border-radius: 14px;
  padding: 10px 12px;
}

.facts small {
  display: block;
  color: #8a8173;
  font-size: 11px;
  margin-bottom: 3px;
}

.facts b {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
}

.upload-card {
  padding: 18px;
  margin-bottom: 14px;
}

.upload-card h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  letter-spacing: 0.08em;
}

.upload-card p {
  margin: 0 0 14px;
  color: #7a7368;
  font-size: 13px;
  line-height: 1.7;
}

.drop {
  position: relative;
  border: 1.5px dashed #d2c6ae;
  border-radius: 18px;
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #8a8173;
  background: #fffdf8;
  overflow: hidden;
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drop span { position: relative; z-index: 1; padding: 0 20px; }

.upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.empty-card, .guide-card {
  padding: 22px 18px;
}

.empty-card h2, .guide-card h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  letter-spacing: 0.08em;
}

.empty-card p, .guide-text {
  margin: 0;
  color: #6f685c;
  line-height: 1.8;
  font-size: 14px;
}

.steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #4d4a43;
  font-size: 14px;
  line-height: 1.65;
}

.steps i {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1b3d32;
  color: var(--gold-2);
  font-style: normal;
  font-size: 12px;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.home-apps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: #f4eee3;
  text-decoration: none;
  color: var(--ink);
}

.home-app img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}

.home-app span {
  font-weight: 650;
  font-size: 14px;
}

.home-app small {
  font-size: 11px;
  color: #8a8173;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  background: #1b3d32;
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
}

.link-btn span {
  font-size: 12px;
  color: var(--gold-2);
  font-weight: 500;
}

.state {
  padding: 48px 18px;
  text-align: center;
}

.state p { color: var(--muted); line-height: 1.7; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 28, 24, 0.94);
  color: var(--cream);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 20;
  border: 1px solid var(--line);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
}

.lightbox.show { display: flex; }
.lightbox img { width: min(92vw, 420px); background: #fff; border-radius: 12px; }

.tips {
  margin: 16px 0 0;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.tips h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.06em;
}

.tips ol {
  margin: 0;
  padding-left: 1.2em;
  color: #4d4a43;
  font-size: 14px;
  line-height: 1.75;
}

.tips li { margin: 0 0 8px; }
.tips li:last-child { margin-bottom: 0; }
.tips strong,
.guide-notes strong { font-weight: 700; color: inherit; }
.tone-red { color: #e23b3b; }
.tone-orange { color: #e67a2a; }
.tone-gold { color: #c48a1a; }
.tone-green { color: #2f8a52; }
.tone-blue { color: #2f6fce; }
.tone-muted { color: #8a8f8a; }

.guide-notes {
  margin: 0;
  padding-left: 1.2em;
  color: #4d4a43;
  font-size: 14px;
  line-height: 1.8;
}

.guide-notes li { margin: 0 0 12px; }
.guide-notes li:last-child { margin-bottom: 0; }

.dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 11, 9, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dialog[hidden] { display: none; }

.dialog-card {
  width: min(100%, 320px);
  padding: 22px 18px 16px;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.dialog-card h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  letter-spacing: 0.06em;
}

.dialog-card p {
  margin: 0 0 16px;
  color: #6f685c;
  font-size: 14px;
  line-height: 1.7;
}

.paper-form {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.paper-form label {
  margin-top: 6px;
  color: #8a8173;
  font-size: 12px;
}

.paper-form input,
.paper-form select {
  height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 0 12px;
  background: #f4eee3;
  color: var(--ink);
}

.paper-form input[type="file"] {
  height: auto;
  padding: 10px 12px;
}

.photo-block {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-preview {
  position: relative;
  width: 120px;
  height: 160px;
  margin: 0 auto;
  border-radius: 14px;
  background: #fffdf8;
  border: 1.5px dashed #d2c6ae;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 0;
}

.photo-preview img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f4eee3;
}

.photo-preview.has-image img { display: block; }

.photo-preview .photo-empty {
  position: relative;
  z-index: 1;
  color: #8a8173;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  padding: 0 10px;
}

.photo-preview.has-image .photo-empty { display: none; }

.field-hint {
  margin: 0;
  color: #8a8173;
  font-size: 12px;
  line-height: 1.6;
}

.page-kh .guide-card {
  padding: 14px 14px 12px;
}

.page-kh .guide-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.page-kh .paper-form {
  gap: 6px;
  margin-top: 8px;
}

.page-kh .paper-form label {
  margin-top: 2px;
  font-size: 11px;
}

.page-kh .paper-form input,
.page-kh .paper-form select {
  height: 38px;
  border-radius: 12px;
}

.page-kh .paper-form .btn.full {
  height: 40px;
  margin-top: 6px;
  font-size: 14px;
}

.page-kh .photo-block {
  gap: 6px;
  margin-bottom: 2px;
}

.page-kh .photo-preview {
  width: 96px;
  height: 128px;
  border-radius: 12px;
}

.page-kh .photo-preview .photo-empty {
  font-size: 11px;
  line-height: 1.45;
  padding: 0 8px;
}

.page-kh .field-hint {
  font-size: 11px;
  line-height: 1.4;
}

@media (min-width: 480px) {
  body {
    display: flex;
    justify-content: center;
    background:
      radial-gradient(50% 40% at 50% 0%, rgba(227, 179, 90, 0.08), transparent),
      #070b09;
  }
  .shell {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 30px 80px rgba(0,0,0,0.45);
  }
}
