/**
 * Customize Pro - Social Share Styles
 */

.cp-social-share {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #eee;
    --cp-social-theme: #0066cc;
}

.cp-social-share.cp-social-position-left {
    position: fixed;
    left: 24px;
    top: 45%;
    z-index: 999;
    margin: 0;
    padding: 0;
    border: 0;
}

.cp-social-share.cp-social-position-left .cp-social-buttons {
    flex-direction: column;
    align-items: stretch;
}

.cp-social-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cp-social-buttons button,
.cp-social-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 18px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 50px;
    text-decoration: none;
    color: #444;
    transition: all .25s ease;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: .3px;
    /* 立体阴影：上方浅色 + 下方深色 */
    box-shadow:
        0 2px 0 0 rgba(0,0,0,0.04),
        0 3px 8px rgba(0,0,0,0.08),
        0 5px 14px rgba(0,0,0,0.06);
}

.cp-social-buttons button:hover,
.cp-social-buttons a:hover {
    border-color: var(--cp-social-theme);
    color: var(--cp-social-theme);
    transform: translateY(-2px);
    box-shadow:
        0 4px 0 0 rgba(0,0,0,0.04),
        0 7px 16px rgba(0,0,0,0.12),
        0 10px 24px rgba(0,0,0,0.08);
}

.cp-social-buttons button:active,
.cp-social-buttons a:active {
    transform: translateY(1px);
    box-shadow:
        0 1px 0 0 rgba(0,0,0,0.04),
        0 2px 5px rgba(0,0,0,0.08);
}

/* 各按钮独立配色 */
.cp-social-buttons .j-cp-donate-btn:hover {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-color: transparent;
    color: #fff;
}

.cp-social-buttons .j-cp-like-btn:hover,
.cp-social-buttons .j-cp-like-btn.active {
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    border-color: transparent;
    color: #fff;
}

.cp-social-buttons .j-cp-poster-btn:hover {
    background: var(--cp-social-theme);
    border-color: transparent;
    color: #fff;
}

.cp-social-buttons .j-cp-share-btn:hover {
    background: var(--cp-social-theme);
    border-color: transparent;
    color: #fff;
}

/* 点赞已激活状态 */
.cp-social-buttons .j-cp-like-btn.active {
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    border-color: transparent;
    color: #fff;
}

.cp-btn-icon {
    font-size: 16px;
}

/* Modal Styles */
.cp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-modal {
    background: #ffffff;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    width: 620px;
}

.cp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.cp-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.cp-modal-close:hover {
    color: #333;
}

.cp-modal-content {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.cp-poster-container {
    text-align: center;
}

.cp-poster-container canvas {
    max-width: 100%;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cp-poster-download {
    display: block;
    margin: 20px auto 0;
    padding: 12px 30px;
    background: #0066cc;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.cp-poster-download:hover {
    background: #0055aa;
}

.cp-donate-content {
    text-align: center;
    padding: 20px;
}

.cp-donate-content p {
    margin: 0 0 20px;
    color: #666;
}

.cp-donate-content .cp-donate-msg {
    font-size: 15px;
    margin-bottom: 16px;
}

.cp-donate-qrs {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 10px 0;
}

.cp-donate-qr-item,
.cp-donate-qr-single {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cp-donate-qr-item img,
.cp-donate-qr-single img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 8px;
}

.cp-donate-qr-item span,
.cp-donate-qr-single span {
    font-size: 13px;
    color: #999;
}

/* =================================================================
 * 分享弹窗卡片样式
 * ================================================================= */
.cp-share-card {
    padding: 0;
}

.cp-share-cover {
    width: 100%;
    overflow: hidden;
}

.cp-share-cover img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.cp-share-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 14px 18px 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-share-desc {
    font-size: 13px;
    color: #666;
    margin: 0 18px 10px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-share-site {
    font-size: 12px;
    color: #aaa;
    margin: 0 18px 12px;
}

.cp-share-way-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 18px 16px;
}

.cp-share-way {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    color: #333;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.cp-share-way:hover {
    border-color: var(--cp-social-theme);
    color: var(--cp-social-theme);
}

.cp-share-url-bar {
    display: flex;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
}

.cp-share-url-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 13px;
    color: #333;
    outline: none;
    min-width: 0;
    text-overflow: ellipsis;
}

.cp-share-copy-btn {
    flex-shrink: 0;
    border: none;
    background: #0066cc;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 0 0 6px 0;
    transition: all .2s;
    white-space: nowrap;
    margin: 4px 0;
}

.cp-share-copy-btn:hover {
    background: #0055aa;
}

.cp-share-copy-btn.copied {
    background: #22a855;
}

/* =================================================================
 * 点赞 Toast 提示（靠近按钮弹出）
 * ================================================================= */
.cp-like-toast {
    position: fixed;
    z-index: 10001;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.cp-like-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.cp-like-toast.cp-toast-success {
    background: linear-gradient(135deg, #ff4757, #e84118);
}

.cp-like-toast.cp-toast-error {
    background: linear-gradient(135deg, #555, #333);
}

body.cp-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 640px) {
    .cp-social-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cp-social-share.cp-social-position-left {
        position: static;
        margin-top: 40px;
        padding-top: 40px;
        border-top: 1px solid #eee;
    }

    .cp-social-share.cp-social-mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        margin: 0;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid #eee;
        background: #fff;
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
    }

    .cp-social-buttons button,
    .cp-social-buttons a {
        flex: 1;
        min-width: calc(50% - 5px);
        justify-content: center;
        padding: 7px 12px;
        font-size: 13px;
    }

    .cp-modal {
        width: 95%;
        margin: 10px;
    }

    /* 海报弹窗移动端适配 */
    .cp-poster-modal {
        width: 95vw !important;
        max-width: 320px !important;
    }

    .cp-poster-modal .mobile-share-wrap {
        width: 100% !important;
    }
}

/* =================================================================
 * 微海报弹窗专用样式（移植自 MagicPost）
 * ================================================================= */

.cp-poster-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,.15);
    display: inline-block !important;
    position: relative;
    vertical-align: middle;
    pointer-events: auto;
    width: 360px;
}

.cp-poster-modal .cp-poster-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    background: rgba(0,0,0,.25);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    border: none;
    transition: background .2s;
}

.cp-poster-modal .cp-poster-close:hover {
    background: rgba(0,0,0,.45);
}

.cp-poster-modal .cp-poster-body {
    padding: 0;
    overflow: hidden;
    border-radius: 6px;
}

.cp-poster-modal .mobile-share-wrap {
    width: 360px;
    overflow: hidden;
}

@media (max-width: 400px) {
    .cp-poster-modal .mobile-share-wrap {
        width: 100%;
    }
}

.cp-poster-modal .mobile-share-wrap img {
    display: block;
    width: 100% !important;
    height: auto !important;
    border-radius: 6px 6px 0 0;
}

.cp-poster-modal .poster-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 460px;
    color: #999;
    font-size: 14px;
    text-align: center;
}

.cp-poster-modal .poster-share-tips {
    color: #999;
    font-size: 12px;
    line-height: 28px;
    text-align: center;
    border-top: 1px solid #eee;
    padding: 8px 16px;
    margin: 0;
}
