/* ========================================
   AI World Summit 2026 - 赛博朋克风格样式
   ======================================== */

/* ========== 基础样式 ========== */
:root {
    --primary-glow: 0 0 20px rgba(0, 200, 255, 0.5);
    --secondary-glow: 0 0 20px rgba(200, 0, 255, 0.5);
    --accent-glow: 0 0 20px rgba(255, 200, 0, 0.5);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ========== 加载屏幕 ========== */
#loading-screen {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
}

#loading-text {
    font-family: 'Orbitron', monospace;
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ========== 首页背景效果 ========== */
.hero-bg {
    pointer-events: none;
    background: linear-gradient(135deg, 
        #0a0a0a 0%, 
        #1a1a2e 25%, 
        #16213e 50%, 
        #0f3460 75%, 
        #0a0a0a 100%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 赛博网格背景 */
.cyber-grid {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 200, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 200, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

/* 粒子效果 */
.particle-field {
    pointer-events: none;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 200, 255, 0.6);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========== 标题效果 ========== */
.title-glow {
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 0 80px currentColor;
    animation: title-flicker 3s ease-in-out infinite alternate;
}

@keyframes title-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
    75% { opacity: 0.98; }
}

/* 浮动动画 */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

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

/* ========== 按钮效果 ========== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::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.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 200, 255, 0.5);
}

.btn-secondary {
    box-shadow: 0 0 20px rgba(200, 0, 255, 0.3);
}

/* ========== 国家卡片 ========== */
.country-card {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.8), rgba(20, 20, 40, 0.9));
    border: 1px solid rgba(100, 100, 150, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.country-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(0, 200, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.country-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 200, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 200, 255, 0.2);
}

.country-card:hover::before {
    opacity: 1;
}

.country-flag {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

/* ========== 消息气泡 ========== */
.message-bubble {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(30, 30, 50, 0.5);
    border: 1px solid rgba(100, 100, 150, 0.1);
    animation: message-appear 0.3s ease-out;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
}

.message-avatar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid rgba(30, 30, 50, 1);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.message-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(100, 100, 150, 0.2);
}

.message-time {
    font-size: 0.75rem;
    color: rgba(150, 150, 180, 0.6);
}

.message-text {
    line-height: 1.5;
    word-wrap: break-word;
}

/* AI 特殊样式 */
.ai-grok .message-name { color: #60a5fa; }
.ai-grok .message-badge { background: rgba(96, 165, 250, 0.2); color: #60a5fa; }

.ai-claude .message-name { color: #f472b6; }
.ai-claude .message-badge { background: rgba(244, 114, 182, 0.2); color: #f472b6; }

.ai-gpt .message-name { color: #34d399; }
.ai-gpt .message-badge { background: rgba(52, 211, 153, 0.2); color: #34d399; }

.ai-gemini .message-name { color: #fbbf24; }
.ai-gemini .message-badge { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

.ai-qianwen .message-name { color: #fb923c; }
.ai-qianwen .message-badge { background: rgba(251, 146, 60, 0.2); color: #fb923c; }

.ai-doubao .message-name { color: #a78bfa; }
.ai-doubao .message-badge { background: rgba(167, 139, 250, 0.2); color: #a78bfa; }

.ai-kimi .message-name { color: #22d3ee; }
.ai-kimi .message-badge { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }

.ai-deepseek .message-name { color: #818cf8; }
.ai-deepseek .message-badge { background: rgba(129, 140, 248, 0.2); color: #818cf8; }

/* ========== 侧边栏 ========== */
.ai-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(30, 30, 50, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(100, 100, 150, 0.1);
    transition: all 0.2s ease;
}

.ai-card:hover {
    background: rgba(30, 30, 50, 0.6);
    border-color: rgba(0, 200, 255, 0.3);
}

.ai-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ai-card-info {
    flex: 1;
    min-width: 0;
}

.ai-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-card-status {
    font-size: 0.7rem;
    color: rgba(150, 150, 180, 0.6);
}

/* ========== 议题卡片 ========== */
.topic-card {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.6), rgba(20, 20, 40, 0.8));
    border: 1px solid rgba(100, 100, 150, 0.2);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.topic-card:hover {
    border-color: rgba(200, 0, 255, 0.5);
    box-shadow: 0 5px 20px rgba(200, 0, 255, 0.1);
}

.topic-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(200, 0, 255, 0.1);
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 20, 40, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 150, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 150, 0.5);
}

/* ========== 动画工具类 ========== */
.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { 
        text-shadow: 0 0 5px currentColor;
    }
    50% { 
        text-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .title-glow {
        font-size: 2.5rem !important;
    }
    
    .country-flag {
        font-size: 3rem;
    }
    
    .message-bubble {
        padding: 8px;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}

/* ========== 打字机效果 ========== */
.typewriter {
    overflow: hidden;
    border-right: 2px solid currentColor;
    white-space: nowrap;
    animation: 
        typing 2s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: currentColor; }
}
