/* R52 活动报名系统 v1 */
:root {
  --primary: #1565C0; --accent: #42A5F5; --bg: #F0F4FA; --bg-light: #E3F2FD;
  --card: #FFF; --text: #0D2137; --text-muted: #607D8B; --border: #BBDEFB;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; background: var(--bg); color: var(--text); line-height: 1.65; padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
html.has-mobile-bar body { padding-bottom: calc(8.75rem + env(safe-area-inset-bottom)); }
img { max-width: 100%; display: block; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.persona-bar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; padding: .55rem 1rem; background: var(--card); border-bottom: 1px solid var(--border); }
.persona-btn { padding: .4rem .85rem; border-radius: 999px; border: 2px solid var(--border); background: var(--bg); cursor: pointer; font-weight: 600; font-size: .82rem; }
.persona-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.top-nav { position: sticky; top: 0; z-index: 200; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); }
body[data-appearance='dark'] .top-nav { background: rgba(15,20,28,.92); }
.top-nav.is-scrolled { border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.top-nav__row { display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; }
.top-nav__brand { font-weight: 800; color: var(--primary); font-size: .88rem; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-nav__menu { margin-left: auto; border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: .35rem .55rem; cursor: pointer; }
.top-nav__links { display: none; width: 100%; flex-direction: column; gap: .2rem; padding: 0 1rem 1rem; }
.top-nav__links.is-open { display: flex; }
.top-nav__links a, .top-nav__admin { color: var(--text-muted); padding: .45rem .65rem; border-radius: 6px; font-size: .82rem; border: none; background: none; cursor: pointer; text-align: left; }
.top-nav__share { border: 1px dashed var(--border) !important; }
.top-nav__admin { color: var(--primary) !important; font-weight: 700; }
@media (min-width: 768px) {
  .top-nav__menu { display: none; }
  .top-nav__links { display: flex !important; flex-direction: row; width: auto; margin-left: auto; padding: 0; align-items: center; }
}

.theme-panel { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 180; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.theme-appearance-btn, .theme-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.theme-appearance-btn { background: var(--card); font-size: .72rem; line-height: 22px; text-align: center; }
.theme-dot.active { outline: 2px solid var(--text); }

.mobile-bar { position: fixed; left: 0; right: 0; bottom: calc(4.25rem + env(safe-area-inset-bottom)); z-index: 840; display: flex; background: var(--card); border-top: 1px solid var(--border); }
.mobile-bar__btn { flex: 1; padding: .55rem .2rem; border: none; background: none; font-size: .66rem; color: var(--text-muted); text-align: center; cursor: pointer; text-decoration: none; }
@media (min-width: 768px) { .mobile-bar { display: none; } html.has-mobile-bar body { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); } }

.contact-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 850; padding: .45rem .75rem calc(.45rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--border); }
.contact-footer__btns { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; max-width: 420px; margin: 0 auto; }
.contact-footer__cta, .contact-footer__btn { padding: .4rem .85rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.contact-footer__cta { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
body[data-appearance='dark'] .contact-footer__cta { color: #111; }
.contact-footer__btn { background: var(--card); border: 1px solid var(--border); cursor: pointer; }
.contact-footer__brand { text-align: center; font-size: .62rem; color: var(--text-muted); margin-top: .35rem; }

.glass-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.section { padding: 2.5rem 1.25rem; max-width: 720px; margin: 0 auto; }
.section__title { font-size: 1.3rem; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: .35rem; }
.section__sub { text-align: center; font-size: .82rem; color: var(--text-muted); margin-bottom: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1.15rem; border-radius: 999px; font-weight: 600; font-size: .88rem; border: none; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
body[data-appearance='dark'] .btn-primary { color: #111; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-sm { padding: .4rem .75rem; font-size: .78rem; }
.btn-block { display: block; width: 100%; margin-top: .5rem; text-align: center; }

.hero { position: relative; min-height: 380px; display: flex; align-items: flex-end; max-width: none; padding: 0; }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.4)); }
.hero__content { position: relative; z-index: 1; color: #fff; padding: 2rem 1.25rem; max-width: 720px; margin: 0 auto; width: 100%; text-align: center; }
.hero__content h1 { font-size: 1.45rem; font-weight: 800; margin-bottom: .35rem; }
.hero__slogan { font-size: .9rem; opacity: .92; margin-bottom: .5rem; }
.hero__meta { font-size: .78rem; opacity: .85; margin-bottom: 1rem; line-height: 1.6; }

.quota-global { padding: .85rem 1rem; margin: 0 auto 1rem; max-width: 360px; text-align: left; color: var(--text); }
.quota-global__head { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .35rem; }
.quota-bar { height: 8px; background: var(--bg-light); border-radius: 999px; overflow: hidden; }
.quota-bar--sm { height: 5px; margin: .35rem 0; }
.quota-bar__fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
.quota-bar__fill--hot { background: #DC2626; }
.quota-global__hint { font-size: .72rem; color: var(--text-muted); margin-top: .35rem; text-align: center; }

.step-indicator { display: flex; justify-content: center; gap: .5rem; margin-bottom: 1rem; }
.step-indicator__item { flex: 1; max-width: 100px; text-align: center; padding: .5rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card); font-size: .72rem; color: var(--text-muted); }
.step-indicator__item.active { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.step-indicator__item.done { opacity: .65; }
.step-indicator__item span { display: block; font-size: 1.1rem; }

.wizard { padding: 1.25rem; }
.wizard-step__title { font-size: .95rem; margin-bottom: 1rem; color: var(--primary); }
.ticket-grid { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1rem; }
.ticket-card { text-align: left; padding: 1rem; border-radius: 12px; border: 2px solid var(--border); background: var(--bg); cursor: pointer; width: 100%; }
.ticket-card.active { border-color: var(--primary); background: var(--bg-light); }
.ticket-card.sold-out { opacity: .55; cursor: not-allowed; }
.ticket-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .25rem; }
.ticket-card__price { color: var(--primary); font-weight: 800; }
.ticket-card__desc { font-size: .78rem; color: var(--text-muted); margin-bottom: .25rem; }
.ticket-card__quota { font-size: .72rem; margin-top: .25rem; }
.ticket-card__perks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.ticket-card__perks span { font-size: .65rem; padding: .15rem .45rem; border-radius: 4px; background: var(--bg-light); border: 1px solid var(--border); }

.qty-row { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.qty-row select { padding: .45rem .65rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); }

.form-field { margin-bottom: .65rem; }
.form-field label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .25rem; }
.form-field input, .form-field select { width: 100%; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }

.wizard-nav { display: flex; gap: .5rem; margin-top: 1rem; }
.wizard-nav .btn { flex: 1; }

.referral-banner { padding: .85rem; margin: 1rem 0; font-size: .82rem; }
.referral-banner span { font-weight: 700; color: var(--primary); }

.confirm-card { padding: 1rem; margin-bottom: .5rem; }
.confirm-card p { font-size: .85rem; margin-bottom: .35rem; }
.confirm-card__total { font-size: 1.1rem; color: var(--primary); font-weight: 800; margin-top: .5rem !important; }
.confirm-list { list-style: none; font-size: .78rem; color: var(--text-muted); margin-top: .75rem; }
.confirm-list li { margin-bottom: .2rem; }

.stats-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.stats-summary__item { padding: 1rem; text-align: center; }
.stats-summary__item strong { display: block; font-size: 1.35rem; color: var(--primary); }
.stats-summary__item small { font-size: .68rem; color: var(--text-muted); }

.charts-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .charts-grid { grid-template-columns: 1fr 1fr; } }
.chart-box { padding: 1rem; }
.chart-box h4 { font-size: .85rem; margin-bottom: .75rem; color: var(--text-muted); }
.recent-list { padding: 1rem; margin-top: 1rem; }
.recent-list ul { list-style: none; font-size: .78rem; }
.recent-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.recent-list .muted { color: var(--text-muted); }

.embed-snippet { padding: 1rem; overflow-x: auto; font-size: .72rem; text-align: left; white-space: pre-wrap; word-break: break-all; }

.modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal__box { position: relative; background: var(--card); border-radius: 16px; padding: 1.5rem; max-width: 360px; width: 100%; text-align: center; }
.modal__close { position: absolute; right: .75rem; top: .75rem; border: none; background: none; cursor: pointer; font-size: 1.1rem; }
.ticket-code { font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: .04em; margin: .5rem 0; }
.muted { color: var(--text-muted); font-size: .78rem; }

.signup-toast { position: fixed; left: 50%; bottom: calc(6rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(0,0,0,.85); color: #fff; padding: .55rem 1rem; border-radius: 999px; font-size: .82rem; z-index: 999; opacity: 0; pointer-events: none; transition: .3s; }
.signup-toast--show { opacity: 1; }

.embed-frame { min-height: 100vh; padding: 1rem; background: var(--bg); }
.embed-frame__head { text-align: center; margin-bottom: 1rem; font-size: .82rem; color: var(--text-muted); }

@media (max-width: 767px) {
  .theme-panel { top: auto; bottom: calc(7.75rem + env(safe-area-inset-bottom)); transform: none; flex-direction: row; right: 8px; max-height: none; overflow-x: auto; }
}
