/* 浮动聊天图标 */
.chat-icon {
    position: fixed;
    bottom: 30px;
    right: 5%;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.chat-icon i {
    font-size: 45px;
    color: white;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
    padding: 10px;
    box-sizing: border-box;
}

.modal-container {
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 0;
}

.quick-actions-section {
    display: none; /* 手机端隐藏快捷发送 */
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 15px;
    min-height: 0;
}

.message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 5px;
    animation: fadeIn 0.3s ease-in;
    max-width: 90%;
    font-size: 14px;
}

.user-message {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background: #f1f3f4;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border-left: 4px solid #667eea;
}

.chat-input {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e5e9;
    font-size: 16px;
    transition: all 0.3s;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.section-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 15px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-style: italic;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* 响应式设计 - 手机端 */
@media (max-width: 600px) {
    .modal-overlay {
        padding: 5px;
    }

    .modal-container {
        height: 80vh;
        border-radius: 0;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .chat-section {
        padding: 15px;
    }

    .chat-messages {
        padding: 12px;
        margin-bottom: 12px;
    }

    .message {
        padding: 10px;
        margin-bottom: 12px;
        font-size: 13px;
    }

    .chat-input input {
        padding: 10px;
        font-size: 13px;
    }

    .send-btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .chat-icon {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }

    .chat-icon i {
        font-size: 24px;
    }
}

/* 平板和桌面端显示快捷发送 */
@media (min-width: 600px) {
    .modal-container {
        width: 90%;
        max-width: 1200px;
        height: 90vh;
    }

    .modal-body {
        flex-direction: row;
    }

    .chat-section {
        flex: 2;
        border-right: 1px solid #e1e5e9;
    }

    .quick-actions-section {
        display: block;
        flex: 1;
        padding: 25px;
        overflow-y: auto;
    }

    .quick-actions-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 15px;
    }

    .quick-btn {
        background: #f8f9fa;
        border: 2px solid #e1e5e9;
        padding: 20px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
        text-align: center;
        transition: all 0.3s;
        color: #555;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100px;
    }

    .quick-btn:hover {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        border-color: #667eea;
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

    .quick-btn i {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .quick-btn .btn-text {
        font-weight: 600;
        font-size: 1.1rem;
    }

    .quick-btn .btn-desc {
        font-size: 0.9rem;
        opacity: 0.8;
        margin-top: 5px;
    }
}