/* 加载动画样式 */

/* 页面加载动画 */
.content {
    position: relative;
    min-height: calc(100vh - 120px);
}

.page-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-container {
    text-align: center;
    max-width: 300px;
    animation: fadeInUp 0.5s ease-out;
}

.loader-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(32, 178, 170, 0.1);
    border-top: 4px solid var(--primary-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(32, 178, 170, 0.2);
}

.loader-text {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 0.5s ease-out 0.2s both;
}

.loader-progress {
    width: 100%;
    height: 4px;
    background-color: rgba(32, 178, 170, 0.1);
    border-radius: 2px;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover), var(--primary-color));
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progressAnimation 2s ease-in-out infinite, fadeIn 0.5s ease-out 0.4s both;
}

/* 加载动画关键帧 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(32, 178, 170, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(32, 178, 170, 0.4);
        transform: scale(1.05);
    }
}

@keyframes progressAnimation {
    0% {
        width: 0%;
        background-position: -200% 0;
    }
    50% {
        width: 100%;
        background-position: 200% 0;
    }
    100% {
        width: 0%;
        background-position: 200% 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0.05);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }
}

/* 按钮加载状态 */
.control-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.control-btn.loading i {
    animation: spin 1s linear infinite;
}

/* 运行时间显示 - 简化版 */
.uptime-display {
    text-align: center;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

.uptime-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px;
    max-width: 100%;
}

/* 隐藏水平滚动条但保留滚动功能 */
.uptime-digits::-webkit-scrollbar {
    display: none;
}

.uptime-digits {
    scrollbar-width: none;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    min-width: 40px;
}

.digit-container {
    position: relative;
    width: 45px;
    height: 55px;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.current-digit {
    font-size: 1.8rem;
    font-weight: 700;
    color: #20b2aa;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.unit-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.colon {
    font-size: 1.8rem;
    font-weight: 700;
    color: #20b2aa;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    width: 10px;
    height: 55px;
}

/* 确保所有元素都能完整显示 */
.uptime-display, .uptime-digits, .time-unit, .digit-container {
    box-sizing: border-box;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .uptime-digits {
        font-size: 1.2rem;
        gap: 6px;
    }
    
    .digit-container {
        width: 40px;
        height: 50px;
    }
    
    .current-digit {
        font-size: 1.5rem;
    }
    
    .colon {
        font-size: 1.5rem;
        width: 8px;
    }
    
    .unit-label {
        font-size: 0.65rem;
    }
    
    .uptime-display {
        padding: 12px 8px;
        margin: 8px 0;
    }
}