/* ============================================================
   少儿成长训练营 · H5 版样式（暖橙主题，移动优先响应式）
   ============================================================ */
:root {
  --primary: #F76B1C;
  --primary-light: #FFA45C;
  --bg: #FFF7EE;
  --card: #ffffff;
  --text: #3D3229;
  --text-sub: #9A8F84;
  --border: #F0E6DA;
  --danger: #e5484d;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(247, 107, 28, .1);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  background: var(--bg);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100vh;
}
#app { max-width: 720px; margin: 0 auto; padding: 16px 16px 84px; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }
img { display: block; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 6px; font-size: 11px; color: var(--text-sub);
}
.tabbar-item.active { color: var(--primary); font-weight: 600; }
.tabbar-icon { width: 22px; height: 22px; border-radius: 6px; position: relative; }
.tabbar-icon-home { border: 2px solid currentColor; border-radius: 6px; }
.tabbar-icon-records { border: 2px solid currentColor; border-radius: 50%; }
.tabbar-icon-admin { border: 2px solid currentColor; border-radius: 4px; }
.tabbar-icon-diy { border: 2px solid currentColor; }
.tabbar-icon-diy::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

/* ===== 通用卡片与状态 ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.section-title { font-size: 17px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, var(--primary-light), var(--primary)); }
.state { text-align: center; padding: 80px 24px; color: var(--text-sub); font-size: 15px; }
.state-btn { display: inline-block; margin-top: 20px; padding: 12px 36px; border-radius: 999px; background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font-size: 15px; font-weight: 600; border: none; }
.err-text { color: var(--danger); font-size: 14px; }
.empty { text-align: center; color: var(--text-sub); font-size: 13px; padding: 24px 0; }

.btn-primary { border: none; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--primary-light), var(--primary)); width: 100%; }
.btn-primary:disabled { opacity: .5; }
.btn-ghost { border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 14px; color: var(--text-sub); background: #fff; width: 100%; }
.btn-danger-text { color: var(--danger); font-size: 13px; background: none; border: none; }

/* ===== 首页活动卡片 ===== */
.act-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
.act-cover { width: 100%; height: 180px; object-fit: cover; background: #F5EDE3; }
.act-body { padding: 14px 16px 16px; }
.act-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.act-meta { font-size: 13px; color: var(--text-sub); line-height: 1.7; }
.act-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.act-quota { font-size: 12px; color: var(--primary); background: #FFF0E0; border-radius: 999px; padding: 4px 12px; font-weight: 600; }
.act-cta { font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--primary-light), var(--primary)); border-radius: 999px; padding: 8px 22px; }

/* 报名动态滚动条 */
.ticker { background: linear-gradient(90deg, #FFF0E0, #FFE3CC); border-radius: 999px; padding: 8px 16px; margin-bottom: 16px; font-size: 13px; color: #B25A17; overflow: hidden; height: 36px; position: relative; }
.ticker-item { position: absolute; left: 16px; right: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .5s, opacity .5s; line-height: 20px; }
.ticker-item.up { transform: translateY(-24px); opacity: 0; }

/* 联系栏横幅 */
.contact-banner {
  background: linear-gradient(120deg, #FF9A56, #F76B1C);
  border-radius: var(--radius); color: #fff; padding: 16px 18px;
  margin-bottom: 16px; font-size: 14px; line-height: 1.8;
  box-shadow: 0 8px 24px rgba(247, 107, 28, .25);
}
.contact-banner strong { font-size: 16px; }

/* ===== 表单 ===== */
.field { margin-bottom: 14px; }
.field-label { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; display: block; }
.field-input, .field-textarea, .field-select {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 12px 14px; outline: none; background: #FFFCF8; transition: border-color .2s;
}
.field-input:focus, .field-textarea:focus, .field-select:focus { border-color: var(--primary); }
.field-textarea { min-height: 90px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-sub); margin-top: -6px; margin-bottom: 12px; }

.agree-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); margin: 6px 0 16px; }
.agree-row input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ===== 管理后台 ===== */
.hero { background: linear-gradient(135deg, #FF9A56, #F76B1C); border-radius: var(--radius); padding: 18px; color: #fff; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(247, 107, 28, .25); }
.hero-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.hero-name { font-size: 17px; font-weight: 700; }
.hero-sub { font-size: 12px; opacity: .9; margin-top: 3px; }
.hero-logout { font-size: 13px; background: rgba(255,255,255,.2); border: none; color: #fff; border-radius: 999px; padding: 8px 16px; flex-shrink: 0; }

.chip { display: inline-block; font-size: 11px; border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.chip-id { background: #FFF0E0; color: var(--primary); }
.chip-role { background: #F5F5F5; color: var(--text-sub); }
.chip-super { background: var(--primary); color: #fff; }

.profile-row { display: flex; gap: 14px; align-items: flex-start; }
.avatar-btn { position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); background: #FFFCF8; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-sub); font-size: 12px; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-fields { flex: 1; }

.admin-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #FAF3EA; }
.admin-item:last-child { border-bottom: none; }
.team-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #FFF0E0; color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.admin-info { flex: 1; min-width: 0; }
.admin-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-name { font-size: 15px; font-weight: 600; }
.admin-uid { font-size: 11px; color: var(--text-sub); margin-top: 3px; word-break: break-all; }
.admin-remove { color: var(--danger); font-size: 13px; background: rgba(229,72,77,.06); border: 1px solid rgba(229,72,77,.3); border-radius: 8px; padding: 6px 14px; }

.quick-row { display: flex; gap: 12px; margin-bottom: 16px; }
.quick-card { flex: 1; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--primary); border: none; }

.mgr-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.mgr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mgr-title { font-size: 16px; font-weight: 700; }
.mgr-status { font-size: 11px; border-radius: 999px; padding: 3px 10px; font-weight: 600; background: #E8F7EE; color: #1F9D55; }
.mgr-status.closed { background: #F5F5F5; color: var(--text-sub); }
.mgr-meta { font-size: 12px; color: var(--text-sub); margin-top: 6px; }
.mgr-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mgr-btn { font-size: 13px; border-radius: 10px; padding: 8px 16px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.mgr-btn-primary { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; border-color: transparent; }
.mgr-btn-danger { color: var(--danger); border-color: rgba(229,72,77,.35); background: rgba(229,72,77,.06); }

/* 认领 / 登录框 */
.claim-box, .login-box { background: #FFFCF8; border: 1.5px dashed #FFD9B8; border-radius: var(--radius); padding: 18px; margin-top: 16px; text-align: center; }
.claim-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.claim-desc { font-size: 12px; color: var(--text-sub); margin: 8px 0 12px; line-height: 1.7; }

/* 图片宫格上传 */
.cover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.cover-cell { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #F5EDE3; }
.cover-cell img { width: 100%; height: 100%; object-fit: cover; }
.cover-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 12px; line-height: 22px; }
.cover-add { display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--border); border-radius: 12px; aspect-ratio: 1; color: var(--text-sub); font-size: 26px; background: #FFFCF8; cursor: pointer; position: relative; overflow: hidden; }
.cover-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ===== DIY 名片 ===== */
.points-badge { background: #FFF0E0; color: var(--primary); border: 1px solid #FFD9B8; padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.diy-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.diy-ratios { display: flex; gap: 10px; margin-top: 14px; }
.diy-ratio { flex: 1; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 0; text-align: center; cursor: pointer; background: #fff; }
.diy-ratio-name { font-size: 15px; font-weight: 600; }
.diy-ratio-size { font-size: 11px; color: var(--text-sub); margin-top: 3px; }
.diy-ratio.active { border-color: var(--primary); background: #FFF0E0; }
.diy-ratio.active .diy-ratio-name { color: var(--primary); }
.diy-result { display: flex; gap: 16px; align-items: flex-start; }
.diy-poster { width: 210px; height: 280px; border-radius: 12px; object-fit: cover; background: #F5EDE3; }
.diy-qr { width: 130px; height: 130px; background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.08); padding: 8px; }
.diy-qr img, .diy-qr canvas { width: 100% !important; height: 100% !important; }
.diy-qr-label { font-size: 11px; color: var(--text-sub); text-align: center; margin-top: 6px; }
.link-row { display: flex; gap: 8px; margin-top: 14px; }
.link-row input { flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--text-sub); background: #FFFCF8; }
.link-row button { border: none; border-radius: 10px; padding: 0 16px; font-size: 13px; background: var(--primary); color: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery-item { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-meta { padding: 6px 10px; font-size: 11px; color: var(--text-sub); display: flex; justify-content: space-between; }

/* 名单表 */
.roster-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; border-radius: 12px; overflow: hidden; }
.roster-table th, .roster-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #FAF3EA; }
.roster-table th { background: #FFF0E0; color: #B25A17; font-weight: 600; white-space: nowrap; }
.roster-scroll { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); }

/* ===== 弹窗 / Toast / 成功浮层 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 32px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 340px; padding: 20px; }
.modal-title { font-size: 16px; font-weight: 700; text-align: center; }
.modal-content { font-size: 14px; color: var(--text-sub); margin: 12px 0 20px; line-height: 1.7; text-align: center; }
.modal-actions { display: flex; gap: 10px; }
.modal-btn { flex: 1; border: none; border-radius: 10px; padding: 11px 0; font-size: 15px; background: #F5F5F5; color: var(--text-sub); }
.modal-btn-primary { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(61,50,41,.92); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; z-index: 99; }
.success-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 95; display: flex; align-items: center; justify-content: center; }
.success-box { background: #fff; border-radius: 20px; padding: 32px 48px; text-align: center; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font-size: 34px; line-height: 64px; }
.success-text { font-size: 18px; font-weight: 700; }

.hidden { display: none !important; }

/* 桌面端适配 */
@media (min-width: 720px) {
  .act-cover { height: 260px; }
  .diy-poster { width: 260px; height: 346px; }
}
