:root {
  --brand-900: #0f2437;
  --brand-800: #16324f;
  --brand-700: #1d4463;
  --brand-500: #2f7d9e;
  --brand-300: #6fc2c8;
  --accent: #d98b2b;
  --ink: #1f2d3d;
  --muted: #7b8a99;
  --bg: #f4f6f9;
  --line: #e7edf3;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(15, 36, 55, 0.07);

  --el-color-primary: #2f7d9e;
  --el-color-primary-light-3: #5ba0bb;
  --el-color-primary-light-5: #87bccd;
  --el-color-primary-light-7: #b3d6e0;
  --el-color-primary-light-8: #cbe2e9;
  --el-color-primary-light-9: #e6f1f4;
  --el-color-primary-dark-2: #26647e;
  --el-border-radius-base: 8px;
  --el-font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- 登录页 */
.login-wrap {
  height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background:
    radial-gradient(900px 500px at 8% 8%, rgba(111, 194, 200, 0.18), transparent 60%),
    radial-gradient(700px 500px at 92% 88%, rgba(217, 139, 43, 0.14), transparent 55%),
    linear-gradient(125deg, #0b1c2c 0%, #16324f 45%, #1d4463 100%);
  overflow: hidden;
}

.login-brand {
  padding: 8vh 6vw;
  color: #e8f1f6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -60px;
  top: 50%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(-50%);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.login-logo .mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f7d9e, #6fc2c8);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 125, 158, 0.45);
}

.login-logo .name { font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.login-logo .sub { font-size: 12px; color: #9db6c8; letter-spacing: 3px; margin-top: 2px; }

.login-brand h1 {
  font-size: 34px;
  line-height: 1.35;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-brand h1 em {
  font-style: normal;
  color: #6fc2c8;
}

.login-brand p.lead {
  color: #a9c0cf;
  line-height: 1.9;
  max-width: 460px;
  margin: 0 0 28px;
  font-size: 14px;
}

.login-points { display: flex; flex-direction: column; gap: 12px; }
.login-point { display: flex; align-items: center; gap: 10px; color: #c6d8e4; font-size: 13.5px; }
.login-point .dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: rgba(111, 194, 200, 0.16);
  color: #6fc2c8;
  display: grid; place-items: center; font-size: 13px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 392px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 38px 34px 30px;
  box-shadow: 0 30px 60px rgba(4, 16, 27, 0.45);
}

.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .hint { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.login-card .el-input__wrapper { padding: 4px 12px; }
.login-card .el-button { width: 100%; height: 44px; font-size: 15px; letter-spacing: 4px; }
.login-foot { margin-top: 18px; text-align: center; color: #9fb0bd; font-size: 12px; }

/* ---------------------------------------------------------------- 主框架 */
.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: linear-gradient(180deg, #16324f 0%, #0f2437 100%);
  display: flex;
  flex-direction: column;
  color: #c9dbe7;
}

.brand {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #2f7d9e, #6fc2c8);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.brand .txt { line-height: 1.25; }
.brand .txt b { display: block; font-size: 15px; color: #fff; letter-spacing: 1px; }
.brand .txt span { font-size: 11px; color: #8aa7bb; letter-spacing: 2px; }

.menu { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.menu::-webkit-scrollbar { width: 4px; }
.menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }

.menu-label {
  font-size: 11px;
  color: #6f8ba0;
  letter-spacing: 2px;
  padding: 14px 12px 8px;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 43px;
  padding: 0 13px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #b6cad9;
  margin-bottom: 3px;
  transition: all 0.18s ease;
  user-select: none;
}

.menu-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.menu-item.active {
  background: linear-gradient(90deg, rgba(47, 125, 158, 0.95), rgba(47, 125, 158, 0.45));
  color: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

.menu-item .el-icon { font-size: 17px; }

.sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: #7a95a9;
  line-height: 1.7;
  white-space: pre-line;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 66px;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.crumb { display: flex; align-items: baseline; gap: 12px; }
.crumb h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
.crumb span { color: var(--muted); font-size: 12.5px; }

.top-actions { display: flex; align-items: center; gap: 14px; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: #f2f6f9;
  cursor: pointer;
}

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #2f7d9e, #6fc2c8);
  color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}

.content { flex: 1; overflow-y: auto; padding: 20px 24px 36px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h2 { margin: 0; font-size: 20px; letter-spacing: 0.5px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.panel-head h4 { margin: 0; font-size: 15px; }
.panel-head .tip { color: var(--muted); font-size: 12.5px; }
.panel-head .spacer { flex: 1; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }

.stat {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(47, 125, 158, 0.08);
}

.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 26px; font-weight: 700; margin: 10px 0 4px; letter-spacing: 0.5px; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat .foot { font-size: 12px; color: #9aa9b6; }
.stat.accent .value { color: var(--accent); }
.stat.teal .value { color: var(--brand-500); }

/* ---------------------------------------------------------------- 通用 */
.el-table th.el-table__cell { background: #f7fafc !important; color: #51636f; font-weight: 600; }
.el-table { --el-table-border-color: #eef3f7; }
.el-table .cell { line-height: 1.6; }

.num-cell { font-variant-numeric: tabular-nums; }
.money { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.mono { font-family: Consolas, "Courier New", monospace; }

.tag-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-700);
  margin: 6px 0 14px;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2f7d9e, #6fc2c8);
}

.calc-box {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(120deg, #f2f8fb, #eef5f8);
  border: 1px dashed #cfe0ea;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
}

.calc-item { font-size: 13px; color: #5b7285; }
.calc-item b { display: block; font-size: 16px; color: var(--brand-700); margin-top: 3px; font-variant-numeric: tabular-nums; }
.calc-item.hl b { color: var(--accent); font-size: 20px; }

.empty-tip { padding: 40px 0; text-align: center; color: #a4b2bf; font-size: 13px; }

.el-dialog { border-radius: 16px; }
.el-dialog__header { padding-bottom: 10px; }
.el-drawer__header { margin-bottom: 10px; }

.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.split > * { min-width: 0; }
.table-scroll { width: 100%; min-width: 0; }
.table-scroll .el-table { width: 100%; }
/* 列较多时让横向滚动条常显，提示还能向右查看 */
.table-scroll .el-scrollbar__wrap { scrollbar-width: thin; }
.table-scroll .el-scrollbar__wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll .el-scrollbar__wrap::-webkit-scrollbar-thumb { background: #c3d3dd; border-radius: 6px; border: 2px solid #fff; }
.table-scroll .el-scrollbar__wrap::-webkit-scrollbar-track { background: #f2f6f8; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: #eef5f8;
  color: #3c6b82;
  font-size: 12px;
}

.perm-group { margin-bottom: 14px; }
.perm-group .g-title { font-size: 13px; font-weight: 700; color: var(--brand-700); margin-bottom: 8px; }
.perm-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }

/* ---------------- 系统设置 ---------------- */
.setting-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.setting-group-title {
  margin: 8px 0 14px;
  font-weight: 700;
  color: var(--brand-700);
  padding-left: 10px;
  border-left: 3px solid var(--brand-700);
}
.setting-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 6px 0 4px; }
.setting-preview { background: #f7fafc; border: 1px solid #e6edf3; border-radius: 12px; padding: 14px; }
.preview-title { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.preview-side {
  background: linear-gradient(180deg, #12405a, #0f3348);
  border-radius: 10px;
  padding: 14px 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.preview-brand { display: flex; align-items: center; gap: 10px; }
.preview-brand .mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(135deg, #5fc2d8, #2f7d9e);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.preview-brand .txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.preview-brand .txt b { font-weight: 700; }
.preview-brand .txt span { color: #a9c3d3; }
.preview-foot { color: #7e9aad; white-space: pre-line; line-height: 1.5; }
.preview-login { margin-top: 12px; background: #fff; border: 1px solid #e6edf3; border-radius: 10px; padding: 14px; }
.preview-login-name { font-size: 12px; color: var(--muted); }
.preview-login h3 { margin: 6px 0 10px; color: #123; white-space: pre-line; line-height: 1.4; }
.preview-login-card { border: 1px dashed #d7e2ea; border-radius: 8px; padding: 10px; color: #5b707e; }
.preview-login-card b { display: block; color: #123; margin-bottom: 4px; }
.preview-login-card p { margin: 0; font-size: 12px; }
.preview-login-foot { margin-top: 8px; font-size: 11.5px; color: #9aa9b6; text-align: center; }

/* ---------------- 操作日志 ---------------- */
.pager { margin-top: 14px; display: flex; justify-content: flex-end; }
.ua { color: #8a99a6; font-size: 12px; }
.stat .value.danger { color: #d5544a; }

/* ---------------- 数据初始化 ---------------- */
.init-alert { margin-bottom: 16px; }
.init-unit { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.init-group { margin-bottom: 18px; }
.init-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.init-group-title { font-size: 13px; font-weight: 700; color: var(--brand-700); }
.init-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.init-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid #e3ecf2; background: #fbfdfe;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.init-card:hover { border-color: #b9d6e4; box-shadow: 0 4px 14px rgba(47, 125, 158, .08); transform: translateY(-1px); }
.init-card.picked { border-color: #2f7d9e; background: linear-gradient(160deg, #f1f9fc, #e8f4f9); box-shadow: 0 4px 14px rgba(47, 125, 158, .12); }
.init-card.picked.danger { border-color: #dd8c7e; background: linear-gradient(160deg, #fdf4f2, #fbeae7); box-shadow: 0 4px 14px rgba(197, 83, 63, .12); }
.init-card-main { flex: 1; min-width: 0; }
.init-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.init-card-top b { font-size: 13.5px; color: #2b3f4d; }
.init-card p { margin: 6px 0 8px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.init-card-foot { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.init-count { font-size: 20px; font-weight: 700; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.init-card.picked.danger .init-count { color: #c1533f; }
.init-sub { font-size: 11.5px; color: #9aa9b6; }
.init-bar {
  margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, #f3f9fc, #eef6fa); border: 1px dashed #cfe0ea;
}
.init-bar-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #4b6274; }
.init-bar-info b { color: #c1533f; font-size: 15px; font-variant-numeric: tabular-nums; }
.init-bar-info .dot { width: 4px; height: 4px; border-radius: 50%; background: #b6c8d4; }
.init-result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.init-deleted { color: #d5544a; font-weight: 700; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .setting-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { width: 76px; flex: 0 0 76px; }
  .brand .txt, .menu-item span, .menu-label, .sidebar-foot { display: none; }
  .menu-item { justify-content: center; padding: 0; }
  .content { padding: 16px; }
}

/* ---------------- 商品分类 / 商品选择框 ---------------- */
.cat-panel { padding: 14px 12px; }
.cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow: auto; }
.cat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; color: #42566a;
}
.cat-item:hover { background: #f2f7fa; }
.cat-item.active { background: #e8f2f7; color: #1d4463; font-weight: 600; }
.cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { color: #8a9aa8; font-size: 12px; }
.cat-ops { display: none; align-items: center; gap: 4px; color: #6c8496; }
.cat-item:hover .cat-ops { display: flex; }
.cat-tip { margin-top: 12px; padding: 8px 4px 0; border-top: 1px dashed #e2ebf1; color: #9aa9b6; font-size: 11.5px; line-height: 1.6; }
.field-hint { font-size: 11.5px; color: #8a9aa8; line-height: 1.6; margin-top: 2px; }

.picker-wrap { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 14px; }
.picker-side { border: 1px solid #e7edf3; border-radius: 10px; padding: 8px; max-height: 462px; overflow: auto; background: #fafcfd; }
.picker-side-head { font-size: 12px; color: #8a9aa8; padding: 4px 8px 8px; }
.picker-cat { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: #42566a; }
.picker-cat:hover { background: #eef5f8; }
.picker-cat.active { background: #e2eff5; color: #1d4463; font-weight: 600; }
.picker-cat span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-cat b { font-size: 11.5px; color: #8a9aa8; font-weight: 500; }
.picker-main { min-width: 0; }
.pick-dot { display: inline-block; width: 12px; height: 12px; border: 1px solid #c9d6e0; border-radius: 50%; }
.col-setting { display: flex; flex-direction: column; gap: 4px; }
.col-setting .el-checkbox { margin-right: 0; height: 26px; }
