.rp-sync-floating {
    position: absolute;
    right: 10px;
    top: 50%;
    z-index: 40;
    transform: translateY(-50%);
    pointer-events: none;
}

.rp-sync-button {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 28px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 22px -18px rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.rp-sync-button:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.42);
    background: #fff;
    box-shadow: 0 12px 26px -18px rgba(37, 99, 235, 0.75);
}

.rp-sync-button.is-syncing,
.rp-sync-button:disabled {
    color: #1d4ed8;
    background: #eff6ff;
    opacity: 0.76;
    cursor: wait;
}

.rp-sync-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    color: #111827;
}

.rp-sync-modal.is-open {
    display: block;
}

.rp-sync-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.32);
    backdrop-filter: blur(5px);
}

.rp-sync-modal__panel {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(92vw, 420px);
    max-height: min(86vh, 640px);
    overflow-y: auto;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 70px -34px rgba(15, 23, 42, 0.55);
    padding: 18px;
}

.rp-sync-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.rp-sync-modal__eyebrow {
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rp-sync-modal__title {
    margin: 0;
    color: #111827;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.rp-sync-modal__title-main {
    display: block;
    color: #111827;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
}

.rp-sync-modal__title-sub {
    display: block;
    margin-bottom: 3px;
    color: #2563eb;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rp-sync-modal__close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 999px;
    background: #fff;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.rp-sync-modal__close:hover {
    color: #111827;
    border-color: rgba(156, 163, 175, 0.9);
}

.rp-sync-main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rp-sync-action-button {
    min-width: 0;
    height: 42px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 12px;
    background: #fff;
    color: #374151;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.rp-sync-action-button:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: #f8fafc;
    color: #1d4ed8;
}

.rp-sync-action-button.is-primary {
    border-color: rgba(37, 99, 235, 0.25);
    background: #eff6ff;
    color: #1d4ed8;
}

.rp-sync-action-button:disabled,
.rp-sync-modal__button:disabled,
.rp-sync-version-button:disabled {
    opacity: 0.62;
    cursor: wait;
}

.rp-sync-modal__status {
    min-height: 22px;
    margin: 14px 0 10px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.55;
}

.rp-sync-progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.rp-sync-progress__bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transition: width 0.28s ease;
}

.rp-sync-progress__value {
    margin-top: 6px;
    text-align: right;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.rp-sync-update-details {
    margin-top: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.rp-sync-update-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
}

.rp-sync-update-details summary::-webkit-details-marker {
    display: none;
}

.rp-sync-update-details summary::after {
    content: "展开";
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
}

.rp-sync-update-details[open] summary::after {
    content: "收起";
}

.rp-sync-update-body {
    padding-top: 10px;
}

.rp-sync-choice__desc,
.rp-sync-modal__intro {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.rp-sync-version-fields {
    display: grid;
    gap: 8px;
    margin: 8px 0 10px;
}

.rp-sync-version-fields label,
.rp-sync-password-field {
    display: grid;
    gap: 7px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.rp-sync-version-picker {
    position: relative;
}

.rp-sync-version-button {
    position: relative;
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(209, 213, 219, 0.95);
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 13px;
    line-height: 1.45;
    padding: 8px 36px 8px 12px;
    text-align: left;
    font-weight: 700;
    cursor: pointer;
}

.rp-sync-version-button::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.rp-sync-version-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    display: none;
    max-height: 190px;
    overflow-y: auto;
    border: 1px solid rgba(209, 213, 219, 0.95);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 46px -28px rgba(15, 23, 42, 0.48);
    padding: 6px;
}

.rp-sync-version-menu.is-open {
    display: grid;
    gap: 2px;
}

.rp-sync-version-option {
    width: 100%;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #111827;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    padding: 9px 10px;
    text-align: left;
}

.rp-sync-version-option:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.rp-sync-inline-actions,
.rp-sync-modal__actions,
.rp-sync-confirm__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.rp-sync-modal__actions {
    margin-top: 16px;
}

.rp-sync-modal__button {
    min-width: 78px;
    border: 1px solid rgba(209, 213, 219, 0.95);
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
    cursor: pointer;
}

.rp-sync-modal__button:hover {
    border-color: rgba(59, 130, 246, 0.35);
    color: #1d4ed8;
}

.rp-sync-modal__button.is-primary {
    border-color: rgba(37, 99, 235, 0.25);
    background: #eff6ff;
    color: #1d4ed8;
}

.rp-sync-modal__button.is-danger {
    border-color: rgba(239, 68, 68, 0.28);
    background: #fef2f2;
    color: #b91c1c;
}

.rp-sync-password-field {
    margin-top: 14px;
}

.rp-sync-password-field input {
    width: 100%;
    border: 1px solid rgba(209, 213, 219, 0.95);
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 15px;
    line-height: 1.4;
    padding: 11px 12px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.rp-sync-password-field input:focus {
    border-color: rgba(37, 99, 235, 0.52);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

.rp-sync-password-status {
    min-height: 20px;
    margin: 10px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.rp-sync-confirm {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-radius: inherit;
    background: rgba(17, 24, 39, 0.22);
}

.rp-sync-confirm.is-open {
    display: flex;
}

.rp-sync-confirm__box {
    width: min(100%, 330px);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 55px -30px rgba(15, 23, 42, 0.62);
    padding: 16px;
}

.rp-sync-confirm__title {
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}

.rp-sync-confirm__message {
    margin: 8px 0 14px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .rp-sync-floating {
        position: absolute;
        right: 12px;
        top: 50%;
        z-index: 40;
        transform: translateY(-50%);
    }

    .rp-sync-button {
        min-width: 48px;
        height: 26px;
        font-size: 11px;
        box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.68);
    }

    .rp-sync-modal__backdrop {
        background: rgba(17, 24, 39, 0.36);
    }

    .rp-sync-modal__panel {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-height: min(82vh, 620px);
        transform: none;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 20px 20px 0 0;
        padding: 16px 16px max(16px, env(safe-area-inset-bottom));
    }

    .rp-sync-modal__header {
        margin-bottom: 12px;
    }

    .rp-sync-modal__title {
        font-size: 18px;
    }

    .rp-sync-modal__title-main {
        font-size: 17px;
    }

    .rp-sync-modal__title-sub {
        font-size: 10px;
    }

    .rp-sync-main-actions {
        gap: 8px;
    }

    .rp-sync-action-button {
        height: 42px;
        font-size: 14px;
        border-radius: 12px;
    }

    .rp-sync-inline-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .rp-sync-inline-actions .rp-sync-modal__button {
        width: 100%;
    }
}
