.json-compare-page {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(74, 108, 247, 0.12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

body.dark-mode .hero {
    background: rgba(30, 37, 56, 0.92);
    border-color: rgba(74, 108, 247, 0.18);
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text-light);
}

body.dark-mode .hero h1 {
    color: var(--text-dark);
}

.hero p {
    margin: 0;
    color: var(--text-secondary-light);
    max-width: 760px;
}

body.dark-mode .hero p {
    color: var(--text-secondary-dark);
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.hero-actions button,
.panel-actions button,
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 8px 18px rgba(74, 108, 247, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.hero-actions button:hover,
.panel-actions button:hover,
.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(74, 108, 247, 0.24);
}

.hero-actions button:active,
.panel-actions button:active,
.primary-btn:active {
    transform: translateY(1px);
}

.options-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(74, 108, 247, 0.1);
}

body.dark-mode .options-bar {
    background: rgba(30, 37, 56, 0.85);
    border-color: rgba(74, 108, 247, 0.16);
}

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(74, 108, 247, 0.08);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

body.dark-mode .option-chip {
    color: var(--text-dark);
    background: rgba(74, 108, 247, 0.12);
}

.option-chip input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary-color);
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.panel,
.results-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(74, 108, 247, 0.12);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

body.dark-mode .panel,
body.dark-mode .results-panel {
    background: rgba(30, 37, 56, 0.92);
    border-color: rgba(74, 108, 247, 0.18);
}

.panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 520px;
}

.panel-header,
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.panel h2,
.results-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-light);
}

body.dark-mode .panel h2,
body.dark-mode .results-header h2 {
    color: var(--text-dark);
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-actions button {
    padding: 9px 12px;
    font-size: 13px;
}

textarea {
    width: 100%;
    min-height: 420px;
    resize: vertical;
    border-radius: 16px;
    border: 1px solid rgba(100, 116, 139, 0.25);
    background: rgba(248, 250, 252, 0.95);
    color: var(--text-light);
    font-family: Consolas, 'SFMono-Regular', Menlo, Monaco, 'Liberation Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    padding: 16px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 108, 247, 0.12);
}

body.dark-mode textarea {
    background: rgba(15, 18, 28, 0.85);
    color: var(--text-dark);
    border-color: rgba(148, 163, 184, 0.22);
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    font-size: 13px;
    color: var(--text-secondary-light);
}

body.dark-mode .panel-footer {
    color: var(--text-secondary-dark);
}

.panel-footer .ok {
    color: #16a34a;
    font-weight: 600;
}

.panel-footer .error {
    color: #ef4444;
    font-weight: 600;
}

.results-panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.summary-item {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.summary-item.same {
    background: #64748b;
}

.summary-item.changed {
    background: #f59e0b;
}

.summary-item.added {
    background: #16a34a;
}

.summary-item.removed {
    background: #ef4444;
}

.result-banner {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
}

.result-banner.neutral {
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-light);
    border-color: rgba(100, 116, 139, 0.14);
}

.result-banner.success {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.18);
}

.result-banner.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.result-banner.error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.18);
}

body.dark-mode .result-banner.neutral {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-dark);
    border-color: rgba(148, 163, 184, 0.15);
}

body.dark-mode .result-banner.success {
    color: #4ade80;
}

body.dark-mode .result-banner.warning {
    color: #fbbf24;
}

body.dark-mode .result-banner.error {
    color: #f87171;
}

.result-list {
    display: grid;
    gap: 14px;
}

.diff-card {
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.9);
}

body.dark-mode .diff-card {
    background: rgba(15, 18, 28, 0.85);
    border-color: rgba(148, 163, 184, 0.16);
}

.diff-card.same {
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
}

.diff-card.changed {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.diff-card.added {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.12);
}

.diff-card.removed {
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.diff-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.diff-kind {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.diff-card.same .diff-kind {
    background: #64748b;
}

.diff-card.changed .diff-kind {
    background: #f59e0b;
}

.diff-card.added .diff-kind {
    background: #16a34a;
}

.diff-card.removed .diff-kind {
    background: #ef4444;
}

.diff-path {
    font-size: 13px;
    color: var(--text-secondary-light);
    background: rgba(148, 163, 184, 0.12);
    padding: 6px 10px;
    border-radius: 999px;
}

body.dark-mode .diff-path {
    color: var(--text-secondary-dark);
    background: rgba(148, 163, 184, 0.16);
}

.diff-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.diff-column {
    min-width: 0;
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

body.dark-mode .diff-column {
    background: rgba(255, 255, 255, 0.03);
}

.diff-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-secondary-light);
}

body.dark-mode .diff-label {
    color: var(--text-secondary-dark);
}

.diff-column pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, 'SFMono-Regular', Menlo, Monaco, 'Liberation Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-light);
}

body.dark-mode .diff-column pre {
    color: var(--text-dark);
}

.diff-message {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary-light);
}

body.dark-mode .diff-message {
    color: var(--text-secondary-dark);
}

@media (max-width: 1100px) {
    .compare-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        min-height: auto;
    }

    textarea {
        min-height: 320px;
    }
}

@media (max-width: 768px) {
    .json-compare-page {
        width: min(100% - 16px, 100%);
        padding: 16px 0 24px;
    }

    .hero {
        flex-direction: column;
        padding: 18px;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .options-bar {
        padding: 14px;
    }

    .panel,
    .results-panel {
        padding: 14px;
        border-radius: 16px;
    }

    .panel-header,
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-actions {
        width: 100%;
    }

    .panel-actions button {
        flex: 1 1 0;
    }

    textarea {
        min-height: 260px;
        font-size: 13px;
    }

    .diff-body {
        grid-template-columns: 1fr;
    }

    .summary {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-actions button,
    .primary-btn,
    .panel-actions button {
        width: 100%;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions button {
        flex: 1 1 100%;
    }

    .option-chip {
        width: 100%;
        justify-content: space-between;
    }

    textarea {
        min-height: 220px;
    }

    .summary-item {
        width: 100%;
        text-align: center;
    }
}
