/* 付费进群系统 - 前端样式（复刻参考图 + 响应式） */
:root {
    --primary: #FF4D4F;
    --primary-dark: #E63E40;
    --blue: #4A90E2;
    --blue-dark: #357ABD;
    --green: #07C160;
    --bg: #F5F5F5;
    --card: #FFFFFF;
    --text: #333333;
    --text-secondary: #999999;
    --border: #EEEEEE;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
    --max-width: 480px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }

/* ===== 页面容器（手机居中，电脑也居中） ===== */
.app-shell {
    min-height: 100vh;
    background: var(--bg);
}
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--card);
    box-shadow: 0 0 30px rgba(0,0,0,0.05);
    position: relative;
    padding-bottom: 70px;
}
@media (min-width: 768px) {
    .app-shell { padding: 20px 0; }
    .app-container { border-radius: 16px; min-height: calc(100vh - 40px); }
}

/* ===== 顶部导航栏 ===== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-nav .back { font-size: 20px; color: var(--text); width: 32px; }
.top-nav .title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.top-nav .actions { display: flex; gap: 12px; align-items: center; }
.top-nav .action-btn { font-size: 13px; color: var(--text-secondary); background: none; }
.top-nav .refresh { font-size: 18px; color: var(--text-secondary); }

/* ===== 群详情页 Hero ===== */
.group-hero { padding: 16px; background: var(--card); }
.avatar-collage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
}
.avatar-collage img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f0f0f0;
}
.group-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.group-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #E91E8C;
    background: linear-gradient(90deg, #FCE4EC, #F3E5F5);
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 3px solid #E91E8C;
}

/* ===== 群成员区 ===== */
.section-header {
    padding: 14px 16px 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: var(--card);
    border-top: 8px solid var(--bg);
}
.section-header .count { color: var(--primary); }
.member-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px 6px;
    padding: 0 16px 20px;
    background: var(--card);
}
@media (min-width: 480px) {
    .member-grid { grid-template-columns: repeat(6, 1fr); }
}
.member-item { text-align: center; }
.member-item img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    margin: 0 auto;
    background: #f0f0f0;
}
.member-item .name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 底部固定按钮 ===== */
.bottom-cta {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    padding: 10px 16px 16px;
    background: linear-gradient(transparent, rgba(255,255,255,0.95) 30%);
    z-index: 99;
}
.btn-join-main {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 4px 16px rgba(255,77,79,0.4);
    transition: transform 0.2s;
}
.btn-join-main:active { transform: scale(0.98); }
.btn-join-blue {
    background: linear-gradient(135deg, var(--blue), #6BB3F0);
    box-shadow: 0 4px 16px rgba(74,144,226,0.4);
}

/* ===== 右侧浮动任务按钮 ===== */
.task-float {
    position: fixed;
    right: max(0px, calc(50% - var(--max-width) / 2));
    top: 55%;
    transform: translateY(-50%);
    background: #FF6B35;
    color: #fff;
    padding: 14px 6px;
    border-radius: 8px 0 0 8px;
    font-size: 13px;
    writing-mode: vertical-rl;
    letter-spacing: 2px;
    z-index: 98;
    box-shadow: -2px 2px 8px rgba(255,107,53,0.3);
}

/* ===== 支付弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.pay-modal {
    background: var(--card);
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    padding: 28px 24px;
    animation: popIn 0.25s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.pay-modal h3 { text-align: center; font-size: 16px; margin-bottom: 8px; color: var(--text-secondary); }
.pay-amount {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin: 12px 0 24px;
}
.pay-amount small { font-size: 16px; }
.pay-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.pay-option.active { border-color: var(--green); background: #F0FFF4; }
.pay-option input { margin-right: 12px; accent-color: var(--green); }
.pay-option .pay-icon { width: 28px; height: 28px; margin-right: 10px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pay-icon-wx { background: #07C160; color: #fff; }
.pay-icon-ali { background: #1677FF; color: #fff; }
.btn-pay-now {
    width: 100%;
    padding: 14px;
    background: var(--green);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 8px;
}
.pay-alt-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-secondary); }
.pay-alt-link a { color: #FF6B35; }

/* ===== 群列表页 ===== */
.city-header {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    padding: 20px 16px;
    text-align: center;
}
.city-header h1 { font-size: 20px; font-weight: 700; color: #1565C0; }
.city-header .sub { font-size: 13px; color: #42A5F5; margin-top: 4px; }

.group-list-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.group-list-item:active { background: #fafafa; }
.group-list-item .thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.group-list-item .info { flex: 1; min-width: 0; }
.group-list-item .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.group-list-item .preview { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-list-item .time { font-size: 12px; color: #ccc; flex-shrink: 0; }

/* ===== 首页 Hero 卡片（城市模板风） ===== */
.hero-card {
    margin: 16px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
}
.hero-card .avatar-row {
    display: flex;
    justify-content: center;
    gap: -8px;
    margin-bottom: 14px;
}
.hero-card .avatar-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -10px;
}
.hero-card .avatar-row img:first-child { margin-left: 0; }
.hero-card h2 { font-size: 18px; font-weight: 700; color: #1565C0; }
.hero-card .tagline { font-size: 14px; color: var(--primary); font-weight: 600; margin-top: 6px; }

/* 子群列表 */
.sub-group-list { padding: 0 16px; }
.sub-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}
.sub-group-item .mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.sub-group-item .mini-grid img { width: 100%; height: 100%; object-fit: cover; }
.sub-group-item .sg-info { flex: 1; }
.sub-group-item .sg-name { font-size: 14px; font-weight: 600; }
.sub-group-item .sg-status { font-size: 12px; color: var(--primary); }
.sub-group-item .sg-count { font-size: 12px; color: var(--text-secondary); }

/* ===== 群卡片（首页列表） ===== */
.group-card {
    margin: 0 16px 12px;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: block;
}
.group-card .cover { height: 140px; position: relative; background: #eee; }
.group-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.group-card .price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.group-card .card-body { padding: 14px; }
.group-card .card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.group-card .card-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.group-card .card-meta { font-size: 12px; color: #bbb; display: flex; gap: 12px; }

/* ===== 二维码成功页 ===== */
.qrcode-success {
    text-align: center;
    padding: 40px 20px;
    background: var(--card);
}
.qrcode-success h3 { font-size: 20px; margin-bottom: 20px; color: var(--green); }
.qrcode-success img { width: 200px; height: 200px; margin: 0 auto 16px; border-radius: 8px; }
.qrcode-success p { font-size: 14px; color: var(--text-secondary); }

/* ===== 底部导航 ===== */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    background: var(--card);
    display: flex;
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-bottom .nav-item {
    flex: 1;
    text-align: center;
    padding: 8px 0 6px;
    font-size: 11px;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.nav-bottom .nav-item.active { color: var(--primary); }
.nav-bottom .nav-item .icon { font-size: 22px; display: block; margin-bottom: 2px; }

/* ===== 用户中心 ===== */
.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 16px;
    background: var(--card);
}
.profile-card .avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.profile-card .info h3 { font-size: 18px; font-weight: 600; }
.profile-card .info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.stats-card {
    margin: 0 16px 12px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.stats-card .card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--primary); }
.stats-row { display: flex; }
.stats-row .stat-item { flex: 1; text-align: center; }
.stats-row .stat-item + .stat-item { border-left: 1px solid var(--border); }
.stats-row .value { font-size: 20px; font-weight: 700; color: var(--primary); }
.stats-row .label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
    padding: 8px 0;
}
.tool-item { text-align: center; }
.tool-item .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 6px;
}
.tool-icon-orange { background: #FFF3E0; }
.tool-icon-green { background: #E8F5E9; }
.tool-icon-yellow { background: #FFFDE7; }
.tool-icon-blue { background: #E3F2FD; }
.tool-icon-cyan { background: #E0F7FA; }
.tool-icon-red { background: #FFEBEE; }
.tool-item .tool-name { font-size: 12px; color: var(--text); }

/* ===== 客服浮标 ===== */
.float-service {
    position: fixed;
    right: max(8px, calc(50% - var(--max-width) / 2 + 8px));
    bottom: 100px;
    width: 48px;
    height: 48px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(7,193,96,0.4);
    z-index: 97;
}

/* ===== 展示图片区 ===== */
.preview-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 16px 20px;
    background: var(--card);
}
.preview-gallery img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 10px;
    background: #f0f0f0;
}

/* ===== 分类标签 ===== */
.category-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: var(--card);
    -webkit-overflow-scrolling: touch;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    background: #f0f0f0;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.category-tab.active { background: var(--primary); color: #fff; }

/* ===== 电脑端扩展 ===== */
@media (min-width: 768px) {
    .group-list-page .app-container,
    .group-detail-page .app-container { padding-bottom: 80px; }
}

/* 宽屏下两侧留白展示 */
@media (min-width: 1200px) {
    :root { --max-width: 420px; }
}
