:root {
    --bg: #07111f;
    --bg-soft: rgba(10, 22, 40, 0.72);
    --bg-card: rgba(11, 24, 45, 0.74);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 214, 145, 0.24);
    --text: #eff4fb;
    --muted: #93a6bf;
    --primary: #caa15b;
    --primary-deep: #8f6a2c;
    --success: #43d39e;
    --danger: #ff7b72;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(202, 161, 91, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(56, 108, 186, 0.16), transparent 28%),
        linear-gradient(145deg, #030812 0%, #07111f 45%, #09192a 100%);
}

body.theme-admin {
    background:
        linear-gradient(180deg, rgba(202, 161, 91, 0.08), transparent 22%),
        linear-gradient(140deg, #07111f 0%, #05101c 48%, #0c1b2b 100%);
}

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 0 18px;
}

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

.brand-badge {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #08111f;
    background: linear-gradient(145deg, #f9d89d, #b88a45);
    box-shadow: var(--shadow);
}

.brand-badge-admin {
    color: #f4ebd7;
    background: linear-gradient(145deg, #6f562f, #a88244);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

h1 {
    font-size: 30px;
    font-weight: 700;
}

h2 {
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.05;
    margin-bottom: 18px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 16px;
    margin-bottom: 12px;
}

.lead {
    max-width: 640px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.header-actions,
.cta-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.ghost-link {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    padding: 13px 20px;
}

.primary-btn {
    color: #08111f;
    font-weight: 700;
    background: linear-gradient(135deg, #f4d59d 0%, #c6974d 100%);
    box-shadow: 0 18px 40px rgba(198, 151, 77, 0.28);
}

.secondary-btn {
    color: var(--text);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
}

.ghost-btn,
.ghost-link {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    padding: 11px 18px;
}

.danger-btn {
    background: linear-gradient(135deg, #ffb39d 0%, #cf614b 100%);
    box-shadow: 0 18px 40px rgba(207, 97, 75, 0.24);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.ghost-link:hover {
    transform: translateY(-2px);
}

.hero-panel,
.auth-panel,
.hero-admin,
.glass {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-panel,
.auth-panel {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 28px;
    padding: 40px;
    margin-top: 18px;
}

.hero-stats,
.hero-admin {
    padding: 28px;
}

.metric,
.metric-block {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.metric:last-child,
.metric-block:last-child {
    border-bottom: 0;
}

.metric span,
.metric-block span,
dt {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.metric strong,
.metric-block strong,
dd {
    display: block;
    font-size: 22px;
    font-weight: 700;
    word-break: break-word;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.card {
    padding: 28px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.wallet-grid,
.compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

.compact-grid .metric-block {
    padding: 0;
    border: 0;
}

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

.info-list div {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.info-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

dd {
    margin: 0;
    font-size: 16px;
}

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

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

.stack-form span {
    color: var(--muted);
    font-size: 13px;
}

.stack-form input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(7, 16, 28, 0.8);
    outline: none;
}

.stack-form input:focus {
    border-color: rgba(202, 161, 91, 0.8);
    box-shadow: 0 0 0 3px rgba(202, 161, 91, 0.14);
}

.inline-hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 12px;
}

.status-pill.success {
    color: #08111f;
    background: linear-gradient(135deg, #8df3c9, #3fd29d);
}

.status-pill.error {
    color: #fff4f3;
    background: linear-gradient(135deg, #ffb3aa, #da6859);
}

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

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

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

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

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

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

.auth-form {
    align-self: center;
}

.auth-copy p:last-child {
    color: var(--muted);
    line-height: 1.8;
    margin-top: 16px;
}

.admin-shell {
    padding-bottom: 40px;
}

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

.bg-orb,
.bg-grid {
    pointer-events: none;
    position: fixed;
    inset: 0;
}

.bg-orb::before,
.bg-orb::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(40px);
}

.bg-orb-a::before {
    width: 280px;
    height: 280px;
    top: 90px;
    left: -60px;
    background: rgba(202, 161, 91, 0.14);
}

.bg-orb-b::after {
    width: 320px;
    height: 320px;
    right: -80px;
    bottom: 40px;
    background: rgba(57, 120, 200, 0.14);
}

.bg-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at center, black 45%, transparent 90%);
    opacity: 0.3;
}

.reveal {
    animation: riseIn 0.7s ease both;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .site-header,
    .hero-panel,
    .auth-panel,
    .panel-grid,
    .dual-table {
        grid-template-columns: 1fr;
    }

    .site-header {
        flex-direction: column;
        gap: 18px;
        align-items: flex-start;
    }

    .wallet-grid,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .wide-card {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 100%);
    }

    .card,
    .hero-panel,
    .auth-panel {
        padding: 22px;
    }

    h1 {
        font-size: 24px;
    }
}
