/* ============================================================
   湾区青年 H5 - 全局样式（移动端优先，多主题 CSS 变量）
   ============================================================ */
:root {
  --primary: #ff6b81;
  --gradient: linear-gradient(135deg, #ff8fa3, #ff4757);
  --nav: #ff6b81;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-light: #999999;
  --border: #f0f0f0;
  --primary-soft: rgba(255, 107, 129, 0.08);
  --radius: 16px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
body[data-theme="ocean"] { --primary:#1677ff; --gradient:linear-gradient(135deg,#40a9ff,#1677ff); --nav:#1677ff; --bg:#f5f7fb; --primary-soft:rgba(22,119,255,.08); }
body[data-theme="sunset"]{ --primary:#ff7a00; --gradient:linear-gradient(135deg,#ffab40,#ff7a00); --nav:#ff7a00; --bg:#faf6f1; --primary-soft:rgba(255,122,0,.08); }
body[data-theme="forest"]{ --primary:#07c160; --gradient:linear-gradient(135deg,#34d399,#07c160); --nav:#07c160; --bg:#f3faf5; --primary-soft:rgba(7,193,96,.08); }
body[data-theme="dark"]  { --primary:#ff6b81; --gradient:linear-gradient(135deg,#ff8fa3,#ff4757); --nav:#1f1f27; --bg:#17171e; --card:#23232b; --text:#e8e8ec; --text-light:#9a9aa6; --border:#33333d; --primary-soft:rgba(255,107,129,.15); --shadow:0 2px 12px rgba(0,0,0,.3); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
input, textarea, button, select { font-family: inherit; font-size: inherit; color: inherit; outline: none; }
button { border: none; background: none; cursor: pointer; }
img { display: block; }

/* 页面容器：移动端居中 */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
.page.with-nav { padding-top: calc(48px + env(safe-area-inset-top)); }

/* ===== 顶部导航 ===== */
.nav-bar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(48px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--nav);
  color: #fff;
  display: flex; align-items: center;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.nav-inner { display: flex; align-items: center; width: 100%; height: 48px; padding: 0 12px; }
.nav-back { font-size: 20px; width: 40px; height: 48px; display: flex; align-items: center; justify-content: flex-start; }
.nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-right { width: 40px; display: flex; justify-content: flex-end; }

/* ===== 底部 Tab ===== */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.tab-item {
  flex: 1; height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--text-light);
  font-size: 11px;
}
.tab-item .tab-icon { font-size: 22px; line-height: 1; }
.tab-item.active { color: var(--primary); }

/* ===== 通用组件 ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: flex; align-items: center; justify-content: center;
  height: 46px; border-radius: 23px;
  background: var(--gradient); color: #fff;
  font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(255, 107, 129, .3);
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn.disabled { background: #ccc; box-shadow: none; }
.btn-outline { background: var(--card); color: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
.btn-sm { height: 34px; font-size: 13px; border-radius: 17px; padding: 0 16px; }

.input {
  width: 100%; height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
}
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: none; }
.input:focus { border-color: var(--primary); }

/* 头像 */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: #eee; flex-shrink: 0; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; }
.avatar.sm { width: 32px; height: 32px; }

/* 徽章 V 标识（类似微博简约风） */
.badge-v {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: #fff;
  margin-left: 4px; flex-shrink: 0; vertical-align: middle;
  line-height: 1;
}
.badge-v.blue { background: #3c8cff; }
.badge-v.pink { background: linear-gradient(135deg, #ff8fa3, #ff4757); }
.badge-v.super { background: linear-gradient(135deg, #ffd76a, #ffab00 45%, #ff8a00); color: #7a4a00; box-shadow: 0 1px 4px rgba(255,171,0,.4); }
.badge-v.gray { background: #c0c0c0; }
.badge-audit {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 6px; border-radius: 5px;
  background: linear-gradient(135deg, #ffab40, #ff7a00);
  color: #fff; font-size: 11px; font-weight: 700;
  margin-left: 4px; flex-shrink: 0;
}
/* 合作商金色徽章 */
.badge-partner {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 6px; border-radius: 5px;
  background: linear-gradient(135deg, #ffe28a, #f5b83d 55%, #e89b1c);
  color: #7a4a00; font-size: 11px; font-weight: 700;
  margin-left: 4px; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(245,184,61,.35);
}
.role-tag {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; padding: 3px 10px; border-radius: 14px; margin: 0 4px 4px 0;
  white-space: nowrap; line-height: 1.4;
}
.role-tag .badge-v, .role-tag .badge-audit, .role-tag .badge-partner { margin-left: 0; }
.role-super { background: linear-gradient(135deg, #fff7e0, #ffe9b8); color: #7a4a00; border: 1px solid #f5d47a; font-weight: 700; }
.role-pink { background: #fff0f3; color: #ff4757; border: 1px solid #ffc9d3; font-weight: 600; }
.role-blue { background: #eaf2ff; color: #2f6fe4; border: 1px solid #c8dcff; font-weight: 600; }
.role-partner { background: #fff3d6; color: #c47b10; border: 1px solid #f0d49a; font-weight: 600; }
.role-gray { background: #f4f4f4; color: #8a8a8a; border: 1px solid #e3e3e3; }
.partner-hero {
  background: linear-gradient(135deg, #ffe9c2, #ffd98a 55%, #ffc257);
  color: #7a4a00; border-radius: var(--radius); padding: 22px 18px; margin: 14px;
  position: relative; overflow: hidden;
}
.partner-hero .ph-title { font-size: 19px; font-weight: 700; }
.partner-hero .ph-sub { font-size: 12px; opacity: .8; margin-top: 6px; line-height: 1.6; }
.partner-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 14px; padding: 16px; }
.partner-card .pc-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.partner-card .pc-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.partner-card .pc-item:last-child { border-bottom: none; }
.partner-card .pc-item .pi-arrow { margin-left: auto; color: var(--text-light); }

/* 标签 */
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; background: var(--primary-soft); color: var(--primary); margin-right: 6px; }
.tag.gray { background: #f0f0f0; color: var(--text-light); }

/* 列表 */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--primary-soft); }
.list-icon { font-size: 20px; margin-right: 12px; }
.list-name { flex: 1; font-size: 15px; }
.list-extra { font-size: 12px; color: var(--text-light); }
.list-arrow { color: var(--text-light); margin-left: 6px; font-size: 16px; }

/* Toast */
#toast {
  position: fixed; top: 40%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; z-index: 9999;
  opacity: 0; pointer-events: none; transition: opacity .25s;
  max-width: 80%; text-align: center;
}
#toast.show { opacity: 1; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card); border-radius: 18px 18px 0 0;
  z-index: 210; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
.sheet-title { text-align: center; font-size: 16px; font-weight: 600; margin-bottom: 14px; }

/* 骨架/空态 */
.empty { text-align: center; padding: 48px 20px; color: var(--text-light); font-size: 14px; }
.skeleton { background: linear-gradient(90deg,#f0f0f0 25%,#e6e6e6 50%,#f0f0f0 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* 会员/审核状态色 */
.text-pending { color: #ff9500; }
.text-approved { color: #34c759; }
.text-rejected { color: #ff3b30; }

/* 活动已结束印章 */
.stamp { position: absolute; top: 12px; right: 12px; width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid #e0392f; color: #e0392f; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; letter-spacing: 1px; transform: rotate(14deg); background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1.5px rgba(224,57,47,.35), 0 2px 6px rgba(224,57,47,.25); opacity: .92; pointer-events: none; z-index: 3; text-shadow: 0 0 1px rgba(224,57,47,.3); }

/* SVG 线性图标：跟随文字大小与颜色 */
.icn { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }

.mini-msg { font-size: 12px; color: var(--primary); background: var(--primary-soft); border: none; border-radius: 10px; padding: 4px 10px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.mini-msg:active { opacity: .8; }
.list-icon .icn { width: 20px; height: 20px; }
.sec-ico .icn { width: 20px; height: 20px; }
.scan-btn .icn { width: 22px; height: 22px; }
.status-icon .icn { width: 30px; height: 30px; }
