/* ===== 基础 ===== */
:root {
  --brand: #ff5a1f;
  --brand-2: #ff8a3d;
  --ink: #16181d;
  --ink-2: #565b66;
  --ink-3: #9aa0ac;
  --line: #eef0f4;
  --bg: #f5f6f8;
  --card: #fff;
  --radius: 16px;
  --bar-h: 64px;
  --shadow: 0 2px 12px rgba(22, 24, 29, .06);
  --shadow-lg: 0 -6px 24px rgba(22, 24, 29, .08);
}

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

html, body {
  margin: 0;
  padding: 0;
  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.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.page {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--bar-h) + 24px + env(safe-area-inset-bottom));
}

/* ===== 头图 ===== */
.hero {
  position: relative;
  width: 100%;
  height: 58vw;
  max-height: 340px;
  min-height: 210px;
  overflow: hidden;
  background: #d9dce2;
}
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 34%, rgba(0,0,0,0) 62%, rgba(0,0,0,.18) 100%);
  pointer-events: none;
}
.hero-back {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s;
}
.icon-btn:active { background: rgba(0,0,0,.06); }

/* ===== 内容 ===== */
.content {
  padding: 0 12px;
  margin-top: -22px;
  position: relative;
  z-index: 2;
}

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

.head-card { padding-top: 20px; }

.act-title {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: -.2px;
}
.act-summary {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.6;
}

/* 标签 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.chip-price { color: var(--brand); background: rgba(255, 90, 31, .09); font-size: 15px; }
.chip-price i { font-style: normal; font-size: 11px; font-weight: 500; margin-left: 1px; opacity: .8; }
.chip-free  { color: #0a9c5d; background: rgba(10, 156, 93, .1); }
.chip-warn  { color: #b25a00; background: rgba(255, 149, 0, .12); }
.chip-muted { color: var(--ink-2); background: #f1f3f6; font-weight: 500; }

/* 信息列表 */
.meta-list { list-style: none; margin: 0; padding: 0; }
.meta-list li {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.meta-list li:first-child { border-top: none; padding-top: 4px; }
.meta-list li:last-child { padding-bottom: 0; }
.meta-ico {
  flex: 0 0 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--brand);
  background: rgba(255, 90, 31, .08);
}
.meta-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px; }
.meta-value { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.meta-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

.card-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

/* 详情富文本 */
.detail { font-size: 14.5px; color: #33373f; line-height: 1.78; word-break: break-word; }
.detail h3 {
  font-size: 15px; font-weight: 700; color: var(--ink);
  margin: 20px 0 8px; padding-left: 0;
}
.detail h3:first-child { margin-top: 0; }
.detail p { margin: 0 0 12px; }
.detail ul, .detail ol { margin: 0 0 12px; padding-left: 20px; }
.detail li { margin-bottom: 6px; }
.detail img { border-radius: 10px; margin: 12px 0; }
.detail a { color: var(--brand); }

/* 主办方 */
.org-card { padding-bottom: 16px; }
.org-row { display: flex; align-items: center; gap: 12px; }
.org-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.org-body { min-width: 0; }
.org-name { font-size: 14.5px; font-weight: 600; }
.org-sub { font-size: 12.5px; color: var(--ink-3); }

.foot-note {
  text-align: center; font-size: 12px; color: var(--ink-3);
  margin: 20px 0 4px;
}

/* ===== 底部固定栏 ===== */
.bottom-bar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 640px;
  display: flex; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .08s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.btn-ghost {
  flex: 0 0 38%;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e3e6eb;
}
.btn-ghost:active { background: #f7f8fa; }

.btn-primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 4px 14px rgba(255, 90, 31, .3);
}
.btn-price {
  font-size: 14px; font-weight: 600;
  padding-left: 8px; margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, .45);
}
.btn-block { width: 100%; }

/* ===== 报名弹层 ===== */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 80;
  animation: fadeIn .2s ease;
}
.sheet {
  position: fixed;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 640px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  z-index: 90;
  animation: slideUp .26s cubic-bezier(.22, .8, .3, 1);
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translate(-50%, 100%) } to { transform: translate(-50%, 0) } }

.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; }

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 13px; color: var(--ink-2);
  margin-bottom: 7px; font-weight: 500;
}
.field-label i { color: var(--brand); font-style: normal; }

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  background: #f6f7f9;
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: border-color .15s, background .15s;
  outline: none;
  font-family: inherit;
}
.field input::placeholder { color: #b3b8c2; }
.field input:focus { background: #fff; border-color: var(--brand); }

.stepper {
  display: inline-flex; align-items: center;
  height: 42px;
  border: 1px solid #e3e6eb;
  border-radius: 10px;
  overflow: hidden;
}
.step-btn {
  width: 44px; height: 100%;
  font-size: 20px; color: var(--ink-2);
  background: #f7f8fa;
}
.step-btn:active { background: #eef0f4; }
.stepper input {
  width: 56px; height: 100%;
  text-align: center;
  border: none; background: #fff;
  font-size: 15px; font-weight: 600;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sheet-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 0 16px;
  margin-top: 4px;
  border-top: 1px dashed #e8ebf0;
  font-size: 14px; color: var(--ink-2);
}
.sheet-total strong { font-size: 23px; color: var(--brand); font-weight: 700; }

.sheet-tip {
  text-align: center; font-size: 12px; color: var(--ink-3);
  margin: 10px 0 0;
}

/* 联系主办方 */
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: #f6f7f9;
  border-radius: 12px;
}
.contact-item:active { background: #eef0f4; }
.contact-ico {
  flex: 0 0 36px; height: 36px;
  border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 90, 31, .09); color: var(--brand);
}
.contact-body { display: flex; flex-direction: column; gap: 2px; }
.contact-label { font-size: 12px; color: var(--ink-3); }
.contact-value { font-size: 15px; font-weight: 600; }

/* Toast */
.toast {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(22, 24, 29, .88);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  max-width: 76vw;
  text-align: center;
  animation: fadeIn .18s ease;
}

/* ===== 列表页 ===== */
.list-page { background: #fff; }
.top-bar {
  padding: calc(22px + env(safe-area-inset-top)) 18px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.top-bar h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.top-bar p { margin: 3px 0 0; font-size: 13px; color: var(--ink-3); }

.list { padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.empty { text-align: center; color: var(--ink-3); padding: 60px 0; font-size: 14px; }

.act-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  transition: transform .12s;
}
.act-card:active { transform: scale(.99); }
.act-card-img { aspect-ratio: 16 / 9; background: #e9ecf1; overflow: hidden; }
.act-card-img img { width: 100%; height: 100%; object-fit: cover; }
.act-card-body { padding: 14px 15px 16px; }
.act-card-body h3 {
  margin: 0 0 8px;
  font-size: 16px; font-weight: 650;
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.act-card-time { margin: 0 0 3px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.act-card-loc {
  margin: 0 0 12px; font-size: 12.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-card-foot { display: flex; align-items: center; gap: 8px; }
.price { font-size: 17px; font-weight: 700; color: var(--brand); }
.tag { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; font-weight: 600; }
.tag-warn { color: #b25a00; background: rgba(255, 149, 0, .13); }
.tag-muted { color: var(--ink-3); background: #f1f3f6; }

/* ===== 结果页 ===== */
.result-page {
  padding: calc(30px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: #fff;
  min-height: 100vh;
  text-align: center;
}
.result-page .card { text-align: left; }
.result-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.result-icon.ok { color: #0a9c5d; background: rgba(10, 156, 93, .1); }
.result-icon.wait { color: var(--brand); background: rgba(255, 90, 31, .1); }
.result-title { margin: 0 0 6px; font-size: 21px; font-weight: 700; }
.result-sub { margin: 0 0 24px; font-size: 13.5px; color: var(--ink-2); }
.result-card { text-align: left; }
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.kv {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.kv:last-child { border-bottom: none; }
.kv span { color: var(--ink-3); flex: 0 0 auto; }
.kv strong { font-weight: 600; text-align: right; }
.kv .money { color: var(--brand); font-size: 15px; }
.kv .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.mock-badge {
  display: inline-block;
  font-size: 11.5px; font-weight: 600;
  color: #b25a00; background: rgba(255, 149, 0, .14);
  padding: 4px 10px; border-radius: 20px;
  margin-bottom: 22px;
}

/* 桌面端微调 */
@media (min-width: 641px) {
  body { background: #eceef2; }
  .page { box-shadow: 0 0 40px rgba(0, 0, 0, .07); }
  .bottom-bar { box-shadow: 0 -6px 24px rgba(22, 24, 29, .08); }
}

/* ===== PC 扫码支付页 ===== */
.qr-page {
  padding: 40px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  padding: 28px 22px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.qr-head { margin-bottom: 18px; }

.qr-label {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: .5px;
}

.qr-amount {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--ink);
}

.qr-amount::before { font-size: 20px; margin-right: 2px; }

.qr-activity {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-box {
  width: 240px;
  height: 240px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box img,
.qr-box canvas { display: block; width: 208px; height: 208px; }

.qr-loading {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
}

.qr-tip {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.qr-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.qr-meta span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-actions {
  width: 100%;
  max-width: 380px;
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.qr-status {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}
