/**
 * Three.js AI动画样式 - 优化升级版
 * 云昇气味库
 */

/* 加载动画容器样式 */
#ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 120px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(3, 15, 35, 0.85), rgba(6, 18, 45, 0.9));
    margin: 20px 0;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 10, 50, 0.2);
    border: 1px solid rgba(30, 140, 210, 0.25);
    transition: all 0.3s ease;
}

#ai-loading:hover {
    box-shadow: 0 15px 40px rgba(0, 50, 180, 0.25);
    border-color: rgba(30, 180, 255, 0.35);
}

/* Three.js画布样式 */
#ai-loading canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 12px;
}

/* AI状态文本样式 */
.ai-status-text {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 15px rgba(30, 200, 255, 0.8), 0 0 30px rgba(30, 180, 255, 0.5);
    z-index: 2;
    animation: glow-pulse 2.5s infinite;
    font-family: 'Arial', sans-serif;
    letter-spacing: 1.5px;
    padding: 0 20px;
}

/* 脉冲发光动画 */
@keyframes glow-pulse {
    0% { opacity: 0.7; text-shadow: 0 0 10px rgba(30, 180, 255, 0.5); }
    50% { opacity: 1; text-shadow: 0 0 20px rgba(30, 200, 255, 0.9), 0 0 30px rgba(30, 180, 255, 0.6); }
    100% { opacity: 0.7; text-shadow: 0 0 10px rgba(30, 180, 255, 0.5); }
}

/* 装饰元素 */
.cyber-corner {
    position: absolute;
    width: 35px;
    height: 35px;
    z-index: 3;
    transition: all 0.3s ease;
}

.cyber-corner:before, .cyber-corner:after {
    content: '';
    position: absolute;
    background: rgba(60, 210, 255, 0.7);
    box-shadow: 0 0 8px rgba(60, 210, 255, 0.8), 0 0 20px rgba(60, 210, 255, 0.4);
    transition: all 0.5s ease;
}

#ai-loading:hover .cyber-corner:before,
#ai-loading:hover .cyber-corner:after {
    background: rgba(100, 220, 255, 0.8);
    box-shadow: 0 0 10px rgba(100, 220, 255, 1), 0 0 25px rgba(100, 220, 255, 0.6);
}

.cyber-corner.top-left {
    top: 15px;
    left: 15px;
}

.cyber-corner.top-left:before {
    top: 0;
    left: 0;
    width: 3px;
    height: 20px;
    animation: corner-pulse 3s infinite;
}

.cyber-corner.top-left:after {
    top: 0;
    left: 0;
    width: 20px;
    height: 3px;
    animation: corner-pulse 3s infinite 0.5s;
}

.cyber-corner.top-right {
    top: 15px;
    right: 15px;
}

.cyber-corner.top-right:before {
    top: 0;
    right: 0;
    width: 3px;
    height: 20px;
    animation: corner-pulse 3s infinite 0.25s;
}

.cyber-corner.top-right:after {
    top: 0;
    right: 0;
    width: 20px;
    height: 3px;
    animation: corner-pulse 3s infinite 0.75s;
}

.cyber-corner.bottom-left {
    bottom: 15px;
    left: 15px;
}

.cyber-corner.bottom-left:before {
    bottom: 0;
    left: 0;
    width: 3px;
    height: 20px;
    animation: corner-pulse 3s infinite 0.75s;
}

.cyber-corner.bottom-left:after {
    bottom: 0;
    left: 0;
    width: 20px;
    height: 3px;
    animation: corner-pulse 3s infinite 0.25s;
}

.cyber-corner.bottom-right {
    bottom: 15px;
    right: 15px;
}

.cyber-corner.bottom-right:before {
    bottom: 0;
    right: 0;
    width: 3px;
    height: 20px;
    animation: corner-pulse 3s infinite 0.5s;
}

.cyber-corner.bottom-right:after {
    bottom: 0;
    right: 0;
    width: 20px;
    height: 3px;
    animation: corner-pulse 3s infinite;
}

/* 角落脉冲动画 */
@keyframes corner-pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* 添加边缘光效果 */
#ai-loading:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    pointer-events: none;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(30, 120, 255, 0.03) 15%, 
        transparent 30%,
        transparent 70%, 
        rgba(30, 120, 255, 0.03) 85%, 
        transparent 100%
    );
    box-shadow: inset 0 0 30px rgba(0, 50, 100, 0.3);
    z-index: 2;
}

/* 添加顶部状态指示器 */
#ai-loading:before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    width: 40%;
    height: 3px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, 
        rgba(20, 120, 255, 0.1), 
        rgba(20, 120, 255, 0.7) 50%,
        rgba(20, 120, 255, 0.1)
    );
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(30, 150, 255, 0.5);
    opacity: 0.8;
    animation: scan-line 2s ease-in-out infinite;
    z-index: 2;
}

/* 扫描线动画 */
@keyframes scan-line {
    0% { transform: translateX(-50%) scaleX(0.5); opacity: 0.3; }
    50% { transform: translateX(-50%) scaleX(1); opacity: 0.8; }
    100% { transform: translateX(-50%) scaleX(0.5); opacity: 0.3; }
}

/* 加载文本样式 */
.loading-text {
    position: relative;
    z-index: 3;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 15px;
    letter-spacing: 1px;
    font-weight: 400;
    text-align: center;
}

/* 动画控制按钮样式 */
.animation-toggle-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(30, 50, 80, 0.8);
    border: 1px solid rgba(60, 180, 255, 0.5);
    border-radius: 6px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(30, 150, 255, 0.3);
}

.animation-toggle-btn:hover {
    background: rgba(40, 70, 100, 0.9);
    border-color: rgba(80, 200, 255, 0.7);
    box-shadow: 0 0 15px rgba(30, 150, 255, 0.5);
}

.animation-toggle-btn i {
    color: rgba(200, 230, 255, 0.9);
    font-size: 16px;
}

/* 隐藏动画的样式 */
#ai-loading.hidden {
    min-height: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
}

/* 悬浮指示样式 */
.animation-toggle-btn:after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    right: 0;
    background: rgba(20, 40, 70, 0.9);
    color: rgba(200, 230, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.animation-toggle-btn:hover:after {
    opacity: 1;
} 