/* 成长营地 H5 —— 移动端基础样式（零构建，直接引用） */

:root {
  --brand: #2477ee;
  --brand-dark: #1a5fc4;
  --text: #172033;
  --text-sub: #748195;
  --line: #eef1f6;
  --bg: #f5f7fb;
  --ok: #35b98b;
  --warn: #ff6b57;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

/*
 * hidden 属性必须真的生效。
 * 浏览器 UA 样式里的 [hidden] { display: none } 优先级低于作者样式，
 * 只要作者样式给同一元素写了 display（例如 .loading-mask 的 display:flex），
 * hidden 就会失效 —— "加载中…"遮罩曾因此从页面加载起就一直盖在最上层。
 */
[hidden] { display: none !important; }


html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

body { padding-bottom: calc(24px + var(--safe-bottom)); }

a { color: var(--brand); text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

.page { max-width: 720px; margin: 0 auto; }

/* ---------- 顶部栏 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 14px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.appbar__back {
  width: 32px; height: 32px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; font-size: 20px; color: var(--text); cursor: pointer;
}
.appbar__title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.appbar__right { width: 32px; flex: none; text-align: right; font-size: 13px; color: var(--brand); }

/* ---------- 卡片 / 区块 ---------- */
.card { background: #fff; border-radius: var(--radius); margin: 12px; padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 14px 10px; }
.section-title h2 { margin: 0; font-size: 17px; }
.section-title .more { font-size: 13px; color: var(--text-sub); }

/* ---------- 轮播 ---------- */
.banner { position: relative; margin: 12px; border-radius: var(--radius); overflow: hidden; background: #dbe6f6; }
.banner__track { display: flex; transition: transform .35s ease; }
.banner__item { flex: 0 0 100%; }
.banner__item img { width: 100%; height: 160px; object-fit: cover; }
.banner__dots { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 5px; }
.banner__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.banner__dots i.on { background: #fff; }

/* ---------- 活动 ---------- */
.activity-list { display: grid; gap: 12px; margin: 0 12px; }
.activity {
  display: flex; gap: 12px; background: #fff; border-radius: var(--radius); padding: 12px; cursor: pointer;
}
.activity__cover { width: 96px; height: 72px; flex: none; border-radius: 8px; object-fit: cover; background: #eef1f6; }
.activity__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.activity__name { font-size: 15px; font-weight: 600; }
.activity__meta { font-size: 12px; color: var(--text-sub); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.tag--open { background: #e8f2ff; color: var(--brand); }
.tag--soon { background: #fff4e5; color: #d69300; }
.tag--ended { background: #f1f3f7; color: var(--text-sub); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-label .req { color: var(--warn); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfd;
  font-size: 15px; color: var(--text); appearance: none;
}
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.input[disabled], .select[disabled] { color: var(--text-sub); background: #f2f4f8; }
.hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text-sub); line-height: 1.5; }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; min-width: 0; }

.file-btn {
  width: 100%; min-height: 44px; border: 1px dashed #c8d4e6; border-radius: 10px;
  background: #fafbfd; color: var(--brand); font-size: 15px; cursor: pointer;
}
.file-btn--picked { border-style: solid; border-color: var(--ok); color: var(--ok); }

.preview { margin-top: 10px; border-radius: 10px; width: 120px; height: 90px; object-fit: cover; }

.submit-bar { padding: 16px 12px 8px; }
.btn {
  width: 100%; min-height: 48px; border: 0; border-radius: 24px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn:disabled { background: #b9c6d8; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn--sm { min-height: 36px; font-size: 14px; border-radius: 18px; padding: 0 16px; width: auto; }

/* ---------- 列表 / 空态 ---------- */
.empty { padding: 48px 24px; text-align: center; color: var(--text-sub); font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-sub); flex: none; }
.kv span:last-child { text-align: right; word-break: break-all; }

.status { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.status--active { background: #e8f7f1; color: var(--ok); }
.status--cancelled { background: #f1f3f7; color: var(--text-sub); }

/* ---------- 提示 / 遮罩 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  max-width: 84vw; padding: 10px 16px; border-radius: 20px;
  background: rgba(23,32,51,.88); color: #fff; font-size: 14px; line-height: 1.4;
  z-index: 100; text-align: center;
}
.loading-mask {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.72);
}
.loading-box { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13px; color: var(--text-sub); }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid #dbe6f6; border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box { margin: 12px; padding: 14px; border-radius: var(--radius); background: #fff2f0; color: #b4241a; font-size: 13px; line-height: 1.6; }
.muted { color: var(--text-sub); font-size: 13px; }

/* ---------- 底部导航（对齐小程序 custom-tab-bar） ---------- */
body.has-tabbar { padding-bottom: calc(72px + var(--safe-bottom)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  display: flex;
  align-items: stretch;
  height: calc(54px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid #e8edf3;
  box-shadow: 0 -4px 15px rgba(22, 52, 91, .06);
}
.tabbar__item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: 0; background: transparent; cursor: pointer;
  color: #748195; font-size: 11px; line-height: 1.1;
}
.tabbar__item.is-active { color: var(--brand); font-weight: 600; }
.tabbar__item svg { display: block; }

/* ---------- 内容区通用留白 ---------- */
.page--flush { margin: 0; }
.section { padding: 15px 14px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title { font-size: 17px; font-weight: 700; color: var(--text); }
.section-more { color: #7c8799; font-size: 12px; cursor: pointer; }

