:root{
    --editor-font-size: 14px;
    --sidebar-width: 180px;
}
:root {
    --p: 0.62 0.25 250;  /* #1970fc 的近似值 */
    --pc: 1 0 0;
}

.jsonfont{
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

[data-theme="dark"] {
    --p: 0.65 0.25 250;  /* 暗色主题稍微亮一点 */
    --pc: 1 0 0;
}

/* ===========================================
 * 全局滚动条样式重定义
 * 类似 Monica 的滚动条设计
 * =========================================== */

/* Webkit 浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;  /* 垂直滚动条宽度 */
    height: 8px; /* 水平滚动条高度 */
}

::-webkit-scrollbar-track {
    background: transparent; /* 滚动条轨道背景 */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15); /* 滚动条颜色 */
    border-radius: 4px;
    transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25); /* 悬停时颜色 */
}

::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.35); /* 拖拽时颜色 */
}

/* 滚动条角落 */
::-webkit-scrollbar-corner {
    background: transparent;
}

/* ===========================================
 * 深色主题下的滚动条样式
 * =========================================== */

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.4);
}

/* ===========================================
 * Firefox 浏览器滚动条样式
 * =========================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

[data-theme="dark"] * {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}




body {
    /*overflow: hidden; !* 完全禁用滚动 *!*/
    overflow-x: hidden;
}

.search-dropdown {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

/* 缩小导航栏高度 */
.navbar {
    min-height: 3rem;
    height: 3rem;
    /* 加深边框 */
    border-bottom: 1px solid #ccc;
    font-family: PingFang SC;
}

.navbar .btn2 {
    height: 2rem;
    min-height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.navbar .btn3 {
    height: 3rem;
    width: 3rem;
}

.navbar .input {
    height: 2rem;
    min-height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.navbar .menu li > * {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.navbar .dropdown-content {
    margin-top: 0.75rem;
}

/* 调整背景色和边框 */
.navbar.bg-base-200 {
    background-color: #f1f5f9;
}


#centerPanel .bg-base-200 {
    background-color: #f8fafc;
}

/* 深色主题适配 */
[data-theme="dark"] .navbar.bg-base-200 {
    background-color: #1e293b;
}

[data-theme="dark"] #leftPanel .bg-base-200,
[data-theme="dark"] #centerPanel .bg-base-200 {
    background-color: #1e293b;
}



/* 深色主题适配 */
[data-theme="dark"] .navbar2 {
    border-bottom: 1px solid #434968;
}



[data-theme="dark"] #leftPanel {
    border-right: 1px solid #434968;
}



/* 左侧边栏宽度控制 */
#leftPanel {
    width: var(--sidebar-width) !important;
    /*transition: width 0.3s ease;*/
    /*overflow: hidden;*/
}

/* 左侧边栏字体大小 */
#leftPanel .project-name-input {
    font-size: 12px !important;
    height: 1.8rem !important;
    min-height: 1.8rem !important;
    padding: 0 0.5rem !important;
    width: 120px;
}

/* 左侧边栏按钮字体 */
#leftPanel .btn {
    font-size: 12px !important;
}

/* 宽度切换按钮样式 */
.sidebar-toggle-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 10;
    font-size: 10px !important;
    padding: 2px 4px !important;
    min-height: 1.2rem !important;
    height: 1.2rem !important;
}

#centerPanel button.gap-0{
    gap: 3px;
}

.editor-panel {
    width: 35%;
}

.output-panel {
    width: 65%;
}

.CodeMirror {
    height: 100% !important;
    font-family: 'Consolas', 'Monaco', '微软雅黑', 'Courier New', monospace;
    font-size: var(--editor-font-size);
}

.CodeMirror pre {
    word-break: break-all !important;
}

#jsonTreeView{
    contain: layout style paint; /* CSS Containment */
    overflow-y: auto;
    height: 100%;
}


/* 可编辑树形结构样式 */
.json-tree {
    font-family: 'Consolas', 'Monaco', '微软雅黑', 'Courier New', monospace;
    font-size: var(--editor-font-size);
    line-height: 1.6;
}

.json-item {
    margin: 0;
    padding: 0 0;
    border-radius: 3px;

}

.json-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}



/* 减少重绘 */
.json-editable:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.json-editable {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0 10px;
    font-family: 'Consolas', 'Monaco', '微软雅黑', 'Courier New', monospace;
    font-size: var(--editor-font-size);
    min-width: 20px;
    display: inline-block;
    /*transition: all 0.2s;*/
    cursor: text;
    word-break: break-all;
}

.json-editable:hover {
    border-color: #d1d5db;
    background-color: rgba(255, 255, 255, 0.8);
}

.json-editable:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.json-editable[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    font-style: italic;
}

/* 特定类型样式 */
.json-string-editable {
    color: #059669;
}

.json-number-editable {
    color: #dc2626;
}

.json-boolean-editable {
    color: #7c3aed;
}

.json-null-editable {
    color: #6b7280;
}

.json-key-editable {
    color: #1d4ed8;
    font-weight: bold;
    margin-right: 4px;
    min-width: 30px;
    outline: none;
    white-space: nowrap;
}

.json-key-editable:focus {
    background-color: #eff6ff;
    border-color: #3b82f6;
    border-radius: 3px;
}

.json-key-editable:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    font-style: italic;
    font-weight: normal;
}

.json-key-wrapper {
    display: inline-flex;
    align-items: center;
}

.json-index {
    color: #6b7280;
    font-weight: bold;
    margin-right: 8px;
    min-width: 20px;
    display: inline-block;
}

.json-bracket {
    color: #374151;
    font-weight: bold;
    margin-right: 4px;
}

.json-expandable {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

.json-expanded::before {
    content: '▼ ';
    color: #6b7280;
    margin-right: 4px;
}

.json-collapsed::before {
    content: '▶ ';
    color: #6b7280;
    margin-right: 4px;
}

.json-content {
    margin-left: 12px;
}

.add-item-btn {
    color: #059669;
    font-weight: bold;
}

.delete-item-btn {
    color: #dc2626;
    opacity: 0.6;
}

.delete-item-btn:hover {
    opacity: 1;
}

/* 深色主题适配 */
[data-theme="dark"] .json-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .json-editable:hover {
    border-color: #6b7280;
    background-color: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .json-editable:focus {
    background-color: #1f2937;
    border-color: #60a5fa;
}

[data-theme="dark"] .json-bracket {
    color: #d1d5db;
}

[data-theme="dark"] .editor-panel {
    border-right-color: #434968;
    border-bottom-color: #434968;
}

[data-theme="dark"] .output-panel {
    border-bottom-color: #434968;
}

/* 深色主题适配 - 使用相同的颜色 */
[data-theme="dark"] .json-string-editable {
    color: #c3e88d;
}

[data-theme="dark"] .json-number-editable {
    color: #f78c6c;
}

[data-theme="dark"] .json-boolean-editable {
    color: #c792ea;
}

[data-theme="dark"] .json-null-editable {
    color: #546e7a;
}

[data-theme="dark"] .json-key-editable {
    color: #82b1ff;
}

[data-theme="dark"] .json-bracket {
    color: #89ddff;
}

[data-theme="dark"] .json-index {
    color: #ffcb6b;
}


.avatar-online {
    position: relative;
}

.avatar-online::after {
    content: '';
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 0.3rem;
    height: 0.3rem;
    background: #10b981; /* 绿色 */
    border-radius: 50%;
}

.avatar-offline {
    position: relative;
}

.avatar-offline::after {
    content: '';
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 0.3rem;
    height: 0.3rem;
    background: #666; /* 绿色 */
    border-radius: 50%;
}


.json-content .btn-xs{
    height: 1rem;
    min-height: 1rem;
}

.drag-over {
    position: relative;
    border: 2px dashed #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.drag-over::after {
    content: attr(data-drag-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 123, 255, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    border-radius: inherit;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.drag-over:not([data-drag-text])::after {
    content: "松开鼠标上传文件";
}

.drop-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}



.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}



.CodeMirror-foldgutter-open:after {
    color: #272727;
    font-size: 14px;
    font-family: monospace;
    font-weight: bold;
}



.tab.tab-active {
    background-color: #2fa4e7 !important; /* 激活状态的颜色 */
}


.border-primary {
    border-color: #2fa4e7;
}
.link-primary{
    color: #2fa4e7;
}

.rounded-sm-importent{
    border-radius: 0.125rem !important;
}


/* 添加到你的 CSS */
.dropdown.force-close .dropdown-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}



