/* 基础重置与字体 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Nunito', sans-serif;
    background: linear-gradient(135deg, #fff9f0 0%, #f5e6d3 100%);
    min-height: 100vh;
    color: #5a4a3a;
    line-height: 1.6;
    padding: 20px;
}
/* 添加全屏水印 */
body::before {
    content: "三亚城市职业学院 新能源汽车技术专业"; /* 水印文字 */
    position: fixed; /* 固定定位，覆盖整个视口 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* 【已修改】设置为一个很高的正值，使其位于最上层 */
    opacity: 0.08; /* 透明度，可根据需要调整（0.05-0.1之间较佳） */
    font-size: 60px; /* 水印字体大小 */
    font-weight: bold;
    color: #8B5A2B; /* 水印颜色，与主题色保持一致 */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* 防止水印干扰页面操作 */
    white-space: nowrap;
    transform: rotate(-30deg); /* 倾斜角度 */
}
/* 主容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(139, 97, 58, 0.12), 0 8px 20px rgba(139, 97, 58, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 237, 213, 0.8);
}

/* ====== 顶部学校信息栏 ====== */
.school-header {
    background: linear-gradient(to right, #8B5A2B 0%, #D2691E 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 4px solid #FFA726;
}

.school-info-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.school-logo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%; /* 圆形 */
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #FFB74D;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* 关键：确保图片被圆形裁剪 */
    position: relative; /* 为图片定位做准备 */
}

.school-logo-placeholder i {
    font-size: 2.2rem;
    color: #8B5A2B;
}

.school-logo-placeholder img {
    width: 100%; /* 填充整个容器 */
    height: 100%; /* 填充整个容器 */
    object-fit: cover; /* 关键：保持图片比例，裁剪多余部分 */
    border-radius: 80%; /* 确保图片本身也是圆形 */
    position: absolute; /* 绝对定位，覆盖整个容器 */
    top: 0;
    left: 0;
}

.school-name-major .school-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.school-name-major .major-name {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.course-title-right h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: right;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* ====== 助手形象区域 ====== */
.assistant-profile {
    padding: 30px 40px 20px;
    background: linear-gradient(to bottom, #FFF8E1 0%, #FFECB3 100%);
    border-bottom: 2px dashed #FFB74D;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.avatar-frame {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid white;
    box-shadow: 0 8px 20px rgba(139, 97, 58, 0.25);
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-frame:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 12px 30px rgba(139, 97, 58, 0.4);
}

.avatar-frame .default-avatar {
    font-size: 5.5rem;
    color: white;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-name-tag {
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(139, 97, 58, 0.15);
    border: 2px solid #FFB74D;
}

.avatar-name-tag i {
    color: #FF9800;
    font-size: 1.2rem;
}

.assistant-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #8B5A2B;
    letter-spacing: 0.5px;
}

.assistant-title {
    font-size: 0.9rem;
    color: #FF9800;
    font-weight: 600;
    background: #FFF3E0;
    padding: 2px 10px;
    border-radius: 20px;
}

.assistant-greeting {
    flex: 1;
    min-width: 300px;
    background: white;
    padding: 20px 25px;
    border-radius: 20px;
    border-left: 6px solid #FF9800;
    box-shadow: 0 6px 18px rgba(139, 97, 58, 0.1);
}

.assistant-greeting p {
    font-size: 1.1rem;
    color: #5a4a3a;
    line-height: 1.8;
}

.assistant-greeting i.fa-quote-left {
    color: #FFB74D;
    margin-right: 8px;
    font-size: 1.2rem;
}

.assistant-greeting i.fa-quote-right {
    color: #FFB74D;
    margin-left: 8px;
    font-size: 1.2rem;
}

/* ====== 主要内容区域 (左右布局) ====== */
.main-content {
    display: flex;
    padding: 0;
    gap: 0;
    min-height: 500px;
}

.input-section, .chat-section {
    padding: 30px;
    flex: 1;
}

.input-section {
    border-right: 2px dashed #FFE0B2;
    background: #fefefe;
}

.chat-section {
    background: #f9f9f9;
}

.section-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #FFE0B2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    font-size: 1.5rem;
    color: #8B5A2B;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.section-header h3 i {
    color: #FF9800;
}

.input-hint {
    background: #FFF3E0;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #8B5A2B;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid #FFB74D;
    width: 100%;
    margin-top: 10px;
}

.input-hint i {
    color: #FF9800;
    font-size: 1.1rem;
    margin-top: 2px;
}

.chat-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 输入区域 */
.input-area textarea {
    width: 100%;
    height: 180px;
    padding: 20px;
    border: 2px solid #FFE0B2;
    border-radius: 16px;
    font-size: 1.05rem;
    resize: vertical;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background: #fff;
    color: #5a4a3a;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.input-area textarea:focus {
    outline: none;
    border-color: #FF9800;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.2);
    background: #fffcf5;
}

.input-area textarea::placeholder {
    color: #c8b7a6;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

button {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(to right, #FF9800 0%, #FFB74D 100%);
    color: white;
    box-shadow: 0 6px 0 #F57C00;
    flex: 2;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 #F57C00;
    background: linear-gradient(to right, #FFB74D 0%, #FF9800 100%);
}

.btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #F57C00;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 0 #F57C00;
}

.btn-secondary {
    background: #FFF3E0;
    color: #8B5A2B;
    border: 2px solid #FFD54F;
}

.btn-secondary:hover {
    background: #FFECB3;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 183, 77, 0.2);
}

.btn-outline {
    background: transparent;
    border: 2px solid #81C784;
    color: #388E3C;
}

.btn-outline:hover {
    background: rgba(129, 199, 132, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(56, 142, 60, 0.15);
}

.btn-scroll {
    padding: 8px 16px;
    background: rgba(255, 183, 77, 0.2);
    color: #8B5A2B;
    border: 1px solid #FFB74D;
    font-size: 0.9rem;
    flex: 0 0 auto;
}

.btn-scroll:hover {
    background: rgba(255, 183, 77, 0.4);
    transform: translateY(-2px);
}

/* 聊天信息区域 */
.chat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFF3E0;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #FFE0B2;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8B5A2B;
    font-weight: 600;
}

.chat-stats i {
    color: #FF9800;
    font-size: 1.2rem;
}

.chat-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8B5A2B;
    font-size: 0.9rem;
    flex: 1;
    min-width: 200px;
}

.chat-tip i {
    color: #FF9800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* 打字指示器 */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    background: #FFF3E0;
    padding: 8px 16px;
    border-radius: 20px;
    color: #8B5A2B;
    font-size: 0.9rem;
    gap: 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #FF9800;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 聊天容器 */
.chat-container {
    background: white;
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(139, 97, 58, 0.08);
    border: 1px solid #FFE0B2;
    height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    min-height: 300px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 消息包装器 */
.message-wrapper {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

.message-wrapper.message-user {
    flex-direction: row-reverse;
}

/* 消息头像 */
.message-avatar {
    flex-shrink: 0;
}

.avatar-img-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFF3E0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFB74D;
    overflow: hidden;
}

.avatar-img-small i {
    font-size: 1.5rem;
    color: #FF9800;
}

.message-user .avatar-img-small {
    background: #E3F2FD;
    border-color: #2196F3;
}

.message-user .avatar-img-small i {
    color: #2196F3;
}

/* 消息气泡 */
.message-bubble {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.message-ai-bubble {
    background: #FFF9F2;
    border-top-left-radius: 5px;
    border: 1px solid #FFE0B2;
}

.message-user-bubble {
    background: #E3F2FD;
    border-top-right-radius: 5px;
    border: 1px solid #BBDEFB;
}

/* 消息头部 */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(139, 97, 58, 0.1);
}

.message-user-bubble .message-header {
    border-bottom-color: rgba(33, 150, 243, 0.1);
}

.message-sender {
    font-weight: 700;
    font-size: 0.95rem;
    color: #8B5A2B;
}

.message-user-bubble .message-sender {
    color: #1565C0;
}

.message-time {
    font-size: 0.8rem;
    color: #A1887F;
    opacity: 0.8;
}

/* 消息内容 */
.message-content {
    line-height: 1.7;
    color: #5a4a3a;
}

.message-user-bubble .message-content {
    color: #0D47A1;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message-content li {
    margin-bottom: 5px;
    padding-left: 5px;
}

.message-content strong {
    color: #FF9800;
    font-weight: 700;
    background: #FFF3E0;
    padding: 2px 6px;
    border-radius: 4px;
}

.message-user-bubble .message-content strong {
    color: #2196F3;
    background: #E3F2FD;
}

.message-content .course-warning {
    color: #D84315;
    font-weight: 600;
    padding: 15px;
    border-left: 5px solid #D84315;
    background-color: #FFEBEE;
    border-radius: 10px;
    margin: 15px 0;
}

/* 状态栏 */
.status-bar {
    padding: 15px 25px;
    text-align: center;
    font-size: 0.95rem;
    color: #8B5A2B;
    font-weight: 500;
    background: #FFF3E0;
    border-top: 1px solid #FFE0B2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
}

.status-bar i {
    color: #4CAF50;
}

/* 页脚 */
footer {
    background: #8B5A2B;
    color: #FFECB3;
    padding: 25px 40px;
    text-align: center;
}

.footer-content p {
    margin-bottom: 10px;
    line-height: 1.7;
}

.footer-content i {
    color: #FFB74D;
    margin-right: 8px;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
    margin: 15px 0;
}

.footer-credit {
    font-size: 0.9rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #A1887F;
}

.squirrel-name {
    color: #FFB74D;
    font-weight: 700;
    font-style: italic;
}

/* 模态框 (课程大纲) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(90, 74, 58, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(90, 74, 58, 0.3);
    width: 90%;
    border: 3px solid #FFB74D;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #FFE0B2;
    padding-bottom: 15px;
}

.modal-header h3 {
    color: #8B5A2B;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2.2rem;
    cursor: pointer;
    color: #8B5A2B;
    line-height: 1;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: white;
    background-color: #FF9800;
    transform: rotate(90deg);
}

.modal-body {
    line-height: 1.6;
    color: #5a4a3a;
}

.outline-section {
    margin-bottom: 25px;
    background: #FFF9F2;
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid #FFB74D;
}

.outline-section h4 {
    color: #8B5A2B;
    margin-bottom: 12px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.outline-section h4:before {
    content: "";
    width: 12px;
    height: 12px;
    background: #FF9800;
    border-radius: 50%;
    display: inline-block;
}

.outline-section ul {
    margin-left: 25px;
    color: #5a4a3a;
}

.outline-section li {
    margin-bottom: 8px;
    padding-left: 8px;
    position: relative;
}

.outline-section li:before {
    content: "•";
    color: #FF9800;
    font-weight: bold;
    position: absolute;
    left: -12px;
}

/* 响应式设计 */
@media (max-width: 1100px) {
    .main-content {
        flex-direction: column;
    }
    
    .input-section {
        border-right: none;
        border-bottom: 2px dashed #FFE0B2;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 16px;
    }
    
    .school-header, .assistant-profile, .input-section, .chat-section, footer {
        padding: 20px;
    }
    
    .school-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .school-info-left, .course-title-right {
        width: 100%;
        justify-content: center;
    }
    
    .course-title-right h1 {
        text-align: center;
    }
    
    .assistant-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .assistant-greeting {
        min-width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .avatar-frame {
        width: 100px;
        height: 100px;
    }
    
    .avatar-frame .default-avatar {
        font-size: 4.5rem;
    }
    
    .assistant-name {
        font-size: 1.3rem;
    }
    
    .message-bubble {
        max-width: 90%;
    }
    
    .chat-messages {
        max-height: 400px;
    }
}

/* 添加CSS动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1.05) rotate(5deg); box-shadow: 0 12px 30px rgba(139, 97, 58, 0.4); }
    50% { transform: scale(1.08) rotate(5deg); box-shadow: 0 15px 35px rgba(139, 97, 58, 0.6); }
    100% { transform: scale(1.05) rotate(5deg); box-shadow: 0 12px 30px rgba(139, 97, 58, 0.4); }
}

@keyframes bounce {
    0%, 100% { transform: scale(1.05) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-5deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(5deg); }
    25% { transform: translateX(-5px) rotate(5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}