/* ========================================
   木子屋博客 - 代码展示美化样式
   配色基于站点主题：暖黄背景 #FAF7EF，紫色标题 #796BDA
   使用方法：在页面 <head> 中引用此 CSS 文件
   <link rel="stylesheet" href="code-highlight-beautify.css" type="text/css" media="all" />
   ======================================== */

/* ========== 基础样式 ========== */
.UBBPanel {
    margin: 10px 0;
    border: 1px solid #DDD6C2;
    border-radius: 4px;
    overflow: hidden;
    background: #FAF7EF;
    font-size: 12px;
}

/* ========== 标题栏 - 匹配站点紫色标题 #796BDA ========== */
.UBBTitle {
    background: linear-gradient(180deg, #8B7FE0 0%, #796BDA 100%);
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #6B5FC0;
}

.UBBTitle img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
    width: 14px;
    height: 14px;
}

/* ========== 代码内容区域 ========== */
.UBBContent {
    padding: 8px;
    background: #FAF7EF;
}

.UBBContent TEXTAREA {
    width: 100%;
    height: 280px;
    max-height: 500px;
    padding: 10px;
    border: 1px solid #DDD6C2;
    border-radius: 3px;
    background-color: #FFFDF5;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #464646;
    resize: vertical;
    overflow-y: auto;
    overflow-x: auto;
    tab-size: 4;
    white-space: pre;
    box-sizing: border-box;
}

.UBBContent TEXTAREA:focus {
    outline: none;
    border-color: #796BDA;
    box-shadow: 0 0 0 2px rgba(121, 107, 218, 0.15);
}

/* ========== 按钮组 - 匹配站点暖橙色调 ========== */
.UBBContent INPUT.userbutton {
    margin: 6px 6px 0 0;
    padding: 4px 12px;
    border: 1px solid #C5A06C;
    border-radius: 3px;
    background: linear-gradient(180deg, #F0D9A0 0%, #D8B87A 100%);
    color: #5A4520;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.UBBContent INPUT.userbutton:hover {
    background: linear-gradient(180deg, #F5E4BC 0%, #E0C88E 100%);
    border-color: #B0884E;
}

.UBBContent INPUT.userbutton:active {
    background: linear-gradient(180deg, #D8B87A 0%, #C5A06C 100%);
}

/* ========== 滚动条美化 ========== */
.UBBContent TEXTAREA::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.UBBContent TEXTAREA::-webkit-scrollbar-track {
    background: #F5F0E3;
    border-radius: 4px;
}

.UBBContent TEXTAREA::-webkit-scrollbar-thumb {
    background: #C5B89A;
    border-radius: 4px;
    border: 1px solid #DDD6C2;
}

.UBBContent TEXTAREA::-webkit-scrollbar-thumb:hover {
    background: #B0A080;
}

/* ========== Page 5226 风格：div 直接显示代码（非 TEXTAREA）========== */

/* 代码面板 - 纯 div 渲染的代码块 */
.codePanel > .UBBContent,
.UBBPanel.codePanel > .UBBContent {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: auto;
    padding: 10px 12px;
    background-color: #FFFDF5;
    border-top: 1px solid #E5DFD0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #464646;
    white-space: normal;
    word-wrap: break-word;
}

/* 代码面板中 <br> 确保换行 */
.codePanel > .UBBContent br,
.UBBPanel.codePanel > .UBBContent br {
    content: "";
    display: block;
    margin: 0;
    padding: 0;
    height: 0;
}

/* 引用面板 - quotePanel，不需要滚动和等宽 */
.quotePanel > .UBBContent {
    padding: 10px 12px;
    background-color: #FFFDF5;
    border-top: 1px solid #E5DFD0;
    font-size: 12px;
    line-height: 1.8;
    color: #464646;
    max-height: none;
    overflow: visible;
}

/* 代码面板标题栏的复制链接 */
.codePanel .UBBTitle a {
    color: #E8D8C0 !important;
    font-size: 11px !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.codePanel .UBBTitle a:hover {
    color: #ffffff !important;
}

/* div 代码块内的滚动条 */
.codePanel > .UBBContent::-webkit-scrollbar,
.UBBPanel.codePanel > .UBBContent::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.codePanel > .UBBContent::-webkit-scrollbar-track,
.UBBPanel.codePanel > .UBBContent::-webkit-scrollbar-track {
    background: #F5F0E3;
    border-radius: 4px;
}

.codePanel > .UBBContent::-webkit-scrollbar-thumb,
.UBBPanel.codePanel > .UBBContent::-webkit-scrollbar-thumb {
    background: #C5B89A;
    border-radius: 4px;
    border: 1px solid #DDD6C2;
}

.codePanel > .UBBContent::-webkit-scrollbar-thumb:hover,
.UBBPanel.codePanel > .UBBContent::-webkit-scrollbar-thumb:hover {
    background: #B0A080;
}
