/* 自定义样式文件 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Noto Sans SC', sans-serif;
}

/* 确保16:9比例 */
.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

/* 大屏适配 */
@media (min-width: 1920px) {
    .container {
        max-width: 1920px;
    }
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 按钮动画 */
.btn-animate {
    transition: all 0.2s ease;
}

.btn-animate:hover {
    transform: scale(1.05);
}

.btn-animate:active {
    transform: scale(0.95);
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 文字渐变 */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 聊天消息样式 */
.message-bubble {
    max-width: 80%;
    word-wrap: break-word;
}

.message-user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.message-ai {
    background: #f3f4f6;
    color: #374151;
}

/* 游戏卡片样式 */
.game-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.game-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* 进度条样式 */
.progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    border-radius: 9999px;
}

/* 输入框样式 */
.input-field {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.input-field:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 柔和动态背景元素 */
.ambient-blob {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(60px);
    animation: drift 16s ease-in-out infinite;
    left: -120px;
    top: -120px;
}

.ambient-blob.delay-700 { animation-delay: .7s; right: -120px; left: auto; bottom: -120px; top: auto; }

@keyframes drift {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(80px,40px) scale(1.05); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* AI智能体样式 */
.ai-avatar {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.ai-head {
    width: 60px;
    height: 60px;
    background: #fdbcb4;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ai-hair {
    width: 70px;
    height: 40px;
    background: #2c2c2c;
    border-radius: 50% 50% 0 0;
    position: absolute;
    top: -5px;
    left: -5px;
    z-index: 1;
}

.ai-glasses {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.ai-lens {
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 50%;
    position: absolute;
    top: 0;
}

.ai-lens:first-child {
    left: -8px;
}

.ai-lens:last-child {
    left: 8px;
}

.ai-bridge {
    width: 4px;
    height: 2px;
    background: #333;
    position: absolute;
    top: 6px;
    left: -2px;
}

.ai-eyes {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.ai-eye {
    width: 6px;
    height: 6px;
    background: #2c2c2c;
    border-radius: 50%;
    position: absolute;
    top: 0;
}

.ai-eye:first-child {
    left: -8px;
}

.ai-eye:last-child {
    left: 8px;
}

.ai-mouth {
    width: 8px;
    height: 4px;
    background: #e8a598;
    border-radius: 0 0 8px 8px;
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
}

.ai-body {
    width: 50px;
    height: 40px;
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
}

.ai-shirt {
    width: 50px;
    height: 40px;
    background: #ffffff;
    border-radius: 8px 8px 0 0;
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-arm {
    width: 8px;
    height: 25px;
    background: #fdbcb4;
    border-radius: 4px;
    position: absolute;
    top: 5px;
}

.ai-arm-left {
    left: -5px;
    transform: rotate(-15deg);
}

.ai-arm-right {
    right: -5px;
    transform: rotate(15deg);
}

/* 欢迎手势动画 */
.ai-arm-right {
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(25deg); }
}

/* 增强的悬停效果 */
.hover\:scale-103:hover {
    transform: scale(1.03) translateY(-4px);
}

.hover\:-translate-y-1:hover {
    transform: translateY(-4px);
}

/* 图标悬停动画 */
.hover-icon {
    transition: all 300ms ease;
}

.hover-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 文字悬停效果 */
.hover-text {
    transition: all 300ms ease;
}

.hover-text:hover {
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 统一动画速度 */
.transition-all {
    transition: all 300ms ease;
}

/* AI智能体交互样式 */
#ai-character {
    transition: transform 1s ease-in-out;
}

#voice-button {
    transition: all 300ms ease;
}

#voice-button:hover {
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.3);
}

#speech-bubble {
    transition: all 300ms ease;
}

/* 语音按钮状态动画 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.voice-recording {
    animation: pulse-glow 1.5s infinite;
}

/* 智能体呼吸动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.ai-breathing {
    animation: breathe 3s ease-in-out infinite;
}

/* 气泡出现动画 */
@keyframes bubble-appear {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bubble-show {
    animation: bubble-appear 300ms ease-out;
}

/* 播放按钮样式 */
#play-audio {
    transition: all 300ms ease;
}

.play-audio-btn:hover {
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.3);
}

#play-audio:active {
    transform: scale(0.95);
}

/* 播放按钮光效 */
@keyframes play-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(147, 51, 234, 0);
    }
}

.play-button-active {
    animation: play-glow 2s infinite;
}

/* 气泡容器样式 */
#bubble-container {
    max-width: calc(50% - 2rem); /* 确保不超出卡片右边界 */
    z-index: 10;
}

/* 气泡样式优化 */
#speech-bubble {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    #bubble-container {
        max-width: calc(45% - 1rem);
    }
    
    #speech-bubble {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    #bubble-container {
        max-width: calc(40% - 0.5rem);
    }
    
    #speech-bubble {
        max-width: 150px;
        padding: 0.75rem;
    }
    
    #speech-bubble p {
        font-size: 0.75rem;
    }
}
