/* 全局禁止长按菜单 */
* {
    -webkit-touch-callout: none;
}

/* 默认禁止选择 */
body {
    -webkit-user-select: none;
    user-select: none;
}

/* 可选区域 */
.selectable {
    -webkit-user-select: text !important;
    user-select: text !important;
}



/* 防止浏览器默认的选择行为 */
.shareable-content {
    /*-webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;*/
    /* 禁用浏览器默认的上下文菜单 */
    /*-webkit-touch-callout: none;
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;*/
}

/* 悬浮菜单样式 */
.text-share-floating-menu {
    position: fixed;
    z-index: 999999;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    padding: 8px;
    display: flex;
    gap: 4px;
    animation: textShareFadeIn 0.2s ease-out;
    user-select: none;
}

@keyframes textShareFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.text-share-menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.text-share-menu-item:hover {
    background: #f8f9fa;
    color: #007bff;
}

.text-share-menu-item:active {
    background: #e9ecef;
    transform: scale(0.95);
}

.text-share-menu-item svg {
    flex-shrink: 0;
}

/* 模态框样式 */
.text-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: textShareModalFadeIn 0.3s ease-out;
}

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

.text-share-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 600px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: textShareModalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes textShareModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.text-share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

.text-share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.text-share-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-share-close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.text-share-modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.text-share-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    flex-shrink: 0;
}

.text-share-download-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.text-share-download-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

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

/* 预览区域样式 */
.text-share-preview {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /*min-height: 300px;*/
    background: #f8f9fa;
    /*border-radius: 8px;*/
    padding: 20px;
/*    overflow-y: auto;
    max-height: 400px;*/
}

.text-share-slider-container {
    width: 100%;
    max-width: 500px;
}

.text-share-slider-wrapper {
    position: relative;
    overflow: hidden;
    /*border-radius: 8px;*/
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /* 移动端触摸优化 - 允许垂直滑动 */
    touch-action: pan-y;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* 提高移动端滑动性能 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.text-share-slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* 提高移动端滑动性能 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.text-share-slide {
    min-width: 100%;
    /*flex-shrink: 0;*/
    display: block;
}

.text-share-slide.active {
    display: block;
}

.text-share-html-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    max-height: 350px;
    /* 移动端滚动优化 */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* 确保滚动容器可以正常工作 */
    position: relative;
    z-index: 1;
}

/* 底部小点样式 */
.text-share-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.text-share-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-share-dot:hover {
    background: #adb5bd;
}

.text-share-dot.active {
    background: #007bff;
    transform: scale(1.2);
}

/* 分享卡片样式 */
.share-card {
    background: transparent;
    /*border-radius: 12px;*/
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: none;
    overflow: visible;
}

/* 分享卡片样式 */
.share-card {
    background: #1A4A8C;
    color: white;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    min-width: 200px;
    box-sizing: border-box;
    overflow: hidden;
}

.share-card.style-a,
.share-card.style-b {
    background: #004098;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.share-card .share-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.share-card .share-content {
    margin-bottom: 20px;
    flex: 1;
    overflow: visible;
    min-height: 0;
}

.share-card .selected-text {
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 12px 0;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.share-card .selected-text:last-child,
.share-card .selected-text.last-paragraph {
    margin-bottom: 0;
}

.share-card .share-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-shrink: 0;
    margin-top: auto;
}

.share-card .author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-card .author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.share-card .logo-section .author-avatar {
    width: 80px;
    height: auto;
    border-radius: inherit;
    border: 0;
}

.share-card .author-name {
    font-size: 20px;
    font-weight: 500;
    padding:0;
}

.share-card .website-logo {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.share-card .article-info {
    text-align: right;
}

.share-card .article-title {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 8px 0;
    opacity: 0.9;
}

.share-card .website-qr {
    width: 50px;
    height: 50px;
    border-radius: 0;
}

.share-card.style-b .website-qr {
    border: 3px solid #fff;
}

.share-card.style-b .share-bottom {
    padding: 0 20px 15px;
}


/* Toast提示样式 */
.text-share-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10002;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .text-share-modal-content {
        width: 98vw;
        max-height: 98vh;
        margin: 5px;
    }
    
    .text-share-modal-header,
    .text-share-modal-body,
    .text-share-modal-footer {
        padding: 12px;
    }
    
    .text-share-preview {
        min-height: 200px;
        padding: 8px;
        max-height: 70vh;
    }
    
    .text-share-slider-container {
        width: 100%;
        max-width: none;
    }
    
    .text-share-html-preview {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    
    .share-card {
        max-width: none;
        width: 100%;
        min-width: 200px;
        padding: 8px;
        margin: 0;
        box-sizing: border-box;
    }
    
    .share-card.style-a,
    .share-card.style-b {
        width: 100%;
        max-width: none;
        min-width: 200px;
        padding: 8px;
        box-sizing: border-box;
    }
    
    .text-share-floating-menu {
        flex-direction: column;
        gap: 2px;
        min-width: 120px;
        padding: 8px;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }
    
    .text-share-menu-item {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        margin-bottom: 4px;
    }
    
    .text-share-menu-item:last-child {
        margin-bottom: 0;
    }
    
    .text-share-menu-item svg {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    .text-share-modal-content {
        width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .text-share-modal-header,
    .text-share-modal-body,
    .text-share-modal-footer {
        padding: 10px;
    }
    
    .text-share-preview {
        min-height: 150px;
        padding: 5px;
        max-height: 80vh;
    }
    
    .share-card {
        min-width: 150px;
        padding: 6px;
    }
    
    .share-card.style-a,
    .share-card.style-b {
        min-width: 150px;
        padding: 6px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .text-share-menu-item:hover {
        background: transparent;
    }
    
    .text-share-menu-item:active {
        background: #e9ecef;
        transform: scale(0.95);
    }
    
    .text-share-download-btn:hover {
        background: #007bff;
        transform: none;
    }
    
    .text-share-download-btn:active {
        background: #0056b3;
        transform: scale(0.95);
    }
    
    .text-share-close-btn:hover {
        background: transparent;
    }
    
    .text-share-close-btn:active {
        background: #e9ecef;
        transform: scale(0.95);
    }
    
    .text-share-dot:active {
        transform: scale(1.3);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .text-share-floating-menu {
        border: 2px solid #000;
    }
    
    .text-share-modal {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .text-share-modal-content {
        border: 2px solid #000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .text-share-floating-menu,
    .text-share-modal,
    .text-share-modal-content,
    .text-share-slider-track,
    .text-share-dot,
    .text-share-menu-item,
    .text-share-download-btn,
    .text-share-close-btn,
    .text-share-toast {
        animation: none;
        transition: none;
    }
} 

/* 滚动条样式 */
.text-share-modal-body::-webkit-scrollbar,
.text-share-preview::-webkit-scrollbar,
.text-share-html-preview::-webkit-scrollbar {
    width: 6px;
}

.text-share-modal-body::-webkit-scrollbar-track,
.text-share-preview::-webkit-scrollbar-track,
.text-share-html-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.text-share-modal-body::-webkit-scrollbar-thumb,
.text-share-preview::-webkit-scrollbar-thumb,
.text-share-html-preview::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.text-share-modal-body::-webkit-scrollbar-thumb:hover,
.text-share-preview::-webkit-scrollbar-thumb:hover,
.text-share-html-preview::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox滚动条样式 */
.text-share-modal-body,
.text-share-preview,
.text-share-html-preview {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* 移动端滚动优化 */
@media (max-width: 768px) {
    .text-share-modal-body::-webkit-scrollbar,
    .text-share-preview::-webkit-scrollbar,
    .text-share-html-preview::-webkit-scrollbar {
        width: 4px;
    }
    .text-share-html-preview {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* 确保移动端可以正常滚动 */
        touch-action: pan-y;
        max-height: 70vh;
        /* 移动端滚动优化 */
        position: relative;
        z-index: 1;
        /* 确保滚动条可见 */
        scrollbar-width: thin;
        -ms-overflow-style: auto;
    }
    .text-share-modal-body,
    .text-share-preview,
    .text-share-html-preview {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .text-share-modal-body::-webkit-scrollbar,
    .text-share-preview::-webkit-scrollbar {
        display: none;
    }
    
    /* 保持HTML预览的滚动条可见，以便用户知道可以滚动 */
    .text-share-html-preview::-webkit-scrollbar {
        width: 4px;
        display: block;
    }
    
    .text-share-html-preview::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 2px;
    }
    
    .text-share-html-preview::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 2px;
    }
}

/* 分享卡片通用样式 */
.share-header {
    text-align: right;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.share-header-ico {
    flex-shrink: 0;
    margin-right: 15px;
    display: flex;
    align-items: flex-end;
    position: absolute;
    bottom: 0;
}

.share-header-ico img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.share-header-content {
    flex: 1;
    text-align: right;
}

.share-header-content p {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.share-header-content p:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.share-header .divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to left, #B8C5D1, transparent);
    margin: 0 auto;
}

.share-content {
    margin-bottom: 20px;
    line-height: 1.6;
}

.selected-text {
    margin: 0 0 12px 0;
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
    text-align: left;
}

.selected-text:last-child {
    margin-bottom: 0;
}

.share-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.article-author-name {
    font-weight: 500;
    font-size: 16px;
    color: white;
}

.share-bottom {
    background: #dae8f3;
    margin: 19px -20px -20px -20px;
    padding: 0 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qr-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.website-qr {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.question-text {
    color: #333;
    font-size: 15px;
    line-height: 1.4;
    padding-right: 10px;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}



/* 编辑对话框样式 */
.author-edit-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
}

.author-edit-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    max-width: 400px;
}

.author-edit-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.author-edit-form {
    margin-bottom: 20px;
}

.author-edit-label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.author-edit-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.author-edit-input:focus {
    border-color: #007bff;
}

.author-edit-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.author-edit-cancel {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.author-edit-cancel:hover {
    background: #e9ecef;
}

.author-edit-confirm {
    padding: 10px 20px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.author-edit-confirm:hover {
    background: #0056b3;
}

/* 下载等待界面样式 */
.download-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100001;
    backdrop-filter: blur(5px);
}

.download-loading-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 300px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.loading-text {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 可编辑作者样式 */
.editable-author {
    cursor: pointer;
    background-color: transparent;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editable-author:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.share-line {
    background: #dae8f3;
    margin: 19px -20px -20px -20px;
/*    display: flex;
    justify-content: space-between;
    align-items: center;*/
    padding: 0 0 2px;
    overflow: hidden;
}

    .share-line img {
        width: 100%;
        height: auto;
        max-width: 100%;
        float:left;
        display:inherit;
    }