/* ============================================================
   QQBot Console
   日间模式 · QQ 开放平台风格 / 白底 + QQ 蓝
   ============================================================ */
:root {
    --bg: #f5f6f8;
    --bg-2: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --ink: #17181a;
    --ink-2: #5c6370;
    --ink-3: #9aa0a8;
    --line: #e8eaee;
    --line-soft: #f0f2f5;

    --primary: #0066ff;
    --primary-deep: #0052d9;
    --primary-soft: #e8f2ff;
    --success: #00a870;
    --success-soft: #e8f7f0;
    --warning: #d48806;
    --warning-soft: #fff7e6;
    --danger: #e5484d;
    --danger-soft: #fdecec;
    --purple: #722ed1;
    --purple-soft: #f3ebff;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);

    --font-body: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
    --font-display: "Bahnschrift", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: .16s ease; }
a:hover { color: var(--primary-deep); }

::selection { background: rgba(0, 102, 255, .16); }

:focus-visible { outline: 2px solid rgba(0, 102, 255, .45); outline-offset: 2px; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }

/* 背景装饰（QQ 风格保持干净） */
.ambient, .grain { display: none; }

/* ---------- 布局 ---------- */
.app-body { display: flex; min-height: 100vh; position: relative; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    margin: 12px 0 12px 12px;
    height: calc(100vh - 24px);
    position: sticky;
    top: 12px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 18px 12px 12px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #dfe3e8; border-radius: 99px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 9px;
    display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #4d94ff, #0066ff);
}
.brand-mark .ico { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong {
    font-family: var(--font-display); font-size: 16px; letter-spacing: .04em;
    color: var(--ink); font-weight: 600;
}
.brand-text small {
    color: var(--ink-3); font-size: 9px; letter-spacing: .14em; margin-top: 3px;
}

.nav { flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-label {
    font-size: 10px; color: var(--ink-3);
    letter-spacing: .1em; padding: 6px 12px;
}
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin: 2px 0;
    border-radius: 8px;
    color: var(--ink-2); font-size: 13.5px;
    transition: .16s ease;
}
.nav-item .ico { opacity: .7; transition: .16s; width: 17px; height: 17px; }
.nav-item:hover { background: #f5f7fa; color: var(--ink); }
.nav-item:hover .ico { opacity: 1; }
.nav-item.active {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 600;
}
.nav-item.active .ico { opacity: 1; }
.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; font-weight: 600; font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #4d94ff, #0066ff);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.user-meta strong { color: var(--ink); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--ink-3); font-size: 10.5px; }
.logout { color: var(--ink-3); display: grid; place-items: center; }
.logout:hover { color: var(--primary); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 2; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: 12px 16px 0;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 8px; z-index: 30;
}
.topbar h1 {
    font-size: 18px; margin: 0;
    font-weight: 600; letter-spacing: .01em; color: var(--ink);
}
.crumb { margin: 1px 0 0; color: var(--ink-3); font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-btn {
    display: none; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); border-radius: 8px; width: 34px; height: 34px; font-size: 15px; cursor: pointer;
}

.page { padding: 14px 16px 40px; }

/* ---------- 通用 ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 6px; font-size: 12px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.pill .ico { width: 13px; height: 13px; }
.pill-soft {
    background: var(--primary-soft); border-color: transparent; color: var(--primary);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 15px; border-radius: 8px; border: 1px solid transparent;
    font-size: 13px; font-weight: 500; cursor: pointer; transition: .16s ease;
    background: transparent; color: var(--ink-2); white-space: nowrap;
    font-family: var(--font-body);
}
.btn .ico { width: 15px; height: 15px; }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 102, 255, .2);
}
.btn-primary:hover { background: var(--primary-deep); color: #fff; }
.btn-ghost {
    background: var(--surface); border-color: #dfe3e8; color: var(--ink-2);
}
.btn-ghost:hover { background: #f5f7fa; border-color: #cfd5dd; color: var(--ink); }
.btn-soft {
    background: var(--primary-soft); color: var(--primary); border-color: transparent;
}
.btn-soft:hover { background: #d6e8ff; color: var(--primary-deep); }
.btn-danger {
    background: var(--danger-soft); color: var(--danger); border-color: transparent;
}
.btn-danger:hover { background: #fbdada; color: #c93a3f; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 10px; }
.btn[disabled], .btn.disabled {
    background: #f5f6f8; color: var(--ink-3); border-color: var(--line);
    box-shadow: none; cursor: not-allowed; pointer-events: none;
}

.flashes { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.flash {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; border-radius: 8px; font-size: 12.5px;
    border: 1px solid var(--line); background: var(--surface);
}
.flash button { border: 0; background: none; font-size: 16px; cursor: pointer; color: inherit; opacity: .55; }
.flash-success { background: var(--success-soft); color: #00774f; border-color: #b7e6d4; }
.flash-error { background: var(--danger-soft); color: #b83237; border-color: #f7c6c7; }
.flash-warning { background: var(--warning-soft); color: #9a6200; border-color: #f5dfb0; }
.flash-info { background: var(--primary-soft); color: var(--primary-deep); border-color: #c4ddff; }

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-title {
    font-size: 14px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px;
    color: var(--ink);
}
.card-title .ico { color: var(--primary); width: 17px; height: 17px; }
.card-sub { color: var(--ink-3); font-size: 11px; font-weight: 400; margin-left: 4px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }
.card-actions { display: flex; gap: 8px; align-items: center; }

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

/* ---------- 指标卡 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
    position: relative; overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px 15px;
    box-shadow: var(--shadow);
}
.kpi::after {
    content: ''; position: absolute; right: -40px; top: -48px;
    width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 102, 255, .06), transparent 70%);
    pointer-events: none;
}
.kpi-icon {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
    margin-bottom: 12px; position: relative; z-index: 1;
}
.kpi-icon.green { background: var(--success-soft); color: var(--success); }
.kpi-icon.orange { background: var(--warning-soft); color: var(--warning); }
.kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi-label { color: var(--ink-3); font-size: 12px; }
.kpi-value {
    font-family: var(--font-display); font-size: 27px; font-weight: 600;
    margin: 2px 0; color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 11.5px; color: var(--ink-3); }
.kpi-sub b { color: var(--primary); font-weight: 600; }
.kpi-sub b.down { color: var(--danger); }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap::-webkit-scrollbar { height: 5px; }
.table-wrap::-webkit-scrollbar-thumb { background: #e2e6eb; border-radius: 99px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left; color: var(--ink-3); font-weight: 500; font-size: 12px;
    padding: 11px 16px; background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover td { background: #fafbfc; }
.table .num { font-variant-numeric: tabular-nums; }

.robot-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.robot-avatar {
    width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto;
    display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px;
    background: linear-gradient(135deg, #4d94ff, #0066ff);
}
.robot-avatar.g2 { background: linear-gradient(135deg, #34c79a, #00a870); }
.robot-avatar.g3 { background: linear-gradient(135deg, #9a6ae0, #722ed1); }
.robot-avatar.g4 { background: linear-gradient(135deg, #ffb54d, #f58a07); }
.robot-cell .name { font-weight: 600; color: var(--ink); font-size: 13px; }
.robot-cell .sub { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500;
    background: var(--bg-2); color: var(--ink-2);
    white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--bg-2); color: var(--ink-3); }

.progress {
    width: 110px; height: 5px; border-radius: 99px; background: var(--bg-2);
    overflow: hidden;
}
.progress > span {
    display: block; height: 100%; border-radius: 99px;
    background: var(--primary);
}
.progress.warn > span { background: var(--warning); }
.progress.danger > span { background: var(--danger); }
.quota-text { font-size: 11px; color: var(--ink-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.quota-text b { color: var(--ink); font-weight: 600; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; }

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .ico { width: 36px; height: 36px; color: #d5dae1; margin-bottom: 8px; }
.empty h3 { margin: 4px 0; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.empty p { margin: 4px 0 14px; font-size: 12.5px; }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 11px; color: var(--ink-3); line-height: 1.5; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid #dfe3e8; border-radius: 8px;
    font-size: 13px; color: var(--ink); font-family: var(--font-body);
    background: var(--surface);
    transition: .16s ease;
}
input::placeholder, textarea::placeholder { color: #b3b9c2; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, .10);
}
input[disabled] { color: var(--ink-3); background: #f5f6f8; }
textarea { resize: vertical; min-height: 92px; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #9aa0a8 50%), linear-gradient(135deg, #9aa0a8 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: #fff; color: var(--ink); }
input[type=date] { color-scheme: light; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 高级设置折叠区 */
.advanced { border-top: 1px dashed var(--line); padding-top: 14px; }
.advanced > summary {
    display: flex; align-items: center; gap: 6px;
    list-style: none; cursor: pointer;
    font-size: 12.5px; color: var(--ink-2); font-weight: 500;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before {
    content: "+"; color: var(--primary); font-weight: 700; font-size: 14px;
    width: 16px; height: 16px; line-height: 15px; text-align: center;
    border: 1px solid var(--line); border-radius: 5px;
}
.advanced[open] > summary::before { content: "−"; }
.advanced[open] > summary { margin-bottom: 14px; }
.advanced > .form-row { gap: 14px; }

.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.filter-bar .field { min-width: 160px; }
.filter-bar .btn { height: 36px; }

/* ---------- 图表 ---------- */
.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--ink-3); }
.legend-dot { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- 聊天预览 ---------- */
.chat-preview {
    background: var(--surface-2);
    border-radius: 10px; padding: 16px; border: 1px solid var(--line-soft);
}
.bubble {
    background: #fff; border: 1px solid var(--line);
    border-radius: 4px 12px 12px 12px;
    padding: 10px 14px;
    font-size: 12.5px; white-space: pre-wrap; color: var(--ink);
    margin-left: 12px; max-width: 420px;
    box-shadow: var(--shadow-sm);
}
.bubble-meta { font-size: 11px; color: var(--ink-3); margin: 6px 0 8px 12px; }
.bubble + .bubble { margin-top: 12px; }

/* ---------- 其他 ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: 12px; color: var(--ink-2);
}
.tag form { display: inline-flex; }
.tag button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 14px; padding: 0 0 0 2px; line-height: 1; }
.tag button:hover { color: var(--danger); }

pre.code {
    background: #1f2329; color: #e6edf3;
    border: 1px solid #2c323a;
    padding: 14px 16px; border-radius: 10px;
    font-size: 11.5px; overflow-x: auto;
    font-family: "Cascadia Code", Consolas, "Menlo", monospace; line-height: 1.65;
}

.section-title {
    font-size: 12px; font-weight: 600; color: var(--ink-2);
    margin: 0 0 10px; display: flex; align-items: center; gap: 7px;
}
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 16px; }
.pagination a, .pagination span {
    min-width: 30px; height: 30px; padding: 0 9px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; border: 1px solid var(--line); color: var(--ink-2);
    background: var(--surface);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { color: var(--ink-3); opacity: .6; }

.stat-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.stat-line:last-child { border-bottom: 0; }
.stat-line .label { color: var(--ink-3); font-size: 12.5px; }
.stat-line .value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

.bar-line { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; }
.bar-line .name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-line .bar { height: 7px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar-line .bar span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bar-line .val { text-align: right; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.mono { font-family: "Cascadia Code", Consolas, "Menlo", monospace; font-size: 11.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- 管理后台 ---------- */
.log-list { display: flex; flex-direction: column; gap: 12px; }
.log-item { display: flex; gap: 10px; align-items: flex-start; }
.log-dot {
    width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto;
    background: var(--primary);
}
.log-item strong { color: var(--ink); font-weight: 600; }

.edit-panel {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 14px;
}
.edit-row > td { background: #fafcff !important; }

/* 复制提示 */
.toast {
    position: fixed; left: 50%; bottom: 30px; z-index: 999;
    transform: translate(-50%, 14px); opacity: 0;
    padding: 9px 16px; border-radius: 8px;
    background: rgba(23, 24, 26, .92);
    color: #fff; font-size: 12.5px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .22);
    transition: .22s ease; pointer-events: none;
    max-width: min(90vw, 640px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 登录页 ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--bg); }
.auth-wrap {
    position: relative; z-index: 2;
    width: min(940px, 100%);
    display: grid; grid-template-columns: 1fr 1fr;
    border-radius: 16px; overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 18px 60px rgba(16, 24, 40, .10);
}
.auth-aside {
    position: relative;
    padding: 38px 36px;
    display: flex; flex-direction: column;
    background: linear-gradient(160deg, #eef5ff 0%, #f7faff 52%, #eef8f4 100%);
    border-right: 1px solid var(--line);
    overflow: hidden;
}
.auth-aside::after {
    content: ''; position: absolute; right: -90px; top: -90px;
    width: 240px; height: 240px; border-radius: 50%;
    border: 1px solid rgba(0, 102, 255, .12);
    box-shadow: 0 0 0 34px rgba(0, 102, 255, .04), 0 0 0 68px rgba(0, 102, 255, .02);
    pointer-events: none;
}
.brand-light { padding: 0 0 34px; }
.eyebrow { display: inline-block; font-size: 10px; letter-spacing: .18em; color: var(--primary); margin-bottom: 14px; font-weight: 600; }
.auth-aside h2 {
    font-size: 29px; line-height: 1.38; margin: 0 0 14px;
    color: var(--ink); font-weight: 600; letter-spacing: .01em;
}
.auth-aside h2 em { font-style: normal; color: var(--primary); }
.auth-quote p { color: var(--ink-2); font-size: 12.5px; margin: 0 0 26px; max-width: 300px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 13px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.auth-points .ico { width: 16px; height: 16px; color: var(--primary); }
.auth-note { margin-top: auto; padding-top: 28px; font-size: 10.5px; letter-spacing: .1em; color: var(--ink-3); }
.auth-main { padding: 44px 40px; display: flex; align-items: center; }
.auth-card { width: 100%; }
.auth-head h1 { font-size: 24px; font-weight: 600; margin: 0 0 5px; color: var(--ink); }
.auth-head p { color: var(--ink-3); margin: 0 0 26px; font-size: 12.5px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 12.5px; color: var(--ink-3); }
.auth-tip {
    margin-top: 24px; text-align: center; font-size: 11.5px; color: var(--ink-3);
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 8px; padding: 9px;
}

/* ---------- 动效 ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .kpi { animation: rise .35s ease both; }
.kpi:nth-child(2) { animation-delay: .04s; }
.kpi:nth-child(3) { animation-delay: .08s; }
.kpi:nth-child(4) { animation-delay: .12s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar {
        position: fixed; left: 0; top: 0; margin: 10px;
        height: calc(100vh - 20px);
        transform: translateX(-112%);
        transition: transform .22s ease;
        z-index: 60;
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .topbar { margin: 10px 10px 0; padding: 10px 14px; }
    .topbar-right .pill { display: none; }
    .page { padding: 10px 10px 30px; }
    .flashes { padding: 10px 10px 0; }
    .grid-2, .grid-3, .form-row { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { padding: 32px 24px; }
}
@media (max-width: 520px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .bar-line { grid-template-columns: 90px 1fr 70px; }
    .topbar h1 { font-size: 16px; }
}
