/* ============================================================
   首页弹窗 · 完整样式（高度调大版）
   ============================================================ */

/* ---------- 遮罩 ---------- */
.home-popup-mask{
    position:fixed; inset:0; z-index:9998;
    background:rgba(15,15,20,.45);
    -webkit-backdrop-filter:blur(6px);
    backdrop-filter:blur(6px);
    opacity:0; visibility:hidden;
    transition:opacity .3s ease, visibility .3s ease;
}
.home-popup-mask.show{ opacity:1; visibility:visible; }

/* ---------- 主弹窗 ---------- */
.home-popup{
    position:fixed; top:50%; left:50%; z-index:9999;
    width:720px;
    max-width:calc(100vw - 32px);
    max-height:calc(100vh - 24px);
    background:#fff; border-radius:18px; overflow:hidden;
    box-shadow:0 2px 8px rgba(0,0,0,.04), 0 24px 80px rgba(0,0,0,.18);
    opacity:0; visibility:hidden;
    transform:translate(-50%, calc(-50% + 12px)) scale(.96);
    transition:
            transform .5s cubic-bezier(.16,1,.3,1),
            opacity .35s ease,
            visibility .35s ease,
            height .38s cubic-bezier(.16,1,.3,1);
}
.home-popup.show{
    opacity:1; visibility:visible;
    transform:translate(-50%,-50%) scale(1);
}
.home-popup.collapsing{
    opacity:0;
    transform:translate(-50%, calc(-50% + 10px)) scale(.9);
    transition:transform .26s ease, opacity .22s ease, visibility .22s ease;
}

/* ---------- 关闭按钮 ---------- */
.popup-close{
    position:absolute; top:14px; right:14px; z-index:3;
    width:32px; height:32px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:20px; line-height:1; color:#86868b; background:#f5f5f7;
    cursor:pointer;
    transition:background .2s, color .2s, transform .25s;
}
.popup-close:hover{ background:#1d1d1f; color:#fff; transform:rotate(90deg); }

/* ---------- 内容容器 ---------- */
.popup-body{
    position:relative;
    padding:36px 36px 32px;
    overflow:hidden;
    min-height:320px;
}

/* ---------- 两个视图 ---------- */
.popup-view{
    opacity:0; visibility:hidden;
    transform:translateX(24px);
    transition:
            opacity .3s ease,
            transform .4s cubic-bezier(.16,1,.3,1),
            visibility .3s ease;
}
.popup-view.active{
    position:relative;
    opacity:1; visibility:visible;
    transform:translateX(0);
}
.popup-view:not(.active){
    position:absolute; top:36px; left:36px; right:36px;
}
.popup-view.leaving       { transform:translateX(-24px); opacity:0; }
.popup-view.leaving-right { transform:translateX(24px);  opacity:0; }

/* ---------- Update 标签 ---------- */
.popup-tag{
    display:inline-block; padding:3px 10px; margin-bottom:12px;
    font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase;
    color:#e60012; background:rgba(230,0,18,.08); border-radius:20px;
}

/* ---------- 标题 ---------- */
.popup-title{
    margin:0 0 12px;
    font-size:22px;
    font-weight:700; color:#1d1d1f;
    letter-spacing:-.2px; line-height:1.4;
    padding-right:28px;
}

/* ============================================================
   内容区：原样渲染 + 高度调大
   ============================================================ */

/* 摘要 */
.popup-summary{
    margin:0 0 28px;
    max-height:60vh;
    overflow-y:auto;
}

/* 详情 */
.popup-detail-content{
    margin:0 0 28px;
    max-height:68vh;
    overflow-y:auto;
}

/* 图片/表格兜底 */
.popup-summary img,
.popup-detail-content img{
    max-width:100%;
    height:auto;
    border-radius:8px;
}
.popup-summary table,
.popup-detail-content table{
    max-width:100%;
}

/* ---------- 按钮区 ---------- */
.popup-actions{ display:flex; gap:10px; }
.popup-btn{
    display:inline-flex; align-items:center; justify-content:center;
    height:44px; padding:0 20px; border-radius:10px;
    font-size:14px; font-weight:600; text-decoration:none;
    transition:transform .2s, background .2s, box-shadow .2s, color .2s, border-color .2s;
}
.popup-btn:hover{ transform:translateY(-1px); }

.popup-btn-primary{
    flex:1;
    background:#1d1d1f; color:#fff;
    box-shadow:0 4px 14px rgba(0,0,0,.15);
}
.popup-btn-primary:hover{ background:#000; }

.popup-btn-plain{
    flex:0 0 auto;
    background:transparent; color:#6e6e73;
    border:1px solid #d2d2d7;
}
.popup-btn-plain:hover{
    background:#f5f5f7; color:#1d1d1f; border-color:#b8b8bd;
}

/* ---------- 收起小图标 ---------- */
.home-popup-mini{
    position:fixed; right:28px; bottom:28px; z-index:9997;
    width:58px; height:58px; border-radius:50%;
    background:#e60012; color:#fff;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
    box-shadow:0 8px 24px rgba(230,0,18,.35);
    opacity:1;
    transform:scale(1);
    transition:transform .4s cubic-bezier(.34,1.56,.64,1) .1s, opacity .25s ease .1s;
}
.home-popup-mini.show{ opacity:1; transform:scale(1); }

.home-popup-mini::before{
    content:''; position:absolute; inset:0; border-radius:50%;
    border:2px solid rgba(230,0,18,.5);
    animation:miniPulse 2s ease-out infinite; pointer-events:none;
}
@keyframes miniPulse{
    0%   { transform:scale(1);   opacity:.8; }
    100% { transform:scale(1.7); opacity:0;  }
}

.mini-badge{
    position:absolute; top:-2px; right:-2px; min-width:18px; height:18px; padding:0 5px;
    border-radius:9px; background:#ffd400; color:#1d1d1f;
    font-size:11px; font-weight:700; line-height:18px; text-align:center;
    box-shadow:0 0 0 2px #fff;
}

.home-popup-mini .mini-icon{
    width:24px; height:24px;
    display:block; color:#fff;
    pointer-events:none;
}

/* ============================================================
   手机端 · 两个弹窗（摘要 + 详情）文字样式完全统一
   ============================================================ */
@media (max-width:680px){

    /* ---- 标题（两个视图共用） ---- */
    .popup-view-summary .popup-title,
    .popup-view-detail  .popup-title{
        font-size:clamp(16px, 4.6vw, 20px);
        line-height:1.35;
        margin:0 0 10px;
        padding-right:26px;
        display:-webkit-box;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
        overflow:hidden;
    }

    /* ---- 标签（两个视图共用） ---- */
    .popup-view-summary .popup-tag,
    .popup-view-detail  .popup-tag{
        font-size:10px;
        padding:2px 8px;
        margin-bottom:8px;
    }

    /* ---- 内容区整体基准字号（两个视图共用） ---- */
    .popup-summary,
    .popup-detail-content{
        font-size:clamp(13px, 3.6vw, 15px);
        line-height:1.6;
        word-break:break-word;
        overflow-wrap:anywhere;
    }

    /* ---- 段落 / 列表 / 行内元素：继承基准（两个视图共用） ---- */
    .popup-summary p,
    .popup-summary li,
    .popup-summary span,
    .popup-summary strong,
    .popup-summary em,
    .popup-summary a,
    .popup-summary div,
    .popup-summary blockquote,
    .popup-detail-content p,
    .popup-detail-content li,
    .popup-detail-content span,
    .popup-detail-content strong,
    .popup-detail-content em,
    .popup-detail-content a,
    .popup-detail-content div,
    .popup-detail-content blockquote{
        font-size:inherit;
        line-height:inherit;
    }
    .popup-summary p,
    .popup-detail-content p{ margin:.5em 0; }
    .popup-summary ul, .popup-summary ol,
    .popup-detail-content ul, .popup-detail-content ol{
        padding-left:1.2em;
        margin:.5em 0;
    }

    /* ---- 标题层级：两个视图统一（h1~h6 同字号） ---- */
    .popup-summary h1, .popup-summary h2, .popup-summary h3,
    .popup-summary h4, .popup-summary h5, .popup-summary h6,
    .popup-detail-content h1, .popup-detail-content h2, .popup-detail-content h3,
    .popup-detail-content h4, .popup-detail-content h5, .popup-detail-content h6{
        font-size:clamp(14px, 4vw, 17px);
        line-height:1.4;
        margin:.6em 0 .4em;
    }

    /* ---- 图片（两个视图共用） ---- */
    .popup-summary img,
    .popup-detail-content img{
        max-width:100%;
        height:auto;
        border-radius:8px;
    }

    /* ---- 表格：单元格字号统一 + 横向滚动（两个视图共用） ---- */
    .popup-summary table,
    .popup-detail-content table{
        display:block;
        width:100%;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
    }
    .popup-summary td, .popup-summary th,
    .popup-detail-content td, .popup-detail-content th{
        font-size:clamp(12px, 3.2vw, 14px);
        line-height:1.5;
    }

    /* ---- 富文本残留隐藏节点（两个视图共用） ---- */
    .popup-summary style,
    .popup-summary script,
    .popup-detail-content style,
    .popup-detail-content script{ display:none !important; }
    .popup-summary p:empty,
    .popup-detail-content p:empty{ display:none; }
}
/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce){
    .home-popup,
    .home-popup-mask,
    .home-popup-mini,
    .popup-view,
    .popup-close{
        transition-duration:.01ms !important;
        animation:none !important;
    }
}
