/* 微信社群系统 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: #07c160; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, button, select { font-family: inherit; font-size: inherit; }

/* 头部导航 */
.header {
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.header h1 { font-size: 18px; font-weight: 600; }
.header-sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }

/* 底部导航 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid #eee;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}
.tabbar-item.active { color: #07c160; }
.tabbar-item .icon { font-size: 22px; margin-bottom: 2px; }

/* 内容区 */
.container { padding: 12px; padding-bottom: 70px; min-height: 100vh; }

/* 搜索栏 */
.search-bar {
    background: #fff;
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}
.search-bar .search-icon { color: #999; margin-right: 8px; }

/* 分类标签 */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
    flex-shrink: 0;
    padding: 6px 16px;
    background: #fff;
    border-radius: 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid #eee;
}
.category-tab.active {
    background: #07c160;
    color: #fff;
    border-color: #07c160;
}

/* 社群卡片 */
.group-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}
.group-card:active { transform: scale(0.98); }
.group-card.top {
    border: 1px solid #ffd700;
}
.group-card.top::before {
    content: '置顶';
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #fff;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 0 12px 0 12px;
}
.group-card.recommend::after {
    content: '推荐';
    position: absolute;
    top: 0;
    right: 60px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 0 12px 0 12px;
}
.group-card .group-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.group-card .group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #07c160, #06ad56);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}
.group-card .group-info { flex: 1; min-width: 0; }
.group-card .group-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-card .group-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    display: flex;
    gap: 12px;
}
.group-card .group-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.group-card .group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.group-card .tag {
    background: #f0f9f4;
    color: #07c160;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.group-card .group-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.group-card .group-stats {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 12px;
}
.group-card .btn-join {
    background: #07c160;
    color: #fff;
    border: none;
    padding: 6px 20px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.group-card .btn-join:active { background: #06ad56; }

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}
.form-label .required { color: #ff4d4f; margin-right: 4px; }
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}
.form-input:focus { border-color: #07c160; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn-primary {
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff;
}
.btn-primary:active { opacity: 0.9; }
.btn-block { display: block; width: 100%; }
.btn-outline {
    background: #fff;
    color: #07c160;
    border: 1px solid #07c160;
}
.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
    background: #fff;
    border-radius: 16px;
    width: 85%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header {
    padding: 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
}
.modal-body { padding: 16px; }
.modal-footer {
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #f0f0f0;
}
.modal-footer .btn { flex: 1; }

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.toast.show { opacity: 1; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-top-color: #07c160;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 页面特定样式 */
.page-login { padding: 40px 20px; }
.page-login .logo {
    text-align: center;
    margin-bottom: 40px;
}
.page-login .logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #07c160, #06ad56);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    margin-bottom: 12px;
}
.page-login h2 { font-size: 22px; color: #333; }

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}
.login-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 15px;
    color: #999;
    cursor: pointer;
    position: relative;
}
.login-tab.active {
    color: #07c160;
    font-weight: 600;
}
.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 30%;
    right: 30%;
    height: 2px;
    background: #07c160;
    border-radius: 1px;
}

/* 详情页 */
.detail-header {
    background: #fff;
    padding: 20px 16px;
    margin: -12px -12px 12px;
}
.detail-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.detail-meta { font-size: 13px; color: #999; display: flex; gap: 16px; }
.detail-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.detail-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.detail-qrcode {
    text-align: center;
    padding: 20px;
}
.detail-qrcode img {
    max-width: 200px;
    margin: 0 auto;
    border-radius: 8px;
}

/* 个人中心 */
.profile-header {
    background: linear-gradient(135deg, #07c160, #06ad56);
    padding: 30px 20px;
    color: #fff;
    text-align: center;
    border-radius: 0 0 20px 20px;
    margin: -12px -12px 16px;
}
.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 8px;
    border: 3px solid rgba(255,255,255,0.3);
}
.profile-name { font-size: 18px; font-weight: 600; }
.profile-phone { font-size: 13px; opacity: 0.8; margin-top: 4px; }

.menu-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .menu-icon {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
    text-align: center;
}
.menu-item .menu-text { flex: 1; font-size: 14px; color: #333; }
.menu-item .menu-arrow { color: #ccc; font-size: 12px; }

/* 管理后台 */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #07c160;
}
.stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.admin-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}
.admin-table table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.admin-table th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
}
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.status-badge.pending { background: #fff7e6; color: #fa8c16; }
.status-badge.approved { background: #f0f9f4; color: #07c160; }
.status-badge.rejected { background: #fff1f0; color: #ff4d4f; }

/* 上传区域 */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.upload-area:hover { border-color: #07c160; }
.upload-area .icon { font-size: 36px; color: #ccc; margin-bottom: 8px; }
.upload-area p { font-size: 13px; color: #999; }
.upload-preview {
    position: relative;
    display: inline-block;
}
.upload-preview img {
    max-width: 200px;
    border-radius: 8px;
}
.upload-preview .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
}
.pagination button {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination .current {
    font-size: 13px;
    color: #666;
}
