/* ======================================
   小组首页 - 简洁现代设计
   与详情页风格统一
   ====================================== */

/* 页面容器 - 统一宽度 */
.group-index-page .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0 1.5rem;
    gap: 2rem;
}

.header-content {
    flex: 1;
    min-width: 0;
}

.header-content h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.header-content p {
    margin: 0;
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}

.btn-create {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--main-color, #008b8b);
    border-radius: 8px;
    color: var(--main-color, #008b8b);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-create:hover {
    background: var(--main-color, #008b8b);
    color: #fff;
    transform: translateY(-1px);
}

/* 分类导航 - 参考话题标签样式 */
.category-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-link:hover {
    background: var(--main-color, #008b8b);
    color: #ffffff;
    border-color: var(--main-color, #008b8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 139, 139, 0.2);
}

.category-link.active {
    background: var(--main-color, #008b8b);
    color: #ffffff;
    border-color: var(--main-color, #008b8b);
}

/* 小组网格 */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 小组卡片 - 包含话题列表 */
.group-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.group-card:hover {
    border-color: var(--main-color, #008b8b);
    box-shadow: 0 2px 8px rgba(0, 139, 139, 0.1);
}

/* 卡片头部 */
.card-header {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.group-header-info {
    flex: 1;
    min-width: 0;
}

.group-header-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-header-info h3 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.group-header-info h3 a:hover {
    color: var(--main-color, #008b8b);
}

.group-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #999;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-item::before {
    content: '•';
    color: #ddd;
}

.stat-item:first-child::before {
    content: '';
}

/* 头部快捷按钮 */
.header-quick-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--main-color, #008b8b);
    border-radius: 6px;
    color: var(--main-color, #008b8b);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-quick-btn:hover {
    background: var(--main-color, #008b8b);
    color: #fff;
}

.header-quick-btn.entered {
    background: #f0f0f0;
    border-color: #e0e0e0;
    color: #888;
}

.header-quick-btn.entered:hover {
    background: #e5e5e5;
    border-color: #d5d5d5;
}

/* 话题列表 */
.topic-list {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #fafafa;
    min-height: 180px;
}

.topic-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.topic-user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.topic-title {
    font-size: 0.8125rem;
    color: #444;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.topic-item a:hover .topic-title {
    color: var(--main-color, #008b8b);
}

.topic-time {
    font-size: 0.6875rem;
    color: #999;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

.empty-topics {
    text-align: center;
    padding: 2rem 1rem;
    color: #ccc;
    font-size: 0.8125rem;
}


/* 分页 */
.pagination-wrap {
    margin: 2rem 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .group-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 992px) {
    .group-index-page .container {
        padding: 0 16px;
    }
    
    .group-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .group-index-page .container {
        padding: 0 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 0 1rem;
    }
    
    .header-content h1 {
        font-size: 1.75rem;
    }
    
    .btn-create {
        width: 100%;
        text-align: center;
    }
    
    .category-nav {
        margin-bottom: 1.5rem;
        gap: 0.375rem;
    }
    
    .category-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .group-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .group-icon {
        width: 44px;
        height: 44px;
    }
    
    .topic-list {
        min-height: 160px;
        padding: 0.625rem 0.875rem;
    }
    
    .topic-user-avatar {
        width: 18px;
        height: 18px;
    }
    
    .header-quick-btn {
        padding: 0.3rem 0.625rem;
        font-size: 0.6875rem;
    }
}

@media (max-width: 576px) {
    .group-index-page .container {
        padding: 0 12px;
    }
    
    .page-header {
        padding: 1rem 0 0.75rem;
    }
    
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content p {
        font-size: 0.875rem;
    }
    
    .category-nav {
        gap: 0.25rem;
    }
    
    .category-link {
        padding: 0.3rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .card-header {
        padding: 0.875rem;
    }
    
    .group-icon {
        width: 40px;
        height: 40px;
    }
    
    .group-header-info h3 {
        font-size: 0.9375rem;
    }
    
    .group-stats {
        font-size: 0.6875rem;
    }
    
    .topic-list {
        min-height: 140px;
        padding: 0.5rem 0.75rem;
    }
    
    .topic-title {
        font-size: 0.75rem;
    }
    
    .topic-time {
        font-size: 0.625rem;
    }
    
    .topic-user-avatar {
        width: 16px;
        height: 16px;
    }
    
    .header-quick-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.625rem;
    }
}

