/* ===== 弹窗样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-white);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: var(--transition);
}

/* iframe弹窗样式 */
.modal-content.modal-iframe {
    max-width: 900px;
    width: 95%;
    padding: 0;
    overflow: visible;
    height: 95vh;
    max-height: 800px;
}

/* 图片弹窗样式 */
.modal-content.modal-image {
    max-width: 900px;
    width: 90%;
    max-height: 95vh;
    padding: 16px;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* 隐藏滚动条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content.modal-image::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.modal-content.modal-image img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0;
    padding: 0;
}

/* 图片弹窗关闭按钮 */
.modal-content.modal-image .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.modal-content.modal-image .modal-close:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
}

/* 咨询弹窗特定样式 - 隐藏右上角分享按钮 */
.modal-content.modal-iframe.consult-modal {
    position: relative;
}

.modal-content.modal-iframe.consult-modal::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 60px;
    background: linear-gradient(to left, rgba(248, 250, 252, 1) 60%, rgba(248, 250, 252, 0.8) 80%, transparent 100%);
    z-index: 100;
    border-radius: 16px 16px 0 0;
}

/* 确保关闭按钮在最上层 */
.modal-content.modal-iframe.consult-modal .modal-close {
    z-index: 101;
}

.modal-content.modal-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
    /* 允许iframe内部内容滚动 */
    overflow-y: auto;
}

.modal-content.modal-iframe .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

/* 图片弹窗的关闭按钮样式已删除 */

.modal-content.modal-iframe .modal-close:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

.modal-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
    padding-right: 40px;
}

/* 表单样式 */
.consult-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label::after {
    content: '';
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-white);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #303133;
    box-shadow: 0 0 0 3px rgba(48, 49, 51, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: #303133;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-submit:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:active {
    transform: translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    .modal-content.modal-iframe {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        max-width: none;
    }

    .modal-content.modal-iframe iframe {
        border-radius: 0;
    }

    .modal-content.modal-iframe .modal-close {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
        background-color: rgba(255, 255, 255, 0.95);
        font-size: 24px;
    }

    /* 图片弹窗移动端样式 */
    .modal-content.modal-image {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        padding: 0;
    }

    .modal-content.modal-image img {
        max-width: 100%;
        height: auto;
        margin: 0 auto 20px auto;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 24px;
        border-radius: 12px;
    }

    .modal-content h3 {
        font-size: 20px;
        padding-right: 32px;
    }

    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: 12px;
        right: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 14px;
    }

    .btn-submit {
        padding: 12px 24px;
        font-size: 14px;
    }
}
