/* ── JSON 输入区 ── */
.json-editor-wrap {
    margin-bottom: 1rem;
}

.json-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    resize: vertical;
    color: #333;
    background: #fafafa;
    box-sizing: border-box;
}

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

/* ── 缩进选项 ── */
.json-options {
    margin-bottom: 1rem;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.option-label {
    font-size: 0.88rem;
    color: #666;
    font-weight: 500;
}

.option-radio {
    font-size: 0.88rem;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.option-radio input[type="radio"] {
    accent-color: #2563eb;
}

/* ── 结果区 ── */
.json-result {
    margin-top: 1.5rem;
}

.json-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.json-result-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.json-result-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
}

.json-result-status.success {
    color: #059669;
    background: #d1fae5;
}

.json-result-status.error {
    color: #dc2626;
    background: #fee2e2;
}

.json-output {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #333;
    background: #f8f9fb;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ── 格式化前后对比 ── */
.compare-example {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.compare-block {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.compare-title {
    padding: 0.7rem 1rem;
    background: #f5f7fa;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
}

.compare-code {
    padding: 1rem;
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #333;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .json-textarea {
        min-height: 150px;
        font-size: 0.82rem;
    }

    .json-output {
        font-size: 0.8rem;
        max-height: 300px;
    }

    .compare-example {
        grid-template-columns: 1fr;
    }

    .option-group {
        gap: 0.6rem;
    }
}