:root {
    --wine: #672137;
    --wine-deep: #471526;
    --wine-soft: #8b3650;
    --gold: #bf9254;
    --gold-soft: #ead7b9;
    --ink: #241d1f;
    --muted: #7a6c6e;
    --paper: #f7f3ed;
    --card: #fffdf9;
    --line: #e7ddd3;
    --green: #247257;
    --green-soft: #e5f2ec;
    --amber: #9a6519;
    --amber-soft: #fff1d8;
    --red: #a53d43;
    --red-soft: #f9e7e8;
    --blue: #376b91;
    --blue-soft: #e7f0f7;
    --shadow: 0 14px 45px rgba(53, 31, 38, .08);
    --radius-xl: 26px;
    --radius-lg: 18px;
    --radius-md: 13px;
    --sidebar-width: 244px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 96% 4%, rgba(191, 146, 84, .13), transparent 26rem),
        radial-gradient(circle at 14% 94%, rgba(103, 33, 55, .08), transparent 30rem),
        var(--paper);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: var(--wine);
}

.boot-screen {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
}

.boot-title {
    margin-top: 12px;
    font-family: "STSong", "SimSun", serif;
    font-size: 30px;
    letter-spacing: .28em;
    padding-left: .28em;
}

.boot-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.spinner {
    width: 24px;
    height: 24px;
    margin-top: 18px;
    border: 2px solid var(--gold-soft);
    border-top-color: var(--wine);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    color: white;
    font-family: Georgia, serif;
    font-size: 22px;
    line-height: 1;
}

.brand-mark--large {
    width: 64px;
    height: 64px;
    color: var(--wine);
    border-color: var(--gold);
    font-size: 32px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 1.05fr) minmax(380px, .95fr);
}

.auth-story {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 52px clamp(36px, 6vw, 92px);
    color: #fff9f3;
    background:
        linear-gradient(145deg, rgba(42, 10, 24, .28), rgba(42, 10, 24, .86)),
        repeating-linear-gradient(125deg, rgba(255,255,255,.026) 0 1px, transparent 1px 17px),
        var(--wine);
}

.auth-story::before {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    right: -160px;
    top: 12%;
    border: 1px solid rgba(234, 215, 185, .22);
    border-radius: 50%;
    box-shadow:
        0 0 0 52px rgba(234, 215, 185, .035),
        0 0 0 110px rgba(234, 215, 185, .026);
}

.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-brand-text {
    font-family: "STSong", "SimSun", serif;
    font-size: 21px;
    letter-spacing: .22em;
}

.auth-copy {
    position: relative;
    max-width: 580px;
    margin: auto 0;
    padding: 70px 0;
}

.auth-eyebrow {
    color: var(--gold-soft);
    font-size: 12px;
    letter-spacing: .28em;
    text-transform: uppercase;
}

.auth-copy h1 {
    margin: 22px 0 24px;
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(42px, 6vw, 76px);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: .04em;
}

.auth-copy p {
    max-width: 480px;
    margin: 0;
    color: rgba(255, 249, 243, .7);
    font-size: 16px;
    line-height: 1.9;
}

.auth-note {
    position: relative;
    color: rgba(255, 249, 243, .46);
    font-size: 12px;
    letter-spacing: .06em;
}

.auth-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 36px;
}

.auth-card {
    width: min(100%, 440px);
    padding: 38px;
    background: rgba(255, 253, 249, .92);
    border: 1px solid rgba(231, 221, 211, .85);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--wine);
}

.auth-mobile-brand .brand-mark {
    color: var(--wine);
    border-color: var(--gold);
}

.auth-title {
    margin: 0 0 8px;
    font-family: "STSong", "SimSun", serif;
    font-size: 30px;
    font-weight: 600;
}

.auth-description {
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 24px;
    padding: 4px;
    border-radius: 12px;
    background: #f0e9df;
}

.auth-tab {
    padding: 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.auth-tab.active {
    color: var(--ink);
    background: var(--card);
    box-shadow: 0 3px 12px rgba(50, 30, 34, .08);
}

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

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

.field > span,
.field-label {
    color: #514749;
    font-size: 13px;
    font-weight: 600;
}

.field-hint {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.field input,
.field textarea,
.field select,
.input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    color: var(--ink);
    background: #fffefb;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.field textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.65;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus {
    border-color: var(--wine-soft);
    box-shadow: 0 0 0 4px rgba(103, 33, 55, .08);
}

.field input::placeholder,
.field textarea::placeholder {
    color: #b4a8a5;
}

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

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}

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

.button:disabled {
    opacity: .58;
    cursor: wait;
    transform: none;
}

.button--primary {
    color: white;
    background: var(--wine);
    box-shadow: 0 8px 20px rgba(103, 33, 55, .2);
}

.button--primary:hover {
    background: var(--wine-deep);
}

.button--gold {
    color: var(--wine-deep);
    background: var(--gold-soft);
}

.button--secondary {
    color: var(--wine);
    background: rgba(103, 33, 55, .06);
    border-color: rgba(103, 33, 55, .1);
}

.button--danger {
    color: var(--red);
    background: var(--red-soft);
}

.button--success {
    color: white;
    background: var(--green);
}

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

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

.button--small {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 12px;
}

.form-error {
    display: none;
    padding: 11px 13px;
    border-radius: 10px;
    color: var(--red);
    background: var(--red-soft);
    font-size: 12px;
    line-height: 1.6;
}

.form-error.visible {
    display: block;
}

.success-panel {
    padding: 24px;
    text-align: center;
    border: 1px solid #cbe1d7;
    border-radius: var(--radius-lg);
    background: var(--green-soft);
}

.success-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    color: white;
    background: var(--green);
    font-size: 24px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 18px 20px;
    color: rgba(255, 250, 246, .78);
    background:
        linear-gradient(165deg, rgba(255,255,255,.035), transparent 38%),
        var(--wine-deep);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 28px;
}

.sidebar-brand-name {
    color: #fff8f0;
    font-family: "STSong", "SimSun", serif;
    font-size: 19px;
    letter-spacing: .16em;
}

.sidebar-brand-caption {
    display: block;
    margin-top: 3px;
    color: rgba(255, 250, 246, .4);
    font-size: 10px;
    letter-spacing: .12em;
}

.nav-label {
    padding: 0 13px;
    margin-bottom: 9px;
    color: rgba(255, 250, 246, .35);
    font-size: 10px;
    letter-spacing: .18em;
}

.nav-list {
    display: grid;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 45px;
    padding: 10px 13px;
    border: 0;
    border-radius: 11px;
    color: inherit;
    background: transparent;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, .06);
}

.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, .11);
    box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    opacity: .78;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-user {
    margin-top: auto;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
}

.sidebar-user-name {
    color: #fff;
    font-size: 13px;
}

.sidebar-user-meta {
    margin-top: 4px;
    color: rgba(255, 255, 255, .42);
    font-size: 10px;
}

.sidebar-logout {
    margin-top: 12px;
    padding: 0;
    border: 0;
    color: var(--gold-soft);
    background: none;
    font-size: 11px;
    cursor: pointer;
}

.content-column {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(20px, 4vw, 48px);
    border-bottom: 1px solid rgba(231, 221, 211, .72);
    background: rgba(247, 243, 237, .82);
    backdrop-filter: blur(18px);
}

.mobile-menu {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    cursor: pointer;
}

.topbar-title {
    font-family: "STSong", "SimSun", serif;
    font-size: 18px;
    font-weight: 600;
}

.topbar-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

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

.month-control {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: var(--card);
}

.avatar-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(103, 33, 55, .12);
    border-radius: 50%;
    color: var(--wine);
    background: #efe2dd;
    font-family: "STSong", "SimSun", serif;
    font-size: 16px;
    cursor: pointer;
}

.page {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 46px) clamp(20px, 4vw, 48px) 96px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-eyebrow {
    margin-bottom: 7px;
    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.page-head h1 {
    margin: 0;
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    letter-spacing: .02em;
}

.page-head p {
    max-width: 620px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-height: 220px;
    padding: clamp(26px, 4vw, 44px);
    margin-bottom: 22px;
    color: #fff9f3;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(118deg, rgba(38, 10, 21, .08), rgba(38, 10, 21, .4)),
        var(--wine);
    box-shadow: 0 20px 48px rgba(70, 19, 36, .17);
}

.hero::after {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -105px;
    top: -135px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    box-shadow:
        0 0 0 40px rgba(255, 255, 255, .025),
        0 0 0 90px rgba(255, 255, 255, .016);
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    color: var(--gold-soft);
    font-size: 11px;
    letter-spacing: .18em;
}

.hero h2 {
    margin: 12px 0 13px;
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 500;
}

.hero p {
    margin: 0;
    color: rgba(255, 249, 243, .6);
    font-size: 13px;
}

.hero-rank {
    position: relative;
    z-index: 1;
    min-width: 118px;
    padding: 22px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(10px);
}

.hero-rank-number {
    display: block;
    color: var(--gold-soft);
    font-family: Georgia, serif;
    font-size: 48px;
    line-height: 1;
}

.hero-rank-label {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    letter-spacing: .12em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 249, .88);
    box-shadow: 0 8px 28px rgba(65, 43, 46, .04);
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 74px;
    height: 74px;
    right: -28px;
    bottom: -34px;
    border-radius: 50%;
    background: rgba(191, 146, 84, .08);
}

.metric-label {
    color: var(--muted);
    font-size: 11px;
}

.metric-value {
    display: block;
    margin-top: 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1;
}

.metric-value small {
    margin-left: 3px;
    font-family: "Microsoft YaHei", sans-serif;
    font-size: 11px;
    color: var(--muted);
}

.metric-foot {
    display: block;
    margin-top: 13px;
    color: var(--muted);
    font-size: 10px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 18px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 249, .9);
    box-shadow: 0 9px 30px rgba(65, 43, 46, .035);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(231, 221, 211, .72);
}

.card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.card-body {
    padding: 22px;
}

.card-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    background: #fffdf9;
    text-align: left;
    cursor: pointer;
}

.quick-action:hover {
    border-color: var(--gold-soft);
    background: #fffaf2;
}

.quick-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 11px;
    color: var(--wine);
    background: rgba(103, 33, 55, .07);
}

.quick-action strong {
    display: block;
    font-size: 13px;
}

.quick-action span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.record-list {
    display: grid;
}

.record-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.4fr) minmax(110px, .7fr) minmax(90px, .6fr) auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 17px 22px;
    border: 0;
    border-bottom: 1px solid rgba(231, 221, 211, .6);
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.record-row:last-child {
    border-bottom: 0;
}

.record-row:hover {
    background: rgba(191, 146, 84, .045);
}

.record-primary {
    min-width: 0;
}

.record-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
}

.record-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.record-money {
    font-family: Georgia, serif;
    font-size: 16px;
}

.record-commission {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge--pending {
    color: var(--amber);
    background: var(--amber-soft);
}

.badge--approved {
    color: var(--green);
    background: var(--green-soft);
}

.badge--rejected {
    color: var(--red);
    background: var(--red-soft);
}

.badge--backfill {
    color: var(--blue);
    background: var(--blue-soft);
}

.badge--muted {
    color: var(--muted);
    background: #f1ece7;
}

.empty-state {
    padding: 50px 22px;
    text-align: center;
    color: var(--muted);
}

.empty-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border: 1px dashed var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 22px;
}

.empty-state strong {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 14px;
}

.empty-state p {
    margin: 0 0 18px;
    font-size: 12px;
    line-height: 1.7;
}

.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-button {
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--card);
    font-size: 11px;
    cursor: pointer;
}

.filter-button.active {
    color: white;
    border-color: var(--wine);
    background: var(--wine);
}

.form-card {
    max-width: 820px;
}

.form-section {
    padding: 26px;
    border-bottom: 1px solid var(--line);
}

.form-section:last-child {
    border-bottom: 0;
}

.form-section-title {
    margin: 0 0 20px;
    font-size: 15px;
}

.backfill-panel {
    display: none;
    margin-top: -4px;
    padding: 14px;
    border: 1px solid #c7dbea;
    border-radius: 12px;
    background: var(--blue-soft);
}

.backfill-panel.visible {
    display: block;
}

.backfill-panel p {
    margin: 0 0 11px;
    color: var(--blue);
    font-size: 11px;
    line-height: 1.6;
}

.upload-zone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 132px;
    padding: 20px;
    border: 1px dashed #c8b8ac;
    border-radius: 15px;
    color: var(--muted);
    background: #fbf8f3;
    text-align: center;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--wine-soft);
    background: #fffaf7;
}

.upload-zone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-zone strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-size: 13px;
}

.upload-zone span {
    font-size: 10px;
    line-height: 1.6;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
    margin-top: 13px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #eee7df;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item span {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 3px 6px;
    border-radius: 5px;
    color: white;
    background: rgba(30, 22, 24, .64);
    font-size: 9px;
}

.amount-preview {
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--wine);
    background: rgba(103, 33, 55, .055);
    font-size: 12px;
}

.amount-preview strong {
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 500;
}

.leaderboard-list {
    display: grid;
    gap: 9px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 54px minmax(130px, 1fr) minmax(90px, .55fr) minmax(80px, .5fr);
    align-items: center;
    gap: 15px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
}

.leaderboard-row.is-me {
    border-color: rgba(103, 33, 55, .3);
    background: linear-gradient(90deg, rgba(103, 33, 55, .055), rgba(255,253,249,.95));
}

.rank-number {
    font-family: Georgia, serif;
    font-size: 24px;
    color: var(--muted);
}

.leaderboard-row:nth-child(1) .rank-number {
    color: #b17a24;
}

.leaderboard-row:nth-child(2) .rank-number {
    color: #7c858d;
}

.leaderboard-row:nth-child(3) .rank-number {
    color: #a55f35;
}

.leaderboard-name {
    font-size: 13px;
    font-weight: 700;
}

.leaderboard-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.leaderboard-amount {
    font-family: Georgia, serif;
    font-size: 17px;
}

.leaderboard-commission {
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

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

.staff-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--card);
}

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

.staff-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--wine);
    background: #efe2dd;
    font-family: "STSong", "SimSun", serif;
    font-size: 18px;
}

.staff-name {
    font-size: 14px;
    font-weight: 700;
}

.staff-phone {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.staff-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.audit-list {
    display: grid;
}

.audit-row {
    display: grid;
    grid-template-columns: 150px minmax(120px, .6fr) minmax(0, 1fr) 150px;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(231, 221, 211, .65);
    font-size: 11px;
}

.audit-row:last-child {
    border-bottom: 0;
}

.audit-actor {
    font-weight: 700;
}

.audit-action {
    color: var(--wine);
}

.audit-details {
    color: var(--muted);
    line-height: 1.55;
}

.audit-time {
    color: var(--muted);
    text-align: right;
}

.export-card {
    max-width: 720px;
}

.export-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.export-mini {
    padding: 16px;
    border-radius: 12px;
    background: #f5eee6;
}

.export-mini span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.export-mini strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, serif;
    font-size: 20px;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 18px;
}

.profile-summary {
    padding: 26px;
    color: white;
    border-radius: var(--radius-lg);
    background: var(--wine);
}

.profile-avatar {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    color: var(--gold-soft);
    font-family: "STSong", "SimSun", serif;
    font-size: 28px;
}

.profile-name {
    font-family: "STSong", "SimSun", serif;
    font-size: 24px;
}

.profile-meta {
    margin-top: 8px;
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
}

.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid #ead2ad;
    border-radius: 12px;
    color: #7c5319;
    background: #fff5e4;
    font-size: 11px;
    line-height: 1.65;
}

.notice strong {
    white-space: nowrap;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    place-items: center;
    padding: 20px;
}

.modal.open {
    display: grid;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 19, 21, .58);
    backdrop-filter: blur(5px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 720px);
    max-height: min(90vh, 900px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 30px 90px rgba(30, 16, 21, .28);
}

.modal-close {
    position: sticky;
    top: 14px;
    z-index: 4;
    float: right;
    width: 34px;
    height: 34px;
    margin: 14px 14px -48px 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 253, 249, .94);
    font-size: 22px;
    cursor: pointer;
}

.modal-body {
    padding: 30px;
}

.modal-title {
    margin: 0 0 6px;
    font-family: "STSong", "SimSun", serif;
    font-size: 24px;
}

.modal-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 11px;
}

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

.detail-item {
    padding: 13px;
    border-radius: 10px;
    background: #f5efe8;
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 9px;
}

.detail-item strong {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    word-break: break-word;
}

.detail-section {
    margin-top: 20px;
}

.detail-section h3 {
    margin: 0 0 10px;
    font-size: 13px;
}

.detail-text {
    padding: 13px 15px;
    border-radius: 10px;
    color: #574c4e;
    background: #f8f4ee;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.image-grid a {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.action-panel {
    display: none;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbf8f3;
}

.action-panel.visible {
    display: block;
}

.action-panel .button {
    margin-top: 12px;
}

.temporary-password {
    padding: 18px;
    margin: 14px 0;
    border: 1px dashed var(--gold);
    border-radius: 12px;
    text-align: center;
    color: var(--wine);
    background: #fffaf1;
    font-family: Consolas, monospace;
    font-size: 21px;
    letter-spacing: .08em;
}

.mobile-overlay {
    display: none;
}

.mobile-nav {
    display: none;
}

.toast {
    position: fixed;
    z-index: 200;
    left: 50%;
    bottom: 28px;
    max-width: min(90vw, 520px);
    padding: 12px 18px;
    border-radius: 12px;
    color: white;
    background: rgba(38, 29, 31, .92);
    box-shadow: 0 12px 35px rgba(20, 12, 14, .2);
    font-size: 12px;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: .22s;
}

.toast.visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.error {
    background: rgba(139, 45, 53, .96);
}

.skeleton {
    border-radius: 10px;
    background: linear-gradient(90deg, #eee7df 20%, #f7f2ec 45%, #eee7df 70%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

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

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

@media (max-width: 820px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-story {
        display: none;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 24px 18px;
        background:
            radial-gradient(circle at 100% 0, rgba(103, 33, 55, .12), transparent 18rem),
            var(--paper);
    }

    .auth-mobile-brand {
        display: flex;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 280px);
        transform: translateX(-102%);
        transition: transform .24s ease;
        box-shadow: 15px 0 50px rgba(24, 12, 16, .25);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 19;
        background: rgba(28, 18, 21, .45);
    }

    .mobile-overlay.open {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

    .topbar {
        min-height: 64px;
        padding: 11px 16px;
    }

    .topbar-subtitle {
        display: none;
    }

    .topbar-actions .month-control {
        max-width: 125px;
        font-size: 11px;
    }

    .page {
        padding: 24px 16px 100px;
    }

    .page-head {
        display: block;
    }

    .page-head .button {
        margin-top: 16px;
    }

    .hero {
        min-height: 185px;
        padding: 24px;
    }

    .hero h2 {
        font-size: 30px;
    }

    .hero-rank {
        min-width: 92px;
        padding: 16px 12px;
    }

    .hero-rank-number {
        font-size: 38px;
    }

    .record-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 15px 16px;
    }

    .record-row .record-money {
        text-align: right;
    }

    .record-row .record-status {
        grid-column: 1;
    }

    .record-row .record-amount-cell {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        text-align: right;
    }

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

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .leaderboard-row {
        grid-template-columns: 42px minmax(110px, 1fr) minmax(90px, auto);
        gap: 10px;
        padding: 13px;
    }

    .leaderboard-commission {
        display: none;
    }

    .audit-row {
        grid-template-columns: 1fr auto;
        gap: 6px 12px;
    }

    .audit-action {
        grid-column: 1;
    }

    .audit-details {
        grid-column: 1 / -1;
    }

    .audit-time {
        grid-column: 2;
        grid-row: 1;
    }

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

    .export-preview {
        grid-template-columns: 1fr;
    }

    .mobile-nav {
        position: fixed;
        z-index: 18;
        left: 12px;
        right: 12px;
        bottom: 10px;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 7px;
        border: 1px solid rgba(231, 221, 211, .9);
        border-radius: 18px;
        background: rgba(255, 253, 249, .94);
        box-shadow: 0 10px 40px rgba(47, 28, 33, .13);
        backdrop-filter: blur(15px);
    }

    .mobile-nav-item {
        display: grid;
        place-items: center;
        gap: 3px;
        min-width: 0;
        padding: 7px 4px;
        border: 0;
        border-radius: 11px;
        color: var(--muted);
        background: transparent;
        font-size: 9px;
        cursor: pointer;
    }

    .mobile-nav-item .nav-icon {
        width: 18px;
        height: 18px;
    }

    .mobile-nav-item.active {
        color: var(--wine);
        background: rgba(103, 33, 55, .07);
    }

    .modal {
        align-items: end;
        padding: 0;
    }

    .modal-card {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
    }

    .modal-body {
        padding: 24px 18px 34px;
    }
}

@media (max-width: 520px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .metric-card {
        min-height: 116px;
        padding: 16px;
    }

    .metric-value {
        font-size: 26px;
    }

    .hero {
        display: block;
    }

    .hero-rank {
        position: absolute;
        right: 18px;
        bottom: 18px;
        min-width: 78px;
        padding: 12px 10px;
        border-radius: 14px;
    }

    .hero-rank-number {
        font-size: 31px;
    }

    .hero p {
        max-width: 65%;
        line-height: 1.65;
    }

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

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .modal-actions .button:only-child {
        grid-column: 1 / -1;
    }
}
