/* =====================================================================
   static/css/pic_viewer.css
   通用图片查看器样式（配合 pic_viewer.js 使用）
   结构：.pic-viewer > .pv-body > .pv-button-group / .pv-prev-record / .pv-content
   颜色：继承 index.css 的 --theme-color / --theme-color-light / --theme-color-soft
   ===================================================================== */

/* ============ 1. 根容器 ============ */
.pic-viewer {
    overflow: hidden;
    margin-bottom: 12px;
}

/* ============ 2. 主体 ============ */
.pic-viewer .pv-body {
    padding: 10px 12px 14px;
}

/* ============ 3. 按钮组 ============ */
.pic-viewer .pv-button-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.6rem;
    margin-bottom: 12px;
}
@media (max-width: 999px) {
    .pic-viewer .pv-button-group {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============ 4. 按钮 ============ */
.pic-viewer .pv-btn {
    padding: 0.7rem 0.4rem;
    cursor: pointer;
    background-color: var(--theme-color, #d9b877);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
}
.pic-viewer .pv-btn:hover {
    background-color: var(--theme-color-soft, #eadfc0);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.pic-viewer .pv-btn:active {
    transform: translateY(0);
}
.pic-viewer .pv-btn.is-active {
    background-color: #006400;
    color: #fff;
}

/* ============ 5. 内容显示区 ============ */
.pic-viewer .pv-content {
    margin-top: 6px;
    padding: 4px 0;
    border-radius: 8px;
    min-height: 1px;
    line-height: 1.6;
    text-align: center;
    animation: pvFadeIn 0.4s ease-out;
}
.pic-viewer .pv-content img {
    max-width: 1000px;
    width: 100%;
    height: auto;
    margin: 0.1rem auto 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: block;
    cursor: zoom-in;
}
.pic-viewer .pv-content .pv-empty {
    color: #999;
    font-size: 14px;
    padding: 20px 0;
}

/* ============ 6. 上一期开奖记录 ============ */
.pic-viewer .pv-prev-record {
    margin: 8px 0 12px;
    text-align: center;
}
.pic-viewer .pv-prev-box {
    background: linear-gradient(135deg,
        var(--theme-color, #d9b877) 0%,
        var(--theme-color-soft, #eadfc0) 100%);
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
}
.pic-viewer .pv-prev-box strong {
    font-size: 16px;
    display: block;
    margin-bottom: 6px;
}
.pic-viewer .pv-prev-box a {
    color: #fff;
    text-decoration: underline;
    font-weight: 700;
}

/* ============ 7. 号码圆圈 ============ */
.pic-viewer .pv-numbers {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pic-viewer .pv-num {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    color: #fff !important;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.pic-viewer .pv-num.is-special {
    background-color: #FFD700 !important;
    color: #000 !important;
}
.pic-viewer .pv-special-mark {
    margin: 0 8px;
    font-weight: bold;
    color: #FFD700;
    font-size: 16px;
    line-height: 30px;
}

/* ============ 8. 图片放大模态框 ============ */

/* 遮罩层 */
body > .pv-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 60px 16px 16px;   /* 顶部留出信息条的空间 */
    box-sizing: border-box;
}
body > .pv-modal.is-open {
    display: flex;
}

/* 大图 */
.pv-modal .pv-modal-img {
    max-width: 95vw;
    max-height: calc(100vh - 100px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    background: #fff;
    animation: pvZoom 0.3s ease-out;
}

/* 顶部“上期是第 XX 期”信息条 */
.pv-modal .pv-modal-prev {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 92vw;
    padding: 8px 16px;

    /* ✅ 主题色渐变背景 */
    background: linear-gradient(135deg,
        var(--theme-color, #d9b877) 0%,
        var(--theme-color-soft, #eadfc0) 100%);

    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 10px;
    text-align: center;

    /* 阴影也跟着主题色柔一点 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);

    /* 可选：加个细边框，让信息条和深色遮罩更分明 */
    border: 1px solid var(--theme-color-light, #f7e8b5);

    z-index: 10001;
    pointer-events: none;
}

/* 顶部信息条里的号码圆圈：稍微放大、加间距 */
.pv-modal .pv-modal-prev .pv-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.pv-modal .pv-modal-prev .pv-num {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #fff !important;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.pv-modal .pv-modal-prev .pv-num.is-special {
    background: #FFD700 !important;
    color: #000 !important;
}
.pv-modal .pv-modal-prev .pv-special-mark {
    color: #FFD700;
    font-size: 14px;
    margin: 0 4px;
    line-height: 26px;
}

/* 关闭按钮 × */
.pv-modal .pv-modal-close {
    position: fixed;
    top: 10px;
    right: 16px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10002;
    user-select: none;
}
.pv-modal .pv-modal-close:hover {
    background: #e53935;
    transform: rotate(90deg);
}

/* ============ 9. 动画 ============ */
@keyframes pvFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pvZoom {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ============ 10. 移动端 ============ */
@media (max-width: 768px) {
    .pic-viewer .pv-body { padding: 8px 8px 12px; }

    .pic-viewer .pv-button-group {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }

    .pic-viewer .pv-btn {
        font-size: 13px;
        padding: 0.6rem 0.3rem;
    }

    .pic-viewer .pv-num {
        width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 12px;
    }

    .pic-viewer .pv-prev-box {
        padding: 8px 10px;
    }
    .pic-viewer .pv-prev-box strong { font-size: 14px; }

    .pv-modal .pv-modal-prev { font-size: 13px; padding: 6px 10px; }
}

/* ============ 10b. 小屏手机 ============ */
@media (max-width: 480px) {
    .pic-viewer .pv-body { padding: 6px 6px 10px; }

    /* 小屏 5 列挤，改成 4 列 */
    .pic-viewer .pv-button-group {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.35rem;
        margin-bottom: 8px;
    }

    .pic-viewer .pv-btn {
        font-size: 12px;
        padding: 0.5rem 0.2rem;
        border-radius: 6px;
    }

    .pic-viewer .pv-content img {
        border-radius: 6px;
    }

    .pic-viewer .pv-prev-record { margin: 6px 0 8px; }
    .pic-viewer .pv-prev-box {
        padding: 6px 8px;
        border-radius: 8px;
    }
    .pic-viewer .pv-prev-box strong { font-size: 13px; margin-bottom: 4px; }

    .pic-viewer .pv-num {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 11px;
        margin: 1px;
    }
    .pic-viewer .pv-special-mark {
        font-size: 13px;
        margin: 0 4px;
        line-height: 22px;
    }

    .pv-modal .pv-modal-close { font-size: 32px; top: 12px; right: 18px; }
    .pv-modal .pv-modal-prev { font-size: 12px; padding: 4px 8px; }


    /* ---------- 图片弹窗信息条 ---------- */
    .pv-modal .pv-modal-prev {
        top: 8px;
        padding: 4px 10px;
        max-width: 96vw;
        font-size: 12px;
        line-height: 1.4;
        border-radius: 8px;
    }
    .pv-modal .pv-modal-prev strong {
        font-size: 12px;
    }

    /* 号码圆圈：更小、更紧凑 */
    .pv-modal .pv-modal-prev .pv-numbers {
        gap: 3px;
        margin-top: 3px;
        flex-wrap: nowrap;       /* 禁止换行，强制一行显示 */
    }
    .pv-modal .pv-modal-prev .pv-num {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 11px;
        border-width: 1px;
        margin: 0;
    }
    .pv-modal .pv-modal-prev .pv-special-mark {
        font-size: 11px;
        margin: 0 2px;
        line-height: 20px;
    }

    /* 关闭按钮：小一点、离边近一点 */
    .pv-modal .pv-modal-close {
        top: 6px;
        right: 8px;
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 24px;
    }

    /* 大图：给顶部信息条让出位置 */
    .pv-modal .pv-modal-img {
        max-width: 96vw;
        max-height: calc(100vh - 90px);   /* 顶部留出信息条高度 */
    }
}
}
