:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f9fbff;
    --line: #dde5f0;
    --text: #1f2937;
    --muted: #64748b;
    --brand: #2457ff;
    --brand-deep: #1638b8;
    --green: #12805c;
    --red: #c2410c;
    --yellow: #a16207;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: Consolas, "Courier New", monospace;
}

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

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px 22px;
    background: linear-gradient(180deg, #112142 0%, #172d59 100%);
    color: #dbe7ff;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar__logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7cc6ff 0%, #7f8cff 100%);
    color: #102042;
    font-weight: 800;
}

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

.sidebar__subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(219, 231, 255, 0.72);
}

.sidebar__nav {
    display: grid;
    gap: 10px;
}

.sidebar__link {
    padding: 14px 16px;
    border-radius: 14px;
    color: rgba(219, 231, 255, 0.86);
    transition: all 0.18s ease;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar__footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(219, 231, 255, 0.14);
}

.sidebar__user {
    font-weight: 700;
}

.sidebar__logout {
    display: inline-block;
    margin-top: 10px;
    color: #9dc4ff;
}

.main {
    padding: 28px;
}

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

.topbar__title {
    margin: 0;
    font-size: 30px;
}

.topbar__meta {
    margin: 8px 0 0;
    color: var(--muted);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e7efff;
    color: var(--brand-deep);
    font-size: 13px;
    font-weight: 700;
}

.pill--light {
    background: rgba(255, 255, 255, 0.12);
    color: #e2ebff;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 14px;
}

.alert--success {
    background: #eaf8f2;
    border-color: #bfe6d3;
    color: var(--green);
}

.alert--error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card,
.panel,
.api-card,
.login-card {
    background: var(--surface);
    border: 1px solid rgba(221, 229, 240, 0.9);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 22px;
}

.stat-card__label {
    color: var(--muted);
    font-size: 14px;
}

.stat-card__value {
    margin-top: 14px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-card__desc {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.panel-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 22px;
}

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

.panel-grid--sidebar {
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.7fr);
}

.panel {
    padding: 22px;
}

.panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel__head h2 {
    margin: 0;
    font-size: 20px;
}

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

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.table th {
    color: var(--muted);
    font-weight: 700;
    background: var(--surface-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge--success {
    background: #e8f6ef;
    color: var(--green);
}

.badge--warning {
    background: #fff7e6;
    color: var(--yellow);
}

.badge--muted {
    background: #eef2f7;
    color: #5b6b82;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #eef3ff;
    color: var(--brand-deep);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.button--primary {
    background: linear-gradient(135deg, var(--brand) 0%, #4773ff 100%);
    color: #ffffff;
}

.button--ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--text);
}

.button--full {
    width: 100%;
}

.button--small {
    padding: 8px 12px;
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.field--wide {
    grid-column: span 2;
}

.field--full {
    grid-column: 1 / -1;
}

.input,
.textarea,
select.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd8e5;
    border-radius: 12px;
    background: #ffffff;
    font-size: 14px;
    color: var(--text);
}

.textarea {
    min-height: 104px;
    resize: vertical;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.switch--inline {
    margin-top: 4px;
}

.api-list {
    display: grid;
    gap: 18px;
}

.api-card {
    padding: 20px;
}

.api-card__head,
.api-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.api-card__head h3 {
    margin: 0;
    font-size: 18px;
}

.api-card__foot {
    margin-top: 16px;
    margin-bottom: 0;
}

.code-block {
    display: inline-block;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eef3ff;
    color: var(--brand-deep);
}

.stacked-meta {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.meta-label {
    color: var(--muted);
    font-size: 13px;
}

.field-actions {
    display: flex;
    align-items: center;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline__item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.timeline__title {
    font-weight: 700;
}

.timeline__meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.search-form,
.inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.break-all {
    word-break: break-all;
}

.text-positive {
    color: var(--green);
    font-weight: 700;
}

.text-negative {
    color: var(--red);
    font-weight: 700;
}

.login-body {
    background:
        radial-gradient(circle at top left, rgba(124, 198, 255, 0.25), transparent 28%),
        radial-gradient(circle at bottom right, rgba(71, 115, 255, 0.2), transparent 24%),
        #0f1f3f;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
    width: min(1180px, 100%);
    overflow: hidden;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.login-panel__intro {
    padding: 48px;
    color: #f4f8ff;
}

.login-panel__intro h1 {
    margin: 20px 0 14px;
    font-size: 42px;
}

.login-panel__intro p {
    margin: 0;
    max-width: 520px;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(244, 248, 255, 0.82);
}

.login-panel__tips {
    display: grid;
    gap: 16px;
    margin-top: 34px;
}

.login-tip {
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.login-tip strong {
    display: block;
    margin-bottom: 8px;
}

.login-tip span {
    color: rgba(244, 248, 255, 0.78);
    line-height: 1.7;
}

.login-card {
    padding: 34px;
    margin: 26px;
    background: rgba(255, 255, 255, 0.96);
}

.login-card h2 {
    margin: 0 0 20px;
    font-size: 24px;
}

.login-card__foot {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-grid--two,
    .panel-grid--sidebar {
        grid-template-columns: 1fr;
    }

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

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

    .sidebar {
        gap: 18px;
    }

    .main {
        padding: 18px;
    }

    .topbar {
        flex-direction: column;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field--wide,
    .field--full {
        grid-column: auto;
    }

    .panel,
    .api-card,
    .login-card,
    .stat-card {
        padding: 18px;
    }

    .login-panel__intro {
        padding: 26px;
    }
}
