:root {
  --theme-primary: #EF4444; --theme-primary-light: #FEE2E2; --theme-secondary: #3B82F6;
  --theme-bg: #FFFFFF; --theme-accent: #F59E0B; --theme-text: #374151;
  --theme-card: #FFFFFF; --theme-border: #E5E7EB; --theme-success: #10B981;
  --theme-danger: #EF4444; --theme-warning: #F59E0B; --theme-info: #3B82F6;
  --contact-footer-h: 92px; --bottom-nav-h: 52px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-chrome-h: calc(var(--contact-footer-h) + var(--bottom-nav-h));
  --float-gap: 12px; --zw-fab-size: 56px;
}
[data-theme="sunshine"] {
  --theme-primary: #F59E0B; --theme-primary-light: #FDE68A; --theme-secondary: #F97316;
  --theme-bg: #FFFBEB; --theme-accent: #10B981; --theme-text: #78350F;
  --theme-card: #FFFFFF; --theme-border: #FDE68A; --theme-success: #10B981;
  --theme-danger: #EF4444; --theme-warning: #F59E0B; --theme-info: #3B82F6;
}
[data-theme="sky"] {
  --theme-primary: #3B82F6; --theme-primary-light: #BFDBFE; --theme-secondary: #A855F7;
  --theme-bg: #EFF6FF; --theme-accent: #F472B6; --theme-text: #1E3A5F;
  --theme-card: #FFFFFF; --theme-border: #BFDBFE; --theme-success: #10B981;
  --theme-danger: #EF4444; --theme-warning: #F59E0B; --theme-info: #2563EB;
}
[data-theme="nature"] {
  --theme-primary: #059669; --theme-primary-light: #A7F3D0; --theme-secondary: #92400E;
  --theme-bg: #ECFDF5; --theme-accent: #F59E0B; --theme-text: #064E3B;
  --theme-card: #FFFFFF; --theme-border: #A7F3D0; --theme-success: #059669;
  --theme-danger: #EF4444; --theme-warning: #D97706; --theme-info: #0284C7;
}
[data-theme="sakura"] {
  --theme-primary: #EC4899; --theme-primary-light: #FBCFE8; --theme-secondary: #9CA3AF;
  --theme-bg: #FDF2F8; --theme-accent: #8B5CF6; --theme-text: #831843;
  --theme-card: #FFFFFF; --theme-border: #FBCFE8; --theme-success: #10B981;
  --theme-danger: #EF4444; --theme-warning: #F59E0B; --theme-info: #6366F1;
}
[data-theme="rainbow"] {
  --theme-primary: #EF4444; --theme-primary-light: #FEE2E2; --theme-secondary: #3B82F6;
  --theme-bg: #FFFFFF; --theme-accent: #F59E0B; --theme-text: #374151;
  --theme-card: #FFFFFF; --theme-border: #E5E7EB; --theme-success: #10B981;
  --theme-danger: #DC2626; --theme-warning: #F59E0B; --theme-info: #3B82F6;
}
[data-theme="ocean"] {
  --theme-primary: #1E40AF; --theme-primary-light: #DBEAFE; --theme-secondary: #F97316;
  --theme-bg: #F0F9FF; --theme-accent: #06B6D4; --theme-text: #1E3A5F;
  --theme-card: #FFFFFF; --theme-border: #DBEAFE; --theme-success: #0D9488;
  --theme-danger: #EF4444; --theme-warning: #F97316; --theme-info: #0284C7;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif;background:var(--theme-bg);color:var(--theme-text);line-height:1.5;max-width:480px;margin:0 auto}
body.has-contact-footer.has-bottom-nav{padding-bottom:calc(var(--bottom-chrome-h) + 8px + var(--safe-area-bottom))}
body.share-page{padding-bottom:calc(var(--contact-footer-h) + 16px + var(--safe-area-bottom))}
button,input,select,textarea{font:inherit}
a{color:inherit;text-decoration:none}
.nav-bar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--theme-card);border-bottom:1px solid var(--theme-border);position:sticky;top:0;z-index:80}
.nav-logo{font-weight:700;font-size:15px;flex:1;text-align:center}
.nav-btn{font-size:18px;padding:8px;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;background:none;border:none;color:inherit}
.view-container{padding:12px 16px 16px}
.page-header h1{font-size:20px;margin-bottom:4px}
.sub{font-size:12px;color:var(--theme-text);opacity:.75}
.section-title{font-size:15px;font-weight:700;margin:14px 0 8px}
.stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}
.stat-card{background:var(--theme-card);border:1px solid var(--theme-border);border-radius:12px;padding:10px 6px;text-align:center}
.stat-val{font-size:16px;font-weight:800;color:var(--theme-primary)}
.stat-label{font-size:10px;opacity:.8}
.card-list{display:flex;flex-direction:column;gap:10px}
.card{background:var(--theme-card);border:1px solid var(--theme-border);border-radius:14px;padding:14px;box-shadow:0 2px 8px rgba(0,0,0,.04)}
.card.clickable{cursor:pointer}
.card.clickable:active{transform:scale(.99)}
.card-title{font-weight:700;font-size:15px}
.card-sub{font-size:12px;opacity:.75;margin-top:4px}
.card-stats{font-size:11px;margin-top:8px;display:flex;gap:12px}
.chip{display:inline-flex;align-items:center;padding:6px 12px;border-radius:999px;border:1px solid var(--theme-border);background:var(--theme-card);font-size:12px;margin:4px 4px 0 0}
.chip.active{background:var(--theme-primary-light);border-color:var(--theme-primary);color:var(--theme-text)}
.chip-row{display:flex;flex-wrap:wrap;gap:6px}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:12px;border:1px solid var(--theme-border);background:var(--theme-card);color:var(--theme-text);cursor:pointer;min-height:44px;font-size:14px}
.btn-primary{background:var(--theme-primary);border-color:var(--theme-primary);color:#fff}
.btn-block{display:flex;width:100%;margin-top:10px}
.btn-sm{padding:6px 10px;font-size:12px;min-height:36px}
.field-input{width:100%;padding:10px 12px;border:1px solid var(--theme-border);border-radius:10px;margin:6px 0 12px;background:#fff}
.form-field{display:block;margin-bottom:10px}
.field-label{font-size:13px;font-weight:600}
.bottom-nav{position:fixed;left:0;right:0;bottom:calc(var(--contact-footer-h) + var(--safe-area-bottom));max-width:480px;margin:0 auto;height:var(--bottom-nav-h);display:grid;grid-template-columns:repeat(4,1fr);background:var(--theme-card);border-top:1px solid var(--theme-border);z-index:90}
.bottom-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:none;background:none;font-size:11px;color:var(--theme-text);opacity:.7;min-height:44px}
.bottom-tab.active{opacity:1;color:var(--theme-primary);font-weight:700}
.contact-footer{position:fixed;left:0;right:0;bottom:0;z-index:100;background:#1a1a1a;color:#fff;padding:10px 12px calc(10px + var(--safe-area-bottom))}
.contact-footer__btns{display:grid;grid-template-columns:repeat(3,minmax(0,88px));gap:8px;max-width:320px;margin:0 auto 6px;justify-content:center}
.contact-footer__cta,.contact-footer__btn{display:flex;align-items:center;justify-content:center;padding:.48rem .2rem;font-size:.72rem;border-radius:8px;min-height:40px}
.contact-footer__cta{background:#c41e1e!important;color:#fff!important;font-weight:700}
.contact-footer__btn{border:1px solid rgba(255,255,255,.35);background:transparent;color:#fff}
.contact-footer__brand{text-align:center;font-size:10px;opacity:.75;line-height:1.3}
.toast-box{position:fixed;top:80px;left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px}
.toast{background:rgba(0,0,0,.85);color:#fff;padding:10px 16px;border-radius:999px;font-size:13px}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center;z-index:300}
.modal-sheet{background:#fff;border-radius:16px 16px 0 0;padding:20px;width:100%;max-width:480px}
.type-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:12px}
.type-card{padding:16px;border-radius:14px;border:1px solid var(--theme-border);background:var(--theme-card);font-size:14px;min-height:64px}
.masonry-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.photo-action-bar{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.photo-action-bar__btn{margin:0;min-height:46px;font-size:13px;font-weight:600}
.photo-action-bar__btn--camera{border-color:var(--theme-primary);color:var(--theme-primary);background:var(--theme-card)}
.photo-wall-page h1{margin-bottom:4px}
.masonry-item img{width:100%;border-radius:10px;display:block}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.9);z-index:400;display:flex;align-items:center;justify-content:center}
.lightbox-img{max-width:90%;max-height:80vh;border-radius:8px}
.share-main{padding:24px 16px;text-align:center}
.share-desc{font-size:14px;opacity:.8;margin:8px 0 16px}
.qr-wrap{margin:12px auto}
.theme-grid{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.theme-swatch{padding:10px 14px;border-radius:10px;border:2px solid transparent;font-size:12px}
.theme-swatch.active{border-color:var(--theme-primary)}

.theme-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:10px}
.theme-picker__item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:12px 8px;border:2px solid var(--theme-border);border-radius:14px;background:var(--theme-card);cursor:pointer;min-height:92px;transition:border-color .2s,box-shadow .2s}
.theme-picker__item:active{transform:scale(.98)}
.theme-picker__item.active{border-color:var(--theme-primary);box-shadow:0 0 0 3px var(--theme-primary-light)}
.theme-picker__swatch{display:flex;align-items:center;justify-content:center;gap:5px}
.theme-picker__dot{width:24px;height:24px;border-radius:50%;border:1px solid rgba(0,0,0,.1);box-shadow:inset 0 -2px 4px rgba(0,0,0,.06)}
.theme-picker__label{font-size:11px;font-weight:700;text-align:center;line-height:1.35;color:var(--theme-text)}
.settings-section{margin-top:18px;padding-top:4px}
.settings-section__title{font-size:15px;font-weight:700;margin-bottom:4px}
.settings-section__hint{font-size:11px;opacity:.65;margin-bottom:2px}
.settings-page h1{margin-bottom:12px}
.form-block{margin-bottom:14px}
.class-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.class-row{display:flex;justify-content:space-between;padding:10px 12px;background:var(--theme-card);border:1px solid var(--theme-border);border-radius:10px;font-size:13px}
body[data-brand="kindergarten-chain"].has-contact-footer:not(.share-page) .zw-root .zw-fab{bottom:calc(var(--bottom-chrome-h) + var(--float-gap) + var(--safe-area-bottom));right:10px;z-index:855}
body[data-brand="kindergarten-chain"].share-page.has-contact-footer .zw-root .zw-fab{bottom:calc(var(--contact-footer-h) + var(--float-gap) + var(--safe-area-bottom));right:10px;z-index:855}
body[data-brand="kindergarten-chain"].has-contact-footer:not(.share-page) .em-entry-btn{bottom:calc(var(--bottom-chrome-h) + var(--float-gap) + var(--safe-area-bottom));z-index:860;max-width:calc(100vw - 88px);font-size:.78rem;padding:.48rem .95rem}
body[data-brand="kindergarten-chain"].share-page.has-contact-footer .em-entry-btn{bottom:calc(var(--contact-footer-h) + 12px + var(--safe-area-bottom));max-width:calc(100vw - 88px)}
body[data-brand="kindergarten-chain"] .toast{bottom:calc(var(--bottom-chrome-h) + var(--float-gap) + 52px + 14px + var(--safe-area-bottom))}
.editable-field{outline:2px dashed var(--theme-primary);outline-offset:2px;border-radius:6px}

/* ── 活动详情页 ── */
.detail-page{display:flex;flex-direction:column;gap:0}
.detail-header{background:var(--theme-card);border:1px solid var(--theme-border);border-radius:16px;padding:14px 16px;margin-bottom:12px;box-shadow:0 2px 10px rgba(0,0,0,.04)}
.detail-header__top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.detail-header__title{font-size:18px;font-weight:800;line-height:1.35;margin-bottom:6px}
.detail-header__meta{font-size:12px;opacity:.8;line-height:1.5}
.detail-status{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:700;background:var(--theme-primary-light);color:var(--theme-primary)}
.detail-status--ended,.detail-status--closed{background:#F3F4F6;color:#6B7280}
.detail-type{font-size:11px;opacity:.65;text-transform:uppercase;letter-spacing:.04em}

.detail-kpi{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:14px}
.detail-kpi__item{background:var(--theme-card);border:1px solid var(--theme-border);border-radius:12px;padding:10px 4px;text-align:center}
.detail-kpi__val{font-size:17px;font-weight:800;color:var(--theme-primary);line-height:1.2}
.detail-kpi__val--ok{color:var(--theme-success)}
.detail-kpi__val--warn{color:var(--theme-warning)}
.detail-kpi__val--rate{color:var(--theme-info)}
.detail-kpi__label{font-size:10px;opacity:.75;margin-top:2px}

.detail-segment{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:5px;background:rgba(0,0,0,.04);border-radius:14px;margin-bottom:12px;border:1px solid var(--theme-border)}
.detail-segment__btn{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:58px;padding:8px 4px;border:none;border-radius:11px;background:transparent;color:var(--theme-text);cursor:pointer;transition:background .2s,box-shadow .2s,transform .15s;-webkit-tap-highlight-color:transparent}
.detail-segment__btn:active{transform:scale(.98)}
.detail-segment__btn.active{background:var(--theme-card);box-shadow:0 2px 10px rgba(0,0,0,.08);font-weight:700;color:var(--theme-primary)}
.detail-segment__icon{font-size:20px;line-height:1}
.detail-segment__label{font-size:12px;line-height:1.2}
.detail-segment__badge{position:absolute;top:6px;right:calc(50% - 28px);min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--theme-primary);color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center}

.detail-body{min-height:120px}
.charts-wrap{display:flex;flex-direction:column;gap:12px;padding:4px 0}
.charts-wrap canvas{width:100%;height:auto;border-radius:12px;background:var(--theme-card);border:1px solid var(--theme-border)}

.roster-list{display:flex;flex-direction:column;gap:8px}
.roster-item{display:flex;align-items:center;gap:10px;padding:12px 14px;background:var(--theme-card);border:1px solid var(--theme-border);border-radius:12px}
.roster-item__idx{flex-shrink:0;width:28px;height:28px;border-radius:50%;background:var(--theme-primary-light);color:var(--theme-primary);font-size:12px;font-weight:800;display:flex;align-items:center;justify-content:center}
.roster-item__main{flex:1;min-width:0}
.roster-item__name{font-size:14px;font-weight:700}
.roster-item__phone{font-size:12px;opacity:.65;margin-top:2px}
.roster-item__tag{flex-shrink:0;font-size:10px;padding:3px 8px;border-radius:999px;background:rgba(16,185,129,.12);color:var(--theme-success);font-weight:600}

.detail-photos{padding:4px 0}
.detail-photos__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:12px}
.detail-photos__thumb{border-radius:12px;overflow:hidden;border:1px solid var(--theme-border);aspect-ratio:1}
.detail-photos__thumb img{width:100%;height:100%;object-fit:cover;display:block}

.admin-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px;padding-top:14px;border-top:1px dashed var(--theme-border)}
.admin-toolbar__btn{display:flex;align-items:center;justify-content:center;gap:6px;min-height:46px;padding:10px 12px;border-radius:12px;border:1px solid var(--theme-border);background:var(--theme-card);font-size:13px;font-weight:600;color:var(--theme-text);cursor:pointer}
.admin-toolbar__btn:active{transform:scale(.99)}
.admin-toolbar__btn--primary{background:var(--theme-primary);border-color:var(--theme-primary);color:#fff}

.empty-state{text-align:center;padding:28px 16px;background:var(--theme-card);border:1px dashed var(--theme-border);border-radius:14px}
.empty-state .empty-icon{font-size:36px;margin-bottom:8px}
.empty-state h3{font-size:15px;margin-bottom:6px}
.empty-state p{font-size:12px;opacity:.7;margin-bottom:12px}
