/* ==========================================================================
   广壤科技 · 农副产品配送管理系统 — 全局样式
   风格：简洁专业内部后台；主色深绿 #1F7A4D；无组件库、无外部字体
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --brand: #1F7A4D;
  --brand-dark: #175C3A;
  --brand-deep: #12382A;
  --brand-deeper: #0E2B20;
  --brand-050: #EEF5F1;
  --brand-100: #D8EAE0;
  --brand-200: #B7D8C6;

  --ink: #1E2A24;
  --ink-2: #51605A;
  --ink-3: #8A968F;

  --bg: #F3F6F4;
  --card: #FFFFFF;
  --line: #E3E8E5;
  --line-strong: #CBD5CF;

  --ok: #1F7A4D;
  --ok-bg: #E7F3EC;
  --ok-line: #BFDFCC;
  --warn: #B45E06;
  --warn-bg: #FCF1E2;
  --warn-line: #F0D8B4;
  --danger: #B3261E;
  --danger-bg: #FBECEB;
  --danger-line: #EFC5C2;
  --muted: #66716B;
  --muted-bg: #EEF1F0;
  --muted-line: #DCE1DF;
  --info: #3E6C8E;
  --info-bg: #E9F1F6;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 12px;

  --shadow-1: 0 1px 2px rgba(18, 40, 30, 0.06);
  --shadow-2: 0 10px 28px rgba(18, 40, 30, 0.14);
  --shadow-3: 0 18px 48px rgba(18, 40, 30, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --sidebar-w: 216px;
  --topbar-h: 56px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100%;
}
h1, h2, h3, h4 { font-weight: 600; line-height: 1.4; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
::placeholder { color: var(--ink-3); }

/* ---------- 布局骨架 ---------- */
.layout { display: flex; min-height: 100vh; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1 1 auto; padding: 24px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ---------- 侧边导航 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(180deg, var(--brand-deep) 0%, var(--brand-deeper) 100%);
  color: #C9DCD1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #2C9660, #1F7A4D);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.brand-name { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: #7FA392; letter-spacing: 1px; }

.nav { flex: 1 1 auto; padding: 6px 12px 24px; }
.nav-group { margin-top: 14px; }
.nav-group-title {
  font-size: 11px;
  color: #6E9080;
  letter-spacing: 2px;
  padding: 0 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-m);
  color: #C9DCD1;
  font-size: 14px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}
.nav-item.is-active svg { opacity: 1; }
.sidebar-foot {
  padding: 14px 18px;
  font-size: 11px;
  color: #587A6A;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  flex: none;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.topbar-title .divider { color: var(--line-strong); font-weight: 400; }
.topbar-title .crumb { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.topbar-user { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-name { font-weight: 500; }

/* ---------- 角色标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.tag--role { background: var(--brand-050); color: var(--brand-dark); border: 1px solid var(--brand-100); }

/* ---------- 状态徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pending { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge--approved { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge--rejected { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge--withdrawn { background: var(--muted-bg); color: var(--muted); border-color: var(--muted-line); }
.badge--active { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge--disabled { background: var(--muted-bg); color: var(--muted); border-color: var(--muted-line); }
.badge--plain::before { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  flex: none;
  padding: 8px 16px;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  background: transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn--secondary { background: var(--card); border-color: var(--line-strong); color: var(--ink-2); }
.btn--secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-050); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #99201A; }
.btn--danger-ghost { background: var(--card); border-color: var(--danger-line); color: var(--danger); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn--ghost { color: var(--ink-2); }
.btn--ghost:hover:not(:disabled) { background: var(--brand-050); color: var(--brand-dark); }
.btn--sm { padding: 4px 10px; font-size: 13px; line-height: 18px; border-radius: var(--radius-s); }
.btn--lg { padding: 12px 24px; font-size: 15px; }
.btn--block { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--brand-200); outline-offset: 1px; }

.link-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  color: var(--brand);
  cursor: pointer;
  font-size: 13px;
}
.link-btn:hover { color: var(--brand-dark); text-decoration: underline; }
.link-btn--danger { color: var(--danger); }
.link-btn--danger:hover { color: #99201A; }
.link-btn:disabled { color: var(--ink-3); cursor: not-allowed; text-decoration: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
label.req::after { content: " *"; color: var(--danger); }
.field-tip { font-size: 12px; color: var(--ink-3); }
.input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--card);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  height: 36px;
}
textarea.input { height: auto; min-height: 76px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2351605A' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.12); }
.input[disabled] { background: var(--muted-bg); color: var(--ink-3); cursor: not-allowed; }
.input--inline { width: 130px; text-align: right; height: 30px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.input--date { width: 150px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form--grid .span-2 { grid-column: span 2; }
.form-error { color: var(--danger); font-size: 13px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; margin-right: 16px; }
.chk input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* ---------- 页头 ---------- */
.page { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; }
.page-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- 筛选条 ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input--search { width: 240px; }
.filters .spacer { flex: 1 1 auto; }
.filter-label { font-size: 13px; color: var(--ink-3); flex: none; }

/* ---------- 分段切换 ---------- */
.segmented { display: inline-flex; background: var(--muted-bg); border-radius: var(--radius-m); padding: 3px; gap: 2px; }
.segmented button {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.segmented button.is-active { background: var(--card); color: var(--brand-dark); font-weight: 500; box-shadow: var(--shadow-1); }
.segmented button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tabs ---------- */
.tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.tabs-bar .tabs { border-bottom: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  border: none;
  background: none;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { color: var(--brand-dark); }
.tab.is-active { color: var(--brand-dark); font-weight: 600; border-bottom-color: var(--brand); }
.tab-panel { display: none; padding-top: 16px; }
.tab-panel.is-active { display: block; }
.subtabs { display: flex; gap: 8px; margin-bottom: 14px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th {
  background: #F7FAF8;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color 0.15s ease; }
.table tbody tr:hover { background: #F7FAF8; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table thead th.num { text-align: right; }
.table .cell-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .ops { white-space: nowrap; text-align: right; }
.table thead th.ops { text-align: right; }
.table tr.is-deleting td { color: var(--ink-3); text-decoration: line-through; background: var(--muted-bg); }
.table tr.is-deleting .ops, .table tr.is-deleting .num { text-decoration: line-through; }
.table tr.row-new td { background: var(--brand-050); }
.table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; flex-wrap: wrap; }
.table-empty { padding: 48px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-info { font-size: 13px; color: var(--ink-3); }
.pager button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: var(--radius-s);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
.pager button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.pager button:disabled { opacity: 0.45; cursor: not-allowed; }
.pager .gap { color: var(--ink-3); padding: 0 2px; }

/* ---------- 空状态 ---------- */
.gr-empty { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.gr-empty--box { border: 1px dashed var(--line-strong); border-radius: var(--radius-m); }

/* ---------- 图表容器 ---------- */
.chart { width: 100%; height: 320px; }
.chart--tall { height: 380px; }
.chart-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-note { font-size: 12px; color: var(--ink-3); }
.analytics-grid { display: flex; flex-direction: column; gap: 16px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- 弹层 ---------- */
.gr-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.gr-modal.is-open { display: block; }
.gr-modal__backdrop { position: absolute; inset: 0; background: rgba(14, 30, 22, 0.45); }
.gr-modal__panel {
  position: relative;
  margin: 8vh auto 0;
  width: 640px;
  max-width: calc(100vw - 48px);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-3);
  animation: modal-in 0.18s ease;
}
.gr-modal__panel--sm { width: 420px; }
.gr-modal__panel--md { width: 520px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.gr-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.gr-modal__head h3 { font-size: 16px; }
.gr-modal__x {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-s);
}
.gr-modal__x:hover { color: var(--ink); background: var(--muted-bg); }
.gr-modal__body { padding: 18px 20px 20px; }
.gr-modal__body--flush { padding: 0; }

/* ---------- 确认框 ---------- */
.gr-confirm__msg { color: var(--ink-2); padding: 4px 0 18px; }

/* ---------- 抽屉 ---------- */
.gr-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: var(--card);
  box-shadow: var(--shadow-3);
  z-index: 80;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}
.gr-drawer.is-open { transform: translateX(0); }
.gr-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.gr-drawer__head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gr-drawer__body { flex: 1 1 auto; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.gr-drawer__foot { flex: none; padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* ---------- Toast ---------- */
.gr-toasts {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.gr-toast {
  background: #22312A;
  color: #fff;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  max-width: 70vw;
  animation: toast-in 0.2s ease;
}
.gr-toast--success { background: var(--brand-dark); }
.gr-toast--error { background: #8E211B; }
.gr-toast--warn { background: #8A5410; }
.gr-toast.is-leaving { opacity: 0; transition: opacity 0.25s ease; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 修改清单（编辑模式） ---------- */
.change-list { display: flex; flex-direction: column; gap: 8px; }
.change-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 10px 12px;
  font-size: 13px;
}
.change-item__type { flex: none; }
.change-item__main { flex: 1 1 auto; min-width: 0; }
.change-item__title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-item__diff { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.change-item__diff .arrow { color: var(--ink-3); padding: 0 4px; }
.change-item__diff .del { color: var(--danger); text-decoration: line-through; }
.change-item__diff .add { color: var(--ok); font-weight: 600; }
.change-item__x { flex: none; border: none; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; }
.change-item__x:hover { color: var(--danger); }
.diff-arrow { color: var(--ink-3); padding: 0 6px; }
.diff-old { color: var(--ink-3); text-decoration: line-through; }
.diff-new { color: var(--brand-dark); font-weight: 600; }
.tag--modify { background: var(--info-bg); color: var(--info); }
.tag--add { background: var(--ok-bg); color: var(--ok); }
.tag--delete { background: var(--danger-bg); color: var(--danger); }

/* ---------- 冲突提示 ---------- */
.conflict-box {
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
}
.conflict-box h4 { color: var(--danger); font-size: 13px; margin-bottom: 8px; }
.conflict-box ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.conflict-box .muted { color: var(--ink-2); }

/* ---------- 详情卡（工单 / 版本） ---------- */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-item dt { font-size: 12px; color: var(--ink-3); }
.meta-item dd { font-size: 13.5px; color: var(--ink); word-break: break-all; }
.section-gap { margin-top: 16px; }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(31, 122, 77, 0.14), transparent 60%),
    radial-gradient(800px 420px at -10% 110%, rgba(31, 122, 77, 0.10), transparent 55%),
    var(--bg);
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  padding: 36px 32px 32px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .brand-mark { width: 42px; height: 42px; font-size: 22px; border-radius: 11px; }
.login-brand-name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: 0.5px; }
.login-brand-sub { font-size: 12px; color: var(--ink-3); }
.login-title { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-bottom: 18px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.login-error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-m);
  font-size: 13px;
  padding: 8px 12px;
  margin-bottom: 14px;
}
.login-foot { margin-top: 20px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- 错误页 ---------- */
.error-page { max-width: 480px; margin: 8vh auto 0; text-align: center; padding: 24px; }
.error-code { font-size: 52px; font-weight: 700; color: var(--brand-200); letter-spacing: 2px; line-height: 1.2; }
.error-title { font-size: 19px; margin: 8px 0 10px; }
.error-desc { color: var(--ink-2); font-size: 14px; margin-bottom: 24px; }

/* ---------- 辅助 ---------- */
.muted { color: var(--ink-3); }
.strong { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.money { font-variant-numeric: tabular-nums; }
.money--negative { color: var(--danger); }
.count-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; margin-left: 4px; }
.edit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  border-radius: var(--radius-m);
  padding: 8px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* 滚动条（细） */
.sidebar::-webkit-scrollbar, .gr-drawer__body::-webkit-scrollbar, .gr-modal__panel::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.sidebar::-webkit-scrollbar-thumb, .gr-drawer__body::-webkit-scrollbar-thumb, .gr-modal__panel::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: rgba(122, 134, 128, 0.35); border-radius: 4px; }

/* 窄屏兜底（目标 1280px+，仅保证不破版） */
@media (max-width: 1024px) {
  .summary-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 64px; }
  .brand-name, .brand-sub, .nav-group-title, .nav-item span, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; }
  .form--grid { grid-template-columns: 1fr; }
  .form--grid .span-2 { grid-column: span 1; }
}
