/* ============================================================
   Agnes API Gateway v3 — Admin Design System
   简约 · 大气 · 上档次：墨色侧栏 + 素白工作区 + 靛蓝点缀
   ============================================================ */

:root {
    --ink: #0b1220;
    --ink-2: #111a2c;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e6e9ef;
    --line-soft: #eef1f6;
    --bg: #f6f7f9;
    --surface: #ffffff;

    --accent: #4f46e5;
    --accent-strong: #4338ca;
    --accent-soft: #eef0fe;

    --green: #059669;
    --green-soft: #ecfdf5;
    --amber: #d97706;
    --amber-soft: #fffbeb;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --sky: #0284c7;
    --sky-soft: #f0f9ff;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;

    --shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
    --shadow-2: 0 12px 32px -8px rgba(15, 23, 42, .18);

    --sidebar-w: 256px;
    --topbar-h: 64px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

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

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

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

::selection { background: rgba(79, 70, 229, .18); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.mono { font-family: var(--mono); font-size: .92em; }
.dim { color: var(--faint); }
.opt { color: var(--faint); font-weight: 400; font-size: 12px; }
.inline-form { display: inline-flex; margin: 0; }

/* ─── 布局骨架 ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(79, 70, 229, .16) 0%, transparent 55%),
        var(--ink);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

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

.brand-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .45);
    flex-shrink: 0;
}
.brand-mark-lg { width: 40px; height: 40px; border-radius: 12px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: #818cf8; letter-spacing: .08em; text-transform: uppercase; }
.brand-text-lg strong { font-size: 17px; }
.brand-text-lg span { font-size: 12px; }

.nav { flex: 1; margin-top: 26px; display: flex; flex-direction: column; gap: 2px; }

.nav-label {
    font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: #475569; padding: 14px 12px 6px;
}

.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
    position: relative;
}
.nav-item svg { opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(99, 102, 241, .08));
    color: #fff;
}
.nav-item.active::before {
    content: '';
    position: absolute; left: -14px; top: 20%; bottom: 20%;
    width: 3px; border-radius: 3px;
    background: #818cf8;
}

.sidebar-foot {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 12px 0;
    border-top: 1px solid rgba(255, 255, 255, .07);
    font-size: 11.5px; color: #64748b;
}
.foot-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px;
    position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip { display: flex; align-items: center; gap: 9px; }
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
}
.user-name { font-weight: 550; }
.user-badge {
    font-size: 10.5px; font-weight: 600; color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 2px 8px; border-radius: 999px;
}

.content { padding: 28px 32px 56px; max-width: 1240px; width: 100%; margin: 0 auto; }

/* ─── 页头 ─────────────────────────────────────────────── */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }

.seg {
    display: inline-flex; background: #eef0f4; border-radius: 999px; padding: 3px; gap: 2px;
}
.seg-item {
    padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 550; color: var(--muted);
    transition: all .15s ease;
}
.seg-item:hover { color: var(--text); }
.seg-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ─── 按钮 ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 15px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px; font-weight: 550;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #d7dce4; color: var(--text); }
.btn svg { flex-shrink: 0; }

.btn-primary {
    background: var(--ink); border-color: var(--ink); color: #fff;
}
.btn-primary:hover { background: #1c2941; border-color: #1c2941; color: #fff; }

.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: #fecaca; color: var(--red); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef0f4; color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ─── 统计卡片 ─────────────────────────────────────────── */
.stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-1);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px -6px rgba(15, 23, 42, .1); }

.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-label {
    font-size: 11px; font-weight: 600; letter-spacing: .09em;
    text-transform: uppercase; color: var(--faint);
}
.stat-icon {
    width: 30px; height: 30px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.tint-indigo { background: var(--accent-soft); color: var(--accent); }
.tint-emerald { background: var(--green-soft); color: var(--green); }
.tint-amber { background: var(--amber-soft); color: var(--amber); }
.tint-sky { background: var(--sky-soft); color: var(--sky); }

.stat-value {
    font-size: 28px; font-weight: 700; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.stat-dim { font-size: 15px; font-weight: 550; color: var(--faint); margin-left: 2px; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ─── 卡片 ─────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    margin-bottom: 22px;
    overflow: hidden;
}
.grid-2 .card { margin-bottom: 0; }

.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px 0;
}
.card-head h3 { font-size: 14.5px; font-weight: 650; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.card-body { padding: 16px 20px 20px; }
.card-body.table-wrap { padding: 6px 0 8px; overflow-x: auto; }

/* ─── 表格 ─────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
    color: var(--faint);
    padding: 10px 20px;
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}
.table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    font-size: 13.5px;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #fafbfd; }

.table .num { text-align: right; }
.table th.num { text-align: right; }
.table .ops { text-align: right; white-space: nowrap; min-width: 200px; }
.table .ops .inline-form { margin-left: 2px; }

.cell-title { display: block; font-weight: 550; }
.cell-sub { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }

.empty-inline { text-align: center; color: var(--faint); padding: 34px 20px !important; font-size: 13px; }

.error-tip { color: var(--red); margin-left: 6px; vertical-align: -2px; cursor: help; }

/* ─── 徽章 ─────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600;
    padding: 2.5px 9px; border-radius: 999px;
    white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--green-soft); color: #047857; }
.badge-danger { background: var(--red-soft); color: #b91c1c; }
.badge-warn { background: var(--amber-soft); color: #92400e; }
.badge-off { background: #f1f5f9; color: #64748b; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-neutral::before { display: none; }

/* ─── 进度条 ───────────────────────────────────────────── */
.meter { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.meter-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    transition: width .4s ease;
}
.meter-fill.hot { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.meter-fill.tint-fill-indigo { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.meter-fill.tint-fill-amber { background: linear-gradient(90deg, #d97706, #fbbf24); }
.meter-fill.tint-fill-sky { background: linear-gradient(90deg, #0284c7, #38bdf8); }

/* ─── 账号实时状态 ─────────────────────────────────────── */
.rpm-list { display: flex; flex-direction: column; gap: 15px; max-height: 320px; overflow-y: auto; }
.rpm-meta { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.rpm-name { font-weight: 550; font-size: 13.5px; }
.rpm-num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rpm-tags { display: flex; gap: 6px; margin-top: 8px; }

/* ─── 图表容器 ─────────────────────────────────────────── */
.chart-box { position: relative; height: 250px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

/* ─── 空状态 ───────────────────────────────────────────── */
.empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 8px; padding: 30px 12px; color: var(--faint);
}
.empty svg { color: #cbd5e1; }
.empty p { font-weight: 600; color: var(--muted); }
.empty span { font-size: 12.5px; max-width: 260px; }
.empty .btn { margin-top: 8px; }

/* ─── 告警条 ───────────────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.alert-error { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--sky-soft); color: #075985; border-color: #bae6fd; }

.alert-token { display: block; background: var(--amber-soft); border-color: #fde68a; color: #78350f; }
.token-alert-head { display: flex; align-items: center; gap: 8px; }
.token-alert-head svg { margin: 0; }
.alert-token p { font-size: 12.5px; margin: 4px 0 10px; }
.token-reveal {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(255, 255, 255, .75);
    border: 1px dashed #f59e0b;
    border-radius: var(--radius-xs);
    padding: 10px 14px;
}
.token-reveal code { font-family: var(--mono); font-size: 14px; color: #92400e; word-break: break-all; }

/* ─── 表单 ─────────────────────────────────────────────── */
.field label {
    display: block; font-size: 12.5px; font-weight: 600;
    color: var(--text-2); margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select,
.input-sm {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .input-sm:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}
.field input::placeholder { color: #b6bdca; }

.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 16px;
    align-items: end;
}
.field-wide { grid-column: span 2; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.stack-form { display: flex; flex-direction: column; gap: 14px; }

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

.input-append { display: flex; align-items: center; gap: 10px; }
.input-append input { width: 110px; }
.input-append span { color: var(--muted); font-size: 13px; }

.filter-bar { padding: 12px 16px; }
.inline-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── 弹窗 ─────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
/* display:flex 会压过 hidden 属性的 UA 默认样式，必须显式声明 */
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(11, 18, 32, .5); backdrop-filter: blur(3px); }
.modal-panel {
    position: relative;
    width: min(480px, calc(100vw - 40px));
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-2);
    animation: modalIn .18s ease;
}
.modal-panel-lg { width: min(660px, calc(100vw - 40px)); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 0;
}
.modal-head h3 { font-size: 15.5px; font-weight: 650; }
.modal-close {
    width: 30px; height: 30px; border-radius: 8px;
    border: none; background: transparent; color: var(--faint);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transform: rotate(45deg);
    transition: all .15s ease;
}
.modal-close:hover { background: #eef0f4; color: var(--text); }
.modal-body { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 13px; }

/* ─── 分页 ─────────────────────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin: 20px 0 6px;
}
.page-info { font-size: 12.5px; color: var(--muted); }

/* ─── 系统设置 ─────────────────────────────────────────── */
.info-list { display: flex; flex-direction: column; }
.info-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row > span:first-child { color: var(--muted); }

.model-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.model-cat h4 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.model-cat ul { list-style: none; }
.model-cat li { padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.model-cat li:last-child { border-bottom: none; }

/* ─── 类型分布 / 趋势条 ────────────────────────────────── */
.dist-list { display: flex; flex-direction: column; gap: 16px; }
.dist-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.dist-num { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.trend-bars { display: flex; align-items: stretch; gap: 4px; height: 160px; }
.trend-col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trend-track { flex: 1; display: flex; align-items: flex-end; background: linear-gradient(to top, #f1f3f8, transparent); border-radius: 6px; }
.trend-bar {
    width: 100%;
    background: linear-gradient(180deg, #818cf8, #4f46e5);
    border-radius: 6px 6px 2px 2px;
    transition: height .4s ease;
    min-height: 0;
}
.trend-lab { font-size: 10px; color: var(--faint); text-align: center; height: 14px; line-height: 14px; white-space: nowrap; }

/* ─── 代码示例 ─────────────────────────────────────────── */
.code-sample {
    background: var(--ink);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    overflow-x: auto;
}
.code-sample pre { margin: 0; }
.code-sample code, .code-sample pre {
    font-family: var(--mono); font-size: 12.5px; color: #d7dce8; line-height: 1.7;
}
.code-sample .str { color: #86efac; }
.code-sample-wrap { position: relative; }
.code-copy-btn {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    color: #cbd5e1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.code-copy-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.code-copy-btn svg { display: block; }

/* ─── 令牌前缀 ─────────────────────────────────────────── */
.token-prefix { background: #f1f3f8; padding: 3px 8px; border-radius: 6px; color: var(--accent-strong); font-weight: 600; }

/* ─── 认证页（登录 / 初始化）───────────────────────────── */
.auth-body { background: var(--ink); }
.auth-split { display: flex; min-height: 100vh; }

.auth-brand {
    flex: 1.1;
    background:
        radial-gradient(90% 70% at 15% 10%, rgba(99, 102, 241, .28) 0%, transparent 60%),
        radial-gradient(60% 50% at 90% 90%, rgba(139, 92, 246, .14) 0%, transparent 55%),
        var(--ink);
    color: #e2e8f0;
    display: flex; align-items: center;
    padding: 8vh 7vw;
    position: relative;
    overflow: hidden;
}
.auth-brand::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(70% 70% at 30% 30%, #000 0%, transparent 75%);
    pointer-events: none;
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-brand h1 {
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
    color: #fff;
    margin: 40px 0 14px;
}
.auth-brand h1 em { font-style: normal; color: #a5b4fc; }
.auth-sub { color: #94a3b8; font-size: 15px; }
.auth-points { list-style: none; margin-top: 34px; display: flex; flex-direction: column; gap: 13px; }
.auth-points li { display: flex; align-items: center; gap: 11px; color: #b3bdd1; font-size: 13.5px; }
.auth-points svg { color: #818cf8; flex-shrink: 0; }

.auth-form-wrap {
    flex: 1;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    padding: 48px 24px;
}
.auth-form-box {
    width: 100%; max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-1);
    padding: 38px 36px 30px;
}
.auth-form-box h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.auth-hint { color: var(--muted); font-size: 13px; margin: 5px 0 22px; }
.auth-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--faint); text-align: center; }

/* ─── Toast ────────────────────────────────────────────── */
.toast-wrap {
    position: fixed; right: 20px; bottom: 20px; z-index: 200;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--ink); color: #fff;
    font-size: 13px; font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: var(--shadow-2);
    opacity: 0; transform: translateY(8px);
    transition: all .25s ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: #065f46; }
.toast-error { background: #7f1d1d; }

/* ─── 响应式 ───────────────────────────────────────────── */
@media (max-width: 1080px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .model-cats { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .field-wide { grid-column: span 2; }
}

@media (max-width: 820px) {
    .sidebar { display: none; }
    .content { padding: 20px 16px 48px; }
    .topbar { padding: 0 16px; }
    .auth-split { flex-direction: column; }
    .auth-brand { padding: 48px 28px; flex: none; }
    .auth-brand h1 { margin-top: 24px; }
    .auth-points { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: span 1; }
}

/* ─── 设置页补充 ───────────────────────────────────────── */
.form-hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.form-hint code { background: #eef0f4; padding: 1px 6px; border-radius: 5px; font-size: 11.5px; color: var(--accent-strong); }
.upstream-cell { display: inline-flex; align-items: center; gap: 8px; }
.upstream-cell code { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
