/**
 * 分享赚钱系统样式
 * 飞创学术 - 分享海报生成与分享功能
 */

/* ===== 分享弹窗 ===== */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal.active {
    opacity: 1;
    visibility: visible;
}

.share-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-modal.active .share-modal-content {
    transform: scale(1) translateY(0);
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.share-modal-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.share-modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* ===== 海报模板选择 ===== */
.poster-templates {
    margin-bottom: 24px;
}

.poster-templates-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poster-templates-title i {
    color: #667eea;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.template-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    aspect-ratio: 3/4;
    background: #f7fafc;
}

.template-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.template-item.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-item .template-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 11px;
    text-align: center;
    font-weight: 500;
}

.template-item.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ===== 海报预览区 ===== */
.poster-preview-section {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.poster-preview-container {
    background: #f7fafc;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poster-canvas-wrapper {
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

#sharePosterCanvas {
    display: block;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.poster-hint {
    font-size: 12px;
    color: #718096;
    text-align: center;
}

/* ===== 推广信息 ===== */
.share-info-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-info-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.share-info-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-info-card h4 i {
    color: #667eea;
}

.promo-code-box {
    display: flex;
    gap: 8px;
}

.promo-code-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    background: white;
    color: #2d3748;
}

.btn-copy-code {
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy-code:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.promo-link-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-link-input {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    color: #4a5568;
}

/* ===== 分享按钮组 ===== */
.share-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.btn-share-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-share-action i {
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-share-action.wechat i {
    background: #e8f5e9;
    color: #07c160;
}

.btn-share-action.wechat:hover {
    border-color: #07c160;
}

.btn-share-action.qq i {
    background: #e3f2fd;
    color: #12b7f5;
}

.btn-share-action.qq:hover {
    border-color: #12b7f5;
}

.btn-share-action.download i {
    background: #fff3e0;
    color: #ff9800;
}

.btn-share-action.download:hover {
    border-color: #ff9800;
}

.btn-share-action span {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
}

/* ===== 二维码弹窗 ===== */
.qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qrcode-modal.active {
    opacity: 1;
    visibility: visible;
}

.qrcode-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.qrcode-modal.active .qrcode-content {
    transform: scale(1);
}

.qrcode-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.qrcode-content p {
    font-size: 13px;
    color: #718096;
    margin-bottom: 20px;
}

#qrcodeCanvas {
    margin: 0 auto 20px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qrcode-tip {
    font-size: 12px;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .poster-preview-section {
        grid-template-columns: 1fr;
    }
    
    .poster-preview-container {
        order: -1;
    }
    
    #sharePosterCanvas {
        max-width: 200px;
    }
    
    .share-actions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .share-modal-body {
        padding: 16px;
    }
    
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .share-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-share-action {
        flex-direction: row;
        justify-content: center;
        padding: 12px;
    }
}
