:root {
  --ios-blue: #007AFF;
  --ios-bg: #F2F2F7;
  --ios-card: #FFFFFF;
  --ios-text: #1C1C1E;
  --ios-secondary: #8E8E93;
  --ios-separator: #E5E5EA;
  --ios-red: #FF3B30;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
}

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

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: #D8D8DE;
  color: var(--ios-text);
  -webkit-font-smoothing: antialiased;
}

.phone-frame {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--ios-bg);
}

.app-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ---------- 页面切换 ---------- */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--ios-bg);
  transition: transform .34s cubic-bezier(.4,0,.2,1), filter .34s ease;
}
#page-form { transform: translateX(0); z-index: 1; }
#page-preview { transform: translateX(100%); z-index: 2; }
#page-form.slide-back { transform: translateX(-25%); filter: brightness(0.88); }
#page-preview.active { transform: translateX(0); }

/* ---------- 导航栏 ---------- */
.nav-bar {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(242,242,247,0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ios-separator);
}
.nav-bar h1 { font-size: 17px; font-weight: 600; }
.nav-back {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: none;
  border: none;
  color: var(--ios-blue);
  font-size: 16px;
  padding: 4px 8px;
  font-family: inherit;
}

/* ---------- 滚动区 ---------- */
.form-scroll, .preview-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

/* ---------- 图片上传 ---------- */
.image-upload {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #E9E9EE;
}
.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ios-secondary);
  font-size: 14px;
  border: 1.5px dashed #C7C7CC;
  border-radius: 14px;
}
.image-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 表单卡片 ---------- */
.form-card {
  background: var(--ios-card);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.field {
  position: relative;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--ios-separator);
  transition: background .15s ease;
}
.field:last-child { border-bottom: none; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--ios-secondary);
  margin-bottom: 3px;
}
.field input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--ios-text);
  font-family: inherit;
  padding: 2px 0;
}
.field input::placeholder { color: #C7C7CC; }
.field.invalid { background: rgba(255,59,48,0.07); }
.field.invalid label { color: var(--ios-red); }
.field-error {
  display: none;
  font-size: 12px;
  color: var(--ios-red);
  margin-top: 4px;
}
.field.invalid .field-error { display: block; }

.prefix-input { display: flex; align-items: center; gap: 4px; }
.prefix-input span { font-size: 16px; color: var(--ios-text); }
.prefix-input input { flex: 1; }

/* ---------- 底部按钮栏 ---------- */
.bottom-bar {
  flex-shrink: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(242,242,247,0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--ios-separator);
}
.btn-primary, .btn-secondary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
}
.btn-primary { background: var(--ios-blue); color: #fff; }
.btn-primary:active { background: #0062CC; }
.btn-secondary { background: #E5E5EA; color: var(--ios-blue); }
.btn-secondary:active { background: #D1D1D6; }

/* ---------- 预览头部（橙色渐变） ---------- */
.hero {
  flex-shrink: 0;
  padding: max(14px, env(safe-area-inset-top)) 16px 18px;
  background: linear-gradient(135deg, #FF9500, #FF3B30);
  border-radius: 0 0 20px 20px;
  color: #fff;
}
.hero-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.hero-back {
  position: absolute;
  left: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 4px 8px;
  margin-left: -8px;
  font-family: inherit;
}
.hero-title { font-size: 17px; font-weight: 600; }
.hero-price { margin-bottom: 14px; }
.hero-price-label { font-size: 13px; opacity: 0.85; }
.hero-price-value { font-size: 32px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.countdown-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 6px 12px;
}
.countdown-label { font-size: 13px; opacity: 0.9; }
.cd-units { display: flex; align-items: center; gap: 6px; }
.cd-unit { min-width: 0; display: flex; flex-direction: column; align-items: center; color: #fff; }
.cd-unit span {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,0.2);
  padding: 1px 6px;
  border-radius: 5px;
}
.cd-unit small { font-size: 9px; opacity: 0.85; margin-top: 2px; }
.cd-sep { font-size: 14px; font-weight: 700; opacity: 0.8; }
.countdown-ended-text { font-size: 13px; }

/* ---------- 预览海报 ---------- */
.poster {
  position: relative;
  background: var(--ios-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}
.poster-image-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #E9E9EE; }
.poster-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-secondary);
  font-size: 14px;
}

.poster-body { padding: 16px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.title-row h2 { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; word-break: break-word; }
.session-tag {
  flex-shrink: 0;
  background: rgba(0,122,255,0.1);
  color: var(--ios-blue);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
}
.session-tag:empty { display: none; }

.info-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.info-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: #3A3A3C; }
.info-icon { flex-shrink: 0; }
.info-text { flex: 1; min-width: 0; line-height: 1.4; word-break: break-word; }

/* ---------- 水印 ---------- */
.watermark {
  position: absolute;
  inset: -20%;
  z-index: 5;
  pointer-events: none;
  transform: rotate(-22deg);
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.watermark-row {
  color: rgba(0,0,0,0.07);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 2px;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 50;
  opacity: 0;
  transition: all .25s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 订单详情视觉还原 ---------- */
.order-page { background: #f3f5fa; color: #101828; }
.order-hero { height: 370px; margin: 0 -29px; padding: 0 46px; color: #fff; background: linear-gradient(135deg,#ff4b16 0%,#ff5a0a 48%,#ff3b16 100%); }
.order-nav { height: 104px; padding-top: env(safe-area-inset-top); position: relative; display: flex; justify-content: center; align-items: center; }
.order-nav h1 { font-size: 22px; font-weight: 500; }
.order-back { position: absolute; left: 5px; width: 22px; height: 22px; border: 0; border-left: 4px solid white; border-bottom: 4px solid white; transform: rotate(45deg); background: transparent; }
.pay-summary { padding-top: 27px; }
.pay-summary h2 { font-size: 34px; font-weight: 700; letter-spacing: .5px; }
.pay-countdown { margin-top: 13px; font-size: 21px; opacity: .9; }
.pay-countdown #cdUnits { margin-left: 3px; }
.pay-countdown b { font-weight: 400; }
.pay-actions { display: flex; gap: 20px; margin-top: 38px; }
.pay-actions button { height: 48px; width: 106px; border: 0; border-radius: 13px; font: 600 16px var(--font); }
.cancel-order { color: #fff; background: rgba(255,255,255,.2); }
.pay-now { color: #f4511e; background: #fff; }
.order-scroll { padding: 0 29px 44px; background: #f3f5fa; }
.order-content { position: relative; z-index: 2; margin: -50px -29px 0; padding: 13px 29px 1px; border-radius: 32px 32px 0 0; background: #fafafa; }
.service-panel { margin: 0 -9px 24px; transform: translateY(-6px); }
.service-strip { height: 72px; padding: 0 30px; display: flex; align-items: center; gap: 20px; white-space: nowrap; overflow: hidden; border: 1px solid #f0f1f4; border-radius: 30px; background: #fff; box-shadow: 0 3px 12px rgba(28,38,54,.06); font-size: 17px; font-weight: 600; }
.order-content > .ticket-card, .order-content > .customer-card, .order-content > .delivery-card { margin-left: -9px; margin-right: -9px; }
.service-strip i { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 5px; border-radius: 50%; color: #fff; background: #17191d; font-style: normal; font-size: 12px; }
.service-strip i.warn { background: #ff5a17; }
.service-strip > b { margin-left: auto; color: #9da5b4; font-size: 36px; font-weight: 300; }
.ticket-card, .customer-card, .delivery-card { margin-bottom: 24px; border: 1px solid #f0f1f4; border-radius: 30px; background: #fff; box-shadow: 0 4px 14px rgba(28,38,54,.055); overflow: hidden; }
.ticket-card { padding: 25px 25px 24px; }
.event-overview { display: flex; gap: 17px; }
.event-poster { flex: 0 0 89px; height: 120px; border-radius: 10px; overflow: hidden; background: #374044; }
.poster-image { width: 100%; height: 100%; object-fit: cover; }
.default-poster { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #cbd0d0; background: radial-gradient(circle at 35% 35%,#b0bbb8,#3e4748 52%,#1c2526); text-align: center; }
.default-poster strong { font-size: 13px; letter-spacing: 2px; }
.default-poster em { margin-top: 16px; font-size: 15px; font-style: normal; }
.default-poster small { font-size: 11px; }
.event-copy { min-width: 0; padding-top: 4px; }
.event-copy h2 { font-size: 24px; line-height: 1.3; font-weight: 700; }
.event-copy p { margin-top: 7px; color: #9ba4b4; font-size: 19px; }
.event-copy a { display: block; margin-top: 5px; color: #2699e4; font-size: 19px; text-decoration: none; }
.event-copy a small { padding: 3px 6px; border-radius: 5px; color: #fff; background: #2699e4; font-size: 14px; }
.event-time { display: flex; align-items: center; height: 58px; margin-top: 25px; padding: 0 17px; gap: 45px; border-radius: 10px; background: #e5f6ff; color: #27a4e9; font-size: 20px; }
.event-time b { font-weight: 500; }.event-time span { white-space: nowrap; }
.notice-link { padding: 28px 3px 25px; color: #279de3; text-align: right; font-size: 20px; }.notice-link b { font-size: 31px; font-weight: 300; vertical-align: -3px; }
.ticket-cut { position: relative; height: 1px; margin: 0 -25px 25px; border-top: 2px dashed #edf0f5; }.ticket-cut i { position: absolute; top: -14px; width: 27px; height: 27px; border-radius: 50%; background: #f3f5fa; }.ticket-cut i:first-child { left: -14px; }.ticket-cut i:last-child { right: -14px; }
.buyer-row, .seat-row, .amount-row { display: flex; align-items: center; }.seat-row, .amount-row { justify-content: space-between; }.buyer-row { justify-content: flex-start; gap: 10px; }.buyer-row strong { font-size: 25px; }.buyer-row span { padding: 5px 9px; border-radius: 6px; color: #a5adbc; background: #f6f7fa; font-size: 17px; }.seat-row { margin-top: 16px; font-size: 22px; }.seat-row b { font-weight: 400; }.warm-tip { margin-top: 22px; padding: 17px 26px; border-radius: 10px; color: #a7aebb; background: #f5f7fb; font-size: 18px; white-space: nowrap; }.amount-row { margin-top: 30px; font-size: 21px; }.amount-row b { font-size: 27px; }
.customer-card { height: 72px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; color: #9ba4b4; font-size: 19px; }.customer-card i { color: #8eb6ff; font-style: normal; }.customer-card span:first-child { color: #273348; }
.delivery-card { padding: 36px 46px; color: #929baa; font-size: 22px; }.delivery-card > div { display: flex; align-items: center; gap: 25px; min-height: 82px; border-bottom: 1px solid #f1f2f5; }.delivery-card > div:last-child { border: 0; }.delivery-card strong { color: #162033; font-size: 23px; }.delivery-card em { padding: 7px 12px; border: 2px solid #ff9a6f; border-radius: 8px; color: #ff8355; font-style: normal; font-size: 17px; }
.order-info-card { padding-top: 28px; }.order-info-card > h2 { margin-bottom: 38px; font-size: 28px; }.order-info-card .ticket-cut { margin-bottom: 24px; }.order-info-card .seat-row { margin-top: 10px; }.order-info-card .warm-tip { margin-top: 14px; }.order-info-card .amount-row { margin-top: 18px; }
.order-page .watermark { display: none; }

@media (max-width: 600px) {
  .order-scroll {
    padding: 0 18px 30px;
    zoom: .9;
  }
  .order-hero { height: 275px; margin: 0 -18px; padding: 0 36px; }
  .order-nav { height: 94px; transform: translateY(-26px); }
  .order-nav h1 { font-size: 20px; }
  .order-back { left: -18px; top: 50%; width: 14px; height: 14px; border-width: 0 0 3px 3px; transform: translateY(-50%) rotate(45deg); }
  .pay-summary { transform: translate(-18px, -38px); }
  .pay-summary h2 { font-size: 22px; }
  .pay-countdown { margin-top: 12px; font-size: 14px; }
  .pay-actions { gap: 12px; margin-top: 16px; }
  .pay-actions button { width: 90px; height: 40px; border-radius: 10px; font-size: 13px; }
  .order-content { margin: -50px -18px 0; padding: 13px 18px 1px; border-radius: 30px 30px 0 0; }
  .service-panel { margin: 0 -10px 8px; }
  .service-strip { height: 56px; padding: 0 20px; gap: 12px; border-radius: 18px; font-size: 11px; }
  .service-strip i { width: 17px; height: 17px; margin-right: 4px; font-size: 9px; }
  .service-strip > b { font-size: 23px; }
  .order-content > .ticket-card, .order-content > .customer-card, .order-content > .delivery-card { margin-left: -10px; margin-right: -10px; }
  .ticket-card, .customer-card, .delivery-card { border-radius: 22px; margin-bottom: 16px; }
  .order-content > .ticket-card:first-of-type { margin-bottom: 8px; }
  .order-content > .customer-card { margin-bottom: 8px; }
  .ticket-card { padding: 22px 23px; }
  .event-overview { gap: 15px; }
  .event-poster { flex-basis: 88px; height: 105px; border-radius: 9px; }
  .event-copy h2 { font-size: 16px; line-height: 1.35; }
  .event-copy p, .event-copy a { margin-top: 5px; font-size: 14px; }
  .event-copy a small { font-size: 10px; padding: 3px 5px; }
  .default-poster strong { font-size: 12px; }
  .default-poster em { margin-top: 16px; font-size: 14px; }
  .default-poster small { font-size: 10px; }
  .event-time { height: 52px; margin-top: 22px; padding: 0 16px; gap: 32px; font-size: 14px; }
  .notice-link { padding: 12px 2px 8px; font-size: 14px; }
  .notice-link b { font-size: 24px; }
  .ticket-cut { margin: 0 -23px 12px; }
  .buyer-row strong { font-size: 17px; }
  .buyer-row { gap: 8px; }
  .buyer-row span { padding: 4px 7px; font-size: 11px; }
  .seat-row { margin-top: 9px; font-size: 14px; }
  .warm-tip { margin-top: 14px; padding: 12px 13px; font-size: 11px; overflow: hidden; }
  .amount-row { margin-top: 18px; font-size: 14px; }
  .amount-row b { font-size: 19px; }
  .customer-card { height: 56px; padding: 0 20px; border-radius: 18px; font-size: 14px; }
  .delivery-card { padding: 20px 23px; font-size: 14px; }
  .delivery-card > div { min-height: 57px; gap: 16px; }
  .delivery-card strong { font-size: 15px; }
  .delivery-card em { font-size: 9px; padding: 4px 6px; }
  .order-info-card { padding-top: 22px; padding-bottom: 20px; }
  .order-info-card > h2 { margin-bottom: 38px; font-size: 19px; }
  .order-info-card .ticket-cut { margin-bottom: 18px; }
  .order-info-card .seat-row { margin-top: 7px; }
  .order-info-card .warm-tip { margin-top: 10px; font-size: 13px; }
  .order-info-card .amount-row { margin-top: 14px; }
}
