.smart-recommend-portal {
    position: relative;
    z-index: 2147482000;
}

.smart-recommend-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    max-width: calc(100% - 32px);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(20, 28, 40, 0.18);
    border: 1px solid rgba(24, 35, 51, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: #1f2329;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(32px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 2147482001;
}

.smart-recommend-popup.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.smart-recommend-popup.is-minimized {
    transform: translateY(calc(100% - 56px));
}

.smart-recommend-popup__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.smart-recommend-popup__header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px 6px;
}

.smart-recommend-popup__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.smart-recommend-popup__subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.smart-recommend-popup__actions {
    display: flex;
    gap: 6px;
}

.smart-recommend-popup__action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(15, 23, 42, 0.05);
    color: #111827;
    cursor: pointer;
    font-size: 16px;
    line-height: 32px;
    text-align: center;
    transition: background .2s ease;
}

.smart-recommend-popup__action:hover {
    background: rgba(15, 23, 42, 0.12);
}

.smart-recommend-popup__body {
    padding: 0 16px 10px;
    max-height: min(480px, calc(100vh - 220px));
    overflow-y: auto;
}

.smart-recommend-popup__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smart-recommend-popup__item {
    display: flex;
    gap: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 8px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.smart-recommend-popup__item:hover {
    border-color: rgba(30, 100, 255, 0.5);
    box-shadow: 0 8px 20px rgba(30, 100, 255, 0.16);
}

.smart-recommend-popup__item > a {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.smart-recommend-popup__media {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-recommend-popup__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.smart-recommend-popup__content {
    flex: 1;
    min-width: 0;
}

.smart-recommend-popup__item-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.smart-recommend-popup__meta {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.smart-recommend-popup__footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 10px 16px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.smart-recommend-popup__refresh {
    flex: 1;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #1E64FF 0%, #3B82F6 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(30, 100, 255, 0.25);
    transition: transform .15s ease, box-shadow .15s ease;
}

.smart-recommend-popup__refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(30, 100, 255, 0.35);
}

.smart-recommend-popup__empty {
    text-align: center;
    padding: 18px 8px;
    color: #6b7280;
    font-size: 13px;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    border-radius: 12px;
}

.smart-recommend-popup__empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.smart-recommend-popup__empty-action {
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
    transition: transform .15s ease, box-shadow .15s ease;
}

.smart-recommend-popup__empty-action[hidden] {
    display: none;
}

.smart-recommend-popup__empty-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(249, 115, 22, 0.4);
}

.smart-recommend-popup__empty-close {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.smart-recommend-popup__empty strong {
    color: #111827;
    display: block;
    margin-bottom: 6px;
}

.smart-recommend-popup__skeleton {
    display: flex;
    gap: 10px;
}

.smart-recommend-popup__skeleton .thumb,
.smart-recommend-popup__skeleton .line {
    border-radius: 8px;
    background: linear-gradient(110deg, #f4f5f7 8%, #eceff3 18%, #f4f5f7 33%);
    background-size: 200% 100%;
    animation: smartRecommendShimmer 1.2s linear infinite;
}

.smart-recommend-popup__skeleton .thumb {
    width: 56px;
    height: 56px;
}

.smart-recommend-popup__skeleton .lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smart-recommend-popup__skeleton .line {
    height: 12px;
    width: 100%;
}

.smart-recommend-popup__skeleton .line.short {
    width: 60%;
}

.smart-recommend-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    border: none;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
    display: none;
    z-index: 2147482002;
}

.smart-recommend-badge.is-visible {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.smart-recommend-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
}

@keyframes smartRecommendShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@media screen and (max-width: 767px) {
    .smart-recommend-popup,
    .smart-recommend-badge {
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }
    .smart-recommend-popup {
        bottom: 90px;
    }
    .smart-recommend-badge {
        bottom: 16px;
    }
}


