﻿body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0px;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: calc(100vh - 40px);
}

.left-panel, .right-panel {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-panel {
    border-right: 1px solid #ddd;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

textarea {
    flex: 1;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    line-height: 1.5;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 5px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    flex: 1;
    min-width: 100px;
}

    button:hover {
        background-color: #2980b9;
    }

.error {
    color: #e74c3c;
    margin-top: 10px;
    font-weight: bold;
    min-height: 20px;
}

.json-viewer {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: auto;
    position: relative;
    background-color: #f9f9f9;
}

.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    background-color: #eee;
    padding: 10px 5px;
    text-align: right;
    border-right: 1px solid #ddd;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    color: #888;
    user-select: none;
    line-height: 1.5;
}

.json-content {
    margin-left: 50px;
    padding: 10px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    white-space: pre;
    line-height: 1.5;
}

.json-object, .json-array {
    margin-left: 20px;
}

.json-property {
    display: flex;
    margin-bottom: 5px;
}

.json-key {
    color: #2980b9;
    margin-right: 5px;
}

.json-string {
    color: #e74c3c;
}

.json-number {
    color: #f39c12;
}

.json-boolean {
    color: #8e44ad;
}

.json-null {
    color: #7f8c8d;
}

.expand-collapse {
    cursor: pointer;
    margin-right: 5px;
    user-select: none;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1;
    background-color: #f8f8f8;
}

    .expand-collapse.collapse-icon {
        color: #e74c3c; /* 红色表示折叠状态(-) */
        border-color: #e74c3c;
        background-color: #ffeeee;
    }

    .expand-collapse.expand-icon {
        color: #2ecc71; /* 绿色表示展开状态(+) */
        border-color: #2ecc71;
        background-color: #eeffff;
    }

.collapsed {
    display: none;
}

.copy-btn {
    background-color: #2ecc71;
}

    .copy-btn:hover {
        background-color: #27ae60;
    }

.format-btn {
    background-color: #9b59b6;
}

    .format-btn:hover {
        background-color: #8e44ad;
    }

.minify-btn {
    background-color: #e67e22;
}

    .minify-btn:hover {
        background-color: #d35400;
    }

.options {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

    .option-item input[type="checkbox"] {
        margin: 0;
    }

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .left-panel {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
}

