/* 代码块容器样式 */
.code-block-container {
    position: relative;
    border-radius: 5px;
    margin: 10px 0;
    background: #ffffff;
    overflow: hidden;
    border: 1px solid #e6e8eb;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}
.dark .code-block-container {
    border: 1px solid #000000;
    background: #21262d;
}
/* 代码块工具栏 */
.code-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: #f8f8f8;
    border-bottom: 1px solid #f8f8f8;
    color: #1e293b;
    font-size: 0.9rem;
    
}

.dark .code-toolbar {
    background: #000000;
    border-bottom: 1px solid #30363d;
    color: #f1f5f9;
}
.code-language {
    font-weight: bold;
}

.copy-code-btn {
    background: white;
    color: #1e293b;
    border: none;
    padding: 5px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rme;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.dark .copy-code-btn {
    background: #21262d;
    color: #f1f5f9;
}
.copy-code-btn:hover {
    background: #cbccce !important;
}
.dark .copy-code-btn:hover {
    background: #46494e !important;
}
.copy-code-btn.copied {
    background: #cbccce !important;
}
.dark .copy-code-btn.copied {
    background: #46494e !important;
}
.copy-code-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* 代码块样式 */
.code-block {
    padding: 0;
    margin: 0;
    overflow-x: auto;
    color: #1e293b;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
    overflow-y: auto;
}

.dark .code-block {
    color: #f1f5f9;
}

/* 行号容器样式 */
.line-numbers {
    counter-reset: line;
    padding-left: 0;
    margin: 0;
}

.line-numbers .line {
    display: flex;
    line-height: 30px;
    border-left: 3px solid transparent;
    transition: background-color 0.1s;
}

.line-numbers .line:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.line-numbers .line-number {
    display: inline-block;
    width: 50px;
    text-align: center;
    color: #1e293b;
    user-select: none;
    border-right: 1px solid #f8f8f8;
    margin-right: 15px;
    flex-shrink: 0;
}
.dark .line-numbers .line-number {
    color: #f1f5f9;
}
.line-numbers .line-code {
    flex: 1;
    white-space: pre;
    padding-right: 15px;
}

/* 高亮样式覆盖 */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* 滚动条样式 */
.code-block::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: #f8f8f8;
}

.code-block::-webkit-scrollbar-thumb {
    background: #afafaf;
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: #cbccce;
}

.dark .code-block::-webkit-scrollbar-track {
    background: #48505a;
}

.dark .code-block::-webkit-scrollbar-thumb {
    background: #8f8e8e;
    border-radius: 4px;
}

.dark .code-block::-webkit-scrollbar-thumb:hover {
    background: #b7b8b9;
}