/*
Theme Name:     B2子主题
Theme URI:      http: //7b2.com/
Description:    Child theme for the B2 PRO
Author:         子主题模版
Author URI:     http: //7b2.com/
Template:       b2
Version:        0.1.5
*/

/*下面是您自己DIY的css样式代码*/

/**代码高亮开始**/
/* 代码高亮样式 */
.code-toolbar {
    position: relative;  /* 父容器使用相对定位 */
    margin: 1em 0;
    background: #2f3640;
    border-radius: 6px;
    padding-top: 40px;
}
.code-toolbar:hover .toolbar {
    opacity: 1;
}

.code-toolbar pre {
    margin: 0 !important;
    border-radius: 6px;
    max-height: 300px; /* 设置代码块的最大高度 */
    overflow-y: auto; /* 添加垂直滚动条 */
    padding: 10px; /* 可选：增加内边距 */
    white-space: pre; /* 保留空白符 */
    word-wrap: normal; /* 不自动换行 */
}
.code-toolbar:before {
    content: '';
    height: 40px;
    width: 100%;
    background: #2f3640;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.code-toolbar:after {
    content: '';
    position: absolute;
    top: 12px;
    left: 20px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 25px 0 0 #ffbd2e, 50px 0 0 #27c93f;
    z-index: 1;
}

.toolbar {
    position: absolute;
    top: 6px;
    right: 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 移动端始终显示工具栏 */
@media (max-width: 768px) {
    .toolbar {
        position: absolute;
        top: 6px;
        right: 10px;
        z-index: 5; /* 提高层级 */
        opacity: 1;
        width: auto; /* 确保宽度自适应 */
        display: block !important; /* 强制显示 */
        pointer-events: auto !important; /* 确保可点击 */
    }

    /* 处理短代码包裹的情况 */
    .wp-block-jetpack-markdown .code-toolbar .toolbar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 确保按钮可见且可点击 */
    .toolbar-item button {
        display: block !important;
        pointer-events: auto !important;
    }
}

.toolbar-item button {
    padding: 5px 10px;
    color: #494949;
    cursor: pointer;
    background: #b2bac2;
    border-radius: 4px; /* 修正边框半径 */
    line-height: 1.4;
    border: 1px solid #dddddd03;
}

/**代码高亮结束**/