/**
 * 组件样式文件
 * 负责时间显示、帧率显示器、回到顶部等组件样式
 */

/* 时间显示容器 - 重新设计布局 */
.time-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    width: 100%;
    min-height: 80px;
}

/* 时间显示主容器 - 居中显示 */
.time-display {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.85), rgba(37, 117, 252, 0.85));
    padding: 18px 35px;
    border-radius: 60px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(25px);
    box-shadow: 
        0 12px 35px rgba(106, 17, 203, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* 时间显示悬停效果 */
.time-display:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 20px 45px rgba(106, 17, 203, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 时间显示光效 */
.time-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.8s ease;
}

.time-display:hover::before {
    left: 100%;
}

/* 时间显示背景光晕 */
.time-display::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(106, 17, 203, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.time-display:hover::after {
    opacity: 1;
}

/* 日期显示样式 */
.time-date {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    background: linear-gradient(45deg, #ffffff, #e0e0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 4px 8px;
    border-radius: 8px;
    position: relative;
}

/* 星期显示样式 */
.time-week {
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    font-weight: 600;
    background: rgba(255, 215, 0, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* 时钟显示样式 */
.time-clock {
    color: #00ff9d;
    text-shadow: 0 0 15px rgba(0, 255, 157, 0.6);
    font-weight: 800;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    background: rgba(0, 255, 157, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 157, 0.3);
    animation: clockGlow 2s infinite alternate;
}

/* 时钟发光动画 */
@keyframes clockGlow {
    0% { 
        text-shadow: 0 0 10px rgba(0, 255, 157, 0.4);
        box-shadow: 0 0 10px rgba(0, 255, 157, 0.1);
    }
    100% { 
        text-shadow: 0 0 20px rgba(0, 255, 157, 0.8);
        box-shadow: 0 0 15px rgba(0, 255, 157, 0.2);
    }
}

/* 时钟分隔符动画 */
.time-separator {
    animation: blink 1.2s infinite;
    color: #ff6b9d;
    font-weight: 700;
}

/* 分隔符闪烁动画 */
@keyframes blink {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(0.9);
    }
}

/* 帧率显示器容器 - 绝对定位在右上角 */
.fps-display {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(16, 18, 27, 0.9);
    padding: 14px 22px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 20;
}

/* 帧率显示器悬停效果 */
.fps-display:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 176, 155, 0.5);
    background: rgba(16, 18, 27, 0.95);
}

/* 帧率显示器光效 */
.fps-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.fps-display:hover::before {
    left: 100%;
}

/* 帧率标签样式 */
.fps-label {
    color: #b0b0d0;
    font-weight: 500;
    font-size: 0.95rem;
}

/* 帧率数值样式 */
.fps-value {
    font-weight: 800;
    text-shadow: 0 0 15px currentColor;
    transition: all 0.3s ease;
    min-width: 32px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    padding: 2px 0;
}

/* 帧率单位样式 */
.fps-unit {
    color: #b0b0d0;
    font-weight: 500;
    font-size: 0.9rem;
}

/* 帧率状态文本 */
.fps-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 帧率图标样式 */
.fps-icon {
    animation: pulse 1.5s infinite ease-in-out;
    font-size: 1.1rem;
    color: #6a11cb;
}

/* 帧率图标脉冲动画 */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.15);
        opacity: 0.8;
    }
}

/* 帧率指示器 */
.fps-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: fpsPulse 2s infinite ease-in-out;
    box-shadow: 0 0 10px currentColor;
}

/* 帧率指示器脉冲动画 */
@keyframes fpsPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 5px currentColor;
    }
    50% { 
        transform: scale(1.3);
        box-shadow: 0 0 15px currentColor;
    }
}

/* 帧率颜色状态 - 极佳 (60+ FPS) */
.fps-excellent { 
    color: #00ff9d; 
}
.fps-status-excellent {
    background: rgba(0, 255, 157, 0.2);
    color: #00ff9d;
    border-color: rgba(0, 255, 157, 0.3);
}

/* 帧率颜色状态 - 良好 (45-59 FPS) */
.fps-good { 
    color: #7eff00; 
}
.fps-status-good {
    background: rgba(126, 255, 0, 0.2);
    color: #7eff00;
    border-color: rgba(126, 255, 0, 0.3);
}

/* 帧率颜色状态 - 一般 (30-44 FPS) */
.fps-fair { 
    color: #ffcc00; 
}
.fps-status-fair {
    background: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
    border-color: rgba(255, 204, 0, 0.3);
}

/* 帧率颜色状态 - 较差 (<30 FPS) */
.fps-poor { 
    color: #ff416c; 
}
.fps-status-poor {
    background: rgba(255, 65, 108, 0.2);
    color: #ff416c;
    border-color: rgba(255, 65, 108, 0.3);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 
        0 8px 25px rgba(106, 17, 203, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    animation: float 3s infinite ease-in-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 回到顶部按钮浮动动画 */
@keyframes float {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-8px); 
    }
}

/* 显示回到顶部按钮 */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 回到顶部按钮悬停效果 */
.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 
        0 12px 30px rgba(106, 17, 203, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
    .time-display {
        font-size: 1.3rem;
        padding: 16px 30px;
        gap: 18px;
    }
    
    .fps-display {
        font-size: 1rem;
        padding: 12px 20px;
    }
}

@media (max-width: 768px) {
    .time-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .time-display {
        font-size: 1.2rem;
        padding: 14px 25px;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 25px;
    }
    
    .fps-display {
        position: relative;
        top: auto;
        right: auto;
        align-self: center;
        font-size: 1rem;
        padding: 12px 20px;
        margin-top: 10px;
    }
    
    .time-date,
    .time-week,
    .time-clock {
        text-align: center;
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .time-display {
        font-size: 1.1rem;
        padding: 12px 20px;
        gap: 12px;
        flex-direction: column;
    }
    
    .fps-display {
        font-size: 0.95rem;
        padding: 10px 18px;
        gap: 10px;
    }
    
    .fps-value {
        font-size: 1.2rem;
        min-width: 28px;
    }
    
    .time-date,
    .time-week,
    .time-clock {
        min-width: auto;
        width: 100%;
    }
}

/* 小屏幕手机特殊处理 */
@media (max-width: 360px) {
    .time-display {
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .fps-display {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
    
    .fps-label {
        display: none; /* 在小屏幕上隐藏标签节省空间 */
    }
}