/* =====================================================================
   996 传奇 GM 数据控制台
   ===================================================================== */
:root {
    --bg: #090c11;
    --bg-soft: #0d1118;
    --panel: #111722;
    --panel-2: #151d2a;
    --line: #212b3b;
    --line-soft: #1a2331;
    --text: #e9edf5;
    --muted: #8b95a9;
    --muted-2: #616b7d;
    --gold: #e9b95f;
    --gold-deep: #c9922f;
    --jade: #3ecf9a;
    --red: #e5645e;
    --blue: #5b8def;
    --violet: #a586ff;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

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

[hidden] { display: none !important; }

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }
.num { font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #263143; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 通用控件 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font-size: 13px;
    transition: .18s ease;
    white-space: nowrap;
}
.btn:hover { border-color: #33425b; background: #1a2433; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
    border: none;
    background: linear-gradient(135deg, #eec36d, #cf9a35);
    color: #231705;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(233, 185, 95, .18);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.small { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn.tiny { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 7px; }

.input, .select {
    height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: .18s;
}
.input::placeholder { color: var(--muted-2); }
.input:focus, .select:focus { border-color: rgba(233, 185, 95, .55); box-shadow: 0 0 0 3px rgba(233, 185, 95, .08); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #8b95a9 50%), linear-gradient(135deg, #8b95a9 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.panel {
    background: linear-gradient(180deg, rgba(21, 29, 42, .85), rgba(17, 23, 34, .95));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
}
.panel-title { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.panel-title .count-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 20px;
    background: rgba(233, 185, 95, .12);
    color: var(--gold);
    font-size: 12px;
    font-weight: 500;
    vertical-align: 1px;
}

/* ---------------- 登录页 ---------------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(900px 520px at 12% -8%, rgba(201, 146, 47, .16), transparent 62%),
        radial-gradient(760px 480px at 96% 108%, rgba(91, 141, 239, .12), transparent 60%),
        linear-gradient(160deg, #080b10 0%, #0b1018 55%, #090c12 100%);
    position: relative;
    overflow: hidden;
}
.login-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, .9), transparent 75%);
    pointer-events: none;
}
.login-shell {
    position: relative;
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 48px;
    align-items: center;
}
.login-intro .brand { margin-bottom: 28px; }
.login-intro h1 {
    font-size: 34px;
    line-height: 1.3;
    letter-spacing: .5px;
    background: linear-gradient(120deg, #fff0cf, #e9b95f 55%, #b9821f);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.login-intro p { margin-top: 14px; color: var(--muted); max-width: 420px; line-height: 1.9; }
.login-points { margin-top: 30px; display: grid; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 10px; color: #c3cbd9; font-size: 13px; }
.login-points .tick {
    width: 18px; height: 18px; flex: 0 0 18px;
    border-radius: 50%;
    background: rgba(62, 207, 154, .12);
    color: var(--jade);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px;
}

.login-card {
    background: linear-gradient(180deg, rgba(22, 30, 44, .92), rgba(15, 21, 31, .96));
    border: 1px solid #263247;
    border-radius: 18px;
    padding: 34px 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}
.login-card h2 { font-size: 20px; letter-spacing: .5px; }
.login-card .hint { margin-top: 6px; color: var(--muted); font-size: 13px; }
.login-form { margin-top: 26px; display: grid; gap: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: .3px; }
.field .input { width: 100%; height: 42px; }
.login-form .btn { width: 100%; height: 44px; margin-top: 6px; font-size: 14px; }
.login-error {
    margin-top: 16px;
    padding: 10px 12px;
    border: 1px solid rgba(229, 100, 94, .35);
    background: rgba(229, 100, 94, .1);
    border-radius: 9px;
    color: #f3a19d;
    font-size: 12.5px;
}
.login-foot { margin-top: 20px; text-align: center; color: var(--muted-2); font-size: 12px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(140deg, #f3cd83, #c48b24);
    color: #221604;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -.5px;
    box-shadow: 0 8px 20px rgba(201, 146, 47, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .5px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; }

/* ---------------- 应用框架 ---------------- */
.app-body { background: var(--bg); }
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: linear-gradient(180deg, #0b0f16, #090c11);
    border-right: 1px solid var(--line-soft);
}
.sidebar .brand { padding: 2px 6px 18px; border-bottom: 1px solid var(--line-soft); }
.nav { display: grid; gap: 4px; }
.nav-label { padding: 0 10px; margin-bottom: 8px; font-size: 11px; letter-spacing: 1.4px; color: var(--muted-2); }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px;
    border-radius: 9px;
    color: #aab4c6;
    font-size: 13.5px;
    transition: .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .035); color: var(--text); }
.nav-item.active {
    background: linear-gradient(90deg, rgba(233, 185, 95, .14), rgba(233, 185, 95, .03));
    color: var(--gold);
    box-shadow: inset 2px 0 0 var(--gold);
}
.nav-item .ni { width: 16px; height: 16px; opacity: .9; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.engine-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: var(--muted);
    font-size: 11.5px;
    background: rgba(255, 255, 255, .02);
}
.engine-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 8px var(--jade); }

.main { min-width: 0; padding: 24px 28px 34px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.topbar h1 { font-size: 22px; letter-spacing: .4px; font-weight: 600; }
.topbar .sub { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.topbar .sub b { color: #c8d1e0; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.switch {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
    transition: .18s;
}
.switch .switch-dot { width: 7px; height: 7px; border-radius: 50%; background: #4a566b; transition: .18s; }
.switch.on { color: var(--jade); border-color: rgba(62, 207, 154, .35); background: rgba(62, 207, 154, .07); }
.switch.on .switch-dot { background: var(--jade); box-shadow: 0 0 8px var(--jade); }

/* ---------------- 统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
    position: relative;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(24, 33, 48, .9), rgba(15, 21, 31, .95));
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -30px; top: -40px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 185, 95, .14), transparent 70%);
}
.stat-card .stat-label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat-card .stat-ico {
    width: 22px; height: 22px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(233, 185, 95, .1);
    color: var(--gold);
    font-size: 11px;
}
.stat-card .stat-value { margin-top: 12px; font-size: 27px; font-weight: 650; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { margin-top: 6px; color: var(--muted-2); font-size: 11.5px; }
.stat-card.jade .stat-ico { background: rgba(62, 207, 154, .1); color: var(--jade); }
.stat-card.blue .stat-ico { background: rgba(91, 141, 239, .12); color: var(--blue); }
.stat-card.violet .stat-ico { background: rgba(165, 134, 255, .12); color: var(--violet); }

/* ---------------- 布局 ---------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.side-col { display: grid; gap: 16px; }

/* ---------------- 表格 ---------------- */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .input { width: 210px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); }
.segmented button {
    height: 28px; padding: 0 12px;
    border: none; border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    transition: .16s;
}
.segmented button.active { background: #233044; color: var(--text); }

.batch-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 18px;
    background: rgba(233, 185, 95, .06);
    border-bottom: 1px solid rgba(233, 185, 95, .14);
    font-size: 12.5px;
    color: var(--muted);
}
.batch-bar strong { color: var(--gold); font-weight: 600; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 1220px; border-collapse: collapse; }
.data-table th {
    padding: 11px 12px;
    text-align: left;
    color: var(--muted-2);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(10, 14, 20, .35);
    white-space: nowrap;
}
.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(33, 43, 59, .55);
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .022); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .check-col { width: 38px; }
input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: var(--gold);
    cursor: pointer;
    vertical-align: -2px;
}

.role-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    background: rgba(233, 185, 95, .1);
    color: var(--gold);
}
.avatar.warrior { background: rgba(224, 102, 79, .13); color: #ef8a73; }
.avatar.mage { background: rgba(91, 141, 239, .14); color: #83a9f5; }
.avatar.taoist { background: rgba(62, 207, 154, .12); color: #6ddcb4; }
.avatar.other { background: rgba(165, 134, 255, .12); color: #bda6ff; }
.avatar.big { width: 52px; height: 52px; flex-basis: 52px; border-radius: 13px; font-size: 19px; }
.role-name { font-weight: 550; }
.role-name.link { cursor: pointer; }
.role-name.link:hover { color: var(--gold); }
.role-sub { margin-top: 2px; color: var(--muted-2); font-size: 11.5px; }

.badge {
    display: inline-flex; align-items: center;
    height: 22px; padding: 0 8px;
    border-radius: 6px;
    font-size: 11.5px;
    background: rgba(139, 149, 169, .1);
    color: #b6c0d2;
}
.badge.warrior { background: rgba(224, 102, 79, .12); color: #ef9b88; }
.badge.mage { background: rgba(91, 141, 239, .13); color: #8fb0f7; }
.badge.taoist { background: rgba(62, 207, 154, .11); color: #73dcb8; }
.badge.perm { background: rgba(233, 185, 95, .1); color: var(--gold); }
.badge.perm.zero { background: rgba(139, 149, 169, .08); color: var(--muted); }

.map-cell { display: flex; flex-direction: column; }
.coord { color: var(--muted-2); font-size: 10.5px; margin-top: 2px; }

.money { font-weight: 550; }
.money.gold { color: #e8c77d; }
.money.yuanbao { color: #9fc6ff; }
.money.link-money { cursor: pointer; }
.money.link-money:hover { text-decoration: underline; text-underline-offset: 3px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.status .s-dot { width: 6px; height: 6px; border-radius: 50%; background: #5a6478; }
.status.online { color: #7fe0ba; }
.status.online .s-dot { background: var(--jade); box-shadow: 0 0 7px rgba(62, 207, 154, .8); }
.status.offline { color: var(--muted-2); }

.time-cell { color: #b9c2d2; font-size: 12px; }
.time-cell .rel { display: block; color: var(--muted-2); font-size: 10.5px; margin-top: 2px; }

.row-actions { display: flex; gap: 6px; }
.icon-btn {
    height: 28px; padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    transition: .16s;
}
.icon-btn:hover { color: var(--text); border-color: #36455e; background: rgba(255, 255, 255, .03); }
.icon-btn.gold:hover { color: var(--gold); border-color: rgba(233, 185, 95, .4); }

.empty {
    padding: 54px 20px;
    text-align: center;
    color: var(--muted-2);
}
.empty strong { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.empty span { font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line-soft); }
.pager .pager-info { color: var(--muted-2); font-size: 12px; }
.pager-btns { display: flex; gap: 5px; }
.pager-btns button {
    min-width: 30px; height: 30px; padding: 0 9px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    transition: .16s;
}
.pager-btns button:hover:not(:disabled) { border-color: #36455e; color: var(--text); }
.pager-btns button.active { background: rgba(233, 185, 95, .13); border-color: rgba(233, 185, 95, .35); color: var(--gold); }
.pager-btns button:disabled { opacity: .35; cursor: not-allowed; }

/* ---------------- 侧栏卡片 ---------------- */
.side-col .panel { padding-bottom: 6px; }
.side-col .panel-title { padding: 15px 16px 6px; font-size: 13.5px; }
.job-chart { padding: 8px 16px 14px; display: grid; gap: 13px; }
.job-row { display: grid; grid-template-columns: 42px 1fr 32px; align-items: center; gap: 10px; font-size: 12px; }
.job-row .job-name { color: var(--muted); }
.job-row .job-track { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .045); overflow: hidden; }
.job-row .job-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #d8a348, #f0cb7f); transition: width .5s ease; }
.job-row .job-fill.warrior { background: linear-gradient(90deg, #b34f3b, #e5816b); }
.job-row .job-fill.mage { background: linear-gradient(90deg, #3f66bb, #7ba2ef); }
.job-row .job-fill.taoist { background: linear-gradient(90deg, #2a9c75, #63d7ae); }
.job-row .job-count { text-align: right; color: #c9d2e0; font-variant-numeric: tabular-nums; }

.map-list { padding: 4px 16px 14px; display: grid; gap: 9px; }
.map-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.map-row .map-name { color: #b9c3d3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row .map-count { color: var(--muted); font-size: 11.5px; flex: 0 0 auto; }
.map-rank { width: 18px; height: 18px; border-radius: 5px; background: rgba(255,255,255,.04); color: var(--muted-2); font-size: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; }
.map-row:nth-child(1) .map-rank { background: rgba(233, 185, 95, .14); color: var(--gold); }

.msg-list { padding: 2px 16px 12px; display: grid; gap: 11px; }
.msg-item { padding-bottom: 11px; border-bottom: 1px dashed var(--line-soft); }
.msg-item:last-child { border-bottom: none; padding-bottom: 2px; }
.msg-item .msg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-item .msg-role { font-size: 12.5px; color: #c8d2e1; }
.msg-item .msg-text { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-item .msg-meta { margin-top: 5px; color: var(--muted-2); font-size: 10.5px; }
.chip { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; background: rgba(139,149,169,.1); color: var(--muted); }
.chip.s0 { background: rgba(233, 185, 95, .11); color: var(--gold); }
.chip.s1 { background: rgba(91, 141, 239, .12); color: #8fb0f7; }
.chip.s2 { background: rgba(62, 207, 154, .1); color: #6ddcb4; }
.chip.s3 { background: rgba(229, 100, 94, .12); color: #f0918c; }

/* ---------------- 抽屉 ---------------- */
.overlay {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(4, 7, 11, .6);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .22s ease;
}
.overlay.show { opacity: 1; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
    width: 430px; max-width: 94vw;
    display: flex; flex-direction: column;
    background: #0e141e;
    border-left: 1px solid #263145;
    box-shadow: -20px 0 60px rgba(0, 0, 0, .5);
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.22, .8, .3, 1);
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 13px; padding: 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h2 { font-size: 17px; font-weight: 600; }
.drawer-head .drawer-sub { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.drawer-close { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 16px; line-height: 1; }
.drawer-close:hover { color: var(--text); border-color: #3a4a64; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.drawer-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 11px; overflow: hidden; }
.detail-item { background: #111925; padding: 12px 14px; }
.detail-item .k { color: var(--muted-2); font-size: 11px; letter-spacing: .3px; }
.detail-item .v { margin-top: 5px; font-size: 13.5px; color: #e2e8f2; font-variant-numeric: tabular-nums; }
.detail-item .v.gold { color: #eccb84; }
.detail-item .v.blue { color: #9fc6ff; }
.drawer-section { margin-top: 22px; }
.drawer-section h3 { font-size: 13px; color: #ccd5e3; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.drawer-section h3::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--gold); opacity: .8; }
.log-list { display: grid; gap: 8px; }
.log-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(255,255,255,.015); font-size: 12px; }
.log-row .log-time { color: #bcc6d6; }
.log-row .log-meta { color: var(--muted-2); font-size: 11px; }
.log-row .log-dur { color: var(--muted); font-size: 11px; }

.drawer-send { padding: 14px 20px 20px; border-top: 1px solid var(--line-soft); background: #0b111a; }
.drawer-send textarea { width: 100%; height: 68px; resize: none; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-family: inherit; font-size: 13px; outline: none; }
.drawer-send textarea:focus { border-color: rgba(233, 185, 95, .5); }
.drawer-send .send-row { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.drawer-send .counter { color: var(--muted-2); font-size: 11px; }

/* ---------------- 弹窗 ---------------- */
.modal {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(4, 7, 11, .66);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .2s ease;
}
.modal.show { opacity: 1; }
.modal-card {
    width: 520px; max-width: 100%;
    background: linear-gradient(180deg, #151d2a, #101722);
    border: 1px solid #2a364b;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transform: translateY(10px);
    transition: transform .2s ease;
    overflow: hidden;
}
.modal.show .modal-card { transform: translateY(0); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 15px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.recipients { display: flex; flex-wrap: wrap; gap: 6px; max-height: 74px; overflow-y: auto; }
.recipient { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 6px; background: rgba(233, 185, 95, .09); border: 1px solid rgba(233, 185, 95, .18); color: var(--gold); font-size: 11.5px; }
.quick-phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-phrases button { padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--muted); font-size: 11.5px; text-align: left; }
.quick-phrases button:hover { color: var(--text); border-color: #37465f; }
.modal-body textarea { width: 100%; height: 96px; resize: vertical; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.7; outline: none; }
.modal-body textarea:focus { border-color: rgba(233, 185, 95, .5); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px 18px; }
.modal-foot .counter { color: var(--muted-2); font-size: 11.5px; }
.modal-note { color: var(--muted-2); font-size: 11.5px; line-height: 1.7; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast {
    min-width: 200px;
    padding: 10px 16px;
    border-radius: 9px;
    border: 1px solid #2c3a50;
    background: #16202e;
    color: #dbe4f2;
    font-size: 12.5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    animation: toastIn .22s ease;
}
.toast.ok { border-color: rgba(62, 207, 154, .35); color: #8fe9c6; }
.toast.err { border-color: rgba(229, 100, 94, .4); color: #f3a19d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------------- 接入页 ---------------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-head p { margin-top: 7px; color: var(--muted); font-size: 12.5px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; height: 30px; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.back-link:hover { color: var(--gold); }

.access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.server-card { padding: 18px; }
.server-card .sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.server-card .sc-name { font-size: 15px; font-weight: 600; }
.server-card .sc-id { margin-top: 3px; color: var(--muted-2); font-size: 11.5px; }
.server-card .sc-meta { margin-top: 16px; display: grid; gap: 9px; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.meta-row b { color: #cfd8e6; font-weight: 500; }
.token-box { margin-top: 15px; padding: 11px 12px; border-radius: 9px; border: 1px dashed #33425a; background: rgba(91, 141, 239, .05); }
.token-box .token-label { color: var(--muted-2); font-size: 10.5px; letter-spacing: 1px; }
.token-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.token-line code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: #a9c7ff; font-family: Consolas, "JetBrains Mono", monospace; font-size: 11.5px; }
.copy-btn { height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid #33425a; background: transparent; color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.copy-btn:hover { color: var(--text); border-color: #4a5e7e; }

.steps { padding: 4px 20px 18px; display: grid; gap: 15px; }
.step { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.step-no { width: 24px; height: 24px; border-radius: 7px; background: rgba(233, 185, 95, .11); color: var(--gold); font-size: 11.5px; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.step h4 { font-size: 13px; font-weight: 550; color: #dae2ef; }
.step p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.step code { padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.05); color: #c7d4e6; font-family: Consolas, monospace; font-size: 11.5px; }

.api-table { width: 100%; border-collapse: collapse; }
.api-table th { padding: 10px 18px; text-align: left; color: var(--muted-2); font-size: 11px; font-weight: 500; border-bottom: 1px solid var(--line-soft); }
.api-table td { padding: 11px 18px; border-bottom: 1px solid rgba(33, 43, 59, .5); font-size: 12px; color: #bcc7d8; }
.api-table tr:last-child td { border-bottom: none; }
.api-table code { color: #d8c08a; font-family: Consolas, monospace; font-size: 11.5px; }
.method { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .3px; }
.method.get { background: rgba(62, 207, 154, .1); color: #6ddcb4; }
.method.post { background: rgba(91, 141, 239, .12); color: #8fb0f7; }

.notice { margin-top: 16px; padding: 14px 16px; border-radius: 11px; border: 1px solid rgba(233, 185, 95, .18); background: rgba(233, 185, 95, .05); color: #c7b58d; font-size: 12px; line-height: 1.8; }
.notice b { color: var(--gold); font-weight: 550; }

/* ---------------- 货币监控图表 ---------------- */
.chart-panel { margin-bottom: 16px; overflow: hidden; }
.chart-scope-name { margin-left: 8px; padding: 2px 8px; border-radius: 20px; background: rgba(91, 141, 239, .12); color: #9fc6ff; font-size: 11.5px; font-weight: 500; }
.chart-body { padding: 14px 18px 4px; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg i { width: 14px; height: 3px; border-radius: 3px; display: inline-block; }
.chart-legend .lg.gold i { background: var(--gold); box-shadow: 0 0 8px rgba(233, 185, 95, .5); }
.chart-legend .lg.blue i { background: var(--blue); box-shadow: 0 0 8px rgba(91, 141, 239, .5); }
.chart-hint { margin-left: auto; color: var(--muted-2); font-size: 11px; }
.chart-metrics { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 12px; }
.chart-metrics .metric { display: flex; flex-direction: column; gap: 3px; }
.chart-metrics .metric span { color: var(--muted-2); font-size: 11px; }
.chart-metrics .metric b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: #dbe4f2; }
.chart-metrics .metric b.gold { color: #eccb84; }
.chart-metrics .metric b.blue { color: #9fc6ff; }
.chart-metrics .metric b.red { color: #f0918c; }
.chart-canvas { margin-top: 8px; min-height: 230px; }
.chart-canvas svg { display: block; width: 100%; }
.chart-canvas .grid-line { stroke: rgba(255, 255, 255, .055); stroke-width: 1; }
.chart-canvas .zero-line { stroke: rgba(255, 255, 255, .16); stroke-width: 1; stroke-dasharray: 4 4; }
.chart-canvas .axis-text { fill: #616b7d; font-size: 10px; font-family: inherit; }
.chart-canvas .point-abnormal { fill: #e5645e; stroke: #0e141e; stroke-width: 1.5; }
.alert-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px 13px; border-top: 1px solid var(--line-soft); background: rgba(229, 100, 94, .035); }
.alert-strip .alert-label { color: #f0918c; font-size: 11.5px; flex: 0 0 auto; }
.alert-item { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid rgba(229, 100, 94, .3); background: rgba(229, 100, 94, .08); color: #f0aca7; font-size: 11.5px; }
.alert-item:hover { border-color: rgba(229, 100, 94, .55); color: #ffc4bf; }
.alert-empty { color: var(--muted-2); font-size: 11.5px; }

.source-cell { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; }
.source-cell .ip { color: #bcc7d8; font-family: Consolas, "JetBrains Mono", monospace; }
.source-cell .region { color: var(--muted-2); font-size: 10.5px; }

.badge.bot { background: rgba(165, 134, 255, .14); color: #c1abff; }
.bot-tag { display: inline-flex; align-items: center; height: 17px; padding: 0 5px; margin-left: 6px; border-radius: 4px; background: rgba(165, 134, 255, .16); color: #c1abff; font-size: 10px; vertical-align: 1px; }

.bag-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bag-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(255, 255, 255, .015); font-size: 12px; }
.bag-item .bag-name { color: #c9d3e2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-item .bag-count { color: var(--gold); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cur-list { display: grid; gap: 6px; }
.cur-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(255, 255, 255, .015); font-size: 11.5px; }
.cur-row.warn { border-color: rgba(229, 100, 94, .35); background: rgba(229, 100, 94, .06); }
.cur-row .cur-time { color: var(--muted-2); }
.cur-row .cur-deltas { display: flex; gap: 10px; font-variant-numeric: tabular-nums; }
.cur-row .cur-deltas .g { color: #eccb84; }
.cur-row .cur-deltas .y { color: #9fc6ff; }
.cur-row .cur-flag { color: #f0918c; font-size: 10.5px; }
.drawer-section h3 .btn { margin-left: auto; }

.modal-card.small { width: 420px; }
.modal-card.small .modal-body .input { width: 100%; }

/* ---------------- 用户管理 / 账号 ---------------- */
.sidebar-user {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px; margin: 0 0 6px;
    border: 1px solid var(--line-soft); border-radius: 8px;
    background: rgba(255, 255, 255, .025); font-size: 12px;
}
.sidebar-user .su-name { color: #c9d3e2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .su-role {
    margin-left: auto; flex: 0 0 auto;
    padding: 1px 6px; border-radius: 4px;
    background: rgba(91, 141, 239, .14); color: #9fc6ff; font-size: 10px;
}
.badge.admin { background: rgba(165, 134, 255, .16); color: #c1abff; }
.muted { color: var(--muted-2); }
.panel-hint { color: var(--muted-2); font-size: 11.5px; }
.user-table { min-width: 940px; }
.user-account { color: #dbe4f2; font-family: Consolas, "JetBrains Mono", monospace; font-size: 12px; }
.zone-cell { display: flex; flex-wrap: wrap; }
.zone-pill {
    display: inline-flex; align-items: center;
    padding: 2px 7px; margin: 2px 4px 2px 0; border-radius: 5px;
    background: rgba(91, 141, 239, .1); color: #9fc6ff; font-size: 11px;
}
.zone-pill.all { background: rgba(165, 134, 255, .14); color: #c1abff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-card .field { margin-bottom: 14px; }
.modal-card .form-grid .field { margin-bottom: 0; }
.zone-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.zone-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 8px;
    background: rgba(255, 255, 255, .015); font-size: 12px; cursor: pointer;
}
.zone-item input { accent-color: #5b8def; }
.zone-item .zone-name { color: #c9d3e2; }
.zone-item .zone-sid { margin-left: auto; color: var(--muted-2); font-size: 10.5px; }
.field-note { margin-top: 7px; color: var(--muted-2); font-size: 11px; }
.form-result { color: var(--muted-2); font-size: 11.5px; }


/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .side-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .access-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; gap: 30px; max-width: 420px; }
    .login-intro { display: none; }
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; gap: 16px; overflow-x: auto; }
    .sidebar .brand { padding: 0; border: none; flex: 0 0 auto; }
    .brand-text { display: none; }
    .nav { display: flex; gap: 4px; }
    .nav-label, .sidebar-foot { display: none; }
    .main { padding: 18px 16px 28px; }
    .topbar { flex-direction: column; }
    .top-actions { width: 100%; justify-content: flex-start; }
    .filters .input { width: 100%; }
    .side-col { grid-template-columns: 1fr; }
    .stats { gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 22px; }
    .panel-head { flex-direction: column; align-items: flex-start; }
}
