:root {
  --navy-900: #071527;
  --navy-800: #0b1f3a;
  --navy-700: #123158;
  --blue-600: #1a5fb4;
  --blue-500: #2a76d2;
  --blue-100: #e8f0fb;
  --gold: #c69a4e;
  --hero-1: #0b1f3a;
  --hero-2: #123158;
  --hero-3: #1a4c8a;
  --hero-glow: rgba(42, 118, 210, .55);
  --cover-url: none;
  --ink: #16202e;
  --ink-2: #47566b;
  --ink-3: #7c8a9c;
  --line: #e6ebf2;
  --bg: #f3f6fa;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(11, 31, 58, .06);
}

* { 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", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page { padding-bottom: 96px; }

/* ------------------------------ 顶部横幅 ------------------------------ */
.hero {
  position: relative;
  padding: 34px 20px 30px;
  background:
    radial-gradient(120% 80% at 85% 0%, var(--hero-glow) 0%, rgba(42, 118, 210, 0) 55%),
    linear-gradient(160deg, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%);
  color: #fff;
  overflow: hidden;
}
.hero.style-solid { background: var(--hero-3); }
.hero.style-cover {
  background-image:
    linear-gradient(180deg, rgba(7, 21, 39, .52), rgba(7, 21, 39, .84)),
    var(--cover-url);
  background-size: cover;
  background-position: center;
}
.hero-logo {
  display: block;
  height: 36px; width: auto;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  padding: 3px 7px;
  object-fit: contain;
}
.hero-logo[hidden] { display: none; }
.hero-cover {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}
.hero-cover[hidden] { display: none; }
.hero::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -90px;
  width: 240px; height: 240px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}
.hero-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
}
.hero-title {
  margin: 14px 0 8px;
  font-size: 25px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .5px;
}
.hero-sub {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chip {
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
}
.countdown {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 13px;
  color: rgba(255, 255, 255, .86);
  display: flex;
  gap: 8px;
  align-items: center;
}
.countdown b {
  font-size: 17px;
  color: #ffd79a;
  font-variant-numeric: tabular-nums;
  margin: 0 2px;
}
.countdown.closed b { color: #ffc9c9; }

/* ------------------------------ 活动切换条 ------------------------------ */
.switcher {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.switcher[hidden] { display: none; }
.switcher-inner {
  display: flex;
  gap: 8px;
  padding: 9px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.switcher-inner::-webkit-scrollbar { display: none; }
.sw-chip {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.sw-chip.active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.sw-tag { font-size: 11px; opacity: .72; margin-left: 5px; }

/* ------------------------------ 状态与回顾 ------------------------------ */
.status-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .26);
}
.status-badge[hidden] { display: none; }
.status-badge.finished { background: rgba(255, 215, 154, .2); color: #ffd79a; }
.status-badge.ongoing { background: rgba(120, 230, 170, .2); color: #b6f2d5; }
.note-card { border-left: 3px solid var(--gold); }
.note-body {
  white-space: pre-wrap;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ------------------------------- 卡片 ------------------------------- */
.content { padding: 14px 14px 0; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 4px; height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--blue-500), var(--navy-800));
}
.summary { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }

.kv { list-style: none; margin: 0; padding: 0; }
.kv li {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}
.kv li:first-child { border-top: 0; }
.kv .k { color: var(--ink-3); flex: 0 0 76px; }
.kv .v { color: var(--ink); flex: 1; word-break: break-all; }

/* ----------------------------- 名额卡片 ----------------------------- */
.quota-card { padding: 18px; }
.quota-head { display: flex; justify-content: space-between; align-items: center; }
.quota-num { font-size: 30px; font-weight: 700; color: var(--navy-800); line-height: 1.1; }
.quota-num small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.quota-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.quota-ring {
  width: 54px; height: 54px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--blue-600);
  background: conic-gradient(var(--blue-500) var(--p, 0%), var(--blue-100) 0);
  position: relative;
}
.quota-ring::before {
  content: ""; position: absolute; inset: 5px;
  background: #fff; border-radius: 50%;
}
.quota-ring > * { position: relative; }
.quota-ring small { font-size: 10px; font-weight: 500; }
.bar {
  height: 7px; background: var(--blue-100);
  border-radius: 999px; overflow: hidden; margin: 14px 0 8px;
}
.bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--navy-700));
  border-radius: 999px;
  transition: width .5s ease;
}
.quota-note { font-size: 12px; color: var(--ink-3); }
.quota-note.warn { color: #c0392b; font-weight: 600; }

/* ------------------------------ 议程时间轴 ------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 18px 84px;
  min-height: 30px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 62px; top: 12px; bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline .tl-time {
  position: absolute; left: 0; top: 1px;
  font-size: 13px; font-weight: 600; color: var(--blue-600);
  width: 54px;
}
.timeline .tl-dot {
  position: absolute; left: 58px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.timeline .tl-title { font-weight: 600; font-size: 14.5px; }
.timeline .tl-desc { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ------------------------------- 收费 ------------------------------- */
.fee-desc { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.fee-list { display: grid; gap: 10px; }
.fee-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fbfcfe;
}
.fee-item .fi-name { font-weight: 600; font-size: 14.5px; }
.fee-item .fi-desc { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.fee-item .fi-price {
  flex: 0 0 auto;
  font-size: 16px; font-weight: 700; color: var(--navy-800);
  white-space: nowrap;
}
.fee-item .fi-price.free { color: #c0392b; }

/* ------------------------------- 细则 ------------------------------- */
.rules { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 9px; color: var(--ink-2); font-size: 14px; }
.rules li:last-child { margin-bottom: 0; }

/* ------------------------------- 地点 ------------------------------- */
.place-name { font-weight: 600; font-size: 15px; }
.place-addr { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.place-actions { display: flex; gap: 10px; margin: 12px 0; }
.transport {
  font-size: 13px; color: var(--ink-2);
  background: #f7f9fc; border-radius: 10px; padding: 11px 13px;
  white-space: pre-line;
}

/* ------------------------------- 图集 ------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--blue-100);
}
.gallery img[hidden] { display: none; }
@media (min-width: 520px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ------------------------------- 表单 ------------------------------- */
.form-tip { margin: -6px 0 14px; font-size: 12.5px; color: var(--ink-3); }
.form-tip i, .field label i { color: #c0392b; font-style: normal; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink);
  background: #fbfcfe;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237c8a9c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.field textarea { resize: none; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue-500);
  background: #fff;
}
.field input.invalid, .field select.invalid { border-color: #e08a80; background: #fff6f5; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
.agree {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; color: var(--ink-3);
  margin: 4px 0 16px;
  line-height: 1.6;
}
.agree input { margin-top: 3px; width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--blue-600); }
.form-msg { margin: 10px 0 0; font-size: 13px; text-align: center; min-height: 20px; }
.form-msg.error { color: #c0392b; }
.form-msg.ok { color: #1e8e5a; }

/* ------------------------------- 按钮 ------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--navy-700)); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy-800); border-color: var(--line); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ------------------------------ 底部栏 ------------------------------ */
.bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  z-index: 30;
}
.bottom-info { display: flex; flex-direction: column; line-height: 1.25; }
.bottom-info span { font-size: 16px; font-weight: 700; color: var(--navy-800); }
.bottom-info small { font-size: 11.5px; color: var(--ink-3); }
.bottom-bar .btn { flex: 0 0 auto; min-width: 140px; }

/* ------------------------------- 弹层 ------------------------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(7, 21, 39, .55); }
.modal-body {
  position: relative;
  width: 100%; max-width: 520px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center;
  animation: rise .25s ease;
  max-height: 92vh; overflow-y: auto;
}
@keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.success-icon {
  width: 54px; height: 54px; margin: 0 auto 10px;
  border-radius: 50%;
  background: #e8f7ef; color: #1e8e5a;
  font-size: 26px; line-height: 54px;
}
.modal-body h3 { margin: 0 0 4px; font-size: 19px; }
.success-sub { margin: 0 0 16px; font-size: 13px; color: var(--ink-3); }
.success-card {
  text-align: left;
  background: #f7f9fc; border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.success-card div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.success-card span { color: var(--ink-3); flex: 0 0 62px; }
.success-card b { font-weight: 600; text-align: right; word-break: break-all; }
.poster { width: 100%; border-radius: 12px; margin-bottom: 14px; border: 1px solid var(--line); }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-tip { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }

/* ------------------------------- 页脚 ------------------------------- */
.footer { text-align: center; padding: 6px 20px 26px; color: var(--ink-3); }
.footer-org { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.footer-sub { font-size: 12px; margin-top: 2px; }

@media (min-width: 640px) {
  .content { max-width: 640px; margin: 0 auto; }
  .hero, .footer { max-width: 640px; margin: 0 auto; }
  .bottom-bar { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 14px 14px 0 0; }
}
