/* ==========================================
   团队页样式 - 白色简洁版
   ========================================== */

/* 全局优化 */
body {
    background: #ffffff;
    min-height: 100vh;
    padding-bottom: 0 !important;
    box-sizing: border-box;
    position: relative;
    color: #333333;
}

/* 确保底部内容不被导航栏遮挡 */
.team-detail-card:last-of-type {
    margin-bottom: 20px;
}

.bottom-safe-area {
    display: block;
    width: 100%;
    flex-shrink: 0;
    min-height: 70px;
    height: calc(50px + env(safe-area-inset-bottom, 0px));
}

/* 统计卡片优化 */
.team-stats-card {
    margin: 15px;
    margin-bottom: 15px;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.3s;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #111827;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 层级切换按钮优化 */
.level-tabs-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    background: #f3f4f6;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.level-tabs-container .level-tab {
    background: transparent !important;
    color: #6b7280 !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    padding: 10px;
}

.level-tabs-container .level-tab.active {
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.level-tab {
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #6b7280;
}

.level-tab:not(.active):hover {
    background: rgba(0, 0, 0, 0.05);
    color: #111827;
}

.level-tab.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

/* 当前层级数据展示 */
.current-level-stats {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    color: #111827;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #e5e7eb;
}

.current-level-stats .stat-item {
    background: #ffffff;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
}

.current-level-stats .stat-value {
    color: #111827;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #111827;
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    font-weight: 700;
}

.current-level-stats .stat-label {
    color: #6b7280;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 团队详情卡片 */
.team-detail-card {
    margin: 0 15px 15px;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.level-detail-item {
    margin-bottom: 15px;
    padding: 18px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
    border: 1px solid #e5e7eb;
}

.level-detail-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.level-detail-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-detail-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

/* 邀请入口优化 */
.invite-entry-card {
    margin: 0 15px 20px;
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: #111827;
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.invite-entry-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 50%;
}

.invite-entry-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    color: #111827;
}

.invite-entry-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.invite-entry-btn {
    width: 100%;
    padding: 14px;
    background: #667eea;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.invite-entry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: #5568d3;
}

.invite-entry-btn:active {
    transform: translateY(0);
}

/* 日期筛选按钮优化 */
.date-filter-btn {
    padding: 6px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #111827;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.date-filter-btn:hover {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 加载动画优化 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 响应式优化 */
@media (max-width: 375px) {
    .stats-grid {
        gap: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .current-level-stats .stat-value {
        font-size: 16px;
    }
    
    .level-tabs-container {
        gap: 8px;
        padding: 4px;
    }
    
    .level-tab {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .stat-item {
        padding: 10px 8px;
    }
    
    .current-level-stats {
        padding: 15px;
    }
}

/* 数字动画效果 */
.stat-value {
    transition: all 0.3s;
}

.stat-value:empty::after {
    content: '0';
    opacity: 0.3;
}
