/**
 * 快讯微信分享功能样式
 */

/* 微信分享按钮样式 - 与海报按钮保持一致 */
.kuaixun-actions .btn[data-action="wechat-share"] {
    background: transparent;
    color: #6c757d;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kuaixun-actions .btn[data-action="wechat-share"]:hover {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;
    text-decoration: none;
}

.kuaixun-actions .btn[data-action="wechat-share"]:active {
    transform: none;
    background: rgba(108, 117, 125, 0.15);
}

.kuaixun-actions .btn[data-action="wechat-share"] i {
    font-size: 12px;
}

/* 微信分享模态框 */
.wechat-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.wechat-share-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.wechat-share-modal .modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wechat-share-modal.show .modal-content {
    transform: scale(1);
}

.wechat-share-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #07c160, #38d973);
    color: #ffffff;
}

.wechat-share-modal .modal-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wechat-share-modal .modal-header i {
    font-size: 20px;
}

.wechat-share-modal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wechat-share-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.wechat-share-modal .modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 快讯预览 */
.kuaixun-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    border-left: 4px solid #07c160;
}

.kuaixun-preview .preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.kuaixun-preview .preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
    margin-right: 12px;
    line-height: 1.4;
}

.kuaixun-preview .preview-time {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

.kuaixun-preview .preview-description {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.kuaixun-preview .preview-source {
    color: #888;
    font-size: 12px;
}

/* 分享方式 */
.share-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.share-methods h6 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    text-align: center;
}

/* 二维码部分 */
.qr-code-section {
    text-align: center;
}

.qr-code-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 12px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    transition: all 0.3s ease;
}

.qr-code-container:hover {
    border-color: #07c160;
    background: #f0f9f4;
}

.qr-loading {
    color: #666;
    font-size: 14px;
}

.qr-code-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.qr-error {
    text-align: center;
    color: #dc3545;
}

.qr-error i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.qr-error p {
    margin: 0;
    font-size: 12px;
}

.qr-tip {
    color: #666;
    font-size: 12px;
    margin: 0;
}

/* 链接部分 */
.link-section {
    display: flex;
    flex-direction: column;
}

.link-input-group {
    display: flex;
    margin-bottom: 12px;
}

.share-link-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 12px;
    background: #f8f9fa;
    color: #666;
}

.share-link-input:focus {
    outline: none;
    border-color: #07c160;
    background: #ffffff;
}

.copy-link-btn {
    padding: 8px 16px;
    background: #07c160;
    color: #ffffff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-link-btn:hover {
    background: #06ad56;
    transform: translateY(-1px);
}

.copy-link-btn.copied {
    background: #28a745;
}

.link-tip {
    color: #666;
    font-size: 12px;
    margin: 0;
    text-align: center;
}

/* 模态框底部 */
.wechat-share-modal .modal-footer {
    display: flex;
    justify-content: center;
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.wechat-share-modal .btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wechat-share-modal .btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.wechat-share-modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 错误提示 */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.error-toast.show {
    transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wechat-share-modal .modal-content {
        width: 95vw;
        max-height: 85vh;
    }
    
    .wechat-share-modal .modal-body {
        padding: 20px;
        max-height: 50vh;
    }
    
    .share-methods {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .qr-code-container {
        width: 120px;
        height: 120px;
    }
    
    .share-link-input {
        font-size: 12px;
    }
    
    .copy-link-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* 动画效果 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* 提示框样式 */
.wechat-share-error,
.wechat-share-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wechat-share-error .error-content,
.wechat-share-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wechat-share-error i,
.wechat-share-toast i {
    font-size: 16px;
}

/* 手动复制对话框样式增强 */
.manual-copy-dialog .dialog-close:hover {
    background: #f5f5f5;
    color: #333;
}

.manual-copy-dialog .manual-copy-text:focus {
    outline: none;
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

/* 二维码错误状态样式 */
.qr-error {
    transition: all 0.3s ease;
}

.qr-error:hover {
    background: #f0f0f0 !important;
    border-color: #bbb !important;
}

@media (max-width: 480px) {
    .wechat-share-modal .modal-header,
    .wechat-share-modal .modal-footer {
        padding: 16px 20px;
    }
    
    .wechat-share-modal .modal-body {
        padding: 20px;
    }
    
    .kuaixun-preview {
        padding: 12px;
    }
    
    .share-link-input {
        font-size: 11px;
    }
    
    .copy-link-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .error-toast {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .error-toast.show {
        transform: translateY(0);
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wechat-share-modal.show .modal-content {
    animation: fadeInUp 0.3s ease-out;
}

/* 二维码加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.qr-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 复制按钮点击效果 */
.copy-link-btn:active {
    transform: scale(0.98);
}

/* 微信绿色主题色变量 */
:root {
    --wechat-green: #07c160;
    --wechat-green-hover: #06ad56;
    --wechat-green-light: #f0f9f4;
}