:root {
    --bg: #fff8fb;
    --card: #ffffff;
    --ink: #372632;
    --muted: #7f6673;
    --pink: #e85d93;
    --pink-soft: #ffe2ee;
    --mint: #dff6ed;
    --yellow: #fff1bf;
    --line: #f2c7d8;
    --danger: #d82148;
    --ok: #2c8b68;
    --shadow: 0 16px 40px rgba(178, 86, 123, .14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 226, 238, .9), transparent 34rem),
        linear-gradient(180deg, #fff8fb 0%, #fffdf8 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    overflow-x: hidden;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.html5-sparkles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.html5-sparkles span {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(232, 93, 147, .18);
    transform: rotate(45deg);
    animation: floatSparkle 12s linear infinite;
}

.html5-sparkles span::before,
.html5-sparkles span::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: inherit;
}

.html5-sparkles span::before {
    left: -9px;
}

.html5-sparkles span::after {
    top: -9px;
}

.html5-sparkles span:nth-child(1) {
    left: 8%;
    bottom: -24px;
    animation-delay: 0s;
}

.html5-sparkles span:nth-child(2) {
    left: 28%;
    bottom: -48px;
    width: 14px;
    height: 14px;
    background: rgba(148, 217, 196, .24);
    animation-delay: 3s;
    animation-duration: 14s;
}

.html5-sparkles span:nth-child(3) {
    left: 66%;
    bottom: -36px;
    background: rgba(255, 211, 110, .28);
    animation-delay: 1.5s;
    animation-duration: 13s;
}

.html5-sparkles span:nth-child(4) {
    left: 88%;
    bottom: -30px;
    width: 12px;
    height: 12px;
    animation-delay: 5s;
    animation-duration: 15s;
}

@keyframes floatSparkle {
    0% {
        transform: translateY(0) rotate(45deg) scale(.8);
        opacity: 0;
    }
    15% {
        opacity: .9;
    }
    100% {
        transform: translateY(-115vh) rotate(405deg) scale(1.15);
        opacity: 0;
    }
}

.topbar,
.hero,
.panel,
.stat-card {
    border: 1px solid rgba(242, 199, 216, .75);
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 8px;
    margin-bottom: 18px;
    animation: riseIn .55s ease both;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 28px;
}

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

.eyebrow {
    margin-bottom: 6px;
    color: var(--pink);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
    margin-bottom: 0;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav a,
.primary-button,
.secondary-button {
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 10px 14px;
    text-decoration: none;
    font-weight: 700;
}

.nav a {
    color: var(--ink);
    background: #fff;
}

.nav a.active {
    color: #fff;
    background: var(--pink);
    border-color: var(--pink);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px;
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
    animation: riseIn .65s ease both;
}

.hero.compact {
    margin-bottom: 18px;
}

.hero-total {
    font-size: 44px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--pink);
    margin-bottom: 8px;
}

.mascot {
    width: 160px;
    max-width: 32vw;
    flex: 0 0 auto;
    animation: mascotBob 4s ease-in-out infinite;
}

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

.stat-card {
    border-radius: 8px;
    padding: 14px;
    min-height: 92px;
    animation: riseIn .55s ease both;
}

.stat-card:hover,
.panel:hover {
    transform: translateY(-2px);
}

.stat-card:nth-child(3n + 2) {
    background: linear-gradient(180deg, #fff, var(--mint));
}

.stat-card:nth-child(3n) {
    background: linear-gradient(180deg, #fff, var(--yellow));
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 20px;
}

.panel {
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
    transition: transform .22s ease, box-shadow .22s ease;
    animation: riseIn .72s ease both;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.form-grid,
.filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

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

.deposit-form {
    grid-template-columns: 160px minmax(220px, 1fr) 140px 120px;
}

.income-form {
    grid-template-columns: 130px 150px 110px 100px minmax(150px, 1fr) 130px 86px 108px;
    gap: 10px;
}

.income-form input,
.income-form select,
.income-form .primary-button {
    min-height: 38px;
    padding-top: 7px;
    padding-bottom: 7px;
}

label span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 9px 11px;
    font: inherit;
}

input:focus,
select:focus {
    outline: 3px solid rgba(232, 93, 147, .16);
    border-color: var(--pink);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
    color: #fff;
    background: var(--pink);
    border-color: var(--pink);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(232, 93, 147, .18);
}

.primary-button.small {
    min-height: 36px;
    padding: 8px 12px;
}

.secondary-button {
    color: var(--pink);
    background: var(--pink-soft);
}

.text-link,
.actions a {
    color: var(--pink);
    font-weight: 700;
    text-decoration: none;
}

.filters {
    grid-template-columns: 170px 220px 90px;
    margin-bottom: 14px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    border-bottom: 1px solid #f6d9e4;
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    background: #fff7fa;
}

.money {
    color: var(--pink);
    font-weight: 800;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 8px;
    background: var(--pink-soft);
    padding: 4px 9px;
    color: #9e315e;
    font-weight: 700;
    font-size: 12px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions form {
    margin: 0;
}

.actions button {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.danger-text {
    color: var(--danger);
    font-weight: 800;
}

.alert,
.notice {
    border-radius: 8px;
    padding: 11px 13px;
    font-weight: 700;
}

.alert {
    color: var(--danger);
    background: #fff0f3;
    border: 1px solid #ffc2ce;
}

.notice {
    color: var(--ok);
    background: #effaf6;
    border: 1px solid #bfe9d8;
}

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

.warning-row {
    background: #fff4f6;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 28px 10px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow);
    padding: 28px;
    text-align: left;
    animation: riseIn .6s ease both;
}

.login-mascot {
    display: block;
    width: 128px;
    margin: 0 auto 16px;
}

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

@keyframes mascotBob {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(1.5deg);
    }
}

.login-form,
.account-form {
    display: grid;
    gap: 14px;
}

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

.account-panel {
    max-width: 780px;
}

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

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

    .topbar,
    .hero {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 20px, 1180px);
        padding-top: 12px;
    }

    .stats-grid,
    .form-grid,
    .filters,
    .ip-form,
    .deposit-form,
    .account-form {
        grid-template-columns: 1fr;
    }

    .hero-total {
        font-size: 34px;
    }

    .mascot {
        align-self: center;
        max-width: 190px;
    }

    .topbar,
    .panel,
    .hero {
        padding: 16px;
    }

    .nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav a {
        text-align: center;
    }

    table {
        min-width: 680px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
