/**
 * AI 智能分析组件样式
 * @version 3.0.0
 * @description 极简主义/ChatGPT风格重构版 - 专注于内容阅读体验
 */

/* ========================================
   AI 整体分析弹窗 - 极简风格
   ======================================== */

/* 弹窗容器背景 */
.ai-overall-modal .modal-content {
    max-width: 900px; /* 稍微收窄以提升阅读体验 */
    height: 90vh;
    background: #ffffff;
    color: #374151; /* 柔和的深灰 */
    border: 1px solid #e5e7eb;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* 移除顶部装饰光效 */
.ai-overall-modal .modal-content::before {
    display: none;
}

/* 弹窗头部 */
.ai-overall-modal .modal-header {
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f3f4f6;
    padding: 20px 32px;
    background: #fff;
}

.ai-overall-modal .modal-title {
    color: #111827;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.ai-overall-modal .modal-close-btn {
    color: #9ca3af;
    background: transparent;
    border: none;
    font-size: 20px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-overall-modal .modal-close-btn:hover {
    color: #4b5563;
    background: #f3f4f6;
    transform: none;
    box-shadow: none;
}

.ai-overall-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-overall-subtitle {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* 弹窗主体 */
.ai-overall-modal-body {
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    height: calc(100% - 80px); /* 调整高度计算 */
    overflow-y: auto;
}

.ai-overall-modal-body .ai-insight-card {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

/* ========================================
   滚动条样式 (极简灰)
   ======================================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ========================================
   AI 洞察卡片样式 (弹窗内)
   ======================================== */

/* 头部 - 移除或简化 */
.ai-overall-modal-body .ai-insight-header {
    display: none; /* 极简模式下隐藏内部卡片头部，直接展示内容 */
}

/* 分段标签 */
.ai-section-tabs {
    display: none; /* 暂时隐藏，如果需要可以重新设计为简单的文本标签 */
}

/* 内容区域 */
.ai-overall-modal-body .ai-insight-body {
    flex: 1;
    padding: 32px 48px; /* 增加内边距，提升阅读呼吸感 */
    overflow-y: auto;
    color: #374151;
    font-size: 16px; /* 稍微增大字号 */
    line-height: 1.75;
}

/* 底部区域 */
.ai-overall-modal-body .ai-insight-footer {
    padding: 16px 32px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end; /* 按钮靠右 */
    align-items: center;
}

.ai-overall-modal-body .ai-insight-stats {
    display: none; /* 隐藏统计信息，保持界面干净 */
}

.ai-overall-modal-body .ai-insight-buttons {
    display: flex;
    gap: 12px;
}

.ai-overall-modal-body .button-secondary {
    background: #fff;
    color: #4b5563;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
}

.ai-overall-modal-body .button-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    transform: none;
    box-shadow: none;
}

.ai-overall-modal-body .button-primary.ai-generate-btn {
    background: #10a37f; /* ChatGPT Green */
    border: none;
    color: #fff;
    box-shadow: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
}

.ai-overall-modal-body .button-primary.ai-generate-btn::before {
    display: none;
}

.ai-overall-modal-body .button-primary.ai-generate-btn:hover {
    background: #0d8a6a;
    transform: none;
    box-shadow: none;
}

.ai-overall-modal-body .button-primary.ai-generate-btn:active {
    transform: none;
    box-shadow: none;
}

/* ========================================
   AI 思考动画（Shimmer Effect）- 极简版
   ======================================== */

.ai-thinking-container {
    padding: 40px 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.shimmer-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shimmer-line {
    height: 14px;
    width: 100%;
    background: #f3f4f6;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.shimmer-line.short { width: 40%; }
.shimmer-line.medium { width: 70%; }
.shimmer-line.long { width: 90%; }

.shimmer-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.ai-thinking-text {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ai-thinking-icon {
    animation: pulse 2s infinite;
    color: #10a37f; /* ChatGPT Green */
}

/* ========================================
   AI 文字生成动画 & 内容样式 (Markdown) - 极简版
   ======================================== */

.ai-insight-result {
    opacity: 1;
}

/* 标题样式 */
.ai-overall-modal-body .markdown-body h1,
.ai-overall-modal-body .markdown-body h2,
.ai-overall-modal-body .markdown-body h3 {
    color: #111827;
    margin-top: 32px;
    margin-bottom: 16px;
    border-bottom: none;
    font-weight: 600;
    line-height: 1.4;
}

.ai-overall-modal-body .markdown-body h1 { font-size: 24px; }
.ai-overall-modal-body .markdown-body h2 { font-size: 20px; }

.ai-overall-modal-body .markdown-body h3 {
    font-size: 18px;
    background: transparent;
    padding: 0;
    border-left: none;
    display: block;
    box-shadow: none;
}

/* 移除特定顺序的颜色 */
.ai-overall-modal-body .markdown-body h3:nth-of-type(n) {
    border-left-color: transparent;
    background: transparent;
    color: #111827;
}

/* 列表样式 */
.ai-overall-modal-body .markdown-body ul,
.ai-overall-modal-body .markdown-body ol {
    padding-left: 24px;
    list-style: disc; /* 恢复默认列表样式 */
    margin-bottom: 16px;
}

.ai-overall-modal-body .markdown-body ol {
    list-style: decimal;
}

.ai-overall-modal-body .markdown-body li {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 0;
    margin-bottom: 4px;
    position: relative;
    color: #374151;
    box-shadow: none;
    display: list-item; /* 恢复列表项显示 */
}

.ai-overall-modal-body .markdown-body li:hover {
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.ai-overall-modal-body .markdown-body li::before {
    display: none; /* 移除自定义箭头 */
}

/* 高亮文本 - 纯粹的加粗黑色 */
.ai-overall-modal-body .markdown-body strong {
    color: #000;
    font-weight: 700;
    background: none;
    padding: 0;
}

.ai-overall-modal-body .markdown-body p {
    margin-bottom: 16px;
    opacity: 1;
}

/* 引用块样式 */
.ai-overall-modal-body .markdown-body blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 16px;
    color: #6b7280;
    margin: 16px 0;
}

/* 代码块样式 */
.ai-overall-modal-body .markdown-body code {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    color: #1f2937;
}

.ai-overall-modal-body .markdown-body pre {
    background: #1f2937;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.ai-overall-modal-body .markdown-body pre code {
    background: transparent;
    color: #e5e7eb;
    padding: 0;
}

/* ========================================
   兼容原有其他弹窗 (Student Personal AI)
   ======================================== */

#studentPersonalAIModal .modern-modal-bg-decoration {
    display: none; /* 移除装饰背景 */
}

/* 通用徽章 - 简化 */
.ai-scene-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    box-shadow: none;
}
