/* ===== 全局浮动操作 ===== */
.rfj-floating-actions--mobile {
    position: fixed;
    right: 10px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: var(--rfj-z-popover, 1100);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.rfj-floating-actions__fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffffee;
    color: var(--rfj-text-primary);
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.rfj-floating-actions__fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.rfj-floating-actions__fab .text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.rfj-floating-actions__fab.rfj-mobile-ai-btn {
    width: auto;
    min-width: 78px;
    padding: 0 12px;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    background: linear-gradient(135deg, #315efb 0%, #7357e8 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(49, 94, 251, 0.32);
}

.rfj-floating-actions__fab.rfj-mobile-ai-btn .icon svg {
    width: 20px;
    height: 20px;
}

.rfj-floating-actions__fab.rfj-mobile-ai-btn .text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.rfj-floating-actions__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#mobile-backtop,
.rfj-floating-backtop {
    opacity: 0;
    pointer-events: none;
}

#mobile-backtop.is-visible,
.rfj-floating-backtop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

#mobile-backtop {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

#mobile-backtop:hover {
    background: rgba(0, 0, 0, 0.72);
}

.rfj-floating-backtop--desktop {
    position: fixed;
    right: 16px;
    bottom: 32px;
    z-index: 999;
    transition: opacity 0.2s ease;
}

@media (min-width: 769px) {
    .rfj-floating-actions--mobile {
        display: none;
    }
}

/* ===== AJAX 加载指示器（全局） ===== */
.rfj-loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050;
}

/* ===== 自定义 Modal（替代 Bootstrap modal） ===== */
.rfj-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    overflow: hidden;
    outline: 0;
}

.rfj-modal.is-open {
    display: block;
}

.rfj-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.rfj-modal__dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 16px;
    pointer-events: none;
}

.rfj-modal__content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    overflow: hidden;
}

.rfj-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.rfj-modal__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--rfj-text-primary);
    margin: 0;
    text-align: center;
    flex: 1;
}

.rfj-modal__close {
    background: none;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--rfj-text-tertiary);
    cursor: pointer;
    padding: 0 4px;
    flex: 0 0 auto;
}

.rfj-modal__close:hover,
.rfj-modal__close:focus {
    color: var(--rfj-text-tertiary);
    outline: none;
}

.rfj-modal__body {
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}
/* Shared inline SVG icons replace external icon-font resources on light pages. */
.rfj-svg-icon {
    display: inline-block;
    fill: none;
    flex: 0 0 auto;
    height: 1em;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    vertical-align: -0.15em;
    width: 1em;
}

/* Keep the AI gradient visible against a light hover and focus background. */
.right-nav-button.ai-subscription-button .icon svg {
    width: 28px;
    height: 17px;
}
.right-nav-button.ai-subscription-button:hover,
.right-nav-button.ai-subscription-button:focus-visible {
    background-color: #eef2ff;
    color: #4f46a5;
}
.right-nav-button.ai-subscription-button:hover .text,
.right-nav-button.ai-subscription-button:hover .icon,
.right-nav-button.ai-subscription-button:focus-visible .text,
.right-nav-button.ai-subscription-button:focus-visible .icon {
    color: #4f46a5;
}
.right-nav-button.ai-subscription-button:focus-visible {
    outline: 2px solid #8b80d5;
    outline-offset: 2px;
}
.right-nav-button.ai-subscription-button:active {
    background-color: #e3e8ff;
}
