/* AI按钮样式 - 与原有章节卡片保持一致 */
.chapter-card[onclick*="showAIAssistant"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.chapter-card[onclick*="showAIAssistant"]:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.chapter-card[onclick*="showAIAssistant"] h3 {
    color: white;
    margin-bottom: 10px;
}

.chapter-card[onclick*="showAIAssistant"] p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.chapter-card[onclick*="showAIAssistant"] .poem-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* AI辅助学习界面样式 */
.ai-assistant-page {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.ai-header {
    text-align: center;
    margin-bottom: 30px;
}

.ai-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.ai-header p {
    color: #666;
    font-size: 1.1rem;
}

/* AI聊天容器 */
.ai-chat-container {
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    background: #f8f9fa;
}

.ai-chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

/* AI消息样式 */
.ai-message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    flex-shrink: 0;
}

.ai-message.ai-system .ai-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-message.user .ai-avatar {
    background: #28a745;
    color: white;
}

.ai-content {
    background: #f1f3f4;
    padding: 15px;
    border-radius: 15px;
    max-width: 70%;
    word-wrap: break-word;
}

.ai-message.user .ai-content {
    background: #007bff;
    color: white;
}

.ai-content p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.ai-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-content li {
    margin-bottom: 5px;
}

/* AI输入区域 */
.ai-input-container {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.ai-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.ai-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.ai-input:focus {
    border-color: #667eea;
}

.ai-send-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.ai-send-btn:hover {
    transform: scale(1.05);
}

/* 快速操作按钮 */
.ai-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-quick-btn {
    padding: 8px 16px;
    border: 1px solid #667eea;
    border-radius: 20px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ai-quick-btn:hover {
    background: #667eea;
    color: white;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #6c757d;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* 页面描述 */
.page-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-chat-messages {
        height: 300px;
    }
    
    .ai-content {
        max-width: 85%;
    }
    
    .ai-quick-actions {
        justify-content: center;
    }
    
    .ai-quick-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 加载动画 */
.ai-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-style: italic;
}

.ai-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误消息样式 */
.ai-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

/* 成功消息样式 */
.ai-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}
