/**
 * AI智能助手样式
 */

/* 移动端底部导航栏样式 */
.mobile-bottom-nav {
    display: block; /* 默认显示，由 JS 控制 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 55px;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 55px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-item:hover {
    background: #f5f5f5;
}

.mobile-nav-item.active {
    color: #667eea;
}

.mobile-nav-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
}

.mobile-nav-icon img,
.mobile-nav-icon .nav-icon-img {
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.mobile-nav-text {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 0.3s ease;
}


/* 响应式隐藏 */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-clear-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 5px 2px;
    border-radius: 3px;
    transition: all 0.3s ease;
}
.ai-clear-btn:hover {
    background: #f0f0f0;
    color: #333;
}
.ai-close-btn {
    background: #f0f0f0;
    border: none;
    color: #666;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}
.ai-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}


/* AI助手弹框 */
.ai-assistant-modal {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-assistant-container {
    width: 400px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-assistant-header {
    background: linear-gradient(180deg, #e6f7ff 0%, #ffffff 100%);
    color: #444;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.ai-header-title .ai-header-icon {
    margin-right: 8px;
}


.ai-assistant-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
}

/* AI助手滚动条样式 */
.ai-assistant-body::-webkit-scrollbar {
    width: 4px;
}

.ai-assistant-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-assistant-body::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.ai-assistant-body::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.ai-message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message-bot {
    flex-direction: row;
    justify-content: flex-start;
}

.ai-message-user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.ai-content {
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

/* Markdown样式 */
.ai-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 12px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.ai-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin: 10px 0 6px 0;
}

.ai-content strong {
    font-weight: 600;
    color: #1890ff;
}

.ai-content em {
    font-style: italic;
    color: #666;
}

.ai-content ol ul, .ai-content ol {
    margin: 8px 0;
    padding-left: 1.2em;
}

.ai-content ol {
    list-style-type: decimal;
}
.ai-content ul {
    list-style-type: disc;
	padding-inline-start: 18px;
}


.ai-content li {
    margin: 4px 0;
    line-height: 1.5;
}

.ai-content blockquote {
    margin: 10px 0;
    padding: 8px 12px;
    background: #f5f7fa;
    border-left: 3px solid #667eea;
    color: #666;
    font-size: 13px;
}

.ai-content pre {
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow-x: auto;
}

.ai-content code {
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.ai-content .inline-code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e83e8c;
}

.ai-message-bot .ai-content {
    background: #f5f7fb;
    border-radius: 12px;
}

.ai-message-user .ai-content {
    background: linear-gradient(45deg, #008cf5 0% 20%, #8571f1 100%);
    color: #fff;
    border-radius: 12px;
}

.ai-content p {
    margin: 0 0 8px 0;
}

.ai-content p:last-child {
    margin-bottom: 0;
}

.ai-tips {
    color: #666;
}

.ai-quick-questions {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
	padding-inline-start:0 !important;
}

.ai-quick-questions li {
    display: inline-block;
    background: #fff;
    color: #1890ff;
    padding: 6px 12px;
    border-radius: 15px;
    margin: 4px 4px 4px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-quick-questions li:hover {
    color: #667eea;
}

.ai-assistant-footer {
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 5px 5px 5px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.02),
        0 -4px 16px rgba(0, 0, 0, 0.04),
        0 -2px 8px rgba(0, 0, 0, 0.02),
        4px 0 16px rgba(0, 0, 0, 0.04),
        -4px 0 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s ease;
}

.ai-input-wrapper:focus-within {
    border: 1px solid #188fff60;
}

.ai-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #00adeb 100%);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.ai-typing {
    display: flex;
    align-items: center;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* 加载文字样式 */
.ai-loading-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-loading-text {
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    white-space: nowrap;
    transition: opacity 0.3s ease-in-out;
}

/* 移动端适配 - 全屏样式 */
@media (max-width: 768px) {
    .ai-assistant-modal {
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .ai-assistant-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    
    .ai-assistant-header {
        padding: 12px 15px;
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
    }
    
    .ai-assistant-footer {
        padding: 10px 15px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    
    .ai-assistant-body {
        padding: 10px;
    }
    
    .ai-content {
        font-size: 15px;
    }
    
    .ai-input-wrapper input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* AI按钮样式 */
#ai-assistant-btn {
    position: relative;
}

#ai-assistant-btn img {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#ai-assistant-btn em {
    display: none;
}

#ai-assistant-btn:hover img {
    display: none;
}

#ai-assistant-btn:hover em {
    display: block;
}

/* AI助手首次访问提示遮罩 */
#ai-assistant-tooltip-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    cursor: pointer;
}

#ai-assistant-tooltip {
    position: fixed;
    bottom: 320px;
    right: 40px;
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    max-width: 280px;
    animation: slideUp 0.3s ease-out;
}

#ai-assistant-tooltip .tooltip-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

#ai-assistant-tooltip .tooltip-greeting {
    font-size: 14px;
    color: #666;
}

#ai-assistant-tooltip .tooltip-greeting p {
    margin: 0 0 8px 0;
}

#ai-assistant-tooltip .tooltip-message {
    font-weight: 600;
    margin-bottom: 8px;
    color: #667eea;
}

#ai-assistant-tooltip .tooltip-arrow {
    position: absolute;
    bottom: -10px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 0 solid transparent;
    border-top: 10px solid #fff;
}

/* 学校建议下拉框样式 */
#school-suggestions {
    display: none;
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}

#school-suggestions a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
}

#school-suggestions a:hover {
    background: #f5f5f5;
}

/* 表单验证码容器 */
.captcha-container {
    display: flex;
    align-items: center;
}

.captcha-container input {
    flex: 1;
}

.captcha-container img {
    cursor: pointer;
    margin-left: 10px;
    border-radius: 4px;
}

/* 隐私条款弹窗样式优化 */
#privacyModal .modal-body {
    max-height: 400px;
    overflow-y: auto;
}

#privacyModal .modal-body p {
    margin-bottom: 12px;
}

#privacyModal .modal-body strong {
    color: #333;
}

/* 报名咨询表单样式优化 */
#consult-modal-form .form-group {
    margin-bottom: 15px;
}

#consult-modal-form .checkbox {
    margin: 0;
}

#consult-modal-form .checkbox label {
    margin: 0;
    font-weight: normal;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #ai-assistant-tooltip {
        bottom: 260px;
        right: 40px;
        max-width: 240px;
        padding: 12px 15px;
    }
    
    #ai-assistant-tooltip .tooltip-arrow {
        right: 10px;
    }
}
