/* ===========================
   Custom Review Widget v4.0
   CSS Custom Properties Theme
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =============== 可配置 CSS 变量（默认暗色主题） =============== */
#rv-widget {
    /* 基础 */
    --rv-font: inherit;
    --rv-bg: transparent;
    --rv-text: #fff;
    --rv-text-secondary: #9ca3af;
    --rv-text-muted: #6b7280;

    /* 星标 */
    --rv-star: #ffc107;
    --rv-star-empty: #333;

    /* 卡片 */
    --rv-card-bg: #1e1e1e;
    --rv-card-border: rgba(31, 41, 55, 0.5);
    --rv-card-border-hover: #374151;
    --rv-card-radius: 0.5rem;
    --rv-card-content-color: #e5e7eb;

    /* 高亮/强调 */
    --rv-accent: #ec4899;
    --rv-highlight-border: #ec4899;

    /* 分隔线/边框 */
    --rv-border: #1f2937;
    --rv-divider: rgba(55, 65, 81, 0.6);

    /* 标签 */
    --rv-badge-bg: #1f2937;
    --rv-badge-text: #d1d5db;

    /* 已认证 */
    --rv-verified: #4caf50;

    /* 按钮 */
    --rv-btn-border: #374151;
    --rv-btn-hover-bg: #1f2937;
    --rv-load-more-border: #374151;
    --rv-load-more-hover-bg: #1f2937;

    /* 弹窗 */
    --rv-modal-bg: #fff;
    --rv-modal-text: #111827;
    --rv-modal-text-secondary: #374151;
    --rv-modal-text-muted: #6b7280;
    --rv-modal-border: #f3f4f6;
    --rv-modal-left-bg: #f3f4f6;
    --rv-modal-product-title: #1f2937;
    --rv-modal-view-btn-border: #e5e7eb;
    --rv-modal-view-btn-hover-bg: #f9fafb;
    --rv-modal-admin-bg: #f3f4f6;
    --rv-modal-admin-text: #374151;
    --rv-modal-verified-text: #1f2937;

    /* 写评论弹窗 */
    --rv-write-bg: #1e1e1e;
    --rv-write-text: #fff;
    --rv-write-input-bg: #121212;
    --rv-write-input-border: #333;
    --rv-write-label: #ccc;
    --rv-write-submit-bg: #fff;
    --rv-write-submit-text: #000;

    /* Toast */
    --rv-toast-bg: #333;
    --rv-toast-text: #fff;

    font-family: var(--rv-font);
    color: var(--rv-text);
    box-sizing: border-box;
}

#rv-widget * {
    box-sizing: border-box;
}

/* Scrollbars */
.modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

#rv-widget ::-webkit-scrollbar-track {
    background: transparent;
}

/* SVG Utilities */
.rv-w-3\.5 {
    width: 14px;
}

.rv-h-3\.5 {
    height: 14px;
}

.rv-w-4 {
    width: 16px;
}

.rv-h-4 {
    height: 16px;
}

.rv-w-5 {
    width: 20px;
}

.rv-h-5 {
    height: 20px;
}

.rv-w-3 {
    width: 12px;
}

.rv-h-3 {
    height: 12px;
}

.rv-fill-current {
    fill: currentColor;
}

.rv-text-green {
    color: var(--rv-verified);
}

.rv-text-yellow {
    color: var(--rv-star);
}

.rv-text-gray-200 {
    color: #e5e7eb;
}

.rv-text-gray-600 {
    color: var(--rv-text-muted);
}

.rv-text-gray-300 {
    color: var(--rv-badge-text);
}

.rv-text-gray-400 {
    color: var(--rv-text-secondary);
}

.rv-text-black {
    color: #000;
}

.rv-text-pink {
    color: var(--rv-accent);
}

/* Header Elements */
.rv-header-new {
    margin-bottom: 2rem;
}

.rv-main-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--rv-text);
}

.rv-header-bar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid var(--rv-border);
    padding-bottom: 1rem;
}

@media (min-width: 640px) {
    .rv-header-bar {
        flex-direction: row;
        align-items: center;
    }
}

.rv-header-left {
    display: flex;
    flex-direction: column;
}

.rv-header-rating-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rv-stars-group {
    display: flex;
    color: var(--rv-star);
    gap: 0.1rem;
}

.rv-reviews-text {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--rv-text);
}

.rv-reviews-text:hover {
    color: var(--rv-badge-text);
}

/* Tabs */
.rv-header-tabs {
    display: flex;
    gap: 1rem;
}

.rv-tab-btn {
    background: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    color: var(--rv-text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
}

.rv-tab-btn:hover {
    color: var(--rv-text);
}

.rv-tab-btn.active {
    color: var(--rv-text);
    border-bottom: 2px solid var(--rv-text);
}

.rv-badge {
    background: var(--rv-badge-bg);
    color: var(--rv-badge-text);
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    margin-left: 0.25rem;
}

/* Write Review Button */
.rv-btn-write {
    background: transparent;
    color: var(--rv-write-submit-bg, #ec4899);
    border: 1.5px solid var(--rv-write-submit-bg, #ec4899);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.rv-btn-write:hover {
    background: var(--rv-write-submit-bg, #ec4899);
    color: var(--rv-write-submit-text, #fff);
}

.rv-btn-write svg {
    width: 18px;
    height: 18px;
}

/* Masonry Grid - Pinterest-style absolute positioning */
.rv-grid {
    position: relative;
    width: 100%;
}

.rv-grid-col {
    /* no longer used, kept for backward compat */
}

/* Cards */
.rv-masonry-item {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--rv-card-bg);
    border-radius: var(--rv-card-radius);
    overflow: hidden;
    border: 1px solid var(--rv-card-border);
    transition: transform 240ms ease, width 240ms ease, border-color 0.3s;
    will-change: transform;
    cursor: pointer;
    display: block;
}

.rv-masonry-item:hover {
    border-color: var(--rv-card-border-hover);
}

.rv-masonry-item.rv-highlighted {
    border-color: var(--rv-highlight-border);
}

.rv-extra-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 10;
}

.rv-card-img-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.rv-card-main-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.rv-masonry-item:hover .rv-card-main-img {
    transform: scale(1.05);
}

.rv-card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .rv-card-body {
        padding: 1rem;
    }
}

.rv-card-header-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.rv-card-author-block {
    min-width: 0;
    width: 100%;
}

@media (min-width: 640px) {
    .rv-card-header-row {
        flex-direction: row;
        justify-content: space-between;
    }

    .rv-card-author-block {
        flex: 1;
    }
}

.rv-author-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.125rem;
}

.rv-author-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--rv-text);
}

.rv-verified-text-green {
    font-size: 0.75rem;
    color: var(--rv-verified);
    font-weight: 500;
    margin-left: 0.125rem;
}

.rv-date-text {
    font-size: 11px;
    color: var(--rv-text-muted);
    margin-bottom: 0.5rem;
}

.rv-card-stars {
    display: flex;
    gap: 0.125rem;
    margin-bottom: 0.625rem;
    color: var(--rv-star);
}

.rv-card-content {
    font-size: 0.875rem;
    color: var(--rv-card-content-color);
    line-height: 1.375;
    margin: 0 0 1rem 0;
}

.rv-divider {
    border: none;
    border-top: 1px solid var(--rv-divider);
    margin: 0.75rem 0;
}

/* Card footer */
.rv-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rv-card-product {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: opacity 0.2s;
    cursor: pointer;
}

.rv-card-product:hover {
    opacity: 0.8;
}

.rv-product-thumb {
    width: 28px;
    height: 28px;
    border-radius: 0.25rem;
    object-fit: cover;
    border: 1px solid var(--rv-btn-border);
}

.rv-product-name {
    font-size: 0.75rem;
    color: var(--rv-text-secondary);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media(max-width:639px) {
    .rv-product-name {
        max-width: 100px;
    }
}

@media(min-width:768px) {
    .rv-product-name {
        max-width: 140px;
    }
}

.rv-card-actions {
    display: flex;
    gap: 0.75rem;
    color: var(--rv-text-secondary);
}

.rv-card-actions-top {
    background: var(--rv-action-bg, rgba(20, 20, 20, 0.4));
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
    margin-left: -0.25rem;
    flex-shrink: 0;
}

.rv-action-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    cursor: pointer;
    transition: color 0.2s;
}

.rv-action-btn:hover {
    color: var(--rv-text);
}

.rv-action-btn.rv-text-pink {
    color: var(--rv-accent) !important;
}

.rv-action-btn:hover.rv-text-pink {
    color: var(--rv-accent);
}

.rv-action-btn svg {
    width: var(--rv-action-icon-size, 20px);
    height: var(--rv-action-icon-size, 20px);
    transition: transform 0.2s;
}

.rv-action-btn:hover svg {
    transform: scale(1.1);
}

.rv-action-count {
    font-size: var(--rv-action-font-size, 14px);
    font-weight: 500;
}

/* Modal */
.rv-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.rv-detail-overlay.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.rv-modal-container {
    background: var(--rv-modal-bg);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s;
}

.rv-modal-container.scale-100 {
    transform: scale(1);
}

@media (min-width: 768px) {
    .rv-modal-container {
        flex-direction: row;
        height: 500px;
    }
}

.rv-modal-left {
    width: 100%;
    position: relative;
    height: 300px;
    background: var(--rv-modal-left-bg);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .rv-modal-left {
        width: 55%;
        height: 100%;
    }
}

.rv-modal-hero-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    inset: 0;
}

.rv-modal-close-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.375rem;
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.rv-modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.rv-modal-right {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    color: var(--rv-modal-text);
    background: var(--rv-modal-bg);
    text-align: left;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .rv-modal-right {
        width: 45%;
        padding: 2rem;
    }
}

.rv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.rv-modal-author-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.rv-modal-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--rv-modal-text);
}

.rv-modal-verified-badge {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin-left: 0.25rem;
}

.rv-modal-verified-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rv-modal-verified-text);
    margin-left: 2px;
}

.rv-modal-date {
    font-size: 0.75rem;
    color: var(--rv-modal-text-muted);
    white-space: nowrap;
    margin-top: 2px;
}

.rv-modal-stars {
    display: flex;
    gap: 0.125rem;
    margin-bottom: 1rem;
}

.rv-modal-content-text {
    font-size: 14px;
    line-height: 1.625;
    color: var(--rv-modal-text-secondary);
    margin: 0 0 2rem 0;
    flex: 1;
}

.rv-modal-actions-border {
    display: flex;
    gap: 1.25rem;
    color: var(--rv-modal-text-muted);
    border-bottom: 1px solid var(--rv-modal-border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.rv-modal-action-btn {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: inherit;
    cursor: pointer;
    transition: color 0.2s;
}

.rv-modal-action-btn:hover {
    color: #000;
}

.rv-modal-action-btn.rv-text-pink {
    color: var(--rv-accent);
}

.rv-modal-action-btn.rv-text-pink svg {
    fill: currentColor;
}

.rv-modal-action-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.rv-modal-action-btn:hover svg {
    transform: scale(1.1);
}

.rv-modal-product-link {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rv-modal-product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.rv-modal-product-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.rv-modal-product-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rv-modal-product-title);
}

.rv-modal-view-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 11px;
    font-weight: 700;
    color: var(--rv-modal-text-secondary);
    background: transparent;
    border: 1px solid var(--rv-modal-view-btn-border);
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    width: max-content;
}

.rv-modal-view-btn:hover {
    color: #000;
    background: var(--rv-modal-view-btn-hover-bg);
}

.rv-modal-admin-reply {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--rv-modal-admin-bg);
    border-radius: 8px;
    font-size: 14px;
    color: var(--rv-modal-admin-text);
}

/* Lightbox */
#rv-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 6000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
#rv-lightbox.open {
    display: flex;
}
#rv-lightbox-img {
    max-width: 70vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.rv-lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6001;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}
.rv-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Share Panel */
.rv-share-panel {
    display: none;
}
.rv-share-panel.open {
    display: block;
}
.rv-share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 7000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rv-share-box {
    background: var(--rv-card-bg, #1a1a2e);
    border: 1px solid var(--rv-card-border, #333);
    border-radius: 16px;
    padding: 24px 28px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: rv-share-in 0.25s ease-out;
}
@keyframes rv-share-in {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.rv-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 700;
    color: var(--rv-text, #fff);
}
.rv-share-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: var(--rv-text-secondary, #ccc);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.rv-share-close:hover {
    background: rgba(255, 255, 255, 0.15);
}
.rv-share-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.rv-share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--rv-text-secondary, #ccc);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.rv-share-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .rv-share-box {
        min-width: unset;
        width: 90vw;
        padding: 20px;
    }
    .rv-share-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
}
/* Empty state */
.rv-empty {
    margin-top: 2rem;
    color: var(--rv-text-secondary);
    text-align: center;
}

/* Load more */
.rv-load-more {
    text-align: center;
    margin-top: 2rem;
}

.rv-load-more-btn {
    background: transparent;
    border: 1px solid var(--rv-load-more-border);
    color: var(--rv-text);
    padding: 0.5rem 2rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 600;
}

.rv-load-more-btn:hover {
    background: var(--rv-load-more-hover-bg);
}

/* Write Review Modal */
.rv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rv-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.rv-modal {
    background: var(--rv-write-bg);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    padding: 24px;
    position: relative;
}

.rv-modal__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--rv-write-text);
}

.rv-form-group {
    margin-bottom: 16px;
    text-align: left;
}

.rv-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--rv-write-label);
}

.rv-form-input,
.rv-form-textarea {
    width: 100%;
    background: var(--rv-write-input-bg);
    border: 1px solid var(--rv-write-input-border);
    color: var(--rv-write-text);
    padding: 10px;
    border-radius: 4px;
    font-family: inherit;
}

.rv-star-sel {
    cursor: pointer;
    color: var(--rv-star-empty);
    transition: color 0.2s;
    padding: 0 4px;
}

.rv-star-sel.active {
    color: var(--rv-star);
}

.rv-star-sel svg {
    width: 24px;
    height: 24px;
}

.rv-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rv-upload-btn {
    width: 60px;
    height: 60px;
    border: 1px dashed #555;
    background: transparent;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rv-upload-preview-wrap {
    position: relative;
    width: 60px;
    height: 60px;
}

.rv-btn-cancel {
    background: transparent;
    border: 1px solid #555;
    color: var(--rv-write-text);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.rv-btn-submit {
    background: var(--rv-write-submit-bg);
    border: none;
    color: var(--rv-write-submit-text);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

.rv-btn-submit:disabled {
    opacity: 0.5;
    background: #555;
    color: #ccc;
}

.rv-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--rv-toast-bg);
    color: var(--rv-toast-text);
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 6000;
}

.rv-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Custom Tooltip */
.rv-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    margin-left: 4px;
    color: #999;
}

.rv-tooltip-wrapper .rv-tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: auto;
    top: 150%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: normal;
    line-height: 1.4;
    transition: opacity 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.rv-tooltip-wrapper .rv-tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    top: auto;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

.rv-tooltip-wrapper:hover .rv-tooltip-text,
.rv-tooltip-wrapper:focus .rv-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ============ Campaign (Promo) Button ============ */
.rv-btn-promo {
    background: transparent;
    color: var(--rv-promo-btn-color, #a855f7);
    border: 1.5px solid var(--rv-promo-btn-color, #a855f7);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.rv-btn-promo:hover {
    background: var(--rv-promo-btn-color, #a855f7);
    color: #fff;
}

.rv-btn-promo svg {
    width: 18px;
    height: 18px;
}

/* ============ Promo Modal ============ */
.rv-promo-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.rv-promo-overlay.open {
    display: flex;
}

.rv-promo-container {
    background: var(--rv-promo-card-bg, #ffffff);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 640px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    animation: rv-promo-in 0.25s ease-out;
    color: var(--rv-promo-text, #1e293b);
}

@keyframes rv-promo-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header */
.rv-promo-header {
    position: relative;
    background: var(--rv-promo-header-bg, linear-gradient(135deg, #6366f1, #9333ea, #d946ef));
    padding: 2.5rem 2rem;
    text-align: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #fff;
}

.rv-promo-header-deco {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
}

.rv-promo-header-deco::before,
.rv-promo-header-deco::after {
    content: '';
    position: absolute;
    width: 16rem;
    height: 16rem;
    border-radius: 9999px;
    background: #fff;
    filter: blur(48px);
}

.rv-promo-header-deco::before {
    top: -20%;
    left: -10%;
}

.rv-promo-header-deco::after {
    bottom: -20%;
    right: -10%;
}

.rv-promo-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    box-sizing: border-box !important;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50% !important;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.rv-promo-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.rv-promo-header-content {
    position: relative;
    z-index: 1;
}

.rv-promo-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

@media (min-width: 640px) {
    .rv-promo-title {
        font-size: 2rem;
    }
}

.rv-promo-highlight {
    color: var(--rv-promo-highlight, #fde047);
}

.rv-promo-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    max-width: 28rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* Body */
.rv-promo-body {
    overflow-y: auto;
    padding: 1.5rem;
    flex: 1;
}

@media (min-width: 640px) {
    .rv-promo-body {
        padding: 2rem;
    }
}

.rv-promo-body::-webkit-scrollbar {
    width: 6px;
}

.rv-promo-body::-webkit-scrollbar-track {
    background: transparent;
}

.rv-promo-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

.rv-promo-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--rv-promo-text, #1e293b);
}

.rv-promo-badge-tag {
    margin-left: 0.5rem;
    padding: 0.25rem 0.625rem;
    background: var(--rv-promo-badge-bg, #eef2ff);
    color: var(--rv-promo-accent, #6366f1);
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Reward Card */
.rv-promo-reward-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--rv-promo-card-item-bg, #f8fafc);
    border: 1px solid var(--rv-promo-card-item-border, #f1f5f9);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.rv-promo-reward-card:hover {
    border-color: var(--rv-promo-accent, #6366f1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (min-width: 640px) {
    .rv-promo-reward-card {
        flex-direction: row;
    }
}

.rv-promo-reward-card-orange {
    background: var(--rv-promo-card-orange-bg, #fff7ed);
    border-color: var(--rv-promo-card-orange-border, #fed7aa);
}

.rv-promo-reward-card-orange:hover {
    border-color: #fb923c;
}

.rv-promo-reward-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    flex-shrink: 0;
}

.rv-promo-reward-icon-green {
    background: #dcfce7;
    color: #16a34a;
}

.rv-promo-reward-icon-trophy {
    background: linear-gradient(135deg, #fb923c, #f59e0b);
    color: #fff;
    box-shadow: 0 2px 4px rgba(251, 146, 60, 0.3);
}

.rv-promo-reward-body {
    flex: 1;
    min-width: 0;
}

.rv-promo-reward-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--rv-promo-text, #1e293b);
    margin: 0 0 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rv-promo-reward-desc {
    font-size: 0.8125rem;
    color: var(--rv-promo-text-muted, #475569);
    line-height: 1.6;
    margin: 0 0 0.625rem;
}

.rv-promo-reward-note {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--rv-promo-text-muted, #64748b);
}

/* Podium */
.rv-promo-podium {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rv-promo-podium-item {
    flex: 1;
    min-width: 90px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.rv-promo-podium-gold {
    border-color: #fde68a;
}

.rv-promo-podium-bronze {
    border-color: #fed7aa;
}

.rv-promo-podium-emoji {
    display: block;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.rv-promo-podium-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
}

.rv-promo-podium-prize {
    display: block;
    font-weight: 900;
    font-size: 1rem;
}

/* Pro Tip */
.rv-promo-tip {
    background: var(--rv-promo-tip-bg, #eef2ff);
    border: 1px solid var(--rv-promo-tip-border, #c7d2fe);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.rv-promo-tip-icon {
    background: #fff;
    padding: 0.5rem;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.rv-promo-tip-title {
    font-weight: 700;
    color: var(--rv-promo-tip-title-color, #312e81);
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
}

.rv-promo-tip-text {
    font-size: 0.8125rem;
    color: var(--rv-promo-tip-text-color, #3730a3);
    line-height: 1.6;
    margin: 0;
}

/* Terms */
.rv-promo-terms {
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
}

.rv-promo-terms-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.rv-promo-terms-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rv-promo-terms-list li {
    font-size: 0.75rem;
    color: var(--rv-promo-text-muted, #475569);
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    position: relative;
    line-height: 1.5;
}

.rv-promo-terms-list li::before {
    content: '•';
    color: var(--rv-promo-accent, #6366f1);
    position: absolute;
    left: 0;
    top: 0;
}

/* Footer */
.rv-promo-footer {
    background: var(--rv-promo-footer-bg, #f8fafc);
    border-top: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .rv-promo-footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

.rv-promo-footer-text {
    font-size: 0.75rem;
    color: #94a3b8;
    display: none;
}

@media (min-width: 640px) {
    .rv-promo-footer-text {
        display: block;
    }
}

.rv-promo-footer-btns {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

@media (min-width: 640px) {
    .rv-promo-footer-btns {
        width: auto;
    }
}

.rv-promo-later {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--rv-promo-text-muted, #475569);
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.2s;
}

.rv-promo-later:hover {
    background: #f8fafc;
}

.rv-promo-upload {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--rv-promo-upload-text, #fff);
    background: var(--rv-promo-upload-bg, #6366f1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.rv-promo-upload:hover {
    background: var(--rv-promo-upload-hover, #4f46e5);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

@media (min-width: 640px) {

    .rv-promo-later,
    .rv-promo-upload {
        flex: none;
    }
}

/* Header right buttons gap */
.rv-header-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}
.rv-header-right::-webkit-scrollbar {
    display: none;
}
.rv-header-right > * {
    flex-shrink: 0;
}

/* ============ Discount Button ============ */
.rv-btn-discount {
    background: transparent;
    color: var(--rv-disc-btn-color, #f59e0b);
    border: 1.5px solid var(--rv-disc-btn-color, #f59e0b);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.rv-btn-discount:hover {
    background: var(--rv-disc-btn-color, #f59e0b);
    color: #fff;
}

.rv-btn-discount svg {
    width: 18px;
    height: 18px;
}

/* ============ Discount Modal Extras ============ */
.rv-disc-header {
    background: var(--rv-disc-header-bg, linear-gradient(135deg, #6366f1, #9333ea, #d946ef));
}

.rv-disc-code-box {
    background: var(--rv-disc-code-bg, rgba(238, 242, 255, 0.5));
    border: 2px dashed var(--rv-disc-code-border, #c7d2fe);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.rv-disc-code-box:hover {
    border-color: var(--rv-promo-accent, #818cf8);
}

@media (min-width: 480px) {
    .rv-disc-code-box {
        flex-direction: row;
        justify-content: space-between;
    }
}

.rv-disc-code-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.875rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--rv-disc-code-color, #4338ca);
}

@media (min-width: 480px) {
    .rv-disc-code-text {
        font-size: 2.25rem;
    }
}

.rv-disc-copy-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--rv-promo-accent, #6366f1);
    background: #fff;
    border: 1px solid #e0e7ff;
    cursor: pointer;
    transition: all 0.2s;
}

.rv-disc-copy-btn:hover {
    background: var(--rv-promo-accent, #6366f1);
    color: #fff;
    border-color: var(--rv-promo-accent, #6366f1);
}

.rv-disc-copy-btn.rv-disc-copied {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.rv-disc-close {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: #fff !important;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.rv-disc-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.rv-disc-expire-note {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #f1f5f9;
    text-align: left;
}

/* ==================== 
   Linear Layout Mode 
   ==================== */
.rv-linear-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 20px 0;
}

.rv-linear-left {
    width: 250px;
    flex-shrink: 0;
}

.rv-linear-right {
    flex: 1;
    min-width: 0;
}

.rv-linear-score-box {
    margin-bottom: 24px;
}

.rv-linear-avg-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rv-linear-avg {
    color: var(--rv-star, #ffc107);
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
}

.rv-linear-stars-col {
    display: flex;
    flex-direction: column;
}

.rv-linear-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
    font-size: 16px;
}

.rv-linear-total {
    color: var(--rv-text, #fff);
    font-size: 14px;
    font-weight: 600;
}

.rv-linear-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.rv-linear-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--rv-text, #fff);
}

.rv-linear-bar-label {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.rv-linear-bar-track {
    flex: 1;
    height: 6px;
    background: var(--rv-card-border, #333);
    border-radius: 3px;
    overflow: hidden;
}

.rv-linear-bar-fill {
    height: 100%;
    background: var(--rv-star, #ffc107);
    border-radius: 3px;
}

.rv-linear-bar-count {
    width: 20px;
    text-align: right;
    color: var(--rv-text-secondary, #9ca3af);
}

.rv-linear-write-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--rv-card-border-hover, #444);
    color: var(--rv-text, #fff);
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.rv-linear-write-btn:hover {
    border-color: var(--rv-star, #ffc107);
}

.rv-linear-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--rv-card-border, #333);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.rv-linear-tabs {
    display: flex;
    gap: 24px;
}

.rv-linear-tab {
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: var(--rv-text-secondary, #9ca3af);
    transition: color 0.2s;
}

.rv-linear-tab.active,
.rv-linear-tab:hover {
    color: var(--rv-text, #fff);
}

.rv-linear-sort-select {
    background: var(--rv-bg, #000);
    border: 1px solid var(--rv-card-border, #333);
    color: var(--rv-text, #fff);
    padding: 8px 12px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    font-size: 14px;
    appearance: auto;
}

.rv-linear-sort-select option {
    background: var(--rv-card-bg, #111);
    color: var(--rv-text, #fff);
}

.rv-linear-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rv-linear-card {
    border: 1px solid var(--rv-card-border, #333);
    border-radius: 8px;
    padding: 24px;
    background: var(--rv-card-bg, transparent);
}

.rv-linear-card.rv-highlighted {
    border-color: var(--rv-highlight-border, #ec4899);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}

.rv-linear-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rv-linear-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.rv-linear-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    border: 1px solid var(--rv-card-border, #333);
    transition: opacity 0.2s;
}

.rv-linear-img:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .rv-linear-layout {
        flex-direction: column;
        gap: 32px;
    }

    .rv-linear-left {
        width: 100%;
    }

    .rv-linear-filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* ==================== 
   Floating Write Button 
   ==================== */
#rv-global-floating-write {
    position: fixed !important;
    bottom: 24px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 32px) !important;
    max-width: 400px !important;
    z-index: 999999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
    padding: 14px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 8px;
    opacity: 1;
}

#rv-global-floating-write:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.8) !important;
}

#rv-global-floating-write.rv-hidden {
    opacity: 0 !important;
    transform: translate(-50%, 100px) !important;
    pointer-events: none !important;
}