/* Keep the original MX realtime-address-card visual language on the static home page. */
#mx51-buy-bar .mx51-hidden-preview,
#mx51-content-modal .mx51-content {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    line-height: 1.5;
}

#mx51-buy-bar .mx51-hidden-preview::before {
    content: "未支付预览 · 地址中间已打码";
    display: inline-flex;
    align-items: center;
    margin: 0 0 13px;
    padding: 4px 10px;
    border: 1px solid rgba(251, 146, 60, .3);
    border-radius: 999px;
    background: rgba(251, 146, 60, .08);
    color: #c2410c;
    font-size: 13px;
    font-weight: 700;
}

#mx51-buy-bar .mx51-hidden-preview.mx51-preview-unlocked::before {
    content: "已支付 · 完整地址";
    border-color: rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .06);
    color: #16a34a;
}

#mx51-buy-bar .mx51-preview-block + .mx51-preview-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-outer {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent !important;
    text-align: center;
    line-height: 1;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap::before,
:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap::after {
    content: "";
    display: block;
    flex: 1 1 auto;
    min-width: 24px;
    height: 2px;
    border-radius: 999px;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap::before {
    background: linear-gradient(to right, rgba(203, 213, 225, 0), rgba(148, 163, 184, .95));
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap::after {
    background: linear-gradient(to right, rgba(148, 163, 184, .95), rgba(203, 213, 225, 0));
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    max-width: min(72%, 420px);
    padding: 0 2px;
    overflow: hidden;
    background: transparent !important;
    color: #1e293b !important;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .2px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-card {
    margin: 16px 0;
    padding: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    background: #f1f5f9;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-outer .mxrac-site-card:first-of-type {
    margin-top: 0;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-outer .mxrac-site-card:last-of-type {
    margin-bottom: 0;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border: 1px solid #d5dee9;
    border-radius: 9999px;
    background: #e2e8f0;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-avatar-fallback {
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-name {
    color: #1e2937 !important;
    font-size: 19px;
    font-weight: 700;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-time {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 9999px;
    background: transparent;
    font-size: 13px;
    white-space: nowrap;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-time-ok {
    border: 1px solid rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .035);
    color: #16a34a;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-time-fail {
    border: 1px solid rgba(239, 68, 68, .32);
    background: rgba(239, 68, 68, .035);
    color: #dc2626;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 10px;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-link-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 60px;
    padding: 10px 11px 10px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .045);
    text-decoration: none !important;
    transition: all .2s ease;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-link-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .09);
    transform: translateY(-1px);
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-line-info {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 2px;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-line-title {
    display: block;
    margin-bottom: 3px;
    overflow: visible;
    color: #1e2937 !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.32;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-line-url {
    display: block;
    margin: 0;
    overflow: visible;
    color: #2563eb !important;
    font-size: 12px;
    line-height: 1.38;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    word-break: break-all;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-actions {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-flow: row nowrap;
    gap: 6px;
    min-width: 120px;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-copy-btn,
:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-open-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center !important;
    box-sizing: border-box;
    min-width: 54px;
    height: auto !important;
    padding: 7px 12px !important;
    border: 0 !important;
    border-radius: 9999px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s ease;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-copy-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-open-btn {
    background: #eff6ff !important;
    color: #1e40af !important;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mx51-preview-locked {
    opacity: .72;
    cursor: pointer !important;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-copy-ok {
    background: #10b981 !important;
    color: #fff !important;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-copy-fail {
    background: #ef4444 !important;
    color: #fff !important;
}

:is(#mx51-buy-bar, #mx51-content-modal) .mxrac-empty {
    padding: 14px;
    border: 1px solid #fde047;
    border-radius: 12px;
    background: #fefce8;
    color: #854d0e;
    font-size: 14.5px;
}

@media (max-width: 640px) {
    #mx51-buy-bar .mx51-hidden-preview,
    #mx51-content-modal .mx51-content {
        padding: 12px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap {
        gap: 8px;
        margin-bottom: 9px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap::before,
    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title-wrap::after {
        min-width: 18px;
        height: 1.5px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-cards-title {
        max-width: 66%;
        font-size: 16px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-card {
        margin: 14px 0;
        padding: 13px 10px;
        border-radius: 15px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-head {
        flex-wrap: nowrap;
        gap: 6px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-avatar {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-name {
        min-width: 0;
        flex: 0 1 auto;
        font-size: 18px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-site-time {
        flex: 0 0 auto;
        padding: 2px 7px;
        font-size: 12px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-link-card {
        flex-direction: row !important;
        align-items: center !important;
        min-height: 58px;
        padding: 9px 8px 9px 10px;
        gap: 7px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-line-title {
        margin-bottom: 4px;
        font-size: 13px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-line-url {
        font-size: 11.5px;
        line-height: 1.28;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-actions {
        min-width: 104px;
        gap: 5px;
    }

    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-copy-btn,
    :is(#mx51-buy-bar, #mx51-content-modal) .mxrac-open-btn {
        min-width: 48px;
        padding: 6px 9px !important;
        font-size: 12px !important;
        line-height: 1.1 !important;
    }
}
