:root {
    --primary: #165DFF;
    --success: #00b42a;
    --danger: #ff4d4f;
    --light-bg: #f8f9fa;
    --border-color: #e5e7eb;
    --radius: 12px;
}

* {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body, html {
    height: 100%;
    overflow: hidden;
    background-color: var(--light-bg);
}


/* 验证码图片 */
.captcha-img {
    width: 120px;
    height: 38px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    object-fit: cover;
}



/* 侧边栏 */
.sidebar {
    width: 260px;
    background: #111827;
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 100;
}
.sidebar.collapsed {
    width: 0;
}

/* 按钮 */
.btn-primary {
    background-color: var(--primary) !important;
    border: none !important;
}

/* 聊天气泡 */
.message {
    max-width: 75%;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 14px;
    line-height: 1.6;
    font-size: 15px;
    position: relative;
}
.user-message {
    background: var(--primary);
    color: white;
    margin-left: auto;
}
.ai-message {
    background: white;
    border: 1px solid var(--border-color);
    color: #111827;
}

/* 代码高亮 */
.message pre {
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
}
.message code {
    padding: 2px 4px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* 输入框 */
#msgInput {
    border-radius: 16px;
    resize: none;
    min-height: 48px;
    max-height: 120px;
}

/* 图标按钮 */
.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 表情面板 */
.emoji-panel {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 280px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}
.emoji-item {
    font-size: 18px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
}
.emoji-item:hover {
    background: #f3f4f6;
}
.hidden {
    display: none !important;
}

/* 让表单验证正常显示（Bootstrap 原生正确样式） */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}

/* 错误提示：修复位置问题 */
.invalid-feedback {
    position: absolute !important;
    top: 100% !important; /* 移到输入框下方 */
    left: 0 !important;
    margin-top: 2px !important;
    font-size: 12px !important;
    color: #dc3545 !important;
    white-space: nowrap !important;
    z-index: 999 !important;
    opacity: 1 !important; /* 修复透明度问题 */
    width: 100% !important;
    text-align: left !important;
    background-color: transparent !important;
}

/* 输入框容器必须加相对定位 */
.mb-3 {
    position: relative !important;
    margin-bottom: 1.5rem !important; /* 增加底部间距，避免错误提示重叠 */
}
