/* 引入Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

/* 全局字体设置 */
body, .modal, .modal-content, .bubble-toast, input, textarea, button {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 标签样式 */
.tab-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-item:hover {
    background-color: #f0f0f0;
}

.tab-content {
    transition: opacity 0.3s ease;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    margin: 0 auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: #f0f0f0;
    color: #333;
    padding: 6px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    height: 32px;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

#customerForm {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.form-fields {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    width: 100%;
    text-align: left;
    padding-right: 0;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

/* 确保包含按钮的组正确显示 */
.form-group > div {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

/* 调整验证码容器的样式 */
.captcha-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

/* 公司信息区域的验证码容器样式 */
.company-info .captcha-container > div {
    width: 100%;
}

.captcha-container > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 确保按钮和输入框对齐 */
.send-code-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #e0e0e0;
    color: #333;
    border-color: #d0d0d0;
    height: 36px;
}

/* 联系方式表单组样式 */
#contactInfoGroup {
    display: flex;
    flex-direction: column;
}

/* 确保联系方式输入框和按钮在同一行 */
#contactInfoGroup > div {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

/* 为联系方式输入框添加样式 */
#contactInfoGroup input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
}

.form-group > input,
.form-group > textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
}

/* 保持验证码输入框的特殊宽度 */
.captcha-input {
    width: 60%;
    flex: none;
}

/* 确保验证码输入框和图片对齐 */
.captcha-input {
    width: 60%;
    flex: none;
}

.form-group > textarea {
    resize: vertical;
    min-height: 40px;
}

.company-info {
    display: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d0d0d0;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
    flex-shrink: 0;
    background: #fff;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    line-height: normal;
}

.btn-primary {
    background: #e0e0e0;
    color: #333;
}

.btn-primary:hover {
    background: #c0c0c0;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-default {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e1e5e9;
}

.btn-default:hover {
    background-color: #e9ecef;
}

/* 验证码样式 */
.captcha-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 发送验证码按钮样式 */
.send-code-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #e0e0e0;
    color: #333;
    height: 36px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.send-code-btn:hover {
    background: #c0c0c0;
}

.send-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #e0e0e0;
}

.captcha-input {
    flex: 1;
    width: 65%;
    padding: 6px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    height: 36px;
}

.login-code {
    width: 30%; /* 进一步调窄宽度 */
}

.login-code-img {
    cursor: pointer;
    width: 100%;
    height: 36px; /* 与输入框高度统一 */
    border-radius: 6px;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-height: 600px) {
    .modal-content {
        margin: 5% auto;
        max-height: 90vh;
    }
    
    #customerForm {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* 气泡弹窗样式 */
.bubble-toast {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 180px;
    max-width: 80vw;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    z-index: 9999;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.bubble-toast.show {
    display: block;
    opacity: 1;
}

.bubble-toast.success {
    background: #52c41a;
}

.bubble-toast.error {
    background: #ff4d4f;
}

.bubble-toast.info {
    background: #1890ff;
}