:root {
    --bg-0: #050816;
    --bg-1: #08111f;
    --bg-2: #0f1c33;
    --card: rgba(10, 20, 40, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #e6f4ff;
    --muted: #9eb2cc;
    --cyan: #00e0ff;
    --violet: #7c3aed;
    --green: #22c55e;
    --amber: #f59e0b;
    --red: #ef4444;
    --gold: #f7c948;
    --silver: #d8e1ec;
    --bronze: #d08b5b;
    --shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 224, 255, 0.12), transparent 32%),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.2), transparent 28%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0));
    color: var(--text);
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    position: relative;
    overflow: hidden;
}

.container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.bg-orb {
    position: fixed;
    inset: auto;
    width: 360px;
    height: 360px;
    filter: blur(50px);
    border-radius: 50%;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

.bg-orb-cyan {
    top: 8%;
    left: -120px;
    background: var(--cyan);
}

.bg-orb-violet {
    right: -120px;
    bottom: 10%;
    background: var(--violet);
}

.site-header,
.page-main {
    position: relative;
    z-index: 1;
}

.site-header {
    padding: 18px 0 0;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 22px;
}

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

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: #04101e;
    font-weight: 800;
}

.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links a {
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 13px;
}

.nav-chip-admin {
    color: #ffd98c;
}

.page-main {
    padding: 28px 0 56px;
}

.glass-card {
    background: linear-gradient(180deg, rgba(14, 25, 48, 0.88), rgba(7, 15, 30, 0.82));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-grid,
.panel-grid,
.hero-inline-grid,
.chart-grid {
    display: grid;
    gap: 22px;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    align-items: stretch;
    margin-bottom: 28px;
}

.hero-grid--compact {
    align-items: start;
}

.hero-copy,
.hero-panel,
.form-panel,
.side-note,
.ranking-intro,
.admin-table-card,
.slogan-card,
.ring-panel,
.chart-card {
    padding: 28px;
}

.hero-copy h1,
.ranking-intro h1,
.single-panel h1 {
    margin: 8px 0 14px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.05;
}

.hero-copy p,
.ranking-intro p,
.auth-card__head p,
.side-note p {
    color: var(--muted);
    line-height: 1.75;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cyan);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 12px;
}

.hero-actions,
.form-actions,
.table-actions,
.ranking-tabs,
.section-head,
.card-head,
.hero-panel__meta,
.health-bar__meta {
    display: flex;
    gap: 12px;
}

.hero-actions,
.form-actions,
.ranking-tabs {
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--cyan), #58b8ff);
    color: #04101e;
    font-weight: 700;
    box-shadow: 0 14px 32px rgba(0, 224, 255, 0.22);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-success {
    background: rgba(34, 197, 94, 0.14);
    color: #b9ffcf;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ffc6c6;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ffb6b6;
}

.btn-table {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.notice-banner,
.flash {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.notice-banner {
    margin-top: 18px;
}

.notice-banner.info,
.flash-success {
    background: rgba(0, 224, 255, 0.08);
}

.notice-banner.warning,
.flash-warning {
    background: rgba(245, 158, 11, 0.12);
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
}

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at top, rgba(0, 224, 255, 0.18), transparent 55%),
        linear-gradient(180deg, rgba(12, 25, 44, 0.96), rgba(5, 10, 22, 0.9));
}

.hero-panel__value {
    font-size: clamp(3rem, 9vw, 5.8rem);
    line-height: 1;
}

.hero-panel__meta {
    justify-content: space-between;
}

.hero-panel__meta span,
.hero-panel__meta p,
.section-head__aside,
.card-head span,
.auth-footnote,
.health-bar__hint {
    color: var(--muted);
}

.section-head,
.card-head {
    align-items: center;
    justify-content: space-between;
}

.section-head {
    margin: 26px 0 18px;
}

.section-head h2,
.card-head h2,
.card-head h3 {
    margin: 6px 0 0;
    font-size: 1.4rem;
}

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

.stat-card {
    padding: 22px;
    min-height: 148px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover,
.health-bar:hover,
.badge-card:hover,
.ranking-card:hover,
.chart-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.16);
}

.stat-card__title,
.stat-card__subtitle {
    display: block;
    color: var(--muted);
}

.stat-card__value {
    display: block;
    margin: 18px 0 10px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.gradient-number {
    background: linear-gradient(135deg, #ffffff, var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-inline-grid {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    margin-bottom: 24px;
}

.ring-panel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    --progress: 0%;
    width: 220px;
    height: 220px;
    padding: 18px;
    border-radius: 50%;
    background: conic-gradient(var(--cyan) var(--progress), rgba(255, 255, 255, 0.08) 0);
}

.progress-ring__inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(4, 10, 22, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.progress-ring__inner strong {
    font-size: 2.4rem;
}

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

.health-bar {
    padding: 20px;
}

.health-bar__meta {
    justify-content: space-between;
    margin-bottom: 12px;
}

.health-bar__track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.health-bar__fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}

.chart-card--wide {
    grid-column: 1 / -1;
}

.chart-box {
    width: 100%;
    height: 300px;
    margin-top: 18px;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.badge-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

.badge-card__icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.06);
}

.badge-card--active .badge-card__icon {
    background: linear-gradient(135deg, rgba(0, 224, 255, 0.18), rgba(124, 58, 237, 0.26));
    color: #ffffff;
}

.badge-card--locked {
    opacity: 0.45;
}

.badge-card h4 {
    margin: 0 0 8px;
}

.badge-card p,
.slogan-card blockquote,
.empty-card p,
.ranking-card__body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.slogan-card blockquote {
    margin-top: 12px;
    font-size: 1.12rem;
}

.modal-shell {
    width: min(860px, calc(100% - 24px));
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}

.modal-shell::backdrop {
    background: rgba(2, 8, 18, 0.72);
    backdrop-filter: blur(8px);
}

.modal-shell--compact {
    width: min(620px, calc(100% - 24px));
}

.modal-card {
    padding: 28px;
}

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

.modal-copy p {
    color: var(--muted);
    line-height: 1.8;
    margin: 0 0 14px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
}

.panel-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    margin-bottom: 28px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group--full {
    grid-column: 1 / -1;
}

label {
    color: var(--muted);
}

input,
textarea {
    width: 100%;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
    border-color: rgba(0, 224, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 224, 255, 0.08);
}

.input-error {
    color: #ffb4b4;
}

.auth-shell,
.single-panel {
    padding-top: 12px;
}

.auth-card {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 30px;
}

.auth-card--wide {
    width: min(860px, 100%);
}

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

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.ranking-list {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.ranking-tabs a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.ranking-tabs a.active {
    color: #04101e;
    background: linear-gradient(135deg, var(--cyan), #91f3ff);
}

.ranking-card {
    display: grid;
    grid-template-columns: 80px 80px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 24px;
}

.ranking-card__rank {
    font-size: 1.8rem;
    font-weight: 800;
}

.ranking-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
}

.ranking-card__name {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 1.24rem;
    font-weight: 700;
}

.ranking-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    color: #d7e6fb;
}

.podium-1 {
    border-color: rgba(247, 201, 72, 0.34);
    background: linear-gradient(180deg, rgba(60, 46, 10, 0.68), rgba(7, 15, 30, 0.82));
}

.podium-2 {
    border-color: rgba(216, 225, 236, 0.24);
}

.podium-3 {
    border-color: rgba(208, 139, 91, 0.24);
}

.ranking-card--me {
    box-shadow: 0 18px 50px rgba(0, 224, 255, 0.18);
}

.empty-card {
    padding: 28px;
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
}

.status-approved {
    background: rgba(34, 197, 94, 0.14);
    color: #b9ffcf;
}

.status-pending {
    background: rgba(245, 158, 11, 0.14);
    color: #ffe0a4;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.14);
    color: #ffc2c2;
}

.theme-admin .page-main {
    padding-top: 24px;
}

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

    .hero-grid,
    .panel-grid,
    .hero-inline-grid,
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }

    .chart-card--wide {
        grid-column: auto;
    }
}

@media (max-width: 780px) {
    .container {
        width: min(var(--container), calc(100% - 20px));
    }

    .nav-wrap,
    .nav-links,
    .nav-actions,
    .section-head,
    .card-head,
    .ranking-card,
    .hero-panel__meta,
    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-wrap {
        align-items: stretch;
    }

    .stats-grid,
    .badge-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group--full {
        grid-column: auto;
    }

    .hero-copy,
    .hero-panel,
    .form-panel,
    .side-note,
    .modal-card,
    .ranking-intro,
    .admin-table-card,
    .slogan-card,
    .ring-panel,
    .chart-card {
        padding: 22px;
    }

    .hero-copy h1,
    .ranking-intro h1,
    .single-panel h1 {
        font-size: 2.2rem;
    }

    .progress-ring {
        width: 180px;
        height: 180px;
    }

    .ranking-card {
        display: flex;
    }
}
