/* =========================================================
   代理管理系统 · 界面样式
   ========================================================= */

:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --ink: #0f1b2d;
    --text: #334155;
    --muted: #78879c;
    --line: #e6ebf3;
    --line-soft: #eef2f8;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eef4ff;
    --green: #0f9d76;
    --green-soft: #e6f8f1;
    --amber: #a16207;
    --amber-soft: #fff6e2;
    --red: #d24444;
    --red-soft: #fdecec;
    --violet: #6d28d9;
    --violet-soft: #f3edff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05);
    --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 12px 32px -16px rgba(15, 27, 45, .22);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(37, 99, 235, .18); }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------ 整体布局 ------------------------------ */

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    color: #a7b5c9;
    background:
        radial-gradient(120% 60% at 10% 0%, rgba(56, 116, 255, .22), transparent 60%),
        radial-gradient(90% 50% at 100% 100%, rgba(16, 185, 129, .12), transparent 60%),
        linear-gradient(180deg, #0b1524 0%, #0e1b2d 55%, #0b1626 100%);
    overflow-y: auto;
    transition: transform .22s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 8px 22px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8 70%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .9);
    letter-spacing: 0;
}

.brand-mark.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 21px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand-text strong { color: #f8fafc; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.brand-text small { color: #64748b; font-size: 9.5px; letter-spacing: .16em; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 18px; }

.nav-group-title {
    padding: 0 12px 8px;
    font-size: 10.5px;
    letter-spacing: .14em;
    color: #5b6b82;
    text-transform: uppercase;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    font-size: 13.5px;
    color: #a7b5c9;
    transition: background .16s ease, color .16s ease;
}

.nav-item .ico { width: 17px; height: 17px; opacity: .85; }

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

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(59, 130, 246, .32), rgba(59, 130, 246, .06));
    box-shadow: inset 0 0 0 1px rgba(96, 150, 255, .18);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 3px;
    background: #4f8cff;
    box-shadow: 0 0 12px rgba(79, 140, 255, .9);
}

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

.sidebar-foot { padding-top: 14px; }

.quota-box {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .07);
}

.quota-label { display: block; font-size: 11px; color: #7c8ba1; letter-spacing: .04em; }
.quota-value { display: block; margin: 3px 0 2px; font-size: 21px; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.quota-value i { font-style: normal; font-size: 11px; color: #8ca0ba; font-weight: 400; margin-left: 2px; }
.quota-note { font-size: 11px; color: #6f7f95; }

.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.side-user-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.side-user-info strong { color: #e8eef7; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-info small { color: #64748b; font-size: 11px; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, #334e7a, #1e3352);
    color: #dbe7f7;
    font-size: 13px;
    font-weight: 600;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .08);
}

.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11.5px; background: var(--brand-soft); color: var(--brand); border-color: #dbe7ff; }

.main { flex: 1; min-width: 0; margin-left: 250px; display: flex; flex-direction: column; }

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 68px;
    padding: 0 28px;
    background: rgba(244, 246, 251, .86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 17px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { font-size: 11.5px; color: #9aa7b9; margin-top: 1px; }
.crumb span { margin: 0 4px; color: #cbd5e1; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    white-space: nowrap;
}

.pill .ico { width: 14px; height: 14px; }
.pill b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill-quota { color: #4a5f7c; }
.pill-quota .ico { color: var(--green); }
.pill-role { color: #3b5bdb; background: var(--brand-soft); border-color: #dbe7ff; }

.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.topbar-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.icon-btn:hover { background: #eef2f8; color: var(--ink); }

.only-mobile { display: none; }
.sidebar-mask { display: none; }

/* ------------------------------ 页面容器 ------------------------------ */

.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 28px 64px; }

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

.page-head h2 { font-size: 19px; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card + .card { margin-top: 18px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
}

.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px 22px; }
.card-body.tight { padding: 14px 18px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ------------------------------ 统计卡 ------------------------------ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat {
    position: relative;
    padding: 18px 18px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .08), transparent 70%);
}

.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.stat-ico .ico { width: 16px; height: 16px; }
.stat-value { margin-top: 8px; font-size: 25px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stat-foot { margin-top: 4px; font-size: 11.5px; color: #9aa7b9; }

.stat.green .stat-ico { background: var(--green-soft); color: var(--green); }
.stat.green::after { background: radial-gradient(circle, rgba(15, 157, 118, .09), transparent 70%); }
.stat.amber .stat-ico { background: var(--amber-soft); color: var(--amber); }
.stat.red .stat-ico { background: var(--red-soft); color: var(--red); }
.stat.violet .stat-ico { background: var(--violet-soft); color: var(--violet); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}

.btn .ico { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .9); }
.btn-primary:hover { background: linear-gradient(180deg, #2f76ee, #1d4ed8); }

.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #cfd9e8; background: #fafbff; }

.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover { background: #e3edff; }

.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdede; }

.btn-link { background: transparent; color: var(--brand); padding: 0 4px; height: auto; }
.btn-link:hover { text-decoration: underline; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-lg { height: 46px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

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

.field { display: block; margin-bottom: 16px; }
.field-label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 12.5px; color: #475569; font-weight: 500; }
.field-label .req { color: var(--red); }
.field-hint { font-size: 11.5px; color: #94a3b8; margin-top: 5px; }

.input,
select.input,
textarea.input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #dfe6f1;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.input { height: auto; min-height: 82px; padding: 10px 12px; resize: vertical; }

.input::placeholder { color: #b3bfd0; }
.input:focus, select.input:focus, textarea.input:focus { border-color: #8fb4fb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.input:disabled { background: #f6f8fc; color: #94a3b8; cursor: not-allowed; }

select.input { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2378879c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }

.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-left: 38px; }
.input-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa7b9; display: flex; }
.input-ico .ico { width: 16px; height: 16px; }
.input-suffix { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 28px; padding: 0 8px; border: 0; background: transparent; color: var(--brand); font-size: 12px; cursor: pointer; border-radius: 6px; }
.input-suffix:hover { background: var(--brand-soft); }

.input-sm { height: 34px; font-size: 13px; padding: 0 10px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-section { padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; color: var(--ink); font-weight: 600; }
.form-section-title .ico { width: 15px; height: 15px; color: var(--brand); }
.form-section-title small { font-weight: 400; color: var(--muted); font-size: 11.5px; }

.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #475569; cursor: pointer; }
.checkline input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--brand); }

.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--line-soft);
}

.filters .input { width: auto; }
.filters .w-180 { width: 180px; }
.filters .w-150 { width: 150px; }
.filters .w-130 { width: 130px; }
.filters .spacer { flex: 1; }

/* ------------------------------ 提醒 ------------------------------ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert .ico { width: 17px; height: 17px; margin-top: 1px; }
.alert span { flex: 1; padding-top: 1px; }
.alert-success { background: var(--green-soft); border-color: #c8efdf; color: #0b7357; }
.alert-error { background: var(--red-soft); border-color: #f6d3d3; color: #a92f2f; }
.alert-warn { background: var(--amber-soft); border-color: #fbe6b9; color: #8a5a08; }
.alert-info { background: var(--brand-soft); border-color: #dbe7ff; color: #1e4ec4; }

.alert-close { border: 0; background: transparent; color: inherit; opacity: .55; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.alert-close:hover { opacity: 1; }

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

.table-wrap { width: 100%; overflow-x: auto; }

.table { min-width: 720px; }
.table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: #7b8aa0;
    background: #fafbfe;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
}
.table tbody tr:hover td { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { color: var(--ink); font-weight: 600; }
.table .pos { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.table .neg { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

.cell-user { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.cell-user .avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; background: #eef3fb; color: #42608c; border-color: #e1e9f5; }
.cell-user .meta { display: flex; flex-direction: column; line-height: 1.35; }
.cell-user .meta strong { color: var(--ink); font-weight: 500; font-size: 13px; }
.cell-user .meta small { color: #93a1b5; font-size: 11px; }

.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}
.tone-ok { background: var(--green-soft); color: #0b7357; }
.tone-warn { background: var(--amber-soft); color: #8a5a08; }
.tone-bad { background: var(--red-soft); color: #a92f2f; }
.tone-info { background: var(--brand-soft); color: #1e4ec4; }
.tone-mute { background: #f1f4f9; color: #64748b; }
.tone-violet { background: var(--violet-soft); color: #5b21b6; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.page-item { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: #52627a; }
.page-item:hover { border-color: #c8d6ea; background: #fafbff; }
.page-item.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-item.disabled { color: #bcc7d6; background: #fafbfe; border-color: var(--line-soft); cursor: default; }
.page-info { margin-left: 6px; font-size: 11.5px; color: #94a3b8; }

/* 空状态 */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 56px 24px; }
.empty-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: #f1f5fb; color: #93a6c0; margin-bottom: 14px; }
.empty-ico .ico { width: 24px; height: 24px; }
.empty-state h3 { font-size: 14.5px; margin-bottom: 4px; }
.empty-state p { font-size: 12.5px; color: var(--muted); max-width: 360px; }
.empty-state .btn { margin-top: 16px; }

/* ------------------------------ 明细 / 面板 ------------------------------ */

.detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px;
}

.detail-avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: linear-gradient(145deg, #e8f0ff, #d7e6ff);
    color: #2563eb;
    font-size: 20px;
    font-weight: 600;
}

.detail-title { flex: 1; min-width: 200px; }
.detail-title h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv span { font-size: 11.5px; color: #93a1b5; }
.kv strong { font-size: 13.5px; color: var(--ink); font-weight: 500; word-break: break-all; }

.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.mini-item:last-child { border-bottom: 0; }
.mini-item .left { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mini-item .left b { font-weight: 500; color: var(--ink); font-size: 12.8px; }
.mini-item .left small { color: #94a3b8; font-size: 11px; }
.mini-item .amt { font-variant-numeric: tabular-nums; font-weight: 600; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-title h3 { font-size: 14px; }
.section-title a { font-size: 12px; color: var(--brand); }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 168px; padding: 6px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.chart-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 100%; max-width: 40px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #6ea0ff, #2f6fed); min-height: 4px; opacity: .9; transition: opacity .15s ease; }
.chart-col:hover .chart-bar { opacity: 1; }
.chart-label { font-size: 11px; color: #94a3b8; }
.chart-value { font-size: 10.5px; color: #7c8aa0; font-variant-numeric: tabular-nums; height: 14px; }

.progress { height: 7px; background: #eef2f9; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4f8cff, #2563eb); }
.progress.warn > i { background: linear-gradient(90deg, #f6c05a, #e39b19); }
.progress.bad > i { background: linear-gradient(90deg, #f08a8a, #d24444); }

.quota-panel { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: center; }
.quota-panel .big { font-size: 30px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.quota-panel .big small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.quota-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quota-stat { padding: 12px 14px; border-radius: 12px; background: #f8faff; border: 1px solid var(--line-soft); }
.quota-stat span { display: block; font-size: 11.5px; color: #93a1b5; }
.quota-stat strong { display: block; margin-top: 2px; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

.notice {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8faff;
    border: 1px solid #e4ecfa;
    font-size: 12.5px;
    color: #52627a;
    line-height: 1.7;
}
.notice .ico { width: 16px; height: 16px; color: #3b6fd4; margin-top: 2px; }

details.record-form { border-bottom: 1px solid var(--line-soft); background: #fbfcff; }
details.record-form > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    font-size: 13px;
    color: var(--brand-dark);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
details.record-form > summary::-webkit-details-marker { display: none; }
details.record-form > summary::after { content: "展开"; margin-left: auto; font-size: 11.5px; color: #8fa0b8; }
details.record-form[open] > summary::after { content: "收起"; }
details.record-form .form-body { padding: 4px 20px 18px; }

.code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px dashed #dbe4f2;
    border-radius: 10px;
    background: #fbfcff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #334155;
    word-break: break-all;
}
.code-box code { flex: 1; }
.copy-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; height: 26px; padding: 0 8px; font-size: 11.5px; color: #52627a; cursor: pointer; }
.copy-btn:hover { background: #f5f8ff; color: var(--brand); }

.code-pre {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #0f1b2d;
    color: #dbe7f7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}

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

.auth-body { background: #0b1524; }
.auth-wrap { display: grid; grid-template-columns: 1.02fr .98fr; min-height: 100vh; }

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 54px 56px;
    color: #dbe7f7;
    overflow: hidden;
    background:
        radial-gradient(70% 55% at 15% 10%, rgba(59, 130, 246, .35), transparent 62%),
        radial-gradient(60% 50% at 90% 85%, rgba(16, 185, 129, .22), transparent 60%),
        linear-gradient(160deg, #0a1422 0%, #0f2038 55%, #0a1627 100%);
}

.auth-aside::before,
.auth-aside::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}
.auth-aside::before { width: 380px; height: 380px; right: -140px; top: -120px; border: 1px solid rgba(255, 255, 255, .08); }
.auth-aside::after { width: 520px; height: 520px; left: -220px; bottom: -260px; border: 1px solid rgba(255, 255, 255, .06); }

.auth-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand strong { display: block; color: #fff; font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.auth-brand small { display: block; color: #6f86a5; font-size: 10px; letter-spacing: .2em; margin-top: 2px; }

.auth-copy { position: relative; z-index: 1; max-width: 460px; }
.auth-copy h2 { color: #f8fbff; font-size: 34px; line-height: 1.35; letter-spacing: .01em; font-weight: 600; }
.auth-copy p { margin-top: 16px; color: #a9bdd6; font-size: 13.5px; line-height: 1.9; }

.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #b9cae0; }
.auth-points .dot { width: 6px; height: 6px; border-radius: 50%; background: #4f8cff; box-shadow: 0 0 10px rgba(79, 140, 255, .9); }

.auth-foot { font-size: 11.5px; color: #5f7592; position: relative; z-index: 1; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: #f4f6fb; }

.auth-card { width: min(430px, 100%); padding: 38px 36px 32px; background: #fff; border-radius: 22px; box-shadow: 0 30px 70px -34px rgba(15, 27, 45, .45); border: 1px solid #edf1f8; }
.auth-card-head .eyebrow { font-size: 10px; letter-spacing: .2em; color: #94a3b8; }
.auth-card-head h1 { font-size: 24px; margin-top: 6px; }
.auth-card-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 22px 0 20px; background: #f1f4fa; border-radius: 12px; }
.role-tab { text-align: center; padding: 9px 6px; border-radius: 9px; font-size: 13px; color: #64748b; transition: all .15s ease; }
.role-tab:hover { color: var(--ink); }
.role-tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 8px rgba(15, 27, 45, .08); }

.auth-form .field { margin-bottom: 15px; }
.auth-form .btn { margin-top: 8px; }

.auth-tip { display: flex; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); color: #93a1b5; font-size: 11.5px; line-height: 1.65; }
.auth-tip .ico { width: 15px; height: 15px; color: #7fa4e8; margin-top: 1px; flex: 0 0 auto; }

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

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

@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); box-shadow: 24px 0 60px -40px rgba(0, 0, 0, .6); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-mask { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8, 15, 26, .45); opacity: 0; visibility: hidden; transition: opacity .2s ease; }
    .sidebar-mask.show { opacity: 1; visibility: visible; }
    .main { margin-left: 0; }
    .only-mobile { display: inline-grid; }
    .topbar { padding: 0 16px; height: 62px; }
    .topbar-title h1 { font-size: 16px; }
    .topbar-user-name { display: none; }
    .page { padding: 18px 16px 56px; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { min-height: 100vh; background: linear-gradient(160deg, #0d1a2c 0%, #12253c 55%, #0d1a2c 100%); }
    .auth-card { border-radius: 18px; }
}

@media (max-width: 720px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 14px; }
    .stat-value { font-size: 21px; }
    .form-grid { grid-template-columns: 1fr; }
    .kv-grid { grid-template-columns: 1fr; }
    .quota-panel { grid-template-columns: 1fr; }
    .filters { padding: 12px 14px; }
    .filters .w-180, .filters .w-150, .filters .w-130 { width: calc(50% - 6px); }
    .filters .input-sm { flex: 1 1 calc(50% - 6px); width: auto; }
    .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
    .detail-head { padding: 18px; }
    .auth-card { padding: 28px 22px 24px; }
    .grid-3 { grid-template-columns: 1fr; }
    .topbar-right .pill { display: none; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .filters .input-sm { flex: 1 1 100%; }
    .filters .w-180, .filters .w-150, .filters .w-130 { width: 100%; }
}