* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f2f2f2;
  color: #1f1f1f;
}

a {
  color: #425887;
}

.page {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 0.9rem 0;
}

.card {
  background: #fff;
  border-radius: 0.8rem;
  box-shadow: 0 0.15rem 0.6rem rgba(0, 0, 0, 0.06);
  margin-bottom: 0.9rem;
  padding: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.group-header {
  text-align: center;
}

.header-banner {
  width: 100%;
  border-radius: 0.6rem;
  margin-bottom: 0.8rem;
}

.group-icon {
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 0.6rem;
  object-fit: cover;
}

.group-name {
  font-size: 1.26rem;
  margin: 0.6rem 0 0.3rem;
}

.group-desc {
  color: #7e7e7e;
  font-size: 0.94rem;
  margin: 0;
}

.section-title {
  font-size: 1.05rem;
  color: #425887;
  margin: 0 0 0.8rem;
  padding-left: 0.5rem;
  border-left: 0.2rem solid #425887;
}

.avatar-grid {
  display: flex;
  flex-wrap: wrap;
}

.avatar-cell {
  margin-top: 1.14rem;
  width: 20%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-cell img {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

.avatar-cell p {
  font-size: 0.89rem;
  color: #aeaeae;
  width: 83%;
  margin: 0.53rem auto 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.benefit-list,
.review-list,
.faq-list,
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.benefit-card {
  display: flex;
  gap: 0.65rem;
  background: #f8f8fb;
  border-radius: 0.6rem;
  padding: 0.7rem;
}

.benefit-icon img {
  width: 2rem;
  height: 2rem;
}

.benefit-body h3 {
  margin: 0;
  font-size: 0.95rem;
}

.benefit-body p {
  margin: 0.3rem 0 0;
  color: #666;
  font-size: 0.86rem;
  line-height: 1.35;
}

.faq-item {
  border: 1px solid #ececf2;
  border-radius: 0.6rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  border: 0;
  background: #fff;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.65rem 0.7rem;
}

.faq-answer {
  display: none;
  padding: 0 0.7rem 0.65rem;
  font-size: 0.84rem;
  color: #666;
  line-height: 1.45;
}

.faq-item.open .faq-answer {
  display: block;
}

.review-item {
  display: flex;
  gap: 0.65rem;
  background: #f8f8fb;
  border-radius: 0.6rem;
  padding: 0.7rem;
}

.review-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  object-fit: cover;
}

.review-main h3 {
  margin: 0;
  font-size: 0.9rem;
}

.review-main p {
  margin: 0.24rem 0 0;
  font-size: 0.84rem;
  color: #666;
  line-height: 1.45;
}

.bottom-placeholder {
  height: 4.8rem;
}

.pay-btn {
  position: fixed;
  left: 5%;
  bottom: 0.6rem;
  width: 90%;
  border: 0;
  z-index: 999;
  background: linear-gradient(135deg, #425887, #5a7ab5);
  color: #fff;
  font-size: 1.02rem;
  height: 3.2rem;
  border-radius: 1.6rem;
  box-shadow: 0 0.2rem 0.8rem rgba(66, 88, 135, 0.35);
  font-weight: 600;
}

.loading-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f2f2f2;
  z-index: 1200;
  color: #666;
}

.spinner {
  width: 2.1rem;
  height: 2.1rem;
  border: 0.18rem solid rgba(66, 88, 135, 0.2);
  border-top-color: #425887;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 5rem;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 0.4rem;
  font-size: 0.82rem;
  z-index: 1250;
}

.success-page {
  padding-top: 1.4rem;
}

.success-card {
  text-align: center;
}

.success-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  margin: 0 auto;
  background: #e8f6eb;
  color: #2ea44f;
  font-size: 2rem;
  line-height: 3rem;
}

.success-card h1 {
  margin: 0.6rem 0 0.2rem;
  font-size: 1.2rem;
}

.success-tip {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
}

.resource-card {
  margin-bottom: 0.8rem;
}

.resource-title {
  margin: 0;
  color: #425887;
  font-size: 1rem;
}

.resource-desc {
  margin: 0.4rem 0 0;
  font-size: 0.84rem;
  color: #666;
  line-height: 1.45;
}

.resource-qrcode {
  width: 11rem;
  max-width: 100%;
  border-radius: 0.5rem;
  margin-top: 0.6rem;
}

.save-hint {
  margin: 0.35rem 0 0;
  color: #425887;
  font-size: 0.78rem;
}

.code-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.copy-btn {
  border: 0;
  background: #425887;
  color: #fff;
  border-radius: 0.35rem;
  padding: 0.24rem 0.6rem;
  font-size: 0.78rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 1.2rem;
  font-size: 0.88rem;
  text-decoration: none;
}

.back-link img {
  width: 0.9rem;
  height: 0.9rem;
}

.empty-card {
  text-align: center;
  color: #777;
  font-size: 0.88rem;
}

/* === Customer Service Floating Button === */
.service-float {
  position: fixed;
  right: 0.8rem;
  bottom: 5rem;
  width: 2.8rem;
  height: 2.8rem;
  background: #425887;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.2rem 0.6rem rgba(66, 88, 135, 0.4);
  z-index: 900;
  cursor: pointer;
  transition: transform 0.2s;
}

.service-float:active {
  transform: scale(0.92);
}

/* === Popup/Modal System === */
.popup-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-box {
  width: 80%;
  max-width: 20rem;
  background: #fff;
  border-radius: 0.6rem;
  overflow: hidden;
}

.popup-header {
  background: #425887;
  color: #fff;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

.popup-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.popup-body {
  padding: 1rem;
  text-align: center;
}

.service-content .service-tip {
  color: #666;
  font-size: 0.86rem;
  margin: 0;
}

.service-qr {
  width: 10rem;
  max-width: 100%;
  border-radius: 0.4rem;
  margin: 0.5rem auto;
  display: block;
}

.service-phone {
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
}

.service-phone a {
  color: #425887;
  font-weight: 600;
}

.group-introduction {
  margin-bottom: 1.11rem;
}

.introduction-content {
  padding: 1.11rem;
  font-size: 1rem;
  line-height: 1.67rem;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.footer-ad {
  width: 100%;
  display: block;
  margin: 1.11rem 0;
  border-radius: 0.56rem;
}

/* === 自定义 HTML 区域 === */
#sectionCustomHTML {
  position: relative;
  z-index: 1;
  margin: 0 -0.9rem;
  overflow: visible;
}

/* === 可嵌入支付按钮 === */
[data-gmp-pay] {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

[data-gmp-pay].gmp-paying {
  opacity: 0.7;
  pointer-events: none;
}

/* === 群友秀 === */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 0;
}

.showcase-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  cursor: pointer;
}

.showcase-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.showcase-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.showcase-item video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* === 浮窗播报 === */
.float-message {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  z-index: 1000;
  white-space: nowrap;
  pointer-events: none;
}

.float-message-in {
  animation: floatSlideIn 0.4s ease-out forwards;
}

.float-message-out {
  animation: floatSlideOut 0.4s ease-in forwards;
}

@keyframes floatSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-1rem);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes floatSlideOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-1rem);
  }
}

/* === 长图模式 === */
.page.full-image-mode {
  padding: 0;
  max-width: 100%;
}

.full-image-wrap {
  margin-bottom: 0;
}

.full-image {
  width: 100%;
  display: block;
  border-radius: 0;
}

/* === 支付方式 Sheet 弹窗 === */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  animation: sheetSlideUp .25s ease-out;
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
}

.sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.sheet-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.sheet-body {
  padding: 8px 20px 20px;
}

.sheet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fafafa;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.sheet-option:last-child {
  margin-bottom: 0;
}

.sheet-option:active {
  background: #f0f0f0;
  border-color: #ddd;
}

.sheet-option-icon {
  flex-shrink: 0;
  display: block;
}
