/**
 * 爱平小世界 - 分享海报样式
 * 小清新创意风格
 */

/* ========== 海报弹窗 ========== */
.poster-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.poster-modal.active {
    opacity: 1;
    visibility: visible;
}

.poster-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.poster-modal-content {
    position: relative;
    z-index: 1;
    max-width: 90%;
    max-height: 95vh;
    padding: 20px;
    animation: posterSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poster-container {
    max-height: none;
    overflow: visible;
}

@keyframes posterSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.poster-close-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.poster-close-btn:hover {
    color: #ff7a9e;
    background: white;
}

/* ========== 海报预览区 ========== */
.poster-preview {
    margin-bottom: 1rem;
    position: relative;
}

/* ========== 海报卡片 ========== */
.poster-card {
    width: 280px;
    margin: 0 auto;
    background: linear-gradient(180deg, #fff5f8 0%, #f0f8ff 50%, #fff0f5 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(255, 150, 180, 0.3);
    position: relative;
}

/* 顶部区域 */
.poster-header {
    padding: 0.8rem 1rem 0.6rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(126, 184, 218, 0.2));
    position: relative;
}

.poster-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.poster-stars span {
    font-size: 1rem;
    animation: starTwinkle 1.5s ease-in-out infinite;
}

.poster-stars span:nth-child(2) {
    font-size: 1.2rem;
    animation-delay: 0.3s;
}

.poster-stars span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.poster-title {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff7a9e, #7eb8da);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.15rem;
}

.poster-subtitle {
    font-size: 0.8rem;
    color: #8a9bab;
}

/* 中间内容 */
.poster-body {
    padding: 1rem 1rem 0.8rem;
    text-align: center;
}

.poster-avatar {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.6rem;
    background: linear-gradient(135deg, #ffb6c1, #98d8c8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 6px 20px rgba(255, 150, 180, 0.3);
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.poster-desc {
    font-size: 0.9rem;
    color: #5a6c7d;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.poster-tags {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.poster-tag {
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    font-size: 0.75rem;
    color: #ff7a9e;
    border: 1px solid rgba(255, 182, 193, 0.3);
}

/* 二维码区域 */
.poster-qr-section {
    padding: 0.6rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
}

.poster-qr-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto 0.3rem;
    background: white;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.poster-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #8a9bab;
    font-size: 0.8rem;
}

.qr-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 122, 158, 0.2);
    border-top-color: #ff7a9e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.poster-qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.poster-qr-hint {
    font-size: 0.75rem;
    color: #8a9bab;
}

/* 底部区域 */
.poster-footer {
    padding: 0.6rem 1rem;
    text-align: center;
    position: relative;
    background: linear-gradient(135deg, rgba(126, 184, 218, 0.2), rgba(152, 216, 200, 0.2));
}

.poster-wave {
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath fill='%23fff5f8' fill-opacity='0.5' d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,0 L0,0 Z'/%3E%3C/svg%3E") no-repeat;
    background-size: cover;
}

.poster-slogan {
    font-size: 0.8rem;
    color: #7eb8da;
    font-style: italic;
}

/* ========== 操作按钮 ========== */
.poster-actions {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

.poster-btn {
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
}

.poster-download-btn {
    background: linear-gradient(135deg, #ff7a9e, #ff8a80);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 122, 158, 0.3);
}

.poster-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 122, 158, 0.4);
}

.poster-copy-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #5a6c7d;
    border: 1px solid rgba(200, 200, 200, 0.5);
}

.poster-copy-btn:hover {
    background: white;
    border-color: #7eb8da;
}

/* ========== Toast提示 ========== */
.poster-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 10001;
    animation: toastIn 0.3s ease;
}

.poster-toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ========== 分享按钮样式 ========== */
.share-poster-btn {
    position: fixed;
    right: 20px;
    bottom: 180px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7a9e, #ffb6c1);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 122, 158, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-poster-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 122, 158, 0.5);
}

/* ========== 移动端适配 ========== */
@media (max-width: 480px) {
    .poster-modal-content {
        max-width: 95%;
    }
    
    .poster-card {
        width: 280px;
    }
    
    .poster-close-btn {
        top: -10px;
        right: -10px;
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .poster-title {
        font-size: 1.3rem;
    }
    
    .poster-avatar {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }
    
    .poster-qr-wrap {
        width: 100px;
        height: 100px;
    }
    
    .poster-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .poster-btn {
        width: 100%;
    }
    
    .share-poster-btn {
        right: 15px;
        bottom: 160px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}


/* ========== 页面定制样式 ========== */

/* 首页海报 */
.poster-card.poster-home {
    background: linear-gradient(180deg, #fff5f8 0%, #f0f8ff 50%, #fff0f5 100%);
}

.poster-card.poster-home .poster-header {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3), rgba(126, 184, 218, 0.2));
}

.poster-card.poster-home .poster-avatar {
    background: linear-gradient(135deg, #ffb6c1, #98d8c8);
}

/* 测试页海报 */
.poster-card.poster-test {
    background: linear-gradient(180deg, #fff0f5 0%, #ffeef8 50%, #f8f0ff 100%);
}

.poster-card.poster-test .poster-header {
    background: linear-gradient(135deg, rgba(255, 122, 158, 0.25), rgba(255, 182, 193, 0.2));
}

.poster-card.poster-test .poster-title {
    background: linear-gradient(135deg, #ff6b8a, #ff7a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.poster-card.poster-test .poster-avatar {
    background: linear-gradient(135deg, #ff7a9e, #ffb6c1);
    font-size: 3.5rem;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

.poster-card.poster-test .poster-tag {
    color: #ff6b8a;
    border-color: rgba(255, 107, 138, 0.3);
}

.poster-card.poster-test .poster-footer {
    background: linear-gradient(135deg, rgba(255, 122, 158, 0.15), rgba(255, 182, 193, 0.15));
}

.poster-card.poster-test .poster-slogan {
    color: #ff7a9e;
}


/* 结果页海报 */
.poster-card.poster-result {
    background: linear-gradient(180deg, #fff0f5 0%, #ffeef8 30%, #f8f0ff 70%, #fff5f8 100%);
}

.poster-card.poster-result .poster-header {
    background: linear-gradient(135deg, rgba(255, 122, 158, 0.2), rgba(255, 182, 193, 0.15));
}

.poster-card.poster-result .poster-title {
    background: linear-gradient(135deg, #ff6b8a, #ff7a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.poster-result-body {
    padding: 1.5rem 1rem !important;
}

.poster-score-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto 0.8rem;
    background: linear-gradient(135deg, #ff7a9e, #ffb6c1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(255, 122, 158, 0.4);
    animation: scorePulse 2s ease-in-out infinite;
}

@keyframes scorePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 30px rgba(255, 122, 158, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(255, 122, 158, 0.5); }
}

.poster-score-num {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.poster-score-percent {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 2px;
}

.poster-level {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ff7a9e;
    margin-bottom: 0.5rem;
}

.poster-result-hint {
    font-size: 0.9rem;
    color: #8a9bab;
}

.poster-card.poster-result .poster-footer {
    background: linear-gradient(135deg, rgba(255, 122, 158, 0.1), rgba(255, 182, 193, 0.1));
}

.poster-card.poster-result .poster-slogan {
    color: #ff7a9e;
}


/* 海报高亮动画 */
@keyframes posterHighlight {
    0%, 100% { box-shadow: 0 20px 60px rgba(255, 150, 180, 0.3); }
    50% { box-shadow: 0 0 0 4px #ff7a9e, 0 20px 60px rgba(255, 150, 180, 0.5); }
}

/* 确保关闭按钮可点击 - 定位在海报右上角 */
.poster-preview .poster-close-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 10001;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .poster-modal-content {
        max-height: 95vh;
        padding: 15px;
    }
    
    .poster-container {
        max-height: none;
        overflow: visible;
    }
    
    .poster-card {
        width: 260px;
    }
    
    .poster-preview .poster-close-btn {
        top: -10px;
        right: -10px;
        width: 32px;
        height: 32px;
    }
    
    .poster-actions {
        padding: 0 10px;
    }
    
    .poster-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}
