:root {
  --gold: #f7a934;
  --gold-2: #f5c842;
  --ink: #222;
  --muted: #8a8a8a;
  --line: #ededed;
  --bg: #f5f5f5;
  --danger: #ef4444;
  --ok: #16a34a;
  --blue: #2563eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 70px;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.top-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f0f0;
  border-radius: 22px;
  padding: 10px 14px;
}

.search-field i { color: #999; font-size: 18px; }
.search-field input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  min-width: 0;
}

.icon-btn, .go-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #333;
  font-size: 20px;
}

.go-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #fff;
  box-shadow: 0 2px 8px rgba(247, 169, 52, .35);
}

.banner-wrap { padding: 0 14px 14px; background: #fff; }
.hero-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-banner {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16 / 8.4;
  background: #ddd;
  scroll-snap-align: start;
}
.hero-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-banner span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  background: #fff;
}
.chip {
  border: 1px solid #eee;
  border-radius: 18px;
  background: #fff;
  padding: 7px 14px;
  font-size: 13px;
  color: #555;
  white-space: nowrap;
}
.chip.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
}
.section-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}
.section-more { font-size: 12px; color: #999; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 18px;
}
.event-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.event-card img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}
.event-card-body { padding: 10px; }
.event-title {
  min-height: 34px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price {
  color: var(--gold);
  font-size: 15px;
  font-weight: 900;
  margin-top: 6px;
}
.subline {
  color: #999;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 40;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
}
.page-head h1 {
  flex: 1;
  text-align: center;
  font-size: 18px;
  margin: 0 40px 0 0;
}

.panel {
  margin: 12px 14px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.detail-top { display: flex; gap: 14px; }
.detail-top img {
  width: 102px;
  height: 102px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}
.detail-title { font-size: 16px; font-weight: 900; line-height: 1.4; }
.detail-desc {
  color: #666;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.info-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 14px;
  color: #555;
}
.info-row i { color: #aaa; }

.ticket-option, .list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  background: #fff;
}
.ticket-option.active {
  border-color: var(--gold);
  background: #fff8e8;
}
.grow { flex: 1; min-width: 0; }
.strong { font-weight: 800; }
.small { color: #999; font-size: 12px; }
.status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.status.active, .status.paid, .status.success, .status.approved, .status.replied { background: #dcfce7; color: #15803d; }
.status.frozen, .status.pending { background: #fef3c7; color: #b45309; }
.status.voided, .status.used, .status.offline, .status.rejected { background: #fee2e2; color: #b91c1c; }

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  z-index: 50;
}
.primary-btn, .ghost-btn, .danger-btn {
  border: 0;
  border-radius: 24px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 15px;
}
.primary-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #fff;
}
.ghost-btn {
  border: 2px solid var(--gold);
  background: #fff;
  color: var(--gold);
}
.danger-btn {
  background: linear-gradient(135deg, #ff6b6b, #ef4444);
  color: #fff;
}
.bottom-bar button { flex: 1; }

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: 58px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
  display: flex;
  z-index: 60;
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #999;
  font-size: 10px;
  font-weight: 700;
}
.tabbar a.active { color: var(--gold); }
.tabbar i { font-size: 20px; }

.profile-top {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #fff;
  padding: 24px 18px 30px;
}
.profile-top-link {
  cursor: pointer;
}
.profile-top-link:active {
  filter: brightness(.98);
}
.profile-row { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: grid;
  place-items: center;
  font-size: 30px;
  border: 3px solid rgba(255,255,255,.45);
}
.stats {
  position: relative;
  z-index: 2;
  display: flex;
  margin: -16px 14px 14px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat { flex: 1; text-align: center; border-right: 1px solid #f1f1f1; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 19px; }
.stat span { display: block; color: #999; font-size: 12px; margin-top: 3px; }

.menu { background: #fff; margin: 0 0 12px; }
.menu a, .menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #f5f5f5;
  background: #fff;
  padding: 15px 18px;
  text-align: left;
  color: #333;
}
.menu .mi {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
}
.menu .arrow { margin-left: auto; color: #bbb; }

.form {
  display: grid;
  gap: 12px;
}
.form label { font-weight: 800; font-size: 13px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  outline: none;
}
.textarea { min-height: 90px; resize: vertical; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.45);
  z-index: 100;
}
.modal.open { display: flex; }
.modal-box {
  width: min(420px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h2 { margin: 0; font-size: 19px; }

.empty {
  padding: 32px 12px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%) translateY(10px);
  max-width: 86%;
  background: rgba(0,0,0,.78);
  color: #fff;
  border-radius: 20px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 200;
  font-size: 13px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.code-box {
  padding: 12px;
  border: 1px dashed #ddd;
  border-radius: 10px;
  background: #fafafa;
  text-align: center;
  font-weight: 900;
  letter-spacing: 1px;
  word-break: break-all;
}

@media (max-width: 380px) {
  .card-grid { gap: 10px; padding-left: 10px; padding-right: 10px; }
  .panel { margin-left: 10px; margin-right: 10px; }
}
