/* =========================================================================
 * 分享海报组件通用样式 (Share Poster Component)
 * ========================================================================= */

/* 海报弹窗遮罩层 */
#xb-poster-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* 生成后的海报图片 */
#xb-poster-preview {
    max-width: 85%;
    max-height: 75vh;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(var(--primary-color-rgb), 0.2);
    margin-bottom: 20px;
    user-select: none;
    -webkit-user-drag: none;
}

/* 关闭按钮 */
.xb-close-poster {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    z-index: 10000;
}

/* 工具类按钮加载动画 (用于工具页面) */
.btn-share-poster.poster-generating {
    opacity: 0.8;
    cursor: wait;
    animation: xbPulse 1s infinite;
}

/* =========================================================================
 * 底层隐藏的海报渲染模板 (用于 html2canvas 截取)
 * ========================================================================= */
#xb-poster-template {
    position: fixed;
    left: -9999px; /* 移出屏幕外 */
    top: 0;
    width: 375px; /* 固定宽度，确保所有移动端渲染比例一致 */
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 100%); /* 深邃星辰夜空主题 */
    color: white;
    padding: 30px;
    border-radius: 20px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
    border: 1px solid rgba(var(--primary-color-rgb), 0.3); /* 天青色玻璃边框 */
    box-shadow: inset 0 0 20px rgba(var(--primary-color-rgb), 0.1);
}

/* --- 工具测试结果卡片 (type: tool) --- */
#xb-poster-template.layout-tool .poster-header { text-align: center; margin-bottom: 20px; }
#xb-poster-template.layout-tool .poster-title { 
    font-size: 24px; font-weight: bold; margin-bottom: 5px; color: var(--primary-color); text-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.3); 
}
#xb-poster-template.layout-tool .poster-score-box {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.08);
}
#xb-poster-template.layout-tool #poster-score { font-size: 56px; font-weight: 800; margin-bottom: 10px; color: #fff; line-height: 1; }
#xb-poster-template.layout-tool #poster-level { font-size: 22px; font-weight: bold; }
#xb-poster-template.layout-tool #poster-desc { 
    font-size: 14px; opacity: 0.8; line-height: 1.7; text-align: justify; 
    background: rgba(0,0,0,0.2); padding: 15px; border-radius: 12px; 
}

/* --- 文章分享卡片 (type: article) --- */
#xb-poster-template.layout-article {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
}
#xb-poster-template.layout-article .article-cover-container {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #0f172a;
}
#xb-poster-template.layout-article #poster-article-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#xb-poster-template.layout-article .poster-title {
    font-size: 22px; font-weight: bold; margin-bottom: 15px; color: #f8fafc; line-height: 1.4; text-shadow: none;
}
#xb-poster-template.layout-article #poster-desc {
    font-size: 14px; color: #94a3b8; line-height: 1.7; text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 公共底部区域 --- */
#xb-poster-template .poster-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}
#xb-poster-template .poster-qr-container { 
    display: flex;
    align-items: center;
    justify-content: center;
    background: white; 
    padding: 5px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
#xb-poster-template .poster-qr-container canvas { display: block; }
#xb-poster-template .poster-brand { font-size: 16px; font-weight: bold; color: var(--primary-color); }
#xb-poster-template .poster-slogan { font-size: 12px; opacity: 0.6; margin-top: 5px; color: #e2e8f0; }
