/* ======================================================================
 * 系统名称：ITeacherPlatform
 * 开发公司：斯帝姆智能科技有限公司
 * 程序名：common.css
 * 功能描述：AI助手模块公共样式文件，包含所有模板共用的CSS样式
 * 版本号：v1.0.0
 * 修订历史：
 *   - v1.0.0 (2026-03-18)：初始版本，统一所有AI助手页面的样式
 * ====================================================================== */

/* ----------------------------------------------------------------------
 * CSS变量定义 - 全局主题颜色
 * ---------------------------------------------------------------------- */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background-color: #f8f9fa;
    --text-color: #2c3e50;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --card-bg: white;
}

/* 深色模式变量 */
.dark-mode {
    --primary-color: #8a9efc;
    --secondary-color: #a78bfa;
    --background-color: #1e1e1e;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #3d3d3d;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------------------------------------
 * 基础样式
 * ---------------------------------------------------------------------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* 确保页脚文字颜色与base.html保持一致 */
.footer {
    color: white !important;
}

.footer a {
    color: rgba(255, 255, 255, 0.8) !important;
}

.footer a:hover {
    color: white !important;
}

/* ----------------------------------------------------------------------
 * 容器样式
 * ---------------------------------------------------------------------- */
.ai-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ----------------------------------------------------------------------
 * 卡片样式
 * ---------------------------------------------------------------------- */
.ai-card {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ai-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.ai-card-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.ai-card-header h1 i {
    margin-right: 10px;
}

.ai-card-body {
    padding: 25px;
}

/* ----------------------------------------------------------------------
 * 按钮样式
 * ---------------------------------------------------------------------- */
.ai-btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.ai-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.ai-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.ai-btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.ai-btn-outline:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* ----------------------------------------------------------------------
 * 表单样式
 * ---------------------------------------------------------------------- */
.ai-form-control {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.ai-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.ai-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

/* ----------------------------------------------------------------------
 * 文件上传样式
 * ---------------------------------------------------------------------- */
.ai-file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--card-bg);
}

.ai-file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.ai-file-upload i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.ai-file-upload input[type="file"] {
    display: none;
}

/* ----------------------------------------------------------------------
 * 原理说明样式 - 统一所有页面
 * ---------------------------------------------------------------------- */
.principle-content {
    padding: 10px 0;
}

.principle-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.principle-section h3,
.principle-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    font-size: 18px;
}

.principle-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.principle-card h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 16px;
}

.principle-card h5 {
    color: #34495e;
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 14px;
}

.principle-card p {
    line-height: 1.7;
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}

/* ----------------------------------------------------------------------
 * 示例框样式
 * ---------------------------------------------------------------------- */
.example-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.example-box h5 {
    color: white;
    margin-bottom: 10px;
    font-size: 14px;
}

.example-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.example-box li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
}

.example-box li:last-child {
    border-bottom: none;
}

/* ----------------------------------------------------------------------
 * 流程图样式
 * ---------------------------------------------------------------------- */
.process-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.flow-step {
    text-align: center;
    margin: 10px;
}

.step-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.step-text {
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
}

.flow-arrow {
    font-size: 20px;
    color: var(--primary-color);
    margin: 0 10px;
}

/* ----------------------------------------------------------------------
 * 时间线样式
 * ---------------------------------------------------------------------- */
.timeline {
    position: relative;
    padding-left: 25px;
    margin: 15px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 15px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-year {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 14px;
    margin-bottom: 3px;
}

.timeline-content {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-content p {
    margin: 5px 0 0 0;
    font-size: 12px;
}

/* ----------------------------------------------------------------------
 * 故事框样式
 * ---------------------------------------------------------------------- */
.story-box {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

.story-box p {
    margin-bottom: 10px;
    font-size: 13px;
}

/* ----------------------------------------------------------------------
 * 应用网格样式
 * ---------------------------------------------------------------------- */
.application-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.app-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.app-item:hover {
    transform: translateY(-3px);
}

.app-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.app-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 12px;
}

.app-desc {
    font-size: 11px;
    color: #7f8c8d;
}

/* ----------------------------------------------------------------------
 * 未来列表样式
 * ---------------------------------------------------------------------- */
.future-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.future-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 25px;
    font-size: 13px;
}

.future-list li::before {
    content: '🚀';
    position: absolute;
    left: 0;
}

.future-list li:last-child {
    border-bottom: none;
}

/* ----------------------------------------------------------------------
 * 实践步骤样式
 * ---------------------------------------------------------------------- */
.practice-steps {
    margin: 15px 0;
}

.practice-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-content h5 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 13px;
}

.step-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 12px;
}

/* ----------------------------------------------------------------------
 * 提示框样式
 * ---------------------------------------------------------------------- */
.tips-box {
    background: #d1ecf1;
    border-left: 3px solid #17a2b8;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

.tips-box h5 {
    color: #0c5460;
    margin-bottom: 8px;
    font-size: 13px;
}

.tips-box ul {
    margin: 0;
    padding-left: 18px;
}

.tips-box li {
    margin: 5px 0;
    color: #0c5460;
    font-size: 12px;
}

/* ----------------------------------------------------------------------
 * 引擎介绍样式
 * ---------------------------------------------------------------------- */
.engine-intro {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.engine-intro p {
    margin: 0;
    font-size: 14px;
}

/* ----------------------------------------------------------------------
 * 特性列表样式
 * ---------------------------------------------------------------------- */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.feature-list li:last-child {
    border-bottom: none;
}

/* ----------------------------------------------------------------------
 * 结果框样式
 * ---------------------------------------------------------------------- */
.result-box {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    min-height: 100px;
}

/* ----------------------------------------------------------------------
 * 音频播放器样式
 * ---------------------------------------------------------------------- */
.audio-player {
    margin: 20px 0;
    width: 100%;
    display: block;
}

/* ----------------------------------------------------------------------
 * 模态窗口样式
 * ---------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    margin: 20px;
}

/* ----------------------------------------------------------------------
 * 响应式设计
 * ---------------------------------------------------------------------- */
@media (max-width: 768px) {
    .ai-container {
        padding: 10px;
    }
    
    .ai-card-header h1 {
        font-size: 22px;
    }
    
    .ai-card-body {
        padding: 15px;
    }
    
    .process-flow {
        flex-direction: column;
    }
    
    .flow-arrow {
        transform: rotate(90deg);
        margin: 5px 0;
    }
    
    .application-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
