/* JSON编辑器区域 */
.json-editor-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.editor-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.json-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #f7fafc;
}

.json-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
}

/* 操作按钮区域 */
.operation-section {
    text-align: center;
    margin-bottom: 25px;
}

/* 结果显示区域 */
.result-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.result-content {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.result-code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: #2d3748;
}

/* 错误提示 */
.error-message {
    background: #fed7d7;
    border: 2px solid #fc8181;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #742a2a;
    display: none;
}

.error-message i {
    margin-right: 8px;
}

/* 统计信息 */
.json-stats {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #718096;
    margin-top: 5px;
}

/* 视图切换按钮 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-toggle {
    display: inline-flex;
    background: #f7fafc;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.view-toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #718096;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-toggle-btn:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.view-toggle-btn.active {
    background: #667eea;
    color: #fff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* 树形视图样式 */
.tree-view-content {
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    max-height: 600px;
    overflow: auto;
}

.tree-view-container {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
}

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

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tree-node-header:hover {
    background: #e2e8f0;
}

.tree-toggle {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #718096;
    font-size: 12px;
    user-select: none;
}

.tree-toggle.collapsed::before {
    content: '▶';
}

.tree-toggle.expanded::before {
    content: '▼';
}

.tree-key {
    color: #805ad5;
    font-weight: 600;
}

.tree-type {
    color: #718096;
    font-size: 12px;
    font-style: italic;
}

.tree-value {
    color: #2d3748;
}

.tree-value.string {
    color: #38a169;
}

.tree-value.number {
    color: #3182ce;
}

.tree-value.boolean {
    color: #d69e2e;
}

.tree-value.null {
    color: #e53e3e;
    font-style: italic;
}

.tree-children {
    margin-left: 20px;
    border-left: 2px solid #e2e8f0;
    padding-left: 10px;
}

.tree-children.collapsed {
    display: none;
}

.tree-count {
    color: #718096;
    font-size: 12px;
    margin-left: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .editor-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    }