/* ============================================================
   雪虬滑雪租赁 · 运营后台样式
   设计语言与小程序保持一致：冰雪蓝主色 + 大圆角 + 柔和阴影
   ============================================================ */

:root {
  --primary: #1e6fff;
  --primary-dark: #1557d6;
  --primary-soft: #e8f0ff;
  --primary-softer: #f3f7ff;

  --sidebar-from: #101c3a;
  --sidebar-to: #17284f;
  --sidebar-text: #a8b8d8;
  --sidebar-active: #ffffff;

  --bg: #f4f7fc;
  --card: #ffffff;
  --border: #e6ecf5;
  --border-strong: #d5dfee;

  --text: #14203a;
  --text-sub: #5c6b88;
  --text-muted: #93a0b8;

  --success: #12b76a;
  --success-soft: #e6f8ef;
  --warning: #f79009;
  --warning-soft: #fff5e6;
  --danger: #f04438;
  --danger-soft: #fdeceb;
  --info: #0ba5ec;
  --info-soft: #e6f6fd;
  --purple: #7a5af8;
  --purple-soft: #f0ecff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(16, 28, 58, 0.06);
  --shadow: 0 4px 16px rgba(16, 28, 58, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 28, 58, 0.16);

  --sidebar-w: 216px;
  --header-h: 60px;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI',
    Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- 启动占位 ---------- */
.booting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100vh;
  color: var(--text-sub);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   登录页
   ============================================================ */

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

.login-brand {
  position: relative;
  flex: 1 1 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  color: #fff;
  background: linear-gradient(150deg, #0d1a38 0%, #17284f 45%, #1e6fff 140%);
  overflow: hidden;
}

.login-brand::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 111, 255, 0.55), transparent 68%);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.login-logo .mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 20px;
}

.login-brand h1 {
  margin-top: 40px;
  font-size: 38px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-brand p.sub {
  margin-top: 18px;
  max-width: 420px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.8;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.login-points span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.login-panel {
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--card);
}

.login-panel h2 {
  font-size: 24px;
  font-weight: 700;
}

.login-panel .hint {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.login-form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-tip {
  margin-top: 24px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--primary-softer);
  border: 1px dashed var(--border-strong);
  color: var(--text-sub);
  font-size: 12.5px;
  line-height: 1.7;
}

/* ============================================================
   主框架
   ============================================================ */

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar-from), var(--sidebar-to));
  color: var(--sidebar-text);
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 18px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2f80ff, #1e6fff);
  font-size: 16px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group {
  margin: 14px 10px 6px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(168, 184, 216, 0.6);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

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

.nav-item.active {
  background: linear-gradient(100deg, rgba(30, 111, 255, 0.95), rgba(30, 111, 255, 0.7));
  color: var(--sidebar-active);
  box-shadow: 0 6px 18px rgba(30, 111, 255, 0.34);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-item .badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: rgba(168, 184, 216, 0.72);
  line-height: 1.7;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header h2 {
  font-size: 17px;
  font-weight: 700;
}

.header .crumb {
  color: var(--text-muted);
  font-size: 13px;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--primary-softer);
  border: 1px solid var(--border);
}

.user-chip .avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f80ff, #7a5af8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.user-chip .meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-chip .meta b {
  font-size: 12.5px;
  font-weight: 600;
}

.user-chip .meta span {
  font-size: 11px;
  color: var(--text-muted);
}

.view {
  flex: 1;
  padding: 20px 24px 40px;
  min-width: 0;
}

/* ============================================================
   通用组件
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.card-head .sub {
  color: var(--text-muted);
  font-size: 12.5px;
}

.card-head .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-2-1 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.stat {
  position: relative;
  padding: 18px 20px;
  overflow: hidden;
}

.stat .label {
  color: var(--text-sub);
  font-size: 13px;
}

.stat .value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.stat .value small {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 3px;
}

.stat .foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat .accent {
  position: absolute;
  right: -18px;
  top: -18px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  opacity: 0.12;
}

.stat.primary .accent {
  background: var(--primary);
}
.stat.success .accent {
  background: var(--success);
}
.stat.warning .accent {
  background: var(--warning);
}
.stat.danger .accent {
  background: var(--danger);
}
.stat.purple .accent {
  background: var(--purple);
}

.stat .icon {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 26px;
  height: 26px;
  opacity: 0.85;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #2f80ff, var(--primary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(30, 111, 255, 0.28);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.05);
}

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

.btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-sub);
}

.btn-ghost:hover {
  background: var(--primary-softer);
  color: var(--primary);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
  height: 42px;
  font-size: 15px;
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-gray {
  background: #eef1f6;
  color: var(--text-sub);
}
.tag-blue {
  background: var(--primary-soft);
  color: var(--primary);
}
.tag-green {
  background: var(--success-soft);
  color: var(--success);
}
.tag-orange {
  background: var(--warning-soft);
  color: var(--warning);
}
.tag-red {
  background: var(--danger-soft);
  color: var(--danger);
}
.tag-cyan {
  background: var(--info-soft);
  color: var(--info);
}
.tag-purple {
  background: var(--purple-soft);
  color: var(--purple);
}

/* ---------- 表单 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

.field > label .req {
  color: var(--danger);
  margin-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 111, 255, 0.12);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.toolbar .input,
.toolbar .select {
  width: auto;
  min-width: 130px;
  height: 34px;
  font-size: 13px;
}

.toolbar .spacer {
  margin-left: auto;
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: #fafbfe;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-weight: 600;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
}

table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tbody tr:hover td {
  background: var(--primary-softer);
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data .strong {
  font-weight: 600;
}

table.data .sub {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

table.data .actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.cell-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 13px;
}

.pagination .pages {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13px;
}

.page-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.45;
}

/* ---------- 状态页签 ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 0;
}

.tab {
  padding: 7px 14px;
  border-radius: 9px;
  color: var(--text-sub);
  font-size: 13px;
  border: 1px solid transparent;
}

.tab:hover {
  background: var(--primary-softer);
  color: var(--primary);
}

.tab.active {
  background: var(--primary-soft);
  border-color: #c9dcff;
  color: var(--primary);
  font-weight: 600;
}

.tab .count {
  margin-left: 5px;
  font-size: 12px;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

/* ---------- 详情列表 ---------- */
.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 0;
}

.kv-item {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.kv-item .k {
  flex: 0 0 96px;
  color: var(--text-muted);
}

.kv-item .v {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.kv-item.full {
  grid-column: 1 / -1;
}

/* ---------- 时间线 ---------- */
.timeline {
  position: relative;
  padding-left: 18px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 16px 4px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.timeline-item .t {
  font-size: 13px;
  font-weight: 500;
}

.timeline-item .d {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 抽屉 ---------- */
.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.drawer-layer.open {
  pointer-events: auto;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 58, 0.42);
  opacity: 0;
  transition: opacity 0.2s;
}

.drawer-layer.open .drawer-mask {
  opacity: 1;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.drawer-layer.open .drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.drawer-head h3 {
  font-size: 16px;
  font-weight: 700;
}

.drawer-head .sub {
  color: var(--text-muted);
  font-size: 12.5px;
}

.drawer-head .close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 18px;
}

.drawer-head .close:hover {
  background: var(--primary-softer);
  color: var(--primary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  background: #fff;
  border-top: 1px solid var(--border);
}

/* ---------- 弹窗 ---------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 28, 58, 0.45);
}

.modal-layer.open {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease-out;
}

@keyframes pop {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
}

.modal-head {
  padding: 18px 22px 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-head .desc {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
  line-height: 1.7;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
}

.modal.wide {
  width: min(760px, 100%);
}

.modal.xwide {
  width: min(1080px, 100%);
}

/* ---------- 批量导入 ---------- */
.import-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* label 当按钮用时，把 input[type=file] 藏起来但保持可点击 */
.import-pick {
  cursor: pointer;
  margin: 0;
}

.import-filename {
  font-size: 12.5px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.import-help {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--primary-softer);
}

.import-help > summary {
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  user-select: none;
}

.import-help-body {
  max-height: 230px;
  overflow: auto;
  border-top: 1px solid var(--border);
}

table.data.compact th,
table.data.compact td {
  padding: 8px 12px;
  font-size: 12.5px;
}

.import-error {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.7;
}

.import-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.import-stat {
  flex: 1 1 88px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfe;
  text-align: center;
}

.import-stat b {
  display: block;
  font-size: 18px;
  color: var(--text);
}

.import-stat span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.import-stat.ok {
  border-color: #bfeed3;
  background: var(--success-soft);
}

.import-stat.ok b {
  color: var(--success);
}

.import-stat.bad {
  border-color: #f7c9c5;
  background: var(--danger-soft);
}

.import-stat.bad b {
  color: var(--danger);
}

.import-report {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.import-report table.data {
  border-radius: 0;
}

/* 出错行整行淡红底，一眼能看到问题集中在哪几行 */
.import-report tr.row-bad td {
  background: #fff8f7;
}

.import-msg {
  color: var(--text-sub);
  line-height: 1.6;
}

.import-report tr.row-bad .import-msg {
  color: var(--danger);
}

/* ---------- 轻提示 ---------- */
.toast-layer {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 32, 58, 0.94);
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

.toast.success {
  background: rgba(12, 138, 80, 0.96);
}
.toast.error {
  background: rgba(200, 44, 34, 0.96);
}
.toast.warning {
  background: rgba(190, 105, 6, 0.96);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ---------- 空状态 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 52px 20px;
  color: var(--text-muted);
}

.empty .icon {
  font-size: 34px;
  opacity: 0.6;
}

.empty .title {
  font-size: 14px;
  color: var(--text-sub);
}

.empty .desc {
  font-size: 12.5px;
}

/* ---------- 图表 ---------- */
.chart {
  width: 100%;
  height: 240px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
}

.bar-row .name {
  flex: 0 0 108px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row .track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: #eef2f8;
  overflow: hidden;
}

.bar-row .fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4d92ff, var(--primary));
}

.bar-row .val {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- 待办清单 ---------- */
.todo-list {
  display: flex;
  flex-direction: column;
}

.todo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--border);
}

.todo:last-child {
  border-bottom: none;
}

.todo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.todo .dot.warn {
  background: var(--warning);
}
.todo .dot.danger {
  background: var(--danger);
}
.todo .dot.ok {
  background: var(--success);
}

.todo .text {
  flex: 1;
  font-size: 13.5px;
}

.todo .text span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.todo .num {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- 库存条 ---------- */
.stock-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.stock-cell .track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #eef2f8;
  overflow: hidden;
}

.stock-cell .fill {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
}

.stock-cell .fill.low {
  background: var(--warning);
}
.stock-cell .fill.out {
  background: var(--danger);
}

/* ---------- 骨架 / 加载 ---------- */
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-block .spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--primary-softer);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 12.5px;
}

/* ---------- 图片上传 ---------- */
.uploader {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thumb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--primary-softer);
  flex: none;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 图片加载失败时给出可见提示，而不是留一个空白格子 */
.thumb.broken img {
  opacity: 0.12;
}

.thumb.broken::after {
  content: '加载失败';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--danger);
}

.thumb-main {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 7px;
  border-bottom-right-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}

.thumb-ops {
  position: absolute;
  right: 4px;
  top: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.thumb:hover .thumb-ops {
  opacity: 1;
}

.thumb-ops button {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(16, 28, 58, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.thumb-ops button:hover {
  background: var(--primary);
}

.thumb-ops button[data-op='del']:hover {
  background: var(--danger);
}

.thumb-add {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-strong);
  background: #fff;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.thumb-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-softer);
}

.upload-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-tip {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-tip.warn {
  color: var(--warning);
}

.btn .icon {
  vertical-align: -3px;
  margin-right: 4px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2-1 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 68px;
  }
  .sidebar-brand span.name,
  .nav-item span.label,
  .nav-group,
  .sidebar-foot {
    display: none;
  }
  .nav-item {
    justify-content: center;
  }
  .login-brand {
    display: none;
  }
  .login-panel {
    flex: 1;
  }
  .grid-3,
  .grid-2,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- ICP 备案页脚（工信部合规：备案域名页面底部须展示备案号） ---------- */
.icp-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #fff;
  border-top: 1px solid #E6EAEE;
  font-size: 12px;
  color: #8A94A0;
}
.icp-footer a {
  color: #8A94A0;
  text-decoration: none;
}
.icp-footer a:hover {
  color: #07C160;
  text-decoration: underline;
}
#app {
  padding-bottom: 34px;
}
