/* CECC 咨询按钮与弹窗（列表页、详情页共用） */
.cecc-consult-cta {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.cecc-detail-block .wrapper > .cecc-consult-cta {
    margin: 26px auto 0;
}

.cecc-detail-page section.cecc-detail-block:last-of-type .wrapper > .cecc-consult-cta {
    margin-bottom: 0;
}

.cecc-consult-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 180px;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 5px;
    background: #ff0000;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
    box-sizing: border-box;
}

.cecc-consult-btn:hover {
    background: #e60000;
}

.cecc-consult-btn:active {
    background: #cc0000;
}

.cecc-consult-btn__icon {
    display: block;
    flex: 0 0 auto;
}

body.cecc-consult-modal-open {
    overflow: hidden;
}

/* 咨询弹窗打开时，条款/隐私弹层始终叠在其上（含入场动画过程） */
body.cecc-consult-modal-open .select-layer.term-layer {
    z-index: 1200;
}

.cecc-consult-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.cecc-consult-modal.is-open {
    display: block;
}

.cecc-consult-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.cecc-consult-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1050px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    box-sizing: border-box;
    padding: 50px;
}

.cecc-consult-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.cecc-consult-close::before,
.cecc-consult-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #000;
}

.cecc-consult-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cecc-consult-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.cecc-consult-title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    line-height: 36px;
    color: #000;
}

.cecc-consult-subtitle {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 24px;
    color: #999;
}

.cecc-consult-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 20px;
}

.cecc-consult-field {
    display: block;
}

.cecc-consult-field--full {
    margin-top: 20px;
}

.cecc-consult-label {
    display: block;
    margin-bottom: 11px;
    font-size: 16px;
    line-height: 24px;
    color: #000;
}

.cecc-consult-label .req {
    color: #ff0000;
}

.cecc-consult-field input,
.cecc-consult-field select,
.cecc-consult-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #b2b2b2;
    border-radius: 0;
    padding: 18px 20px;
    font-size: 16px;
    line-height: 24px;
    color: #000;
    background: #fff;
}

.cecc-consult-field textarea {
    min-height: 175px;
    resize: vertical;
}

.cecc-consult-field input::placeholder,
.cecc-consult-field textarea::placeholder,
.cecc-consult-field select:invalid {
    color: #999;
}

.cecc-consult-field.has-error input,
.cecc-consult-field.has-error select,
.cecc-consult-field.has-error textarea {
    border-color: #ff0000;
}

.cecc-consult-err {
    margin-top: 6px;
    font-size: 14px;
    line-height: 20px;
    color: #ff0000;
}

.cecc-consult-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.cecc-consult-submit {
    min-width: 110px;
    height: 40px;
    padding: 0 24px;
    border: 0;
    border-radius: 5px;
    background: #ff0000;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.cecc-consult-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cecc-consult-agree {
    margin-top: 20px;
}

.cecc-consult-agree-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 22px;
    color: #000;
}

.cecc-consult-agree-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.cecc-consult-agree-box {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1px solid #b2b2b2;
    border-radius: 50%;
    background: #f5f5f5;
    box-sizing: border-box;
}

.cecc-consult-agree-label input:checked + .cecc-consult-agree-box {
    border-color: #ff0000;
    background: url("../images/icons/tick_red.svg") 55%/75% auto no-repeat;
}

.cecc-consult-agree-text a {
    color: #ff0000;
    text-decoration: none;
}

.cecc-consult-agree-text a:hover {
    text-decoration: underline;
}

.cecc-consult-agree.has-error .cecc-consult-agree-box {
    border-color: #ff0000;
}

/* 笔记本 / 矮视口：缩小弹窗尺寸，超出则在弹层内滚动 */
@media (max-width: 1366px), (max-height: 900px) {
    .cecc-consult-dialog {
        width: min(680px, calc(100vw - 32px));
        max-height: min(680px, calc(100vh - 32px));
        padding: 32px 36px 24px;
    }

    .cecc-consult-title {
        font-size: 20px;
        line-height: 30px;
    }

    .cecc-consult-subtitle {
        margin-bottom: 16px;
        font-size: 14px;
        line-height: 22px;
    }

    .cecc-consult-grid {
        gap: 14px 16px;
    }

    .cecc-consult-field--full {
        margin-top: 14px;
    }

    .cecc-consult-label {
        margin-bottom: 8px;
        font-size: 14px;
        line-height: 22px;
    }

    .cecc-consult-field input,
    .cecc-consult-field select,
    .cecc-consult-field textarea {
        padding: 12px 14px;
        font-size: 14px;
        line-height: 22px;
    }

    .cecc-consult-field textarea {
        min-height: 112px;
    }

    .cecc-consult-agree {
        margin-top: 16px;
    }

    .cecc-consult-actions {
        margin-top: 20px;
    }
}

@media (max-width: 960px) {
    .cecc-consult-cta {
        margin-top: 32px;
    }

    .cecc-detail-block .wrapper > .cecc-consult-cta {
        margin: 20px auto 0;
        padding: 0 20px;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .cecc-consult-dialog {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 24px);
        padding: 32px 20px 24px;
    }

    .cecc-consult-grid {
        grid-template-columns: 1fr;
    }
}
