:root {
  --bg: #F2F6FB;
  --card: #FFFFFF;
  --ink: #17283A;
  --ink-2: #55677A;
  --sub: #8697A8;
  --line: #E2EAF3;
  --line-2: #CDDAE8;
  --brand: #1D5FA6;
  --brand-dk: #174A80;
  --brand-soft: #E7F0FA;
  --green: #157F63;
  --green-soft: #E3F3ED;
  --amber: #B27A1C;
  --amber-soft: #FBF0DA;
  --red: #B23F3F;
  --red-soft: #FBEAEA;
  --radius: 16px;
}

/* ---------- 三套场馆主题 ---------- */
/* 在 <html> 上设置 data-venue 即可整体换色，页面结构完全一致 */

[data-venue="rainforest"],
[data-venue="blue"] {
  --brand: #1D5FA6;
  --brand-dk: #174A80;
  --brand-soft: #E7F0FA;
  --bg: #F2F6FB;
  --line: #E2EAF3;
  --line-2: #CDDAE8;
}

[data-venue="lava"],
[data-venue="red"] {
  --brand: #A3472A;
  --brand-dk: #833720;
  --brand-soft: #FBEDE6;
  --bg: #FAF4F0;
  --line: #F0E2DA;
  --line-2: #E2CCBF;
}

[data-venue="bamboo"],
[data-venue="green"] {
  --brand: #2C7A52;
  --brand-dk: #215E3F;
  --brand-soft: #E9F3ED;
  --bg: #F3F8F4;
  --line: #DFEDE4;
  --line-2: #C8DED2;
}

body {
  transition: background-color 0.25s ease;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.page-wide {
  max-width: 880px;
}

/* ---------- 头部 ---------- */

.hero {
  padding: 30px 4px 22px;
}

.hero .brand {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--brand);
  font-weight: 600;
}

/* 白底 logo 用 multiply 融合到浅色背景上，不会出现白色方块 */
.hero .logo {
  display: block;
  width: 138px;
  height: 138px;
  object-fit: contain;
  margin: -18px 0 -10px -6px;
  mix-blend-mode: multiply;
}

/* 选择页：logo 居中、缩小，把首屏留给三张场馆卡片 */
.hero-center {
  padding: 10px 4px 12px;
  text-align: center;
}

.hero.hero-center .logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 2px;
}

.hero-center h1 {
  margin: 2px 0 5px;
}

/* 选馆页压缩底部留白，争取首屏不滚动 */
.page-tight {
  padding-bottom: 20px;
}

.page-tight .footer-note {
  margin-top: 14px;
}

.ticket-head .logo-sm {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
  mix-blend-mode: multiply;
}

.hero h1 {
  font-size: 26px;
  margin: 8px 0 6px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 14px;
  color: var(--sub);
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 8px;
}

.topbar .back {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topbar .back::before {
  content: "";
  width: 7px;
  height: 7px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  display: inline-block;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.label {
  font-size: 12px;
  color: var(--sub);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.label-inline {
  font-size: 12px;
  color: var(--sub);
}

.hint {
  font-size: 12px;
  color: var(--sub);
  margin: 8px 0 0;
}

/* ---------- 日期条 ---------- */

.date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}

.date-strip::-webkit-scrollbar {
  display: none;
}

.date-chip {
  flex: 0 0 auto;
  width: 58px;
  padding: 9px 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}

.date-chip .w {
  font-size: 11px;
  color: var(--sub);
  line-height: 1.2;
}

.date-chip .d {
  font-size: 19px;
  font-weight: 600;
  margin-top: 1px;
  line-height: 1.2;
}

.date-chip .m {
  font-size: 10px;
  color: var(--sub);
  line-height: 1.2;
}

.date-chip.on {
  background: var(--brand);
  border-color: var(--brand);
}

.date-chip.on .w,
.date-chip.on .d,
.date-chip.on .m {
  color: #fff;
}

.date-chip.full {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ---------- 场馆选择 ---------- */

.venue-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.venue-card:active {
  transform: scale(0.985);
}

.venue-card .bar {
  height: 5px;
  background: var(--vc);
}

.venue-card .in {
  padding: 14px 18px 15px;
}

.venue-card .nm {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
}

.venue-card .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--vc);
  flex: 0 0 auto;
}

.venue-card .tg {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 5px;
  line-height: 1.5;
}

.venue-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}

.venue-card .cap {
  color: var(--vc);
  font-weight: 500;
}

.venue-card .go {
  color: var(--vc);
  font-weight: 500;
}

/* ---------- 选择页底部的「查看我的预约」 ---------- */

.mine-wrap {
  margin-top: 16px;
  text-align: center;
}

.btn-mine {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(23, 40, 58, 0.07);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-mine svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn-mine:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(23, 40, 58, 0.08);
  background: #fff;
}

[data-theme="blue"] {
  --vc: #1D5FA6;
}

[data-theme="red"] {
  --vc: #A3472A;
}

[data-theme="green"] {
  --vc: #2C7A52;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--vc, var(--brand));
  display: inline-block;
  flex: 0 0 auto;
}

/* ---------- 表单 ---------- */

.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus {
  border-color: var(--brand);
}

.input::placeholder {
  color: #B3C1D0;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row .input {
  flex: 1;
  min-width: 0;
}

.btn-code {
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-code:disabled {
  border-color: var(--line-2);
  color: var(--sub);
  cursor: not-allowed;
}

/* ---------- 人数 ---------- */

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 20px;
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper-val {
  font-size: 22px;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

.stepper-val small {
  font-size: 13px;
  font-weight: 400;
  color: var(--sub);
  margin-left: 2px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:active {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  margin-top: 4px;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-weight: 500;
}

.btn-green {
  background: var(--green);
  color: #fff;
}

.btn-danger {
  background: #fff;
  border: 1px solid var(--red);
  color: var(--red);
  font-weight: 500;
}

.btn-sm {
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 10px;
  width: auto;
}

/* ---------- 凭证 ---------- */

.ticket {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.ticket-head {
  padding: 20px 20px 16px;
  border-bottom: 1px dashed var(--line-2);
  text-align: center;
  position: relative;
}

.ticket-head::before,
.ticket-head::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 18px;
  height: 18px;
  background: var(--bg);
  border-radius: 50%;
}

.ticket-head::before {
  left: -9px;
}

.ticket-head::after {
  right: -9px;
}

.ticket-head h2 {
  font-size: 17px;
  margin: 0 0 4px;
  font-weight: 600;
}

.ticket-head p {
  font-size: 12px;
  color: var(--sub);
  margin: 0;
}

.qr-wrap {
  padding: 22px 20px 18px;
  text-align: center;
}

.qr-wrap img {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.ticket-body {
  padding: 0 20px 22px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #F0F5FA;
  font-size: 14px;
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  color: var(--sub);
  flex: 0 0 auto;
}

.kv .v {
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-booked {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-checked {
  background: var(--green-soft);
  color: var(--green);
}

.badge-cancelled {
  background: #EDF2F7;
  color: var(--sub);
}

/* ---------- 状态提示 ---------- */

.result {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.result-success {
  background: var(--green-soft);
}

.result-error {
  background: var(--red-soft);
}

.result-warn {
  background: var(--amber-soft);
}

.result h3 {
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 600;
}

.result p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.result .mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}

.result-success .mark {
  background: var(--green);
}

.result-error .mark {
  background: var(--red);
}

.result-warn .mark {
  background: var(--amber);
}

/* ---------- 统计 ---------- */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: var(--card);
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.tab.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.stat .n {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.stat .t {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--sub);
  font-size: 12px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 10px 6px;
  border-bottom: 1px solid #F0F5FA;
}

tr:last-child td {
  border-bottom: none;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 订单列表 ---------- */

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #F0F5FA;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item .who {
  font-size: 15px;
  font-weight: 500;
}

.order-item .meta {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
}

/* ---------- 登录 ---------- */

.login-box {
  max-width: 360px;
  margin: 60px auto;
  padding: 0 16px;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--sub);
  font-size: 14px;
}

/* ---------- 弹层 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translate(-50%, 20px);
  background: rgba(23, 40, 58, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: 22px;
  font-size: 14px;
  max-width: 80vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 扫码 ---------- */

#scanner {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 900;
  flex-direction: column;
}

#scanner video {
  width: 100%;
  flex: 1;
  object-fit: cover;
}

#scanner .scan-bar {
  padding: 18px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.6);
}

#scanner .scan-close {
  align-self: center;
  margin: 0 0 22px;
  padding: 10px 26px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  font-size: 14px;
  font-family: inherit;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: #A8B6C4;
  margin-top: 24px;
  line-height: 1.8;
}
