/* ===== 付费进群系统 · 前台样式（移动端优先）===== */
:root {
  --primary: #2b7de9;
  --primary-d: #1f68c9;
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #16181d;
  --muted: #8b909a;
  --line: #eceef2;
  --danger: #ff4d4f;
  --pink: #f0508c;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(16, 24, 40, .06);
  --bottom-h: 70px;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

.wrap { padding: 0 14px; }

/* ============ 悬浮进群消息弹窗 ============ */
.join-popup {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 26;
  max-width: 86%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 7px;
  background: rgba(47, 50, 55, .94);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .22);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}
.join-popup.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.join-popup.no-pic { padding-left: 16px; }
.join-popup img {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%; object-fit: cover; display: block;
}
.join-popup .txt {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============ 群主页头部 ============ */
.group-hero {
  position: relative;
  text-align: center;
  padding: 18px 14px 20px;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* 配置了群背景图时：图片铺满顶部区域，头像 / 群名等内容浮在其上 */
.group-hero.has-bg { padding: 32px 14px 30px; }
.group-hero.has-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .14) 0%, rgba(0, 0, 0, .46) 100%);
}
.group-hero > * { position: relative; z-index: 1; }
.group-hero.has-bg .group-name { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .38); }
.group-hero.has-bg .group-desc { color: rgba(255, 255, 255, .94); text-shadow: 0 1px 6px rgba(0, 0, 0, .38); }

/* 群头像：顶部固定显示单个群头像 */
.group-avatar {
  width: clamp(72px, 22vw, 92px);
  height: clamp(72px, 22vw, 92px);
  margin: 0 auto 14px;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: clamp(28px, 8vw, 34px); font-weight: 700;
  box-shadow: 0 4px 16px rgba(43, 125, 233, .28);
}
.group-avatar img { width: 100%; height: 100%; object-fit: cover; }

.group-name {
  font-size: 18px; font-weight: 700;
  text-align: center;
  letter-spacing: .2px;
  margin-bottom: 6px;
}
.group-desc {
  font-size: 13px; color: var(--pink);
  text-align: center;
  padding: 0 10px;
  line-height: 1.7;
}

/* ============ 群成员 ============ */
.member-card {
  background: #fff;
  border-radius: var(--radius);
  margin: 0 14px 16px;
  padding: 16px 14px 18px;
}
.member-head {
  font-size: 15px; font-weight: 600;
  margin-bottom: 14px;
}
.member-head span { color: var(--muted); font-weight: 400; font-size: 13px; }

/* 群成员：5 列 × 3 行（共 15 个）
   格子高度用 padding-bottom 撑出确定值（% 相对宽度，所有浏览器都支持）；
   头像绝对定位铺满格子 → 无论图片多大都不可能撑开容器、溢出布局 */
.member-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.member {
  position: relative;
  padding-bottom: calc(100% + 19px);   /* 正方形头像 + 下方 19px 昵称位 */
  overflow: hidden;
  text-align: center;
}
/* 上边到（底边 -19px）= 格子宽度 → 头像始终是 1:1 正方形 */
.member .pic {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 19px;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f4f7;
}
.member .pic img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
/* 无昵称的成员（末尾两张固定图片）：只显示图片，铺满整格 */
.member.only-pic { padding-bottom: 100%; align-self: start; }
.member.only-pic .pic { bottom: 0; }
.member .name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 19px; line-height: 19px;
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============ 右侧浮动按钮 ============ */
.float-side {
  position: fixed;
  /* 宽屏时对齐到 560px 内容列的右侧内缘，而不是贴在视口最右边 */
  right: max(10px, calc(50vw - 270px));
  top: 46%;
  transform: translateY(-50%);
  z-index: 18;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.float-side .report {
  background: rgba(40, 43, 48, .72);
  color: #fff; font-size: 12px;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  padding: 10px 6px;
  border-radius: 6px;
  border: none; cursor: pointer;
}
.float-side .service {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 3px 12px rgba(43, 125, 233, .35);
}
.float-side .recruit {
  background: var(--pink); color: #fff;
  font-size: 11px; line-height: 1.25;
  padding: 6px 7px; border-radius: 6px;
  text-align: center; width: 44px;
  border: none; cursor: pointer;
  box-shadow: 0 3px 12px rgba(240, 80, 140, .35);
}

/* ============ 底部进群栏 ============ */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  z-index: 25;
}
.join-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 48px;
  border: none; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(43, 125, 233, .3);
}
.join-btn:active { opacity: .88; }

/* ============ 通用卡片 / 按钮 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 0 14px 14px;
}
.card-pull { margin-top: -46px; position: relative; z-index: 2; }
/* 直接放在 .wrap 里的卡片：不再叠一层左右 margin，宽度与上方「群成员」卡片对齐 */
.wrap > .card {
  margin-left: 0;
  margin-right: 0;
  padding: 16px 14px 18px;
}

.hero {
  background: linear-gradient(150deg, var(--primary) 0%, #1f68c9 100%);
  color: #fff;
  padding: 26px 20px 60px;
  text-align: center;
}
.hero h1 { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.hero p { font-size: 13px; opacity: .9; margin-top: 6px; }
.hero .logo {
  width: clamp(56px, 16vw, 62px);
  height: clamp(56px, 16vw, 62px);
  border-radius: 18px; margin: 0 auto 14px;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; backdrop-filter: blur(4px);
}

.section-title {
  font-size: 14px; font-weight: 600; margin: 0 0 10px;
  display: flex; align-items: center; gap: 7px;
}
.section-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--primary);
}
.intro-list { list-style: none; }
.intro-list li { position: relative; padding-left: 22px; font-size: 14px; color: #4a4f57; margin-bottom: 8px; }
.intro-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--primary); font-weight: 700; font-size: 13px; }
.notice { font-size: 13px; color: var(--muted); line-height: 1.9; }
.section-title .sub { color: var(--muted); font-weight: 400; font-size: 13px; }

/* 卡片内的视频（群介绍 / 购买须知）：不加任何边框 / 底色，避免出现黑框 */
.sec-video {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 0;
  outline: none;
  border-radius: 0;
  background: transparent;
}

/* ============ 群友评论 ============ */
.cmt-list { display: flex; flex-direction: column; gap: 14px; }
.cmt { display: flex; gap: 10px; }
.cmt-av {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 600;
}
.cmt-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cmt-name {
  font-size: 13px; font-weight: 600; color: #3b3f47;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmt-time { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.cmt-text { margin-top: 3px; font-size: 14px; color: #4a4f57; line-height: 1.7; word-break: break-word; }

.glist { display: grid; gap: 12px; }
.gitem {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; gap: 14px; align-items: center;
  text-decoration: none; color: inherit; transition: transform .15s;
}
.gitem:active { transform: scale(.985); }
.gitem .thumb {
  width: 54px; height: 54px; border-radius: 13px; flex: 0 0 54px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700; overflow: hidden;
}
.gitem .thumb img { width: 100%; height: 100%; object-fit: cover; }
.gitem .info { flex: 1; min-width: 0; }
.gitem .info h3 { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.gitem .info span { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gitem .price { color: var(--danger); font-weight: 700; font-size: 17px; white-space: nowrap; }
.gitem .price small { font-size: 12px; font-weight: 400; }

.ghead { display: flex; gap: 14px; align-items: flex-start; }
.ghead .avatar {
  width: 58px; height: 58px; border-radius: 14px; flex: 0 0 58px; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 700;
}
.ghead .avatar img { width: 100%; height: 100%; object-fit: cover; }
.ghead h2 { font-size: 18px; font-weight: 700; }
.ghead .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.price-row .now { color: var(--danger); font-size: 26px; font-weight: 700; }
.price-row .now::before { content: "¥"; font-size: 15px; margin-right: 1px; }
.price-row .old { color: var(--muted); text-decoration: line-through; font-size: 13px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%; height: 46px; padding: 0 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfc;
  outline: none; transition: border-color .2s, background .2s;
}
.field input:focus { border-color: var(--primary); background: #fff; }

.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  height: 48px; border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
  background: var(--primary); color: #fff; text-decoration: none; cursor: pointer;
  font-family: inherit; transition: opacity .2s;
}
.btn:active { opacity: .85; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }

.result-icon { text-align: center; font-size: 46px; margin-bottom: 8px; }
.result-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.result-sub { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.qr-box { text-align: center; padding: 10px 0; }
.qr-box img {
  width: min(220px, 62vw); height: auto; aspect-ratio: 1 / 1;
  object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.qr-tip { margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.9; }
.qr-tip b { color: var(--primary); }

.order-info { background: #f7f8fa; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.order-info div { display: flex; justify-content: space-between; padding: 5px 0; }
.order-info span:first-child { color: var(--muted); }
.order-info span:last-child { color: var(--text); font-weight: 500; word-break: break-all; text-align: right; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); font-size: 14px; }
.empty .ico { font-size: 44px; margin-bottom: 10px; }

.footer-note { text-align: center; font-size: 12px; color: #b0b4bb; margin-top: 22px; line-height: 1.9; }
.footer-note a { color: #b0b4bb; text-decoration: none; }

.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .78); color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 14px; z-index: 999; max-width: 80%; text-align: center;
}
.countdown { color: var(--danger); font-weight: 600; }

/* ============ 弹层 ============ */
.pg-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(0, 0, 0, .45);
  align-items: flex-end;
}
.pg-modal.on { display: flex; }
.pg-modal .sheet {
  width: 100%; max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheetUp .25s ease;
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.pg-modal h3 { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.pg-modal .body { font-size: 14px; color: #4a4f57; line-height: 2; }
.pg-modal .body b { color: var(--text); }
.pg-modal .btn { margin-top: 18px; }

/* 客服弹窗里的二维码 */
.kf-qr {
  display: block;
  width: min(220px, 62vw);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto 10px;
}
.kf-tip { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

@media (max-width: 360px) {
  .member-grid { grid-template-columns: repeat(4, 1fr); }
}