﻿/* 遮罩层：固定定位，覆盖整个视口 */
.coop-modal-overlay {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999; /* 确保在最上层 */
    overflow-y: auto; /* 允许内容过长时滚动 */
    backdrop-filter: blur(2px); /* 可选：背景模糊效果 */
}

/* 弹窗容器 */
.coop-modal-container {
    width: 960px;
    max-width: 95%;
    margin: 50px auto;
    background: #fff;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border-radius: 4px;
    position: relative;
    animation: coop-slideDown 0.3s ease-out;
    /* 防止内部浮动元素导致高度塌陷 */
    overflow: hidden;
}

@keyframes coop-slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.coop-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

    .coop-close-btn:hover {
        color: #333;
    }

.coop-header-title {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 15px;
}

    .coop-header-title h2 {
        color: #0056b3;
        margin: 0;
        font-size: 24px;
    }

    .coop-header-title p {
        color: #666;
        font-size: 14px;
        margin-top: 10px;
    }

.coop-form-group {
    margin-bottom: 20px;
    overflow: hidden; /* 清除浮动 */
}
    /* 兼容旧版浏览器的清除浮动 */
    .coop-form-group::after {
        content: "";
        display: table;
        clear: both;
    }

.coop-form-label {
    float: left;
    width: 140px;
    text-align: right;
    padding-right: 15px;
    line-height: 34px;
    font-weight: bold;
    color: #555;
    box-sizing: border-box;
}

.coop-form-control {
    float: left;
    width: calc(100% - 155px); /* 自适应剩余宽度 */
    position: relative;
}

    .coop-form-control input[type="text"],
    .coop-form-control input[type="email"],
    .coop-form-control input[type="tel"],
    .coop-form-control input[type="number"],
    .coop-form-control select,
    .coop-form-control textarea {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 3px;
        font-size: 14px;
        box-sizing: border-box;
        transition: border-color 0.3s;
        font-family: "Microsoft YaHei", Arial, sans-serif;
    }

        .coop-form-control input:focus,
        .coop-form-control select:focus,
        .coop-form-control textarea:focus {
            border-color: #0056b3;
            outline: none;
        }

    .coop-form-control textarea {
        height: 120px;
        resize: vertical;
    }

.coop-input-group {
    display: flex;
    gap: 10px;
}

    .coop-input-group input {
        flex: 1;
    }

.coop-btn-code {
    width: 130px;
    padding: 8px 0;
    background-color: #fff;
    border: 1px solid #0056b3;
    color: #0056b3;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
    font-family: inherit;
}

    .coop-btn-code:hover:not(:disabled) {
        background-color: #e6f0ff;
    }

    .coop-btn-code:disabled {
        background-color: #f0f0f0;
        border-color: #ccc;
        color: #999;
        cursor: not-allowed;
    }

.coop-required {
    color: red;
    margin-left: 4px;
}

.coop-error-msg {
    color: red;
    font-size: 12px;
    position: absolute;
    top: 36px;
    left: 0;
    display: none;
}

.coop-btn-submit {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 10px 0;
    background-color: #0056b3;
    color: #fff;
    text-align: center;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: inherit;
}

    .coop-btn-submit:hover {
        background-color: #004494;
    }

    .coop-btn-submit:disabled {
        background-color: #ccc;
        cursor: not-allowed;
    }

.coop-msg-box {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
    font-size: 14px;
}

.coop-msg-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.coop-msg-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式适配 */
@media (max-width: 980px) {
    .coop-modal-container {
        width: 90%;
        padding: 20px;
        margin: 20px auto;
    }

    .coop-form-label {
        float: none;
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
        line-height: 1.4;
    }

    .coop-form-control {
        float: none;
        width: 100%;
    }

    .coop-error-msg {
        position: static;
        margin-top: 5px;
    }

    .coop-input-group {
        flex-direction: column;
        gap: 5px;
    }

    .coop-btn-code {
        width: 100%;
    }
}
