/**
 * 社交分享卡片样式
 * 版本：2.0
 * 更新日期：2025-11-22
 */

/* ========== CSS 变量（如果主样式文件没有定义） ========== */
:root {
    --color-gold: #D4AF37;
    --color-black: #0A0A0A;
    --color-white: #FFFFFF;
    --color-dark-gray: #1A1A1A;
    --color-gray: #2A2A2A;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --transition-normal: all 0.3s ease;
}

/* ========== 模态框基础样式 ========== */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 遮罩层 */
.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 内容容器 */
.share-modal-content {
    position: relative;
    max-width: 800px;
    margin: 50px auto;
    background: var(--color-dark-gray);
    border-radius: 20px;
    padding: 2rem;
    transform: scale(0.9) translateY(50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.15);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.share-modal.active .share-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 关闭按钮 */
.share-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--color-white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.share-modal-close:hover {
    background: var(--color-gold);
    color: var(--color-black);
    transform: rotate(90deg);
}

/* ========== 模态框头部 ========== */
.share-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.share-modal-header h3 {
    font-size: 2rem;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.share-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ========== 分享卡片容器 ========== */
.share-card-container {
    background: var(--color-gray);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.share-card-container canvas {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ========== 操作按钮 ========== */
.share-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.share-actions button {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-download {
    background: linear-gradient(135deg, var(--color-gold), #B8941F);
    color: var(--color-black);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-copy-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-copy-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-gold);
    transform: translateY(-2px);
}

.btn-copy-link:active {
    transform: translateY(0);
}

/* 按钮波纹效果 */
.share-actions button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.share-actions button:active::after {
    width: 300px;
    height: 300px;
}

/* ========== Toast 提示 ========== */
.share-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, var(--color-gold), #B8941F);
    color: var(--color-black);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.share-toast i {
    font-size: 1.2rem;
}

/* ========== 动画定义 ========== */
@keyframes modalSlideIn {
    0% {
        transform: scale(0.7) translateY(100px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.share-card-container.loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(212, 175, 55, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .share-modal-content {
        max-width: 700px;
        margin: 30px auto;
    }
}

@media (max-width: 768px) {
    .share-modal-content {
        max-width: 90%;
        margin: 20px auto;
        padding: 1.5rem;
    }

    .share-modal-header h3 {
        font-size: 1.5rem;
    }

    .share-actions {
        flex-direction: column;
    }

    .share-actions button {
        width: 100%;
    }

    .share-card-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .share-modal-content {
        margin: 10px;
        padding: 1rem;
        border-radius: 15px;
        max-height: calc(100vh - 20px);
    }

    .share-modal-header {
        margin-bottom: 1rem;
    }

    .share-modal-header h3 {
        font-size: 1.3rem;
    }

    .share-hint {
        font-size: 0.85rem;
    }

    .share-actions {
        margin-top: 1rem;
        gap: 0.75rem;
    }

    .share-actions button {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .share-modal-close {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
        font-size: 1rem;
    }

    .share-card-container {
        padding: 0.75rem;
        margin: 1rem 0;
    }
}

/* ========== 打印优化 ========== */
@media print {
    .share-modal-overlay,
    .share-modal-close,
    .share-modal-header,
    .share-actions {
        display: none !important;
    }

    .share-modal-content {
        box-shadow: none;
        border: none;
        margin: 0;
        max-width: 100%;
    }
}

/* ========== 暗色模式优化 ========== */
@media (prefers-color-scheme: dark) {
    .share-modal-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* ========== 无障碍优化 ========== */
.share-modal-close:focus,
.share-actions button:focus {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* ========== 滚动条样式 ========== */
.share-modal-content::-webkit-scrollbar {
    width: 8px;
}

.share-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.share-modal-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.share-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
