/* ==========================================================================
   Elementor全局字体修复
   ========================================================================== */

/**
 * 确保所有Elementor文本元素使用思源黑体
 * 排除图标和特定Elementor组件
 */
.elementor-widget-container,
.elementor-widget-heading .elementor-heading-title,
.elementor-widget-text-editor,
.elementor-text-editor,
.elementor-button-text,
.elementor-tab-title,
.elementor-accordion-title,
.elementor-toggle-title,
.elementor-counter-title,
.elementor-progress-text,
.elementor-icon-box-title,
.elementor-image-box-title,
.elementor-testimonial-name,
.elementor-testimonial-job,
.elementor-price-table-heading,
.elementor-price-table-subheading,
.elementor-price-table-price,
.elementor-price-table-period,
.elementor-price-table-features-list li,
.elementor-price-table-footer,
.elementor-flip-box-front-title,
.elementor-flip-box-back-title,
.elementor-flip-box-front-description,
.elementor-flip-box-back-description {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* ==========================================================================
   Elementor小部件特定修复
   ========================================================================== */

/* 图标框 */
.elementor-icon-box-wrapper .elementor-icon-box-content h3,
.elementor-icon-box-wrapper .elementor-icon-box-content p {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 图像框 */
.elementor-image-box-wrapper .elementor-image-box-content h3,
.elementor-image-box-wrapper .elementor-image-box-content p {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 进度条 */
.elementor-progress-wrapper .elementor-progress-text {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

.elementor-progress-wrapper .elementor-title {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 计数器 */
.elementor-counter .elementor-counter-number-wrapper,
.elementor-counter .elementor-counter-title {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 价格表 */
.elementor-price-table .elementor-price-table__heading,
.elementor-price-table .elementor-price-table__subheading,
.elementor-price-table .elementor-price-table__price,
.elementor-price-table .elementor-price-table__period,
.elementor-price-table .elementor-price-table__features-list li,
.elementor-price-table .elementor-price-table__footer_additional_info {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 推荐框 */
.elementor-testimonial__name,
.elementor-testimonial__title,
.elementor-testimonial__content {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 翻转盒子 */
.elementor-flip-box__front .elementor-flip-box__layer__title,
.elementor-flip-box__front .elementor-flip-box__layer__description,
.elementor-flip-box__back .elementor-flip-box__layer__title,
.elementor-flip-box__back .elementor-flip-box__layer__description {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* ==========================================================================
   Elementor表单字体修复
   ========================================================================== */
.elementor-field-group .elementor-field-label,
.elementor-field .elementor-field-textual,
.elementor-field-group .elementor-field-subgroup label,
.elementor-button.elementor-size-sm,
.elementor-button.elementor-size-md,
.elementor-button.elementor-size-lg,
.elementor-button.elementor-size-xl,
.elementor-message,
.elementor-field-type-acceptance label {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 表单占位符 */
.elementor-field::placeholder,
.elementor-field::-webkit-input-placeholder,
.elementor-field::-moz-placeholder,
.elementor-field:-ms-input-placeholder,
.elementor-field::-ms-input-placeholder {
    font-family: 'Noto Sans SC Local', sans-serif !important;
    font-weight: 400;
}

/* ==========================================================================
   Elementor菜单和导航字体修复
   ========================================================================== */
.elementor-nav-menu .elementor-item,
.elementor-nav-menu--dropdown .elementor-item,
.elementor-menu-toggle {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

.elementor-nav-menu--main .elementor-item,
.elementor-nav-menu--main .elementor-sub-item {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* ==========================================================================
   Elementor图标字体保护
   ========================================================================== */

/**
 * 确保Font Awesome图标不受影响
 */
.elementor-icon i,
.elementor-icon-list-icon i,
.elementor-social-icon i,
.elementor-swiper-button i,
.elementor-share-buttons i,
.elementor-widget-icon i,
.elementor-widget-icon-list i,
.elementor-widget-social-icons i,
.elementor-widget-share-buttons i {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands', 'FontAwesome' !important;
}

/* Elementor图标字体回退 */
.elementor-icon:before,
.elementor-icon-list-icon:before,
.elementor-social-icon:before {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands', 'FontAwesome' !important;
}

/* ==========================================================================
   Elementor响应式字体调整
   ========================================================================== */

/* 平板设备 */
@media (max-width: 1024px) {
    .elementor-section,
    .elementor-column,
    .elementor-widget {
        font-family: 'Noto Sans SC Local', sans-serif !important;
    }
    
    .elementor-heading-title {
        font-weight: 600 !important;
    }
}

/* 移动设备 */
@media (max-width: 767px) {
    .elementor-widget-container {
        font-family: 'Noto Sans SC Local', sans-serif !important;
    }
    
    .elementor-heading-title {
        font-size: calc(var(--font-size, 1.5em) * 0.9) !important;
    }
    
    .elementor-text-editor {
        font-size: var(--font-size-base) !important;
        line-height: var(--line-height-relaxed) !important;
    }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
    .elementor-button-text {
        font-size: var(--font-size-sm) !important;
    }
    
    .elementor-field {
        font-size: var(--font-size-base) !important;
    }
}

/* ==========================================================================
   Elementor编辑器字体修复
   ========================================================================== */

/* 前端编辑器 */
.elementor-editor-active .elementor *:not(.fa):not(.fas):not(.far):not(.fab):not(.elementor-icon) {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* 确保编辑器中预览正常 */
.elementor-panel * {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.elementor-panel .elementor-control-type-font .select2-selection__rendered {
    font-family: 'Noto Sans SC Local', sans-serif !important;
}

/* ==========================================================================
   Elementor字体加载状态指示器
   ========================================================================== */
.elementor-widget:not(.elementor-widget-text-editor) {
    font-display: swap;
}

/* 字体加载完成后的优化 */
.fonts-loaded .elementor-widget-heading .elementor-heading-title {
    font-optical-sizing: auto;
    font-variation-settings: 'wght' 700;
}

.fonts-loaded .elementor-text-editor {
    font-optical-sizing: auto;
    font-variation-settings: 'wght' 400;
}

/* ==========================================================================
   Elementor自定义字体选择器
   ========================================================================== */

/**
 * 为Elementor编辑器添加思源黑体选项
 * 通过CSS自定义属性实现
 */
:root {
    --e-global-typography-primary-font-family: 'Noto Sans SC Local';
    --e-global-typography-secondary-font-family: 'Noto Sans SC Local';
    --e-global-typography-text-font-family: 'Noto Sans SC Local';
    --e-global-typography-accent-font-family: 'Noto Sans SC Local';
}

.elementor-widget:not([class*="elementor-widget-icon"]) {
    font-family: var(--e-global-typography-text-font-family, 'Noto Sans SC Local') !important;
}