/* ============================================================
   组件层 · 登录 / 侧栏 / 卡片 / 指标 / 表格 / 抽屉 / 弹层
   对齐 sales.3haihui.com 的视觉规范
   ============================================================ */

/* ================= 登录 ================= */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-art {
  background: var(--side);
  color: var(--side-ink);
  padding: 56px 56px 48px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
/* 极淡网格纹理，避免大片死黑 */
.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.auth-art-inner { position: relative; max-width: 430px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}
.auth-logo-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.auth-art h2 {
  margin-top: 34px;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -.02em;
  font-weight: 600;
  color: #fff;
}
.auth-art-inner > p {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--side-ink-2);
}
.auth-points {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 13px;
}
.auth-points li {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--side-ink-2);
  padding-left: 15px;
  position: relative;
}
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
}
.auth-points b {
  color: var(--side-ink);
  font-weight: 600;
  margin-right: 2px;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 336px; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

input[type=text], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238b95a5' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
input[type=number] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.auth-note {
  margin-top: 18px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-3);
  text-align: center;
}

.alert {
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.alert.error { background: var(--up-soft); color: var(--up); border: 1px solid #f0d2ce; }
.alert.warn  { background: var(--warn-soft); color: var(--warn); border: 1px solid #f2e0bd; }
.alert.info  { background: var(--info-soft); color: var(--info); border: 1px solid #cbe7ee; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity var(--dur) ease, background var(--dur) ease,
              border-color var(--dur) ease, color var(--dur) ease, transform 90ms ease;
}
.btn:hover { opacity: .91; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-block { width: 100%; height: 42px; }

.btn.btn-ghost {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink-2);
  font-weight: 400;
}
.btn.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-3);
  opacity: 1;
}
.btn.btn-ghost.on {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}
.btn.btn-danger {
  background: var(--surface);
  border-color: #f0d2ce;
  color: var(--up);
}
.btn.btn-danger:hover { background: var(--up-soft); border-color: var(--up); opacity: 1; }

.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn-icon { width: 32px; padding: 0; }

/* 纯文字按钮（工具条里用） */
.btn-ghost {
  height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 12.5px;
  transition: all var(--dur) ease;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-ghost.on {
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand);
}

/* ================= 应用骨架 ================= */
.shell { display: flex; min-height: 100vh; }

/* ---------- 侧栏 ---------- */
.side {
  width: var(--side-w);
  flex: none;
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.side-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  flex: none;
}
.side-title { font-size: 13.5px; font-weight: 600; color: #fff; letter-spacing: .01em; }
.side-sub { font-size: 10.5px; color: var(--side-ink-2); letter-spacing: .06em; }

.side-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--side-ink-2);
  font-size: 13px;
  text-align: left;
  transition: background var(--dur) ease, color var(--dur) ease;
}
.side-nav button:hover { background: var(--side-2); color: var(--side-ink); }
.side-nav button.on { background: var(--brand); color: #fff; font-weight: 500; }
.side-nav .ni { width: 16px; text-align: center; font-size: 12px; opacity: .85; flex: none; }
.side-nav .nt { flex: 1; }
.side-nav .side-sec {
  padding: 14px 11px 6px;
  font-size: 10.5px;
  color: #5c6779;
  letter-spacing: .1em;
  font-weight: 400;
}

.side-foot { padding: 12px 10px 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  margin-bottom: 8px;
  width: 100%;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--side-2);
  color: var(--side-ink);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
  flex: none;
}
.side-user-info { min-width: 0; flex: 1; }
.side-user-name {
  font-size: 12.5px; font-weight: 500; color: var(--side-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-user-role { font-size: 10.5px; margin-top: 2px; color: var(--side-ink-2); }
.side-logout {
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-sm);
  background: none;
  color: var(--side-ink-2);
  font-size: 12px;
  transition: all var(--dur) ease;
}
.side-logout:hover { background: var(--side-2); color: var(--side-ink); }

/* ---------- 主内容区 ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-bar {
  height: var(--bar-h);
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.crumb { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.crumb .crumb-g { color: var(--ink-3); font-weight: 400; }
.crumb .crumb-p { color: var(--ink); font-weight: 500; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-3);
}
.live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--down);
  box-shadow: 0 0 0 3px rgba(18, 128, 90, .12);
}

.main {
  padding: 22px 26px 64px;
  max-width: 1440px;
  width: 100%;
}

/* ---------- 页标题 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head .sub { font-size: 12.5px; color: var(--ink-2); padding-bottom: 2px; }
.page-head .grow { flex: 1; }

/* ---------- 指标卡 ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px 16px 14px;
  min-width: 0;
}
.stat-card.hl { background: var(--brand-soft); border-color: var(--brand-line); }
.sc-k {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-v {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.026em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-card.hl .sc-v { color: var(--brand); }
.sc-x {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-3);
  min-height: 17px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sc-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head h2 { font-size: 13.5px; }
.card-head .hint { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.toolbar .grow { flex: 1; }
.toolbar__search {
  position: relative;
  flex: 0 1 300px;
  min-width: 180px;
}
.toolbar__search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-3); pointer-events: none;
}
.toolbar__search input { height: 34px; padding-left: 33px; font-size: 13px; }
.toolbar select { height: 34px; width: auto; min-width: 118px; font-size: 12.5px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; position: relative; }
/* 记录少时表格下方会空一大块 —— 让最后一行把剩余高度吃满 */
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl {
  width: 100%;
  /* 固定列合计 1000 + 备注列下限 130 */
  min-width: 1130px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}
table.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
  letter-spacing: .01em;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.tbl th.num { text-align: right; }
table.tbl th.center { text-align: center; }
table.tbl th.right { text-align: right; }
table.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink);
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: var(--surface-2); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 序号列吸左 */
.th-idx {
  position: sticky; left: 0;
  z-index: 3;
  background: var(--surface-2) !important;
  border-right: 1px solid var(--line);
}
td.th-idx {
  background: var(--surface) !important;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
}
table.tbl tbody tr:hover td.th-idx { background: var(--surface-2) !important; }

/* 操作列吸右：横向滚动时按钮仍可见，不必滑到最右才能改一笔 */
.th-ops {
  position: sticky; right: 0;
  z-index: 3;
  background: var(--surface-2) !important;
  border-left: 1px solid var(--line);
}
td.th-ops {
  background: var(--surface) !important;
  border-left: 1px solid var(--line);
}
table.tbl tbody tr:hover td.th-ops { background: var(--surface-2) !important; }

/* 可排序表头 */
.th-sort { cursor: pointer; user-select: none; }
.th-sort span { display: inline-flex; align-items: center; gap: 4px; }
.th-sort .caret {
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0;
  transition: opacity var(--dur) ease, transform var(--dur) ease;
}
.th-sort:hover { color: var(--pillar, var(--ink-2)); }
.th-sort:hover .caret { opacity: .4; }
.th-sort[aria-sort="ascending"] .caret { opacity: 1; transform: rotate(180deg); }
.th-sort[aria-sort="descending"] .caret { opacity: 1; }
.th-sort[aria-sort="ascending"], .th-sort[aria-sort="descending"] { color: var(--brand); }

/* 单元格内容 */
.c-idx { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.c-date { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.c-dealer {
  font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4;
}
.person { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.35; }
.person .p-main {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500; color: var(--ink);
}
.person .p-sub {
  font-size: 11.5px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c-course {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4;
}
.c-time { line-height: 1.38; overflow: hidden; }
.c-time b, .c-time span {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c-time b { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: -.02em; }
.c-time span { font-size: 11px; color: var(--ink-3); }
.c-money { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-price { font-weight: 600; }
.c-profit { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--up); font-weight: 600; }
.c-profit.zero { color: var(--ink-3); font-weight: 400; }
.c-profit.neg { color: var(--down); }
.c-note {
  color: var(--ink-2); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.c-note:empty::after { content: "—"; color: var(--line-2); }

/* 倍率：数字 + 细条 */
.mult { display: inline-flex; align-items: center; gap: 7px; justify-content: flex-end; }
.mult__v { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.mult__bar {
  position: relative;
  width: 34px; height: 4px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  flex: none;
}
.mult__bar i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 99px; }
.mult__bar i.low { background: var(--ink-3); }
.mult__bar i.high { background: var(--up); }

/* 行内操作 */
.row-acts { display: inline-flex; gap: 2px; justify-content: flex-end; }
.act {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  transition: all var(--dur) ease;
}
.act svg { width: 14px; height: 14px; }
.act:hover { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.act.del:hover { color: var(--up); border-color: #f0d2ce; background: var(--up-soft); }

/* 合计行 */
table.tbl tfoot td {
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
table.tbl tfoot td.t-label { color: var(--ink); }
table.tbl tfoot td.up { color: var(--up); }
table.tbl tfoot .th-idx { background: var(--surface-2) !important; }

/* 紧凑模式 */
table.tbl.dense td { padding-top: 6px; padding-bottom: 6px; }
table.tbl.dense { font-size: 12.5px; }

/* 空态 */
.empty { padding: 52px 20px; text-align: center; }
.empty__mark {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-3);
}
.empty__mark svg { width: 20px; height: 20px; }
.empty h3 { font-size: 14.5px; margin-bottom: 6px; }
.empty p { font-size: 12.5px; color: var(--ink-2); max-width: 42ch; margin: 0 auto; line-height: 1.8; }
.empty .btn { margin-top: 16px; }
.noresult { padding: 44px 20px; text-align: center; font-size: 13px; color: var(--ink-2); }
.noresult b { color: var(--ink); }

/* ================= 抽屉 ================= */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(19, 26, 38, .34);
  animation: fadeIn 180ms ease forwards;
}
.drawer {
  position: fixed; z-index: 95;
  top: 0; right: 0; bottom: 0;
  width: min(540px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  animation: drawerIn 300ms var(--ease) forwards;
}
@keyframes drawerIn { to { transform: none; } }
@keyframes drawerOut { to { transform: translateX(100%); } }
.drawer.closing { animation: drawerOut 200ms ease-in forwards; }

.drawer__head {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.drawer__head h2 { font-size: 16px; }
.drawer__head p { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.drawer__body { flex: 1; overflow: auto; padding: 18px 20px; }
.drawer__foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
}
.drawer__foot .btn { flex: 1; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-sec {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 0 12px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-3);
  font-weight: 500;
}
.form-sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-sec:first-child { margin-top: 0; }

/* 计算预览 */
.calc {
  margin-top: 18px;
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.calc__row {
  display: flex; justify-content: space-between; gap: 14px;
  font-size: 12.5px; padding: 3px 0;
}
.calc__row span:first-child { color: var(--ink-2); }
.calc__row span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.calc__row.total {
  margin-top: 6px; padding-top: 9px;
  border-top: 1px dashed var(--line-2);
  font-size: 13.5px;
}
.calc__row.total span:last-child { font-weight: 700; color: var(--up); }
.calc__note { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ================= 弹窗 ================= */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(19, 26, 38, .4);
  animation: fadeIn 160ms ease forwards;
}
.modal {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 20px;
  animation: riseIn 220ms var(--ease) both;
}
.modal h3 { font-size: 15.5px; }
.modal p { margin-top: 8px; color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.modal p b { color: var(--ink); }
.modal__acts { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }

/* ================= 提示 ================= */
.toast-wrap {
  position: fixed; z-index: 110;
  left: 50%; bottom: 26px; transform: translateX(-50%);
  display: grid; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 15px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 13px;
  box-shadow: var(--shadow-2);
  animation: riseIn 240ms var(--ease) both;
  pointer-events: auto;
  max-width: 88vw;
}
.toast.out { animation: fadeIn 180ms ease reverse forwards; }
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.ok svg { color: #7ee0b0; }
.toast.warn svg { color: #ffb59c; }

/* ================= 角色标识 ================= */
.chip {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip.brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.chip.up { background: var(--up-soft); border-color: #f0d2ce; color: var(--up); }
.chip.down { background: var(--down-soft); border-color: #cfe9dd; color: var(--down); }
.chip.warn { background: var(--warn-soft); border-color: #f2e0bd; color: var(--warn); }

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; }
}

@media (max-width: 860px) {
  .side {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 260ms var(--ease);
    box-shadow: var(--shadow-3);
  }
  .side.open { transform: none; }
  .content-bar { padding: 0 16px; gap: 10px; }
  .main { padding: 18px 16px 56px; }
  .page-head { gap: 8px; }
  .page-head .sub { flex-basis: 100%; padding-bottom: 0; }
  .btn__t { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; }
  .toolbar__search { flex-basis: 100%; }
  .toolbar select { flex: 1 1 120px; min-width: 120px; }
}

@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr; }
  .sc-v { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
}

/* 移动端侧栏开关 */
.nav-toggle {
  display: none;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  flex: none;
}
.nav-toggle svg { width: 17px; height: 17px; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none !important; }
}

/* 侧栏展开时的背景遮罩（仅移动端） */
.side-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(19, 26, 38, .4);
  animation: fadeIn 180ms ease;
}
@media (max-width: 860px) {
  .side.open ~ .side-scrim,
  .side-scrim.on { display: block; }
}