/**
 * 分享弹窗样式
 * 参考预览弹窗设计语言
 */

/* ========================================
   分享页导航栏样式
   ======================================== */

.share-page-navbar {
    background: var(--bg-primary, #0d1117);
    border-bottom: 1px solid var(--border-primary, #30363d);
    padding: 0.75rem 0;
}

.share-page-title {
    color: var(--text-primary, #e6edf3);
    font-size: 1rem;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* 移动端响应式：字体稍大，允许换行 */
@media (max-width: 767.98px) {
    .share-page-title {
        font-size: 1.1rem;
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
    }
}

/* 保留移动端样式类（兼容性，但不再使用） */
.share-page-title-mobile {
    display: none;
}

/* 分享页内容容器 */
#shareContentContainer {
    min-height: 400px;
}

/* ========================================
   分享页内容样式
   ======================================== */

.share-page-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* 标题和描述 */
.share-content-title {
    color: var(--text-primary, #e6edf3);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.share-content-description {
    color: var(--text-secondary, #8b949e);
    font-size: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.6;
}

/* 单图展示 */
.share-single-image-wrapper {
    text-align: center;
}

.share-image-container {
    position: relative;
    margin-bottom: 1rem;
    background: var(--bg-secondary, #161b22);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.share-main-image {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.share-main-image:hover {
    transform: scale(1.02);
}

/* 多图展示 */
.share-multiple-images-wrapper {
    position: relative;
}

.share-main-image-area {
    position: relative;
    margin-bottom: 20px;
    background: var(--bg-secondary, #161b22);
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-image-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* 让点击事件穿透到图片 */
}

.share-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s, transform 0.3s;
    z-index: 10;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* 按钮本身可以点击 */
}

.share-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.share-nav-prev {
    left: 20px; /* 与 lightbox 保持一致 */
}

.share-nav-next {
    right: 20px; /* 与 lightbox 保持一致 */
}

.share-main-image-area:hover .share-nav-btn {
    opacity: 1;
}

/* 缩略图导航 */
.share-thumbnail-navigation {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary, #161b22);
    border-radius: 8px;
}

.share-thumbnail-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}

.share-thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.share-thumbnail-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.share-thumbnail-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #0d6efd);
    border-radius: 3px;
}

.share-thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: var(--bg-tertiary, #1a1a1a);
}

.share-thumbnail-item:hover {
    border-color: var(--accent-hover, #0b5ed7);
    transform: translateY(-2px);
}

.share-thumbnail-item.active {
    border-color: var(--accent-primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.share-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--accent-primary, #0d6efd);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
}

.thumbnail-number {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 图片信息 */
.share-image-info {
    text-align: center;
    color: var(--text-secondary, #8b949e);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 操作按钮 */
.share-image-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 产品图库分享页：按钮在一行居中显示 */
.share-product-gallery .share-image-actions {
    flex-wrap: nowrap; /* 不换行，保持在一行 */
}

.share-detail-button-wrapper {
    text-align: center;
}

/* 详情页内容 */
.share-detail-content {
    background: var(--bg-secondary, #161b22);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
}

.detail-page-title {
    color: var(--text-primary, #e6edf3);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.detail-page-description {
    color: var(--text-secondary, #8b949e);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.detail-page-images {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-page-image-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.detail-page-image-wrapper .image-number {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 1;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.detail-page-image-wrapper:hover .image-number {
    opacity: 1;
    transform: translateY(0);
}

.detail-page-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

/* VR图库样式 */
.share-vr-cover-wrapper {
    text-align: center;
    margin-bottom: 2rem;
}

.share-vr-cover-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.share-vr-cover-image:hover {
    transform: scale(1.02);
}

.share-vr-actions {
    text-align: center;
}

/* 全屏图片预览模态框 */
.share-full-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.share-full-image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* 移动端单图分享弹窗样式 */
.share-modal-mobile-single {
    padding: 20px 0;
}

.share-mobile-wechat-btn-wrapper {
    margin-bottom: 16px;
}

.share-mobile-wechat-btn {
    height: 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-mobile-copy-btn-wrapper {
    margin-top: 16px;
}

.share-mobile-copy-btn {
    height: 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.share-mobile-copy-btn:active {
    transform: scale(0.95);
}

/* 移动端复制按钮成功状态动画 */
.share-mobile-copy-btn.copy-success {
    animation: copySuccess 0.3s ease;
}

/* 复制链接按钮高亮样式 */
.share-copy-btn-highlight {
    border: 2px solid var(--accent-primary, #0d6efd) !important;
    background-color: rgba(13, 110, 253, 0.2) !important;
    animation: pulseHighlight 1s ease-in-out infinite;
}

@keyframes pulseHighlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }
}

/* 移动端多图分享弹窗样式 */
.share-modal-mobile-multiple {
    padding: 0;
}

.share-modal-mobile-image-area {
    position: relative;
    width: 100%;
    min-height: 300px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #161b22);
    border-radius: 8px;
    overflow: hidden;
    touch-action: pan-y; /* 允许垂直滚动，水平用于滑动切换 */
}

.share-modal-mobile-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.share-modal-mobile-image-wrapper img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

.share-modal-mobile-thumbnail-navigation {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary, #161b22);
    border-radius: 8px;
}

.share-modal-mobile-thumbnail-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.share-modal-mobile-thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.share-modal-mobile-thumbnail-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.share-modal-mobile-thumbnail-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #0d6efd);
    border-radius: 3px;
}

.share-modal-mobile-thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 70px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: var(--bg-tertiary, #1a1a1a);
}

.share-modal-mobile-thumbnail-item:hover {
    border-color: var(--accent-hover, #0b5ed7);
    transform: translateY(-2px);
}

.share-modal-mobile-thumbnail-item.active {
    border-color: var(--accent-primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.share-modal-mobile-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.share-modal-mobile-thumbnail-item .thumbnail-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--accent-primary, #0d6efd);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.share-modal-mobile-thumbnail-item .thumbnail-number {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.share-modal-mobile-image-info {
    text-align: center;
    color: var(--text-secondary, #999);
    font-size: 14px;
    margin-bottom: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .share-content-title {
        font-size: 1.2rem;
    }
    
    .share-content-description {
        font-size: 0.9rem;
    }
    
    .share-image-container {
        min-height: 300px;
        padding: 10px;
    }
    
    .share-main-image-area {
        min-height: 300px;
        padding: 10px;
    }
    
    .share-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .share-nav-prev {
        left: 10px;
    }
    
    .share-nav-next {
        right: 10px;
    }
    
    .share-thumbnail-item {
        width: 60px;
        height: 45px;
    }
    
    .detail-page-image-wrapper .image-number {
        font-size: 12px;
        padding: 4px 8px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   分享弹窗基础样式
   ======================================== */

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.share-modal-content {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10002;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-modal-title {
    color: var(--text-primary, #fff);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #999);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.share-modal-body {
    color: var(--text-primary, #fff);
}

/* ========================================
   单图分享弹窗样式
   ======================================== */

.share-modal-single {
    text-align: center;
}

.share-qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.share-qrcode-wrapper {
    display: inline-block;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    border: 6px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-qrcode {
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.share-qrcode-hint {
    color: var(--text-secondary, #999);
    font-size: 14px;
    margin-bottom: 20px;
}

.share-copy-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.share-copy-btn:active {
    transform: scale(0.95);
}

/* 复制按钮成功状态动画 */
.share-copy-btn.copy-success {
    animation: copySuccess 0.3s ease;
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   多图分享弹窗样式
   ======================================== */

.share-modal-multiple {
    text-align: center;
}

/* 主图预览区域 */
.share-modal-image-area {
    position: relative;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
}

.share-modal-image-wrapper {
    max-width: 100%;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-image-wrapper img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

/* 左右箭头导航 */
.share-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
    z-index: 10;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.share-modal-prev {
    left: 10px;
}

.share-modal-next {
    right: 10px;
}

/* 鼠标悬停时显示箭头 */
.share-modal-image-area:hover .share-modal-nav {
    opacity: 1;
}

/* 缩略图导航 */
.share-modal-thumbnail-navigation {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.share-modal-thumbnail-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}

/* 隐藏滚动条但保持功能 */
.share-modal-thumbnail-container::-webkit-scrollbar {
    height: 6px;
}

.share-modal-thumbnail-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.share-modal-thumbnail-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #0d6efd);
    border-radius: 3px;
}

/* 缩略图项 */
.share-modal-thumbnail-navigation .thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: var(--bg-tertiary, #1a1a1a);
}

.share-modal-thumbnail-navigation .thumbnail-item:hover {
    border-color: var(--accent-hover, #0b5ed7);
    transform: translateY(-2px);
}

.share-modal-thumbnail-navigation .thumbnail-item.active {
    border-color: var(--accent-primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.share-modal-thumbnail-navigation .thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.share-modal-thumbnail-navigation .thumbnail-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--accent-primary, #0d6efd);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.share-modal-thumbnail-navigation .thumbnail-number {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 图片信息显示 */
.share-modal-image-info {
    margin-bottom: 20px;
    color: var(--text-secondary, #999);
    font-size: 14px;
}

.share-modal-image-info span:first-child {
    color: var(--text-primary, #fff);
    font-weight: 500;
    margin-right: 8px;
}

/* 二维码区域 */
.share-modal-qrcode-section {
    margin-bottom: 20px;
}

/* ========================================
   动画效果
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 768px) {
    .share-modal-content {
        max-width: 95%;
        padding: 20px;
    }
    
    .share-qrcode {
        width: 180px !important;
        height: 180px !important;
    }
}

