/* 全局样式 - 蓝白风格 + 毛玻璃 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #F5F9FF 0%, #FFFFFF 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    color: #1E2A3A;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(42, 109, 244, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 头部毛玻璃 */
.glass-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(42, 109, 244, 0.2);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 12px;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: #2A6DF4;
    letter-spacing: 1px;
}

.header-info {
    color: #546E7A;
    font-size: 14px;
    background: #E9F0FF;
    padding: 6px 12px;
    border-radius: 30px;
}

/* 聊天主区域 */
.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.user-message {
    justify-content: flex-end;
}

.ai-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 24px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.user-message .message-content {
    background: #2A6DF4;
    color: white;
    border-bottom-right-radius: 6px;
}

.ai-message .message-content {
    background: white;
    color: #1E2A3A;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(42, 109, 244, 0.1);
}

/* 消息内样式 */
.message-content pre {
    background: #1E2A3A;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 10px 0;
    position: relative;
    font-size: 14px;
}

.message-content code {
    font-family: 'Consolas', monospace;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}

.message-content a {
    color: #2A6DF4;
    text-decoration: underline;
    word-break: break-all;
}

.message-content h1, .message-content h2, .message-content h3 {
    margin: 8px 0;
    color: #1E2A3A;
    font-weight: 600;
}

.message-content ul, .message-content ol {
    margin: 8px 0 8px 24px;
}

.message-content blockquote {
    border-left: 3px solid #2A6DF4;
    background: #E9F0FF;
    padding: 10px 16px;
    border-radius: 12px;
    margin: 10px 0;
}

.copy-btn {
    position: absolute;
    bottom: 5px;
    right: 8px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    color: inherit;
}

.message-content:hover .copy-btn {
    opacity: 1;
}

/* 图片消息（可选） */
.message-image {
    max-width: 100%;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    margin: 5px 0;
    border: 2px solid rgba(255,255,255,0.5);
}

.image-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.image-action-btn {
    background: #E9F0FF;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #2A6DF4;
    cursor: pointer;
    transition: all 0.2s;
}

.image-action-btn:hover {
    background: #2A6DF4;
    color: white;
}

/* 输入区域 */
.input-footer {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-top: 1px solid rgba(42, 109, 244, 0.2);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    background: white;
    border-radius: 40px;
    padding: 4px 4px 4px 20px;
    border: 1px solid #E9F0FF;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 12px 0;
    background: transparent;
}

.input-wrapper input::placeholder {
    color: #aaa;
}

.send-btn {
    background: #2A6DF4;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(42, 109, 244, 0.3);
}

.send-btn.stop-btn {
    background: #ff4757;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.send-btn.stop-btn:hover {
    background: #ff3344;
}

.send-btn:hover {
    background: #1a5be0;
}

.send-btn:disabled {
    background: #cccccc;
    box-shadow: none;
    cursor: not-allowed;
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    color: #546E7A;
    font-size: 13px;
}

.sound-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.copyright {
    opacity: 0.7;
}

/* 模态框 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(255,255,255,0.4);
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #2A6DF4;
    color: white;
    border-radius: 40px;
    box-shadow: 0 8px 20px rgba(42, 109, 244, 0.3);
    z-index: 3000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
    font-size: 14px;
    backdrop-filter: blur(5px);
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: #2A6DF4;
}

.notification.error {
    background: #ff4757;
}

/* 打字动画 */
.typing-animation {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    body { padding: 8px; }
    .app-container { height: 95vh; border-radius: 24px; }
    .message-content { max-width: 85%; font-size: 14px; }
    .brand-name { font-size: 18px; }
    .logo-img { height: 32px; }
    .input-wrapper input { font-size: 14px; }
    .send-btn { padding: 10px 20px; }
}