/**
 * HuSNS - 圈子列表页面样式
 */

/* 页面容器 */
.circles-content {
    min-height: 100vh;
    padding-bottom: 80px;
}

/* 页面头部 */
.circles-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px 30px;
    border-radius: 0 0 24px 24px;
    color: #fff;
}

.header-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 25px;
    padding: 12px 16px;
    margin: -20px 16px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: #999;
    margin-right: 12px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.search-bar input::placeholder {
    color: #bbb;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    padding: 0 16px;
    margin-bottom: 16px;
    gap: 8px;
}

.category-tab {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* 圈子列表 */
.circle-list {
    padding: 0 16px;
}

/* 圈子卡片 */
.circle-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.circle-card:active {
    transform: scale(0.98);
}

.circle-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 16px;
    flex-shrink: 0;
}

.circle-card-info {
    flex: 1;
    min-width: 0;
}

.circle-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.circle-card-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.circle-card-stats {
    font-size: 12px;
    color: #bbb;
}

.stat-divider {
    margin: 0 8px;
}

.circle-card-action {
    margin-left: 16px;
}

.join-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.join-btn:active {
    opacity: 0.8;
}

.joined-badge {
    display: inline-block;
    padding: 8px 20px;
    background: #f0f0f0;
    color: #999;
    border-radius: 20px;
    font-size: 14px;
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.loading-text {
    font-size: 14px;
    color: #999;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: #999;
}

/* 圈子详情弹窗 */
.circle-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    z-index: 1000;
}

.circle-detail-container {
    width: 100%;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.circle-detail-header {
    position: relative;
}

.circle-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 24px 24px 0 0;
}

.circle-info {
    padding: 0 20px 20px;
    margin-top: -40px;
    position: relative;
}

.circle-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.circle-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.circle-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.circle-stats {
    font-size: 14px;
    color: #999;
}

.circle-detail-actions {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.circle-detail-actions .btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.circle-detail-actions .btn:active {
    opacity: 0.8;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 暗黑模式 */
.dark-mode .search-bar {
    background: #2a2a2a;
}

.dark-mode .search-bar input {
    color: #fff;
}

.dark-mode .search-icon {
    color: #666;
}

.dark-mode .category-tab {
    background: #2a2a2a;
    color: #999;
}

.dark-mode .category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.dark-mode .circle-card {
    background: #2a2a2a;
}

.dark-mode .circle-card-name {
    color: #fff;
}

.dark-mode .circle-card-desc {
    color: #888;
}

.dark-mode .joined-badge {
    background: #3a3a3a;
    color: #888;
}

.dark-mode .empty-title {
    color: #fff;
}

.dark-mode .circle-detail-container {
    background: #1a1a1a;
}

.dark-mode .circle-name {
    color: #fff;
}

.dark-mode .circle-desc {
    color: #888;
}

.dark-mode .btn-secondary {
    background: #3a3a3a;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 320px) {
    .header-title {
        font-size: 24px;
    }
    
    .circle-card-avatar {
        width: 56px;
        height: 56px;
    }
    
    .circle-detail-actions {
        flex-direction: column;
    }
}
