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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #444;
}

.main-content {
    display: flex;
    gap: 20px;
}

.input-section,
.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h2 {
    font-size: 16px;
    color: #555;
}

.input-buttons,
.output-buttons {
    display: flex;
    gap: 5px;
}

button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f0f0f0;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #e0e0e0;
}

#convert-btn {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

#convert-btn:hover {
    background-color: #45a049;
}

.input-options,
.output-options {
    margin-bottom: 10px;
    font-size: 12px;
}

label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

input[type="checkbox"] {
    cursor: pointer;
}

#input-json {
    width: 100%;
    height: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    overflow: auto;
}

#output-container {
    position: relative;
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: auto;
    background-color: #f9f9f9;
    padding-left: 20px;
}

#output-json {
    margin: 0;
    padding: 10px 10px 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 折叠/展开按钮样式 */
.collapse-btn {
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 14px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 5px;
    user-select: none;
    color: #666;
}

.collapse-btn:hover {
    color: #333;
}

.json-content {
    margin-left: 0px;
    display: inline;
}

/* JSON 语法高亮 */
.json-key {
    color: #0000ff;
}

.json-string {
    color: #008000;
}

.json-number {
    color: #ff0000;
}

.json-boolean {
    color: #800080;
}

.json-null {
    color: #808080;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .input-section,
    .output-section {
        width: 100%;
    }
}