/* ── 编辑器头部 ── */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.line-count {
    font-size: 0.82rem;
    color: #999;
}

/* ── 带行号的编辑器 ── */
.editor-with-lines {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.editor-with-lines:focus-within {
    border-color: #2563eb;
    background: #fff;
}

.line-numbers {
    padding: 1rem 0.6rem;
    background: #f0f0f0;
    border-right: 1px solid #e0e0e0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #999;
    text-align: right;
    user-select: none;
    min-width: 2.5rem;
    overflow: hidden;
}

.json-editor-wrap .json-textarea {
    flex: 1;
    width: 100%;
    min-height: 280px;
    padding: 1rem;
    border: none;
    border-radius: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    color: #333;
    background: transparent;
    box-sizing: border-box;
    outline: none;
}

/* ── 校验结果 ── */
.validate-result {
    margin-top: 1.5rem;
}

.validate-card {
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    border: 1px solid;
}

.validate-card.valid {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.validate-card.invalid {
    background: #fef2f2;
    border-color: #fecaca;
}

.validate-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.validate-msg {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.validate-card.valid .validate-msg {
    color: #059669;
}

.validate-card.invalid .validate-msg {
    color: #dc2626;
}

.validate-detail {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.7;
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
}

/* ── 常见错误示例 ── */
.error-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.error-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.2rem;
}

.error-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.8rem;
}

.error-code {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}

.error-wrong {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    color: #991b1b;
    text-decoration: line-through;
    text-decoration-color: #fca5a5;
}

.error-right {
    background: #f0fdf4;
    border-left: 3px solid #059669;
    color: #065f46;
}

.error-tip {
    font-size: 0.82rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

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

    .line-numbers {
        font-size: 0.8rem;
        padding: 1rem 0.4rem;
        min-width: 2rem;
    }

    .error-examples {
        grid-template-columns: 1fr;
    }
}