/* ============================================================
   重楼预存系统 · 全站样式
   主题：黑底 + 青色/紫色霓虹渐变（重楼电竞 Logo 配色）
   ============================================================ */

:root {
    --bg: #05060c;
    --bg2: #0a0d18;
    --panel: rgba(148, 163, 184, 0.055);
    --panel-strong: rgba(13, 16, 28, 0.72);
    --line: rgba(148, 163, 184, 0.16);
    --line-soft: rgba(148, 163, 184, 0.09);
    --txt: #e7ecf6;
    --sub: #939db3;
    --cyan: #2dd4ff;
    --violet: #a78bfa;
    --blue: #5b8cff;
    --ok: #34d399;
    --bad: #fb7185;
    --gold: #fbbf24;
    --grad: linear-gradient(100deg, #7ee0ff 0%, #a78bfa 48%, #f2a9ff 100%);
    --grad-btn: linear-gradient(100deg, #1fc2e8 0%, #7c6cf6 100%);
    --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--txt);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { opacity: 0.85; }

/* 背景霓虹光斑 */
.auth-body, .admin-body, .user-body {
    background:
        radial-gradient(700px 420px at 8% -6%, rgba(45, 212, 255, 0.13), transparent 60%),
        radial-gradient(760px 460px at 96% 4%, rgba(167, 139, 250, 0.14), transparent 62%),
        radial-gradient(620px 500px at 50% 118%, rgba(91, 140, 255, 0.10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------------- 登录页 ---------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    position: relative;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    pointer-events: none;
    animation: float 14s ease-in-out infinite alternate;
}
.orb-1 { width: 420px; height: 420px; left: -120px; top: -80px; background: rgba(45, 212, 255, 0.35); }
.orb-2 { width: 460px; height: 460px; right: -140px; bottom: -120px; background: rgba(167, 139, 250, 0.35); animation-delay: -7s; }

@keyframes float {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, 40px) scale(1.12); }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 42px 36px 30px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    position: relative;
    z-index: 1;
}

.auth-logo {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto 16px;
    border-radius: 20px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    box-shadow: 0 0 34px rgba(124, 108, 246, 0.45);
}

.auth-title {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 2px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-sub {
    text-align: center;
    color: var(--sub);
    font-size: 12px;
    letter-spacing: 3px;
    margin: 6px 0 26px;
    text-transform: uppercase;
}

.auth-tip {
    margin-top: 18px;
    text-align: center;
    color: var(--sub);
    font-size: 12px;
}

.login-foot {
    position: absolute;
    bottom: 18px;
    left: 0; right: 0;
    text-align: center;
    color: rgba(147, 157, 179, 0.55);
    font-size: 12px;
    z-index: 1;
}

/* ---------------- 表单 ---------------- */

.field { display: flex; flex-direction: column; }
.field > label {
    font-size: 12px;
    color: var(--sub);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.field input, .field select, .field textarea,
.input {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--txt);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    width: 100%;
}
.field input:focus, .field select:focus, .input:focus {
    border-color: rgba(45, 212, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(45, 212, 255, 0.14);
}
.field input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

select option { background: #12141f; color: var(--txt); }

input[type="datetime-local"] { color-scheme: dark; }

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sub);
    font-size: 13px;
    user-select: none;
    padding: 11px 0 0;
}
.checkbox-line input { width: 16px; height: 16px; accent-color: #7c6cf6; }

/* ---------------- 按钮 ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 12px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--grad-btn);
    box-shadow: 0 8px 26px rgba(64, 110, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 32px rgba(94, 140, 255, 0.55); }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--txt);
}
.btn-ghost:hover { border-color: rgba(45, 212, 255, 0.5); }

.btn-danger {
    background: rgba(251, 113, 133, 0.12);
    border: 1px solid rgba(251, 113, 133, 0.4);
    color: #fda4af;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 9px;
}
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }

.btn-block { width: 100%; margin-top: 18px; }

/* ---------------- Flash 提示 ---------------- */

.flash {
    padding: 11px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    border: 1px solid;
    animation: slideDown 0.25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash-ok    { background: rgba(52, 211, 153, 0.1);  border-color: rgba(52, 211, 153, 0.4);  color: #6ee7b7; }
.flash-error { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.4); color: #fda4af; }

/* ---------------- 后台布局 ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: rgba(9, 11, 20, 0.85);
    border-right: 1px solid var(--line-soft);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand img {
    width: 44px; height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    box-shadow: 0 0 18px rgba(124, 108, 246, 0.4);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.3; }
.brand-txt b {
    font-size: 15px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-txt i { font-style: normal; font-size: 11px; color: var(--sub); letter-spacing: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 11px;
    color: var(--sub);
    border: 1px solid transparent;
    font-weight: 500;
}
.nav-item:hover { color: var(--txt); background: rgba(255, 255, 255, 0.04); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(45, 212, 255, 0.14), rgba(167, 139, 250, 0.14));
    border-color: rgba(167, 139, 250, 0.3);
}
.nav-ico { display: inline-flex; width: 18px; height: 18px; }
.nav-ico svg { width: 100%; height: 100%; }

.sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--sub);
    padding: 0 6px;
}
.role-chip {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 26px 30px 50px;
    max-width: 1320px;
}

.topbar { margin-bottom: 22px; }
.topbar h1 { font-size: 21px; font-weight: 700; letter-spacing: 1px; }

/* ---------------- 卡片 / 面板 ---------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: "";
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: var(--grad-btn);
    display: inline-block;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--grad-btn);
}
.stat-card .num {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.stat-card .num.accent {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-card .lbl { color: var(--sub); font-size: 12px; margin-top: 4px; letter-spacing: 1px; }

/* ---------------- 工具栏 / 筛选 ---------------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}
.toolbar .field { min-width: 160px; flex: 0 1 auto; }
.toolbar .field.grow { flex: 1 1 220px; }
/* 表单里的按钮与输入框底边对齐，避免比带 label 的字段"高出一截" */
.toolbar > .btn { align-self: flex-end; margin-bottom: 1px; }

/* ---------------- 选项卡 ---------------- */

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
    padding: 8px 20px;
    border-radius: 10px;
    border: 1px solid var(--line);
    color: var(--sub);
    font-weight: 600;
    font-size: 13px;
}
.tab.active {
    background: var(--grad-btn);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(64, 110, 255, 0.3);
}

/* ---------------- 表格 ---------------- */

.tbl-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.015);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
    text-align: left;
    padding: 12px 14px;
    color: var(--sub);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
    font-size: 12.5px;
    letter-spacing: 0.5px;
}
td { padding: 12px 14px; border-top: 1px solid var(--line-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }

.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.muted { color: var(--sub); font-size: 12.5px; }

/* 陪玩列：用青色与消费人（白色）区分 */
.t-target { color: var(--cyan); }

/* 记录类型小标签（前台消费/退款） */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.tag-consume { color: var(--bad); background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.3); }
.tag-refund { color: var(--ok); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); }

/* 消费记录行内操作（退款 + 删除） */
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.btn-refund {
    padding: 5px 12px;
    font-size: 12px;
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: var(--ok);
    background: rgba(52, 211, 153, 0.08);
    border-radius: 8px;
    display: inline-block;
}
.btn-refund:hover { background: rgba(52, 211, 153, 0.18); }

/* 退款页：关联原消费提示条 */
.cons-link-box {
    margin: 10px 0 14px;
    padding: 10px 14px;
    border: 1px dashed rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.06);
    border-radius: 10px;
    color: var(--sub);
    font-size: 13px;
}
.cons-link-box b { color: var(--txt); }
.cons-link-box a { margin-left: 10px; color: var(--cyan); }

.empty {
    text-align: center;
    color: var(--sub);
    padding: 40px 0 !important;
    font-size: 13px;
}

/* ---------------- 等级徽章 ---------------- */

.lv {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
    letter-spacing: 0.5px;
}
.lv-1 { color: #cbd5e1; border-color: rgba(203, 213, 225, 0.45); background: rgba(203, 213, 225, 0.08); }
.lv-2 { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.5);  background: rgba(167, 139, 250, 0.1); }
.lv-3 { color: #fca5a5; border-color: rgba(248, 113, 113, 0.5);  background: rgba(248, 113, 113, 0.1); }
.lv-4 {
    color: #e9d5ff;
    border-color: rgba(192, 132, 252, 0.55);
    background: linear-gradient(120deg, rgba(167, 139, 250, 0.22), rgba(251, 191, 36, 0.18));
}
.lv-5 {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.55);
    background: linear-gradient(120deg, rgba(251, 191, 36, 0.2), rgba(0, 0, 0, 0.55));
}

/* ---------------- 分页 ---------------- */

.pager { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pg {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--sub);
    font-size: 12.5px;
}
.pg:hover { color: var(--txt); border-color: rgba(45, 212, 255, 0.5); }
.pg.cur { background: var(--grad-btn); color: #fff; border-color: transparent; }
.pg-info { color: var(--sub); font-size: 12.5px; margin-right: 8px; }

/* ---------------- 前台会员中心 ---------------- */

.user-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(9, 11, 20, 0.8);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
}
.user-nav .brand img { width: 38px; height: 38px; }
.user-nav-right { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 13px; }
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--txt);
    font-size: 13px;
    font-weight: 600;
}
.user-chip .lv { margin: 0; }
.logout-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid rgba(251, 113, 133, 0.35);
    border-radius: 999px;
    color: #fda4af;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}
.logout-link:hover { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.6); }

.user-main { max-width: 1080px; margin: 0 auto; padding: 30px 20px 60px; }

.welcome { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.welcome h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.welcome h2 .lv { font-size: 12px; padding: 4px 12px; }
.welcome .muted { margin-top: 2px; }

.actions-row { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }

/* ---------------- 会员搜索选择器 ---------------- */

.mp-box { position: relative; }
.mp-input { padding-right: 34px; }
.mp-input.filled {
    border-color: rgba(52, 211, 153, 0.55);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}
.mp-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.18);
    color: var(--sub);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mp-clear:hover { background: rgba(251, 113, 133, 0.3); color: #fff; }
.mp-list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #12141f;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
    display: none;
}
.mp-item { padding: 9px 14px; cursor: pointer; font-size: 13.5px; }
.mp-item:hover { background: rgba(45, 212, 255, 0.12); }
.mp-empty { padding: 12px 14px; color: var(--sub); font-size: 13px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 880px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }
    .nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .nav-item { white-space: nowrap; }
    .sidebar-foot { flex-direction: row; align-items: center; justify-content: space-between; }
    .main { padding: 18px 14px 40px; }
    .user-nav { padding: 12px 16px; }
    .welcome .actions-row { margin-left: 0; width: 100%; }
    .toolbar .field { min-width: 0; flex: 1 1 45%; }
}
