/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    margin: 0;
    background-color: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

/* 标题样式 */
h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 600;
}

/* 工具按钮样式 */
.tools {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    padding: 5px 0;
}

button {
    padding: 10px 18px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* 编辑器容器样式 */
.editor-container {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex: 1;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

/* 行号样式 */
.line-numbers {
    width: 50px;
    background-color: #f8f9fa;
    padding: 10px 8px;
    text-align: right;
    color: #999;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.5;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    user-select: none;
    display: flex;
    flex-direction: column;
}

/* 编辑器样式 */
.editor {
    flex-grow: 1;
    padding: 10px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    border: none;
    outline: none;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}

/* JSON显示区域样式 */
.json-display {
    flex-grow: 1;
    padding: 10px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    white-space: pre;
    overflow: auto;
    display: none;
    line-height: 1.5;
}

/* 状态信息样式 */
.status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.hidden {
    display: none;
}

/* JSON语法高亮样式 */
.json-key {
    color: #0451a5;
    font-weight: 500;
}

.json-string {
    color: #a31515;
}

.json-number {
    color: #098658;
}

.json-boolean {
    color: #0000ff;
    font-weight: 500;
}

.json-null {
    color: #0000ff;
    font-weight: 500;
}

/* 折叠功能样式 */
.collapsible {
    cursor: pointer;
    user-select: none;
    display: inline-block;
    width: 15px;
    height: 15px;
    text-align: center;
    line-height: 15px;
    vertical-align: middle;
    margin-right: 3px;
}

.collapsible::before {
    content: '▼';
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.collapsed::before {
    content: '►';
}

.collapsible-content {
    display: inline;
}

.collapsed + .collapsible-content {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .tools {
        flex-direction: column;
        align-items: stretch;
    }
    
    button {
        margin-bottom: 5px;
    }
    
    .editor-container {
        height: 400px;
    }
}