* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-right: 100px;
}

.toolbar button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.toolbar button:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.main {
    flex: 1;
    overflow: hidden;
    padding: 10px;
}

.editor-split {
    display: flex;
    gap: 0;
    height: 100%;
    position: relative;
}

.editor-container, .tree-container {
    flex: none;
    width: 50%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: auto;
    display: block;
}

#jsonInput {
    width: 100%;
    height: 100%;
    padding: 15px;
    border: none;
    font-family: Monaco, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow: auto;
}

/* JSON树形结构样式 */
.json-tree {
    padding: 15px;
    font-family: Monaco, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    user-select: text;
    min-width: 100%;
}

.tree-node {
    position: relative;
    padding-left: 20px;
}

.tree-line {
    display: flex;
    align-items: flex-start;
    white-space: nowrap;
}

.tree-toggle {
    cursor: pointer;
    padding: 0 5px;
    display: inline-block;
}

.tree-toggle i {
    width: 14px;
    height: 14px;
    display: inline-block;
    text-align: center;
}

.fas.fa-caret-down,
.fas.fa-caret-right {
    color: #666;
}

.tree-key {
    color: #881391;
    margin-right: 4px;
}

.tree-value {
    color: #1a1aa6;
}

.tree-string {
    color: #c41a16;
}

.tree-number {
    color: #1c00cf;
}

.tree-boolean {
    color: #0000ff;
}

.tree-null {
    color: #808080;
}

.tree-content {
    margin-left: 4px;
}

.error-message {
    color: #d32f2f;
    padding: 15px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    margin: 10px;
}

.error-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.error-details {
    margin-bottom: 10px;
    font-family: Monaco, Menlo, Consolas, monospace;
    font-size: 13px;
}

.error-context {
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

.error-context pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: Monaco, Menlo, Consolas, monospace;
    font-size: 13px;
}

/* 折叠动画 */
.tree-content {
    transition: height 0.2s ease-out;
}

/* 高亮显示 */
.tree-line:hover {
    background-color: #f5f5f5;
}

/* 复制提示 */
.copy-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

.splitter {
    width: 6px;
    flex: none;
    background: #ddd;
    cursor: col-resize;
    position: relative;
    user-select: none;
}

.splitter:hover,
.splitter.dragging {
    background: #bbb;
}

.splitter::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #999;
    border-radius: 1px;
}

.toolbar .separator {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 8px;
}

/* 禁用状态的按钮样式 */
.toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 添加语言切换器样式 */
.language-switch {
    position: absolute;
    top: 10px;
    right: 20px;
}

.language-switch select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    font-size: 14px;
    outline: none;
}

.language-switch select:hover {
    border-color: #bbb;
}
 