/* 第一层容器 - 最不透明 */
section {
    margin-bottom: var(--section-spacing);
    padding: 2rem;
    background: var(--bg-layer-1);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(5px);
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after, h2::after, h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
}

/* 第二层容器 - 团队介绍区域 */
.team-leader {
    background: var(--bg-layer-2);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(4px);
}

.team-leader:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* 第三层容器 - 团队成员卡片 */
.team-member {
    background: var(--bg-layer-3);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(3px);
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.member-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--secondary-color);
}

.member-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.member-role {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* 想说的话区域 - 轮播样式 */
.words-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    touch-action: pan-y;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* 第四层容器 - 轮播内容 */
.words-container {
    background: var(--bg-layer-4);
    border-radius: 10px;
    padding: 2.5rem;
    text-align: center;
    min-width: 100%;
    box-sizing: border-box;
    user-select: none;
    backdrop-filter: blur(2px);
}

.words-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--secondary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.words-name {
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.words-content {
    text-align: left;
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.05rem;
    white-space: pre-line;
}

.typing-text {
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    white-space: pre-line;
    margin: 0 auto;
    letter-spacing: 0.05em;
    min-height: 200px;
}

/* 社区展示区域 */
.communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* 第三层容器 - 社区卡片 */
.community-card {
    background: var(--bg-layer-3);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    backdrop-filter: blur(3px);
    position: relative;
    overflow: hidden;
}

.community-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.community-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.community-card:hover .community-img {
    transform: scale(1.05);
}

.community-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

/* 社区卡片详情信息 */
.community-details {
    font-size: 0.85rem;
    color: var(--secondary-color);
    line-height: 1.5;
}

.community-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.community-stat-item {
    flex: 1;
    text-align: center;
}

.community-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.2rem;
}

.community-stat-value {
    display: block;
    font-weight: 600;
    color: var(--text-color);
}

/* 进度条样式 */
.community-progress {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: #666;
    text-align: right;
}

/* 社区等级徽章 */
.community-grade-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ff9900);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 0.5rem;
    box-shadow: 0 2px 5px rgba(255, 153, 0, 0.3);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 可快速加入提示 */
.join-hint {
    font-size: 0.7rem;
    color: #4CAF50;
    margin-top: 0.3rem;
    opacity: 0.8;
    animation: hint-pulse 2s infinite;
}

@keyframes hint-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 无链接时的卡片样式 */
.community-card[href="#"] {
    cursor: not-allowed;
    opacity: 0.7;
}

.community-card[href="#"]:hover {
    transform: none !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
}

.community-card[href="#"] .community-img {
    filter: grayscale(30%);
}

/* 状态徽章 */
.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    backdrop-filter: blur(5px);
    z-index: 1;
}

.status-badge.full {
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
}

.status-badge.hot {
    background: linear-gradient(135deg, #ff9900, #ff6600);
}

.status-badge.normal {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

/* 加载中状态 */
.community-card.loading {
    position: relative;
    overflow: hidden;
}

.community-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 群组满员提示 */
.full-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 77, 77, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    backdrop-filter: blur(5px);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.community-card:hover .full-warning {
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .communities-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .community-stats {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .community-card {
        padding: 1rem;
    }
    
    .community-img {
        width: 70px;
        height: 70px;
    }
    
    .community-name {
        font-size: 1rem;
    }
    
    .community-details {
        font-size: 0.8rem;
    }
    
    .community-stat-label {
        font-size: 0.7rem;
    }
    
    .community-stat-value {
        font-size: 0.9rem;
    }
    
    .community-grade-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .communities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .community-card {
        padding: 0.8rem;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .community-card {
        border: 2px solid var(--primary-color);
    }
    
    .community-img {
        border-width: 2px;
    }
    
    .progress-bar {
        border: 1px solid #000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .community-card,
    .team-member,
    .team-leader,
    section {
        transition: none !important;
        animation: none !important;
    }
    
    .progress-fill {
        transition: none !important;
    }
    
    .community-grade-badge,
    .join-hint {
        animation: none !important;
    }
}