/* 右右侧栏主体样式 */
.far-right-sidebar {
    position: fixed;
    right: 10px;
    bottom: 100px;
    z-index: 999;
}

.far-right-button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.far-right-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    border: none;
    outline: none;
}

.far-right-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.far-right-button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* 返回顶部按钮 */
.far-right-back-to-top {
    opacity: 0;
    visibility: hidden;
    background-color: #7c3aed;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}


.far-right-back-to-top:hover {
    background-color: #6d28d9;
}


.far-right-back-to-top.far-right-visible {
    opacity: 1;
    visibility: visible;
}

.far-right-back-to-top.far-right-visible:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 为了兼容原JavaScript，保留visible类 */
.far-right-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.far-right-back-to-top.visible:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 反馈按钮样式 */
.far-right-feedback-btn {
    background-color: #ff9800;
}

.far-right-feedback-btn:hover {
    background-color: #f57c00;
}

/* 分享海报按钮 */
.far-right-share-poster {
    background-color: #2196F3;
}

.far-right-share-poster:hover {
    background-color: #1976D2;
}

/* APP下载按钮样式 */
.far-right-app-download {
    background-color: #3b82f6;
}

.far-right-app-download:hover {
    background-color: #2563eb;
}



/* 二维码按钮 */
.far-right-qrcode-btn {
    background-color: #25D366;
}

.far-right-qrcode-btn:hover {
    background-color: #20B358;
}

/* 二维码弹出框 */
.far-right-qrcode-popup {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.far-right-qrcode-popup:after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
}

.far-right-qrcode-btn:hover .far-right-qrcode-popup {
    opacity: 1;
    visibility: visible;
    right: 65px;
    pointer-events: auto;
}

.far-right-qrcode-popup.far-right-show {
    opacity: 1;
    visibility: visible;
    right: 65px;
    pointer-events: auto;
}

.far-right-qrcode-title {
    font-size: 14px;
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.far-right-qrcode-image {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.far-right-qrcode-placeholder {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
    font-size: 40px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.far-right-qrcode-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 4px;
}

/* 反馈模态框样式 */
.far-right-feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.far-right-feedback-container {
    background-color: white;
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: far-right-popup 0.3s ease-out;
    margin: 20px;
}

.far-right-feedback-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f8f8;
}

.far-right-feedback-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.far-right-close-feedback {
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.far-right-close-feedback:hover {
    color: #333;
}

.far-right-feedback-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.far-right-form-group {
    margin-bottom: 16px;
}

.far-right-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.far-right-required {
    color: #e74c3c;
}

.far-right-form-group input,
.far-right-form-group select,
.far-right-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.far-right-form-group input:focus,
.far-right-form-group select:focus,
.far-right-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.far-right-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.far-right-char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.far-right-page-info {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 12px;
}

.far-right-page-info-title {
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.far-right-page-title {
    color: #333;
    margin-bottom: 4px;
    word-break: break-all;
}

.far-right-page-url {
    color: #888;
    word-break: break-all;
}

.far-right-feedback-actions {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    background-color: #f8f8f8;
}

/* 海报模态框样式 */
.far-right-poster-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.far-right-poster-container {
    background-color: white;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: far-right-popup 0.3s ease-out;
}

.far-right-poster-header {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f8f8;
}

.far-right-poster-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.far-right-close-poster {
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.far-right-close-poster:hover {
    color: #333;
}

.far-right-poster-content {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
}

/* 全新海报设计 */
.far-right-poster-preview {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 海报画布 - 支持背景图片 */
.far-right-poster-canvas {
    width: 320px;
    height: 520px;
    /* 默认渐变背景 */
    background: linear-gradient(135deg, #3b82f6 0%, #f093fb 50%, #2563eb 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 保持原来的伪元素遮罩用于预览 */
.far-right-poster-canvas.has-bg-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

/* 添加真实遮罩元素样式（用于html2canvas捕获） */
.far-right-poster-real-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
    border-radius: 16px;
    display: none; /* 默认隐藏 */
}


.far-right-poster-canvas.has-bg-image > * {
    position: relative;
    z-index: 2;
}


/* 头部区域 */
.far-right-poster-header-section {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.far-right-poster-logo {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.far-right-poster-brand {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 内容卡片 - 根据是否有背景图片调整样式 */
.far-right-poster-content-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    max-height: 280px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* 当画布有背景图片时，让内容卡片透明 */
.far-right-poster-canvas.has-bg-image .far-right-poster-content-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* 当画布有背景图片时，调整文字颜色为白色 */
.far-right-poster-canvas.has-bg-image .far-right-poster-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.far-right-poster-canvas.has-bg-image .far-right-poster-description {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.far-right-poster-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.far-right-poster-description {
    font-size: 13px;
    color: #5a6c7d;
    line-height: 1.6;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

/* 装饰元素 - 有背景图片时调整颜色 */
.far-right-poster-decoration {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
}

.far-right-decoration-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    opacity: 0.6;
    transition: background 0.3s ease;
}

.far-right-poster-canvas.has-bg-image .far-right-decoration-dot {
    background: rgba(255, 255, 255, 0.6);
}

/* 二维码区域 - 恢复横向布局 */
.far-right-poster-qr-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.far-right-poster-qr-container {
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.far-right-poster-qrcode {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
}

.far-right-poster-qrcode img,
.far-right-poster-qrcode canvas {
    border-radius: 6px;
    max-width: 100%;
    max-height: 100%;
}

.far-right-poster-qr-text {
    color: white;
    flex: 1;
}

.far-right-scan-text {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.far-right-visit-text {
    font-size: 12px;
    opacity: 0.9;
    margin: 0 0 6px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 时间信息在二维码文字里面 */
.far-right-poster-time-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    display: inline-block;
    font-weight: 500;
}

/* 底部信息 - 只显示URL */
.far-right-poster-footer-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    text-align: center;
    line-height: 1.4;
}

.far-right-poster-url {
    word-break: break-all;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.far-right-poster-actions {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    background-color: #f8f8f8;
}

/* 按钮样式 */
.far-right-btn {
    flex: 1;
    margin: 0 5px;
    padding: 10px 0;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.far-right-btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.far-right-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.far-right-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.far-right-btn-default {
    background-color: #f5f5f5;
    border: 1px solid #e5e5e5;
    color: #666;
}

.far-right-btn-default:hover {
    background-color: #eaeaea;
}

/* 加载动画 */
.far-right-poster-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    color: #ccc;
    font-size: 12px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 8px;
}

/* 动画效果 */
@keyframes far-right-popup {
    0% { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .far-right-sidebar {
        right: 15px;
    }
    
    .far-right-button-group {
        gap: 12px;
    }
    
    .far-right-button {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .far-right-qrcode-popup {
        width: 140px;
        right: 50px;
    }
    
    .far-right-qrcode-image {
        height: 120px;
    }
    
    .far-right-feedback-container {
        width: 95vw;
        margin: 10px;
    }
    
    .far-right-poster-container {
        width: 95vw;
        margin: 10px;
    }
    
}
