:root {
    --bg: #081120;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.88);
    --panel-strong: #111c33;
    --panel-border: rgba(148, 163, 184, 0.14);
    --text: #e5eefc;
    --text-muted: #8ea0bd;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.14);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 20px 60px rgba(2, 6, 23, 0.38);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.24), transparent 24%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(180deg, #081120 0%, #0b1324 52%, #0a1428 100%);
}

code,
pre,
.result-card__value {
    font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    border-right: 1px solid var(--panel-border);
    background: rgba(6, 11, 23, 0.76);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand__logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand__title {
    font-size: 18px;
    font-weight: 700;
}

.brand__subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sidebar-nav__item:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.1);
}

.sidebar-nav__item--active {
    background: var(--primary-soft);
    border-color: rgba(99, 102, 241, 0.28);
}

.sidebar-nav__icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #c7d2fe;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-card {
    margin-top: 28px;
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.12), rgba(14, 165, 233, 0.06));
}

.sidebar-card__label {
    color: #c7d2fe;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-card__title {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-card__desc {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}

.main-content {
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.topbar__eyebrow,
.panel__eyebrow {
    color: #93c5fd;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar__title {
    margin: 10px 0 8px;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.12;
}

.topbar__desc {
    max-width: 700px;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 15px;
}

.topbar-meta {
    display: grid;
    gap: 12px;
    min-width: 280px;
}

.topbar-meta__item {
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.topbar-meta__label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.topbar-meta code {
    color: #c7d2fe;
    font-size: 13px;
}

.summary-grid,
.panel-grid {
    display: grid;
    gap: 20px;
}

.summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

.summary-card,
.panel {
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.summary-card {
    padding: 20px 22px;
}

.summary-card__label {
    color: var(--text-muted);
    font-size: 13px;
}

.summary-card__value {
    margin-top: 12px;
    font-size: 28px;
    font-weight: 700;
}

.summary-card__desc {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.panel-grid {
    grid-template-columns: minmax(0, 1fr);
}

.panel__header {
    padding: 24px 24px 0;
}

.panel--hidden {
    display: none;
}

.panel--active {
    display: block;
}

.panel__title {
    margin: 10px 0 8px;
    font-size: 24px;
}

.panel__desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.panel__body {
    padding: 20px 24px 24px;
}

.form-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field__label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 13px;
}

.field__control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(7, 12, 24, 0.75);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field__control:focus {
    border-color: rgba(99, 102, 241, 0.72);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
}

.btn--primary:hover {
    background: linear-gradient(135deg, #5b53f1 0%, #4338ca 100%);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text);
}

.status-bar {
    min-height: 22px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 13px;
}

.status-bar--success {
    color: #6ee7b7;
}

.status-bar--error {
    color: #fca5a5;
}

.result-card {
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(5, 10, 22, 0.72), rgba(10, 17, 31, 0.92));
}

.result-card__head {
    margin-bottom: 18px;
}

.result-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: #c7d2fe;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.result-card__value {
    margin-top: 14px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-all;
}

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

.metric {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.metric__label {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.metric__value {
    font-size: 16px;
    font-weight: 600;
}

.result-json {
    padding-top: 4px;
}

.result-json__label {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

pre {
    margin: 0;
    min-height: 170px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.08);
    color: #dbeafe;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    font-size: 13px;
}

@media (max-width: 1180px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--panel-border);
    }
}

@media (max-width: 980px) {
    .summary-grid,
    .panel-grid,
    .form-grid--two,
    .result-metrics {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
    }

    .topbar-meta {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 18px;
    }

    .sidebar {
        padding: 18px;
    }

    .summary-card,
    .panel__header,
    .panel__body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .result-card__value {
        font-size: 24px;
    }
}
