:root {
    --bg: #080b10;
    --bg-elevated: #0f141c;
    --surface: #131a24;
    --surface-hover: #1a2330;
    --surface2: #222c3d;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.11);
    --text: #f2f6fc;
    --muted: #94a5bd;
    --accent: #5b9aff;
    --accent-dim: rgba(91, 154, 255, 0.17);
    --accent2: #ff9a52;
    --accent2-dim: rgba(255, 154, 82, 0.14);
    --danger: #fb7185;
    --danger-bg: rgba(251, 113, 133, 0.11);
    --ok: #5ee9a0;
    --ok-bg: rgba(94, 233, 160, 0.11);
    --radius: 16px;
    --radius-sm: 11px;
    --radius-xs: 8px;
    --shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 56px rgba(0, 0, 0, 0.52);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.22);
    --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --content-fighter: 560px;
    --content-admin: 1040px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.62;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 130% 85% at 50% -28%, rgba(91, 154, 255, 0.14), transparent 55%),
        radial-gradient(ellipse 65% 50% at 100% 0%, rgba(255, 154, 82, 0.07), transparent 45%),
        radial-gradient(ellipse 55% 45% at 0% 100%, rgba(91, 154, 255, 0.05), transparent 48%);
    background-attachment: fixed;
}

::selection {
    background: rgba(91, 154, 255, 0.38);
    color: #fff;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}
a:hover {
    color: #9ec5ff;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.page {
    margin: 0;
    min-height: 100dvh;
}

.page-fighter .lobby-main,
.page-fighter .toolbar,
.page-fighter .top-banner-inner {
    max-width: var(--content-fighter);
}

@media (max-width: 879px) {
    .page-fighter .fighter-app-nav.bottom-nav {
        max-width: var(--content-fighter);
    }
}

.muted {
    color: var(--muted);
}
.small {
    font-size: 0.875rem;
}

/* —— 登录 / 入口 —— */
.auth-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.35rem 1rem 2.25rem;
    background:
        radial-gradient(ellipse 110% 85% at 50% -32%, rgba(91, 154, 255, 0.2), transparent 56%),
        radial-gradient(ellipse 65% 52% at 100% 100%, rgba(255, 154, 82, 0.09), transparent 46%),
        radial-gradient(ellipse 50% 40% at 0% 85%, rgba(91, 154, 255, 0.05), transparent 50%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: var(--radius) var(--radius) 0 0;
    opacity: 0.95;
}

.auth-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
}
.auth-sub {
    margin: 0.5rem 0 1.35rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.auth-extra {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.auth-extra .btn {
    text-decoration: none;
}

.card {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.03) 0%, transparent 42%), var(--surface);
    border-radius: var(--radius);
    padding: 1.45rem 1.3rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm), var(--shadow);
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.empty-card {
    text-align: center;
    padding: 2.25rem 1.25rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.field span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.field textarea {
    min-height: 6.5rem;
    line-height: 1.55;
    resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted);
    opacity: 0.75;
}
.field input:hover,
.field textarea:hover,
.field select:hover {
    border-color: rgba(255, 255, 255, 0.16);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: rgba(15, 20, 28, 0.98);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

@media (max-width: 520px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
}
.checkbox-field input {
    width: auto;
    accent-color: var(--accent);
}

/* —— 按钮 —— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.65rem;
    padding: 0.58rem 1.15rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.01em;
    transition: transform 0.12s var(--ease), filter 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:active {
    transform: scale(0.98);
}
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-block {
    width: 100%;
}
.btn-lg {
    padding: 0.82rem 1.15rem;
    font-size: 1.02rem;
    border-radius: 12px;
}
.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.btn-secondary:hover {
    filter: brightness(1.08);
    text-decoration: none;
    background: var(--surface-hover);
}
.btn-primary {
    background: linear-gradient(155deg, #4a87ff 0%, #3d72f0 45%, #2f5fd6 100%);
    color: #fff;
    box-shadow: 0 2px 14px rgba(91, 154, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 24px rgba(91, 154, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
    background: var(--surface-hover);
    text-decoration: none;
}
.btn-danger {
    background: var(--danger-bg);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}
.btn-sm {
    min-height: 2.15rem;
    padding: 0.38rem 0.72rem;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

/* —— 提示条 —— */
.op-hint {
    font-size: 0.86rem;
    color: #a8c4ff;
    background: linear-gradient(135deg, var(--accent-dim), rgba(79, 143, 255, 0.06));
    border: 1px solid rgba(79, 143, 255, 0.28);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}
.op-hint-fighter {
    margin-top: 0;
}

.fighter-withdraw-notice-card .fighter-withdraw-notice-body {
    margin-bottom: 0;
}

.page-section-title {
    font-size: 1.12rem;
    margin: 0 0 0.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.btn-claim {
    min-height: 2.5rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.92rem;
    min-width: 5.75rem;
    border-radius: var(--radius-sm);
}
.btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--border);
    transform: none;
    box-shadow: none;
}

.cell-actions-stack {
    min-width: 14rem;
    vertical-align: top;
}
.inline-row-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}
.inline-row-form:last-child {
    margin-bottom: 0;
}
.input-tiny {
    width: 5.5rem;
    min-height: auto;
    padding: 0.38rem 0.5rem;
    font-size: 0.82rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text);
}
.input-tiny:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}
.inline-row-form input[name="new_password"] {
    width: 7.5rem;
}

.flash {
    padding: 0.85rem 1.05rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}
.flash-ok {
    background: linear-gradient(135deg, rgba(94, 233, 160, 0.14), var(--ok-bg));
    color: #86efac;
    border-color: rgba(94, 233, 160, 0.28);
}
.flash-error {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.12), var(--danger-bg));
    color: #fecaca;
    border-color: rgba(251, 113, 133, 0.32);
}

/* —— 前台顶栏 —— */
.top-banner {
    background: linear-gradient(180deg, rgba(26, 35, 48, 0.97) 0%, rgba(19, 26, 36, 0.92) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, var(--shadow-sm);
    padding: 0.9rem 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.top-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    max-width: var(--content-fighter);
    margin: 0 auto;
}
.top-banner-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--text), var(--muted));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
@supports not (background-clip: text) {
    .top-banner-title {
        color: var(--text);
        background: none;
    }
}
.top-banner-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
}
.top-wallet {
    max-width: 100%;
    line-height: 1.4;
    font-size: 0.78rem;
}
.top-logout {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
}
.top-logout:hover {
    color: var(--text);
    background: var(--surface2);
    text-decoration: none;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    max-width: var(--content-fighter);
    margin: 0 auto;
}
.toolbar-stat {
    font-size: 0.86rem;
    color: var(--muted);
}

/* —— 全站主题背景：PHP 注入单层随机图 .theme-bg-random（includes/fighter_theme.php） —— */
.theme-bg-root {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.theme-bg-layer {
    position: absolute;
    inset: 0;
    min-width: 100%;
    min-height: 100%;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    transform: scale(1.04);
    transform-origin: center center;
}
/* 随机单图全屏，无 mix-blend / 无双层叠化 */
.theme-bg-random {
    opacity: 0.92;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .theme-bg-random {
        background-attachment: scroll;
    }
}

/* —— 打手前台：配色与后台一致（:root），随机单图背景 + 桌面侧栏 —— */
.page-fighter {
    position: relative;
    z-index: 0;
    min-height: 100dvh;
    background-color: var(--bg);
    /* 渐变压暗减轻，不压住随机背景大图 */
    background-image:
        radial-gradient(ellipse 130% 85% at 50% -28%, rgba(91, 154, 255, 0.07), transparent 55%),
        radial-gradient(ellipse 65% 50% at 100% 0%, rgba(255, 154, 82, 0.04), transparent 45%),
        radial-gradient(ellipse 55% 45% at 0% 100%, rgba(91, 154, 255, 0.03), transparent 48%);
    background-attachment: fixed;
}

.page-fighter::before {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.14;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 3px
    );
}

.page-fighter::after {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(91, 154, 255, 0.05);
}

/* 勿把 .modal-overlay 算进去，否则其 z-index 会被下面的规则压过弹窗专用样式 */
body.page-fighter > *:not(.theme-bg-root):not(.modal-overlay),
body.page-admin > *:not(.theme-bg-root):not(.modal-overlay) {
    position: relative;
    z-index: 1;
}

body.page-fighter .modal-overlay,
body.page-fighter .modal-overlay-image,
body.page-admin .modal-overlay,
body.page-admin .modal-overlay-image {
    z-index: 12000;
}

.page-fighter > .fighter-app-nav {
    z-index: 25;
}

.page-fighter.page-fighter-auth .auth-wrap {
    background: rgba(8, 11, 16, 0.72);
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

@media (max-width: 879px) {
    .page-fighter {
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 880px) {
    .page-fighter:not(.page-fighter-auth) {
        padding-bottom: 1.25rem;
        padding-left: calc(220px + env(safe-area-inset-left, 0px));
    }

    .page-fighter .fighter-app-nav.bottom-nav {
        position: fixed;
        left: env(safe-area-inset-left, 0px);
        top: 0;
        bottom: 0;
        right: auto;
        width: 220px;
        max-width: none;
        margin: 0;
        transform: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.35rem;
        padding: 1.1rem 0.75rem;
        padding-bottom: max(1.1rem, env(safe-area-inset-bottom));
        border-top: none;
        border-right: 1px solid var(--border-strong);
        border-radius: 0;
        background: linear-gradient(180deg, rgba(12, 17, 24, 0.96), rgba(8, 11, 16, 0.94));
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(16px) saturate(1.1);
        -webkit-backdrop-filter: blur(16px) saturate(1.1);
    }

    .page-fighter .fighter-app-nav.bottom-nav::before {
        content: "导航";
        display: block;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.22em;
        text-transform: uppercase;
        color: var(--muted);
        padding: 0.35rem 0.5rem 1rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 0.5rem;
    }

    .page-fighter .fighter-app-nav .bottom-nav-item {
        flex: 0 0 auto;
        width: 100%;
        text-align: left;
        padding: 0.78rem 0.85rem;
        font-size: 0.92rem;
        border-radius: var(--radius-sm);
        border: 1px solid transparent;
    }

    .page-fighter .fighter-app-nav .bottom-nav-item.is-active {
        border-color: rgba(79, 143, 255, 0.28);
        background: var(--accent-dim);
        color: var(--text);
    }
}

/* —— 大厅 —— */
.lobby-main {
    max-width: var(--content-fighter);
    margin: 0 auto;
    padding: 0.35rem 1rem 1.75rem;
}

.order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.order-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.035) 0%, transparent 45%), var(--surface);
    border-radius: var(--radius);
    padding: 1.15rem 1.05rem 1.05rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm), 0 2px 14px rgba(0, 0, 0, 0.18);
    position: relative;
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.2s var(--ease-out);
}
.order-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.85rem;
    bottom: 0.85rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    opacity: 0.65;
}
@media (hover: hover) {
    .order-card:hover {
        border-color: rgba(79, 143, 255, 0.22);
        box-shadow: var(--shadow);
        transform: translateY(-1px);
    }
}

.order-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    padding-left: 0.35rem;
}

.tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}
.tag-open {
    background: var(--accent-dim);
    color: #93c5fd;
    border: 1px solid rgba(79, 143, 255, 0.25);
}
.tag-level {
    background: var(--accent2-dim);
    color: #fdba74;
    border: 1px solid rgba(255, 140, 66, 0.25);
    font-size: 0.66rem;
}
.tag-status {
    background: var(--surface2);
    color: var(--muted);
    border: 1px solid var(--border);
}
.tag-claimed {
    background: var(--accent2-dim);
    color: #fdba74;
}
.tag-pending-settlement {
    background: rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
    border: 1px solid rgba(196, 181, 253, 0.35);
}
.tag-completed {
    background: var(--ok-bg);
    color: #86efac;
    border: 1px solid rgba(74, 222, 128, 0.2);
}
.tag-cancelled {
    background: var(--danger-bg);
    color: #fca5a5;
}

.order-id {
    font-size: 0.78rem;
    color: var(--muted);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.order-title {
    font-weight: 800;
    font-size: 1.06rem;
    margin-bottom: 0.4rem;
    padding-left: 0.35rem;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.order-desc {
    font-size: 0.87rem;
    color: var(--muted);
    margin-bottom: 0.7rem;
    padding-left: 0.35rem;
    line-height: 1.5;
}

.order-meta {
    display: flex;
    align-items: baseline;
    gap: 0.85rem 1.1rem;
    flex-wrap: wrap;
    padding-left: 0.35rem;
}

.order-meta .price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent2);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.order-meta .deposit,
.order-meta .muted.small {
    font-size: 0.8rem;
    color: var(--muted);
}

.order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    padding-left: 0.35rem;
    border-top: 1px solid var(--border);
}

.inline-form {
    display: inline;
    margin: 0;
}

/* —— 底栏 —— */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    background: rgba(12, 17, 24, 0.88);
    border-top: 1px solid var(--border-strong);
    padding: 0.45rem 0.55rem max(0.5rem, env(safe-area-inset-bottom));
    z-index: 20;
    max-width: var(--content-fighter);
    margin: 0 auto;
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bottom-nav-item {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.35rem;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.bottom-nav-item:hover {
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}
.bottom-nav-item.is-active {
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(79, 143, 255, 0.2);
}

/* —— 派单后台：与打手页同一套 body 渐变 + 随机单图（.theme-bg-root） —— */
.page-admin {
    position: relative;
    z-index: 0;
    min-height: 100dvh;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 130% 85% at 50% -28%, rgba(91, 154, 255, 0.07), transparent 55%),
        radial-gradient(ellipse 65% 50% at 100% 0%, rgba(255, 154, 82, 0.04), transparent 45%),
        radial-gradient(ellipse 55% 45% at 0% 100%, rgba(91, 154, 255, 0.03), transparent 48%);
    background-attachment: fixed;
}

.page-admin::before {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.14;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 3px
    );
}

.page-admin::after {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(91, 154, 255, 0.05);
}

.page-admin.page-admin-auth .auth-wrap {
    background: rgba(8, 11, 16, 0.72);
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

/* —— 后台 —— */
.admin-topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.88rem 1.15rem;
    background: rgba(12, 17, 24, 0.92);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
.app-nav a {
    transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.admin-brand {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}
.admin-topnav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: center;
}
.admin-topnav-links a {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.admin-topnav-links a:hover {
    color: var(--text);
    background: var(--surface2);
    text-decoration: none;
}
.admin-topnav-links a.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(79, 143, 255, 0.35), rgba(79, 143, 255, 0.15));
    border: 1px solid rgba(79, 143, 255, 0.35);
}

.admin-main {
    max-width: var(--content-admin);
    margin: 0 auto;
    padding: 1.25rem clamp(0.85rem, 3vw, 1.35rem) 3rem;
}
.admin-main h1 {
    font-size: clamp(1.15rem, 2.8vw, 1.38rem);
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.25;
    text-wrap: balance;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin: 1rem 0 1.5rem;
}
.stat-grid-compact {
    margin-top: 0;
    margin-bottom: 1.35rem;
}
.stat-grid-compact .stat-card {
    padding: 0.8rem 0.45rem;
}
.stat-grid-compact .stat-value {
    font-size: 1.35rem;
}
.stat-grid-compact .stat-label {
    font-size: 0.7rem;
}
.stat-grid-four {
    grid-template-columns: repeat(2, 1fr);
}
.stat-grid-five {
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
    .stat-grid-four {
        grid-template-columns: repeat(4, 1fr);
    }
    .stat-grid-five {
        grid-template-columns: repeat(5, 1fr);
    }
}
.stat-card-highlight {
    border-color: rgba(196, 181, 253, 0.45);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.12);
}
.stat-card {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, transparent 55%), var(--surface);
    border-radius: var(--radius-sm);
    padding: 1.1rem 0.7rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease);
}
.stat-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
@media (hover: hover) {
    .stat-card:hover {
        border-color: rgba(91, 154, 255, 0.28);
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
        transform: translateY(-1px);
    }
    .stat-card-link:hover {
        text-decoration: none;
    }
}
.stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--accent2);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.stat-label {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 0.3rem;
    font-weight: 600;
}

.admin-form-card {
    margin-bottom: 1.1rem;
}

/* 仪表盘统计图 */
.dashboard-chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
@media (min-width: 900px) {
    .dashboard-chart-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.dashboard-chart-card .page-section-title {
    margin-bottom: 0.25rem;
}
.dashboard-chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: min(280px, 52vw);
    margin-top: 0.65rem;
}
.dashboard-chart-canvas-wrap canvas {
    max-height: 100%;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.data-table th,
.data-table td {
    padding: 0.72rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--bg-elevated);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0.03em;
}
.data-table tbody tr {
    transition: background 0.12s var(--ease);
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}
.data-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.018);
}
.data-table tbody tr:nth-child(even):hover td {
    background: rgba(255, 255, 255, 0.045);
}
.data-table tr:last-child td {
    border-bottom: none;
}

.cell-actions {
    white-space: nowrap;
}
.cell-actions .inline-form {
    display: inline-block;
    margin-right: 0.3rem;
}

code {
    background: var(--surface2);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.84em;
    border: 1px solid var(--border);
}

@media (min-width: 600px) {
    .bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius) var(--radius) 0 0;
    }
}

.tag-frozen {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.order-boss {
    font-size: 0.86rem;
    color: var(--muted);
    margin: 0.2rem 0 0.15rem;
    padding-left: 0.35rem;
    line-height: 1.4;
}
.order-peek {
    margin: 0.25rem 0 0.5rem;
    padding-left: 0.35rem;
}

.upload-section {
    margin-top: 0.85rem;
    padding: 0.85rem 0.65rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin-bottom: 0.65rem;
}
.upload-row:last-child {
    margin-bottom: 0;
}
.upload-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 4.5rem;
}
.upload-inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.input-file {
    max-width: 11rem;
    font-size: 0.78rem;
    color: var(--muted);
}
.shot-thumb {
    max-height: 56px;
    max-width: 72px;
    border-radius: 8px;
    vertical-align: middle;
    border: 1px solid var(--border);
    object-fit: cover;
}

.admin-table-wide {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}
.cell-shots {
    font-size: 0.82rem;
    white-space: nowrap;
}
.cell-shots a {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: var(--accent-dim);
    font-weight: 700;
    text-decoration: none;
}
.cell-shots a:hover {
    text-decoration: none;
    filter: brightness(1.15);
}
.admin-transfer-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}
.select-transfer {
    min-width: 9rem;
    max-width: 14rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text);
}

/* 后台订单：备注状态条 + 操作下拉 */
.cell-note {
    max-width: 10rem;
    vertical-align: middle;
}
.note-status-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    border: 1px dashed var(--border-strong);
    background: var(--surface2);
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.note-status-btn.has-note {
    border-style: solid;
    border-color: rgba(79, 143, 255, 0.35);
    color: var(--text);
}
@media (hover: hover) {
    .note-status-btn:hover {
        border-color: rgba(79, 143, 255, 0.5);
        background: rgba(79, 143, 255, 0.08);
    }
}
.note-status-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-status-btn-dual {
    padding: 0.45rem 0.5rem;
}
.note-preview-row {
    display: flex;
    gap: 0.35rem;
    align-items: baseline;
    font-size: 0.72rem;
    line-height: 1.35;
}
.note-preview-row + .note-preview-row {
    margin-top: 0.3rem;
}
.note-preview-label {
    flex-shrink: 0;
    font-weight: 800;
    color: var(--muted);
    width: 2.1em;
}
.note-preview-row .note-status-text {
    flex: 1;
    min-width: 0;
}
.textarea-readonly {
    cursor: default;
    background: var(--bg-elevated) !important;
    color: var(--muted);
    resize: none;
    opacity: 0.95;
}
.order-notes-strip {
    margin: 0.55rem 0 0.2rem;
}
.order-notes-strip .note-status-btn-dual {
    width: 100%;
}

.admin-order-dd {
    position: relative;
    display: inline-block;
    text-align: left;
}
.admin-order-dd > summary {
    list-style: none;
}
.admin-order-dd > summary::-webkit-details-marker {
    display: none;
}
.admin-order-dd-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
@media (hover: hover) {
    .admin-order-dd-trigger:hover {
        border-color: rgba(79, 143, 255, 0.4);
    }
}
.admin-order-dd-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    bottom: auto;
    min-width: 11.5rem;
    max-width: min(18rem, calc(100vw - 24px));
    max-height: min(62vh, 420px);
    overflow: auto;
    z-index: 300;
    padding: 0.45rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.admin-order-dd.is-floating .admin-order-dd-panel {
    position: fixed;
    z-index: 9999;
}
.admin-order-dd.is-drop-up .admin-order-dd-panel {
    top: auto;
    bottom: calc(100% + 6px);
}
.admin-order-dd.is-align-left .admin-order-dd-panel {
    right: auto;
    left: 0;
}
.admin-dd-form {
    margin: 0 0 0.4rem;
}
.admin-dd-form:last-child {
    margin-bottom: 0;
}
.admin-dd-form .btn-block {
    width: 100%;
    justify-content: center;
}
.admin-dd-hint {
    margin: 0 0 0.4rem;
    padding: 0.35rem 0.4rem;
    line-height: 1.35;
}
.admin-dd-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.admin-transfer-form-dd {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}
.select-transfer-dd {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}
.modal-overlay[hidden] {
    display: none !important;
}
.modal-overlay-image {
    z-index: 12000;
}
.modal-dialog {
    width: 100%;
    max-width: 420px;
    max-height: min(90vh, 520px);
    overflow: auto;
    padding: 1.2rem 1.25rem;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%), var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.modal-dialog-image {
    max-width: min(92vw, 1100px);
    max-height: min(92vh, 880px);
    padding: 0.65rem;
}
.modal-image-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 0.55rem;
}
.modal-image-view {
    width: 100%;
    max-height: calc(92vh - 72px);
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.28);
}
.modal-dialog-note .modal-title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 800;
}
.modal-dialog-note #admin-note-modal-id {
    color: var(--accent2);
    font-variant-numeric: tabular-nums;
}
.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}
html.modal-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .stat-card:hover,
    .order-card:hover {
        transform: none !important;
    }
}
