/*
Theme Name: iDea - Clean & Powerful Bootstrap Theme
Author: HtmlCoder
Author URI: http://www.htmlcoder.me
Author e-mail: htmlcoder.me@gmail.com
Version: 1.0.0 
Created: August 2014
License URI: http://wrapbootstrap.com
File Description: Place here your custom CSS styles
*/

/* ============================================
   回到顶部按钮 - 通用样式
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #c42021 0%, #a01a1a 100%);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(196, 32, 33, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    outline: none;
}

.back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #d42a2a 0%, #b01f1f 100%);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 24px rgba(196, 32, 33, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(196, 32, 33, 0.3);
}

.back-to-top i {
    line-height: 1;
    display: block;
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* 添加一个圆形光晕效果 */
.back-to-top::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
}

.back-to-top:hover::before {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
}

/* 移动端样式优化 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
        font-size: 18px;
        box-shadow: 0 3px 12px rgba(196, 32, 33, 0.25);
    }
    
    .back-to-top:hover {
        transform: translateY(-3px) scale(1.03);
    }
}

/* 平板端样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    .back-to-top {
        bottom: 32px;
        right: 32px;
        width: 52px;
        height: 52px;
        font-size: 19px;
    }
}

/* ============================================
   图片预览模态框 - 通用样式
   ============================================ */
.image-preview-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
    animation: fadeIn 0.3s;
}

.image-preview-modal[style*="display: block"],
.image-preview-modal.show {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-preview-content {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10001;
}

.image-preview-close:hover,
.image-preview-close:focus {
    color: #fff;
    text-decoration: none;
}

.image-preview-caption {
    margin-top: 15px;
    text-align: center;
    color: #fff;
    font-size: 18px;
    max-width: 90%;
    flex-shrink: 0;
    padding: 0 20px;
}

.preview-image {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.preview-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 图片预览响应式设计 */
@media (max-width: 768px) {
    .image-preview-close {
        top: 15px;
        right: 20px;
        font-size: 30px;
    }
    
    .image-preview-content {
        max-width: 98%;
        max-height: 90vh;
    }
    
    .image-preview-caption {
        font-size: 16px;
        margin-top: 10px;
    }
}