/**
 * 新版询价窗口样式 - 不使用Bootstrap
 * 完全独立实现，不影响原有功能
 * 优化后的现代设计风格
 * 
 * 目录:
 * 1. 全局重置和变量
 * 2. Modal 容器和遮罩
 * 3. Modal 对话框和内容
 * 4. Modal 头部样式
 * 5. Modal 主体样式
 * 6. 表单元素样式
 * 7. 按钮样式
 * 8. 隐私电话模态框样式
 * 9. 辅助类
 * 10. 响应式设计
 * 11. 动画效果
 */

/* ==========================================
   1. 全局重置和变量
   ========================================== */
:root {
    --rfj-primary: #667eea;
    --rfj-primary-dark: #764ba2;
    --rfj-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --rfj-text-dark: #2c3e50;
    --rfj-text-muted: #5a6c7d;
    --rfj-border-color: #e9ecef;
    --rfj-bg-light: #f8f9fa;
    --rfj-danger: #e74c3c;
    --rfj-success: #27ae60;
    --rfj-radius: 12px;
    --rfj-radius-sm: 8px;
    --rfj-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    --rfj-shadow-sm: 0 4px 12px rgba(102, 126, 234, 0.3);
    --rfj-transition: all 0.2s ease;
}

.rfj-modal * {
    box-sizing: border-box;
}

/* ==========================================
   2. Modal 容器和遮罩
   ========================================== */
.rfj-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rfj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
    backdrop-filter: blur(2px);
}

/* ==========================================
   3. Modal 对话框和内容
   ========================================== */
.rfj-modal-dialog {
    position: relative;
    width: auto;
    max-width: 580px;
    margin: 50px auto;
    z-index: 2;
    pointer-events: none;
}

.rfj-modal-dialog-sm {
    max-width: 480px;
}

.rfj-modal-dialog-lg {
    max-width: 720px;
}

.rfj-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    background-color: #ffffff;
    background-clip: padding-box;
    border: none;
    border-radius: var(--rfj-radius);
    box-shadow: var(--rfj-shadow);
    outline: 0;
    overflow: hidden;
}

/* ==========================================
   4. Modal 头部样式
   ========================================== */
.rfj-modal-header {
    padding: 24px 24px 20px;
    background: var(--rfj-gradient);
    position: relative;
}

.rfj-modal-header-gradient {
    padding: 20px 24px;
}

.rfj-modal-header-simple {
    padding: 20px 24px;
    background: var(--rfj-gradient);
}

.rfj-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    color: #ffffff;
    opacity: 0.9;
    cursor: pointer;
    padding: 8px 12px;
    z-index: 10;
    border-radius: 6px;
    transition: var(--rfj-transition);
}

.rfj-modal-close:hover,
.rfj-modal-close:focus {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.rfj-modal-header-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rfj-modal-logo {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: var(--rfj-radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rfj-modal-logo-img {
    max-width: 100px;
    height: auto;
    display: block;
}

.rfj-modal-desc {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
    margin-top: 4px;
}

/* ==========================================
   5. Modal 主体样式
   ========================================== */
.rfj-modal-body {
    position: relative;
    padding: 24px;
    background-color: #ffffff;
}

.rfj-modal-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
    color: var(--rfj-text-dark);
    text-align: center;
}

.rfj-modal-title-header {
    color: #ffffff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.text-primary {
    color: var(--rfj-primary);
}

/* ==========================================
   6. 表单元素样式
   ========================================== */
.rfj-form {
    width: 100%;
}

.rfj-form-group {
    margin-bottom: 18px;
}

.rfj-form-group-hidden {
    display: none;
}

.rfj-control-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--rfj-text-dark);
    font-size: 14px;
}

.rfj-label {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-weight: 400;
    cursor: pointer;
    font-size: 14px;
    color: var(--rfj-text-muted);
    transition: var(--rfj-transition);
}

.rfj-label:hover {
    color: var(--rfj-primary);
}

.rfj-label input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.rfj-input,
.rfj-textarea,
.rfj-select {
    display: block;
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--rfj-text-dark);
    background-color: var(--rfj-bg-light);
    background-image: none;
    border: 2px solid var(--rfj-border-color);
    border-radius: var(--rfj-radius-sm);
    transition: var(--rfj-transition);
    box-sizing: border-box;
}

.rfj-textarea {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.rfj-input:hover,
.rfj-textarea:hover,
.rfj-select:hover {
    border-color: #cbd5e0;
    background-color: #ffffff;
}

.rfj-input:focus,
.rfj-textarea:focus,
.rfj-select:focus {
    border-color: var(--rfj-primary);
    outline: 0;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rfj-input-error {
    border-color: var(--rfj-danger) !important;
    background-color: #fff5f5 !important;
}

.rfj-input-error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.rfj-input[readonly] {
    background-color: #e8f4f8;
    color: var(--rfj-text-muted);
    border-color: #d1e7ed;
    cursor: not-allowed;
}

.rfj-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.rfj-input-group .rfj-input {
    position: relative;
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.rfj-input-group .rfj-btn {
    margin-left: -2px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
    min-width: 110px;
}

.rfj-error-message {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 12px;
    color: var(--rfj-danger);
    font-weight: 500;
}

.rfj-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    font-weight: 400;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.6;
    color: var(--rfj-text-muted);
}

.rfj-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.rfj-checkbox-label a {
    color: var(--rfj-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--rfj-transition);
}

.rfj-checkbox-label a:hover {
    color: var(--rfj-primary-dark);
    text-decoration: underline;
}

/* ==========================================
   7. 按钮样式
   ========================================== */
.rfj-btn {
    display: inline-block;
    padding: 10px 20px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
    background-image: none;
    border: 2px solid transparent;
    border-radius: var(--rfj-radius-sm);
    transition: var(--rfj-transition);
}

.rfj-btn:focus,
.rfj-btn:active:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.rfj-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.rfj-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rfj-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.rfj-btn-primary {
    color: #ffffff;
    background: var(--rfj-gradient);
    border-color: transparent;
    box-shadow: var(--rfj-shadow-sm);
}

.rfj-btn-primary:hover,
.rfj-btn-primary:focus {
    color: #ffffff;
    background: linear-gradient(135deg, var(--rfj-primary-dark) 0%, var(--rfj-primary) 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.rfj-btn-primary:active {
    background: var(--rfj-gradient);
}

.rfj-btn-block {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
}

.rfj-help-text {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.5;
}

.rfj-help-text a {
    color: var(--rfj-primary);
    text-decoration: none;
    font-weight: 500;
}

.rfj-help-text a:hover {
    color: var(--rfj-primary-dark);
    text-decoration: underline;
}

/* ==========================================
   8. 隐私电话模态框样式
   ========================================== */
.rfj-phone-content {
    text-align: center;
    padding: 12px 0 4px;
}

.rfj-phone-icon-wrapper {
    background: var(--rfj-gradient);
    border-radius: 50%;
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--rfj-shadow-sm);
}

.rfj-phone-icon {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

.rfj-phone-number-wrapper {
    margin-bottom: 20px;
}

.rfj-phone-number-link {
    display: inline-block;
    font-size: 28px;
    font-weight: 700;
    color: var(--rfj-primary);
    text-decoration: none;
    padding: 14px 36px;
    border: 2px solid var(--rfj-primary);
    border-radius: var(--rfj-radius);
    transition: var(--rfj-transition);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    letter-spacing: 2px;
}

.rfj-phone-number-link:hover {
    background: var(--rfj-gradient);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.rfj-phone-info-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: var(--rfj-radius);
    padding: 18px 20px;
    border-left: 4px solid var(--rfj-primary);
}

.rfj-phone-info-content {
    display: flex;
    align-items: flex-start;
    text-align: left;
    gap: 10px;
}

.rfj-phone-info-icon {
    color: var(--rfj-primary);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.rfj-phone-info-text {
    flex: 1;
    color: var(--rfj-text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.rfj-phone-info-title {
    margin-bottom: 10px;
    color: var(--rfj-text-dark);
    font-weight: 500;
    font-size: 14px;
}

.rfj-phone-info-item {
    margin-bottom: 6px;
}

.rfj-phone-info-highlight {
    color: var(--rfj-primary);
    font-weight: 600;
}

.rfj-phone-info-success {
    color: var(--rfj-success);
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: -2px;
}

/* ==========================================
   9. 辅助类
   ========================================== */
.rfj-hidden {
    display: none !important;
}

.rfj-modal-hidden {
    display: none !important;
}

.rfj-visible {
    display: block !important;
}

.rfj-flex {
    display: flex !important;
}

/* Select2 样式覆盖 */
.rfj-select.select2-hidden-accessible {
    position: absolute;
    width: 1px;
}

.select2-container--default .select2-selection--single {
    height: 44px;
    border: 2px solid var(--rfj-border-color);
    border-radius: var(--rfj-radius-sm);
    background-color: var(--rfj-bg-light);
}

.select2-container--default .select2-selection--single:hover {
    border-color: #cbd5e0;
    background-color: #ffffff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 14px;
    color: var(--rfj-text-dark);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

/* ==========================================
   10. 响应式设计
   ========================================== */
@media (max-width: 768px) {
    .rfj-modal-dialog {
        margin: 20px 10px;
        max-width: calc(100% - 20px);
    }

    .rfj-modal-header {
        padding: 20px 20px 16px;
    }

    .rfj-modal-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rfj-modal-logo {
        margin-bottom: 12px;
    }

    .rfj-modal-logo-img {
        max-width: 80px;
    }

    .rfj-modal-desc {
        font-size: 12px;
        margin-top: 0;
    }

    .rfj-modal-body {
        padding: 20px;
    }

    .rfj-modal-title {
        font-size: 18px;
    }

    .rfj-input-group {
        flex-direction: column;
    }

    .rfj-input-group .rfj-input {
        border-radius: var(--rfj-radius-sm);
        margin-bottom: 10px;
    }

    .rfj-input-group .rfj-btn {
        margin-left: 0;
        border-radius: var(--rfj-radius-sm);
        width: 100%;
    }

    .rfj-label {
        margin-right: 15px;
        font-size: 13px;
    }

    .rfj-phone-icon-wrapper {
        width: 72px;
        height: 72px;
        margin-bottom: 16px;
    }

    .rfj-phone-icon {
        width: 32px;
        height: 32px;
    }

    .rfj-phone-number-link {
        font-size: 24px;
        padding: 12px 28px;
    }

    .rfj-phone-info-card {
        padding: 14px 16px;
    }

    .rfj-phone-info-text {
        font-size: 12px;
    }
}

/* ==========================================
   11. 动画效果
   ========================================== */
@keyframes rfjFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes rfjSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes rfjPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.rfj-modal {
    animation: rfjFadeIn 0.3s ease-out;
}

.rfj-modal-content {
    animation: rfjSlideIn 0.3s ease-out;
}

.rfj-phone-icon-wrapper {
    animation: rfjPulse 2s ease-in-out infinite;
}

/* 打印样式 */
@media print {
    .rfj-modal {
        display: none !important;
    }
}

/* 软件搜索下拉框样式 */
.rfj-software-search-container {
    position: relative;
    width: 100%;
}

.rfj-software-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
    z-index: 10000;
}

.rfj-dropdown-active {
    display: block;
    animation: rfjDropdownFadeIn 0.2s ease-out;
}

@keyframes rfjDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rfj-software-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.rfj-software-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.rfj-software-option:last-child {
    border-bottom: none;
}

.rfj-software-option:hover,
.rfj-software-option-hover {
    background-color: #f8fafc;
}

.rfj-software-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    background-color: #f1f5f9;
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.rfj-software-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfj-software-icon::after {
    content: 'S';
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.rfj-software-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rfj-software-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rfj-software-maker {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.rfj-software-arrow {
    width: 6px;
    height: 6px;
    border-right: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
    transform: rotate(-45deg);
    margin-left: 10px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.rfj-software-option:hover .rfj-software-arrow,
.rfj-software-option-hover .rfj-software-arrow {
    opacity: 1;
}

.rfj-software-empty {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* 选中状态 */
.rfj-software-option-selected {
    background-color: #eff6ff !important;
}

.rfj-software-option-selected .rfj-software-name {
    color: #3b82f6;
}

/* 滚动条样式 */
.rfj-software-dropdown::-webkit-scrollbar {
    width: 6px;
}

.rfj-software-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.rfj-software-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.rfj-software-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}