:root {
    --global-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue", sans-serif;
    --custom-font-family: var(--global-font-family);
}

/* 全局字体应用 */
body.custom-font,
body.custom-font .article-title,
body.custom-font .article-content,
body.custom-font .feed-title,
body.custom-font .article-item,
body.custom-font .search-input,
body.custom-font button,
body.custom-font select,
body.custom-font input,
body.custom-font textarea,
body.custom-font label,
body.custom-font p,
body.custom-font h1,
body.custom-font h2,
body.custom-font h3,
body.custom-font h4,
body.custom-font h5,
body.custom-font h6,
body.custom-font div,
body.custom-font span {
    font-family: var(--custom-font-family) !important;
    transition: font-family 0.3s ease;
}

/* 确保代码和特殊元素不受影响 */
body.custom-font pre,
body.custom-font code,
body.custom-font kbd,
body.custom-font samp,
body.custom-font input[type="password"] {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
}

/* RTL模式与字体集成 */
body.rtl-mode.custom-font {
    /* 某些特定字体在RTL模式下可能需要特殊调整 */
    letter-spacing: 0;
    word-spacing: normal;
}

/* 添加漂亮的字体平滑效果 */
body.custom-font {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* RTL模式全局样式 */
body.rtl-mode {
    direction: rtl;
    text-align: right;
}

body.rtl-mode input,
body.rtl-mode textarea {
    text-align: right;
}

/* RTL模式按钮图标调整 */
body.rtl-mode button i {
    transform: scaleX(-1);
}

/* RTL状态指示器 */
.rtl-active-indicator {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
}

body.rtl-mode .rtl-active-indicator {
    display: block;
} 