/* Tank37135.github.io-TKB6 All rights reserved-Tank37135 */
.code-block {
    position: relative;
    margin: 20px;
}

.code-block button {
    position: absolute;
    right: 10px;
    top: 10px;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 1;
    background: #1a71d5;
    background-size: 0 2px; 
    background-position: bottom right; 
    background-repeat: repeat-y; 
    color: rgba(255, 255, 255, 0.75);
    transition: background-size 0.3s ease;
}

.code-block button:hover {
    background-size: 100% 2px; 
    background-position: bottom left; 
    background: #c469f4;
    color: #d6e6f9;
}

pre {
    background: linear-gradient(to right, #04385e, #2b014a); 
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.code2 {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: inherit;
}

/* 滚动条样式 - 跨浏览器兼容且使用渐变色 */
/* WebKit/Blink 浏览器 (Chrome, Safari, Edge) */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: transparent;
}

pre::-webkit-scrollbar-thumb {
    /* 使用与按钮相同的渐变色 */
    background: linear-gradient(to right, #1a71d5, #c469f4);
    border-radius: 4px;
    /* 添加微妙的阴影增强立体感 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

pre::-webkit-scrollbar-thumb:hover {
    /* 悬停时略微加深渐变 */
    background: linear-gradient(to right, #155db8, #b056e0);
}

/* Firefox */
pre {
    scrollbar-width: thin;
    /* Firefox 不支持渐变作为滚动条颜色，使用最接近的纯色 */
    scrollbar-color: #7a5dd8 transparent;
}
