/**
 * 子比浏览记录插件 - 前台样式
 * 全部使用主题 CSS 变量，自动适配亮色 / 暗色模式（body.dark-theme）
 */

.zvh-box {
    margin-top: 15px;
}

.zvh-header {
    margin-bottom: 12px;
}

.zvh-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--key-color);
    gap: 6px;
}

.zvh-icon {
    flex-shrink: 0;
}

.zvh-count {
    font-size: 12px;
}

.zvh-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.zvh-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--main-radius, 8px);
    background: var(--muted-bg-color);
    transition: all 0.2s;
    min-width: 0;
}

.zvh-item:hover {
    background: var(--theme-color);
}

.zvh-item:hover .zvh-name,
.zvh-item:hover .zvh-time {
    color: #fff !important;
}

.zvh-item .zvh-avatar,
.zvh-item img.avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    flex-shrink: 0;
    object-fit: cover;
}

.zvh-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
    flex: 1;
}

.zvh-name {
    font-size: 13px;
    color: var(--main-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zvh-time {
    font-size: 12px;
    color: var(--muted-color);
    white-space: nowrap;
}

.zvh-more {
    margin-top: 10px;
    font-size: 12px;
}

/* ---- 浏览记录:更多按钮 ---- */

.zvh-more-btn {
    cursor: pointer;
    background: transparent;
    border: 1px dashed var(--muted-border-color, rgba(128, 128, 128, 0.35));
}

.zvh-more-btn .zvh-more-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6a8dff, #9b5cff);
}

.zvh-more-btn:hover {
    border-color: transparent;
}

.zvh-more-btn.zvh-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ---- 浏览记录:全部用户弹窗 ---- */

body.zvh-modal-open {
    overflow: hidden;
}

.zvh-viewers-mask {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.2s;
}

.zvh-viewers-mask.zvh-show {
    opacity: 1;
}

.zvh-viewers-modal {
    width: 620px;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: var(--main-bg-color, #fff);
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.2s;
}

.zvh-viewers-mask.zvh-show .zvh-viewers-modal {
    transform: none;
}

.zvh-vm-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--muted-border-color, rgba(128, 128, 128, 0.15));
}

.zvh-vm-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--key-color);
}

.zvh-vm-count {
    font-size: 12px;
    color: var(--muted-color);
}

.zvh-vm-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: var(--muted-color);
    background: var(--muted-bg-color);
    transition: all 0.2s;
}

.zvh-vm-close:hover {
    color: #fff;
    background: var(--theme-color);
}

.zvh-vm-body {
    padding: 16px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.zvh-vm-guest {
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted-color);
}

/* ---- 内容美化:下载卡片 ---- */

.zvh-dl-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 14px 16px;
    border-radius: var(--main-radius, 8px);
    background: var(--muted-bg-color);
    border: 1px solid var(--muted-border-color);
    line-height: 1.4;
}

.zvh-dl-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #6a8dff, #9b5cff);
    box-shadow: 0 4px 10px rgba(122, 108, 255, 0.35);
    color: #fff;
}

.zvh-dl-card.zvh-dl-warn .zvh-dl-ic {
    background: linear-gradient(135deg, #ff9a5a, #ff5a7e);
    box-shadow: 0 4px 10px rgba(255, 110, 110, 0.32);
}

.zvh-dl-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.zvh-dl-name {
    font-weight: 600;
    color: var(--key-color);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zvh-dl-meta {
    font-size: 12px;
    color: var(--muted-2-color);
}

.zvh-dl-card.zvh-dl-warn .zvh-dl-meta {
    color: #ff7043;
}

.zvh-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, #6a8dff, #9b5cff);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(122, 108, 255, 0.35);
    transition: all 0.25s;
    flex-shrink: 0;
}

.zvh-dl-card.zvh-dl-warn .zvh-dl-btn {
    background: linear-gradient(135deg, #ff9a5a, #ff5a7e);
    box-shadow: 0 3px 10px rgba(255, 110, 110, 0.32);
}

.zvh-dl-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* 积分解锁 / 登录按钮:琥珀金渐变 */
.zvh-dl-btn.zvh-lock-btn {
    background: linear-gradient(135deg, #f7b733, #f78e33);
    box-shadow: 0 3px 10px rgba(247, 158, 51, 0.4);
}

/* 警告提示框 */
.zvh-warn-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    padding: 12px 15px;
    border-radius: var(--main-radius, 8px);
    background: rgba(255, 112, 67, 0.08);
    border: 1px solid rgba(255, 112, 67, 0.25);
    color: #ff7043;
    font-size: 14px;
    line-height: 1.6;
}

.zvh-warn-box svg {
    flex-shrink: 0;
    margin-top: 3px;
}

/* 【标签】徽章与提示条 */
.zvh-pill {
    display: inline-block;
    padding: 4px 15px;
    margin: 0 4px;
    border-radius: 50px;
    background: linear-gradient(135deg, #6a8dff, #9b5cff);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.7;
    vertical-align: middle;
}

.zvh-tip-box {
    margin: 12px 0;
    padding: 12px 15px;
    border-radius: var(--main-radius, 8px);
    background: var(--muted-bg-color);
    color: var(--muted-color);
    font-size: 14px;
    line-height: 2.1;
}

/* 卡密领取卡片 */
.zvh-key-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 14px 16px;
    border-radius: var(--main-radius, 8px);
    background: linear-gradient(135deg, rgba(255, 154, 90, 0.09), rgba(255, 90, 126, 0.09));
    border: 1px solid rgba(255, 122, 90, 0.28);
    line-height: 1.4;
}

.zvh-key-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #ffb35a, #ff5a7e);
    box-shadow: 0 4px 10px rgba(255, 122, 122, 0.35);
    color: #fff;
}

.zvh-key-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.zvh-key-title {
    font-weight: 600;
    color: var(--key-color);
    font-size: 15px;
}

.zvh-key-meta {
    font-size: 12.5px;
    color: #ff7043;
}

.zvh-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 50px;
    background: linear-gradient(135deg, #ffb35a, #ff5a7e);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(255, 90, 126, 0.35);
    transition: all 0.25s;
    flex-shrink: 0;
}

.zvh-key-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* 积分支付确认弹窗 */
.zvh-pay-modal .zvh-pm-dialog {
    max-width: 340px;
    margin: 15vh auto;
}

.zvh-pm-content {
    border: none;
    border-radius: 18px;
    background: var(--main-bg-color, #fff);
    overflow: hidden;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.18);
}

.zvh-pm-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 26px 20px 8px;
}

.zvh-pm-head svg {
    width: 56px;
    height: 56px;
    padding: 13px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffb35a, #ff5a7e);
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 90, 126, 0.35);
    box-sizing: border-box;
}

.zvh-pm-title {
    margin-top: 12px;
    font-size: 17px;
    font-weight: 600;
    color: var(--key-color, #333);
}

.zvh-pm-body {
    padding: 12px 24px 4px;
    text-align: center;
}

.zvh-pm-price {
    font-size: 15px;
    color: var(--main-color, #444);
    margin-bottom: 8px;
}

.zvh-pm-points {
    color: #ff5a7e;
    font-size: 24px;
    margin: 0 4px;
}

.zvh-pm-line {
    font-size: 12.5px;
    color: var(--muted-2-color, #999);
    line-height: 1.9;
}

.zvh-pm-warn {
    color: #ff4d4f !important;
    font-weight: 600;
}

.zvh-pm-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px 22px;
}

.zvh-pm-cancel,
.zvh-pm-confirm {
    flex: 1;
    padding: 10px 0;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.zvh-pm-cancel {
    background: var(--muted-bg-color, #f5f5f5);
    color: var(--muted-color, #888);
}

.zvh-pm-cancel:hover {
    opacity: 0.8;
}

.zvh-pm-confirm {
    background: linear-gradient(135deg, #f7b733, #f78e33);
    color: #fff;
    box-shadow: 0 3px 10px rgba(247, 158, 51, 0.4);
}

.zvh-pm-confirm:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
}

.zvh-pm-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

a.zvh-pm-download {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #fff !important;
    background: linear-gradient(135deg, #4cd97b, #2bb673);
    box-shadow: 0 3px 10px rgba(43, 182, 115, 0.4);
}

/* 移动端:卡片纵向自适应 */
@media (max-width: 560px) {
    .zvh-dl-card,
    .zvh-key-card {
        flex-wrap: wrap;
    }

    .zvh-dl-btn,
    .zvh-key-btn {
        margin-left: auto;
    }

    .zvh-pay-modal .zvh-pm-dialog {
        max-width: 92%;
        margin: 20vh auto;
    }
}

/* ---- 顶部横幅 ---- */

.zvh-top-banner {
    max-width: var(--mian-max-width, 1220px);
    margin: 16px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.zvh-banner-inner {
    display: block;
    overflow: hidden;
    border-radius: var(--main-radius, 8px);
    line-height: 0;
}

.zvh-top-banner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--main-radius, 8px);
    transition: transform 0.45s ease;
}

.zvh-top-banner:hover img {
    transform: scale(1.05);
}

/* 移动端适配 */
@media (max-width: 767px) {
    .zvh-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }

    .zvh-top-banner {
        margin: 8px auto 10px;
        padding: 0 10px;
    }

    .zvh-hide-mobile {
        display: none !important;
    }
}
