/* ===================================================================== */
/* === Sidebar (侧边栏) / 浮动工具栏 样式 (最终版本) === */
/* ===================================================================== */

#sidebar-tools {
    /* 固定定位，确保它不随页面内容滚动 */
    position: fixed;
    right: 25px; 
    bottom: 50px; 
    z-index: 1000; 
    display: flex;
    flex-direction: column; /* 垂直堆叠 */
    gap: 12px;
}

.tool-item {
    /* 【尺寸、背景透明和边框】: 默认透明背景 + 浅蓝边框 */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: transparent; /* 背景透明 */
    border: 2px solid #3EB2FB;    /* 浅蓝边框 */
    color: #ffffff; /* 确保字体图标（如返回顶部）是白色 */
    border-radius: 50%; 
    font-size: 20px; 
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease-in-out; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); 
}

.tool-item:hover {
    /* 悬停时，渐变覆盖背景和边框 */
    /* 确保您的主 CSS 中定义了 --brand-gradient */
    background: var(--brand-gradient, linear-gradient(90deg, #00BFFF 0%, #00FF87 100%));
    transform: translateY(-3px); 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-color: transparent; /* 悬停时边框透明 */
    color: #ffffff; 
}

/* 控制图片图标（<img>）的尺寸和居中 */
.tool-item .tool-icon {
    width: 55%; 
    height: auto;
    object-fit: contain;
}

/* 确保字体图标（<i> - 如返回顶部）是白色 */
.tool-item i {
    color: #ffffff; 
}


/* --- 二维码弹窗样式 --- */
.qr-code-popup {
    position: absolute;
    right: 100%; 
    top: 50%;
    transform: translateY(-50%); 
    width: 160px; 
    padding: 10px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none; 
    margin-right: 20px; 
}

.qr-code-popup::after {
    /* 小三角指示器 */
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background-color: #ffffff;
    box-shadow: 2px -2px 5px rgba(0, 0, 0, 0.05); 
}

.tool-item:hover .qr-code-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; 
}

.qr-code-popup img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 5px;
}

.qr-code-popup p {
    text-align: center;
    font-size: 13px;
    color: #212529; 
    margin: 0;
}

/* 返回顶部按钮 - 初始隐藏，由 JS 控制显示/隐藏 */
#back-to-top {
    display: none; 
}


/* --- 响应式调整 --- */
@media (max-width: 768px) {
    #sidebar-tools {
        right: 10px;
        bottom: 20px;
        gap: 8px;
    }
    .tool-item {
        width: 45px;
        height: 45px;
    }
    .tool-item .tool-icon,
    .tool-item i {
        font-size: 18px; /* 调整图标大小 */
    }
    /* 移动端隐藏二维码弹窗 */
    .qr-code-popup {
        display: none !important;
    }
}