/* ===== 新增：表单样式 ===== */
.form-section {
    background: #f7faff;
    padding: 28px 32px;
    border-radius: 16px;
    border: 1px solid #e4ebf3;
    margin-bottom: 32px;
}

.form-section h3 {
    font-size: 20px;
    color: #1a2634;
    margin-bottom: 2px;
}

.form-hint {
    color: #8a9aa8;
    font-size: 14px;
    margin-bottom: 18px;
}

.message-form .form-group {
    margin-bottom: 16px;
}

.message-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.message-form input,
.message-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #dce3ec;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: white;
}

.message-form input:focus,
.message-form textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.12);
}

.btn-submit {
    background: #2c6fbb;
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background: #1e5a9e;
}

.btn-submit:active {
    transform: scale(0.97);
}

/* ===== Toast 提示 ===== */
.toast {
    padding: 14px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    border-left: 5px solid #ccc;
}

.toast-success {
    background: #e8f5e9;
    border-left-color: #2e7d32;
    color: #1e4620;
}

.toast-error {
    background: #fdecea;
    border-left-color: #c62828;
    color: #7f1d1d;
}

.toast-info {
    background: #e3f2fd;
    border-left-color: #0d47a1;
    color: #1a3a5c;
}

/* ===== 留言列表 ===== */
.message-list {
    margin-bottom: 32px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #eef2f6;
    margin-bottom: 18px;
}

.list-header h3 {
    font-size: 20px;
    color: #1a2634;
}

.badge-count {
    background: #e3e8ef;
    padding: 4px 18px;
    border-radius: 30px;
    font-size: 14px;
    color: #2c3e50;
}

.empty-tip {
    text-align: center;
    padding: 40px 20px;
    color: #8a9aa8;
    background: #f9fbfd;
    border-radius: 12px;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message-item {
    background: #f9fbfd;
    border-radius: 14px;
    padding: 18px 22px;
    border: 1px solid #e9edf2;
    transition: box-shadow 0.15s;
}

.message-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.msg-user {
    font-weight: 700;
    color: #1a2634;
    font-size: 15px;
}

.msg-time {
    color: #8a9aa8;
    font-size: 13px;
}

.btn-delete {
    margin-left: auto;
    color: #c0392b;
    font-size: 13px;
    text-decoration: none;
    padding: 2px 12px;
    border-radius: 20px;
    background: #fde8e6;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: #fcd0cc;
}

.msg-content {
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.7;
    padding: 6px 0 8px 0;
    word-break: break-word;
}

.msg-footer {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #aab5c0;
    margin-top: 6px;
    border-top: 1px dashed #e4ebf3;
    padding-top: 8px;
}

.msg-label {
    color: #4a90d9;
}

/* ===== 响应式调整 ===== */
@media (max-width: 700px) {
    .container {
        padding: 20px 14px;
    }
    .form-section {
        padding: 18px 16px;
    }
    .message-item {
        padding: 14px 16px;
    }
    .msg-header {
        gap: 8px;
    }
    .btn-delete {
        margin-left: 0;
    }
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
/* ===== ICP 备案号 ===== */
.icp-info {
    margin-top: 10px;
    font-size: 13px;
}

.icp-info a {
    color: #7a8a9a;
    text-decoration: none;
    transition: color 0.2s;
}

.icp-info a:hover {
    color: #4a90d9;
    text-decoration: underline;
}
/* ====== AI对话区域样式 ====== */
.chat-section {
    background: #f7faff;
    padding: 28px 32px;
    border-radius: 16px;
    border: 1px solid #e4ebf3;
    margin-bottom: 32px;
}

.chat-section h3 {
    font-size: 20px;
    color: #1a2634;
    margin-bottom: 2px;
}

.chat-hint {
    color: #8a9aa8;
    font-size: 14px;
    margin-bottom: 18px;
}

/* 聊天容器 */
.chat-container {
    background: white;
    border-radius: 14px;
    border: 1px solid #e9edf2;
    display: flex;
    flex-direction: column;
    height: 450px;
    overflow: hidden;
}

/* 消息列表区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 单条消息 */
.chat-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

/* 用户消息（靠右） */
.chat-message.user {
    align-self: flex-end;
}

/* AI消息（靠左） */
.chat-message.assistant {
    align-self: flex-start;
}

/* 系统消息（居中） */
.chat-message.system {
    align-self: center;
}

.chat-message.system .chat-bubble {
    background: #f0f4f8;
    border: 1px dashed #c4d0dc;
    color: #6a7a8a;
}

/* 消息气泡 */
.chat-bubble {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
}

/* 用户气泡样式 */
.chat-message.user .chat-bubble {
    background: #2c6fbb;
    color: white;
    border-bottom-right-radius: 4px;
}

/* AI气泡样式 */
.chat-message.assistant .chat-bubble {
    background: #e8f0fe;
    color: #1a2634;
    border: 1px solid #d4e3f7;
    border-bottom-left-radius: 4px;
}

/* 消息元信息（发送者+时间） */
.chat-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.chat-message.user .chat-meta {
    justify-content: flex-end;
}

.chat-sender {
    font-weight: 600;
}

.chat-time {
    font-size: 11px;
    opacity: 0.7;
}

/* 消息文本 */
.chat-text {
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 输入区域 */
.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eef2f6;
    background: #fafbfc;
}

.chat-input-area input[type="text"] {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid #dce3ec;
    border-radius: 30px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-area input[type="text"]:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.12);
}

.chat-input-area input[type="text"]:disabled {
    background: #f5f7fa;
    cursor: not-allowed;
}

/* 发送按钮 */
.btn-chat-send {
    background: #2c6fbb;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-chat-send:hover:not(:disabled) {
    background: #1e5a9e;
}

.btn-chat-send:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-chat-send:disabled {
    background: #a8c4e0;
    cursor: not-allowed;
}

/* 滚动条美化 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c4d0dc;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8b8c8;
}

/* 响应式调整 */
@media (max-width: 700px) {
    .chat-section {
        padding: 18px 16px;
    }
    
    .chat-container {
        height: 380px;
    }
    
    .chat-bubble {
        max-width: 85%;
    }
    
    .chat-input-area {
        padding: 12px 14px;
    }
    
    .btn-chat-send {
        padding: 10px 20px;
    }
}
