:root {
  --brand-900: #0a2554;
  --brand-800: #0f3576;
  --brand-700: #14479e;
  --brand-600: #1d4ed8;
  --brand-500: #2f6bf0;
  --brand-50: #eef4ff;
  --accent: #e8590c;
  --accent-bg: #fff4e8;
  --bg: #f3f6fc;
  --card: #ffffff;
  --text: #101828;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e3e9f2;
  --ok: #0f9d58;
  --ok-bg: #e9f8f0;
  --warn: #b54708;
  --warn-bg: #fff5e6;
  --danger: #d92d20;
  --danger-bg: #fef1f0;
  --info-bg: #eef4ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px rgba(10, 37, 84, .22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.35;
}

p {
  margin: 0;
}

/* ---------------- 顶部导航 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(120deg, var(--brand-900), var(--brand-700) 55%, var(--brand-500));
  color: #fff;
  box-shadow: 0 6px 20px rgba(10, 37, 84, .18);
}

.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .5px;
  flex: none;
}

.brand-text b {
  display: block;
  font-size: 16px;
  letter-spacing: .3px;
}

.brand-text span {
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
}

.nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.nav-item {
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .86);
  cursor: pointer;
  font-size: 14px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  transition: .16s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
  font-weight: 600;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, .22);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}

.user-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, .78);
  line-height: 1.3;
}

.user-meta b {
  display: block;
  font-size: 13px;
  color: #fff;
}

/* ---------------- 布局 ---------------- */
.view {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px 40px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.9;
}

.footer b {
  color: var(--muted);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 20px;
}

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-products {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.grid-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stack {
  display: grid;
  gap: 16px;
}

/* ---------------- 商品卡片 ---------------- */
.product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-media {
  position: relative;
  height: 190px;
  background: linear-gradient(135deg, #eaf1ff, #f7faff);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media .icon-fallback {
  width: 96px;
  height: 96px;
  color: var(--brand-600);
  opacity: .85;
}

.product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.product-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-name {
  font-size: 17px;
  font-weight: 700;
}

.product-summary {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}

.price {
  color: var(--danger);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.5px;
}

.price small {
  font-size: 13px;
  font-weight: 600;
}

.price-unit {
  color: var(--muted);
  font-size: 12px;
}

.stock {
  font-size: 12px;
  color: var(--muted);
}

.stock.low {
  color: var(--accent);
  font-weight: 600;
}

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: .16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  color: var(--text);
  line-height: 1.2;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(120deg, var(--brand-700), var(--brand-500));
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .24);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--brand-700);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--brand-500);
  background: var(--brand-50);
}

.btn-danger {
  background: #fff;
  border-color: #f3c4c0;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-ok {
  background: var(--ok);
  color: #fff;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--brand-600);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
}

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--info-bg);
  color: var(--brand-700);
  white-space: nowrap;
}

.badge.pending_payment {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.reviewing {
  background: var(--info-bg);
  color: var(--brand-700);
}

.badge.approved {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.rejected {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge.completed {
  background: #eef2f6;
  color: #344054;
}

.badge.cancelled {
  background: #f2f4f7;
  color: var(--muted-2);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.admin-tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--muted-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.admin-tab:hover {
  color: var(--brand-700);
}

.admin-tab.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
  font-weight: 600;
}

/* ---------------- 表单 ---------------- */
.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}

.field label i {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: .16s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(47, 107, 240, .14);
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
}

.field .hint.err {
  color: var(--danger);
  font-weight: 600;
}

.field .hint.ok {
  color: var(--ok);
}

/* ---------------- 提示条 ---------------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.7;
}

.alert b {
  font-weight: 700;
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #ffe0b8;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f8d2ce;
}

.alert-info {
  background: var(--info-bg);
  color: var(--brand-700);
  border: 1px solid #d5e2ff;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #c4ecda;
}

/* ---------------- 键值信息 ---------------- */
.kv {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.kv-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  align-items: center;
}

.kv-row:last-child {
  border-bottom: none;
}

.kv-row .k {
  color: var(--muted);
  font-size: 13px;
}

.kv-row .v {
  font-weight: 600;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kv-row .v.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .5px;
}

.kv-row.hl {
  background: #fffdf7;
}

/* ---------------- 备注框 ---------------- */
.remark-box {
  border: 1.5px dashed var(--accent);
  background: #fffaf3;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.remark-box .remark-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .5px;
}

.remark-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  color: #7a2e00;
  word-break: break-all;
  background: #fff;
  border: 1px solid #ffdcb8;
  border-radius: 8px;
  padding: 10px 12px;
}

.remark-box .meta {
  font-size: 12px;
  color: var(--warn);
  line-height: 1.7;
}

/* ---------------- 步骤条 ---------------- */
.steps {
  display: flex;
  gap: 6px;
  padding: 16px 20px 0;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-2);
  flex: 1;
  min-width: 140px;
}

.step .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef1f6;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.step.active {
  color: var(--brand-700);
  font-weight: 600;
}

.step.active .dot {
  background: var(--brand-600);
  color: #fff;
}

.step.done {
  color: var(--ok);
}

.step.done .dot {
  background: var(--ok-bg);
  color: var(--ok);
}

.step-line {
  height: 2px;
  background: var(--line);
  flex: 1;
  border-radius: 2px;
  min-width: 18px;
}

/* ---------------- 弹窗 ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 46, .55);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade .16s ease;
}

@keyframes fade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.99)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: min(760px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
  overflow: hidden;
}

.modal.modal-lg {
  width: min(900px, 100%);
}

.modal.modal-sm {
  width: min(380px, 100%);
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h3 {
  font-size: 16px;
}

.modal-head .close {
  border: none;
  background: #f2f4f7;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow: auto;
  display: grid;
  gap: 16px;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: #fbfcfe;
  flex-wrap: wrap;
}

.modal-foot .left {
  margin-right: auto;
  align-self: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------- 表格 ---------------- */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fff;
}

table.tbl th,
table.tbl td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

table.tbl th {
  background: #f8fafd;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table.tbl tr:hover td {
  background: #fafcff;
}

.mono-sm {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* ---------------- 统计卡 ---------------- */
.stat {
  padding: 16px;
  display: grid;
  gap: 4px;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
}

.stat .value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
}

/* ---------------- 时间线 ---------------- */
.timeline {
  display: grid;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.tl-item:last-child::before {
  display: none;
}

.tl-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-50);
  border: 2px solid var(--brand-500);
  margin-top: 2px;
}

.tl-item:first-child .tl-dot {
  background: var(--brand-600);
}

.tl-body b {
  font-size: 13px;
}

.tl-body p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------------- 订单卡 ---------------- */
.order-card {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.order-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--muted);
}

.order-title {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.order-line {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  align-items: center;
}

.order-line b {
  color: var(--text);
}

.order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

/* ---------------- 步骤提示 / 复制 ---------------- */
.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.copy-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-700);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
}

/* ---------------- 上传 ---------------- */
.upload {
  border: 1.5px dashed #c7d3e6;
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  background: #fbfdff;
  cursor: pointer;
  transition: .16s;
}

.upload:hover {
  border-color: var(--brand-500);
  background: var(--brand-50);
}

.upload .up-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.upload .up-sub {
  font-size: 12px;
  color: var(--muted);
}

.preview {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #fff;
}

.preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.preview .pv-icon {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--brand-50);
  display: grid;
  place-items: center;
  color: var(--brand-700);
  font-weight: 700;
  flex: none;
}

/* ---------------- 商品展示照片 ---------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.photo-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafd;
}

.photo-item img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
}

.photo-cover {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  background: rgba(29, 78, 216, .92);
  color: #fff;
  font-size: 11px;
  line-height: 1.6;
  padding: 1px 7px;
  border-radius: 6px;
}

.photo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.photo-actions .photo-tip {
  font-size: 12px;
  color: var(--muted-2);
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.pv-gallery {
  margin-bottom: 14px;
}

.pv-main {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafd;
  text-align: center;
}

.pv-main img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
}

.pv-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pv-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f8fafd;
  cursor: pointer;
  transition: .16s;
}

.pv-thumb:hover {
  border-color: var(--brand-500);
}

.pv-thumb.active {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.pv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-cell .thumb-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.thumb-cell .thumb-empty {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-size: 18px;
}

/* ---------------- 空态 / 加载 ---------------- */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 10px;
  place-items: center;
}

.empty .ico {
  font-size: 34px;
}

.loading {
  padding: 48px;
  text-align: center;
  color: var(--muted-2);
}

/* ---------------- Toast ---------------- */
.toast-root {
  position: fixed;
  top: 78px;
  right: 20px;
  z-index: 200;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-600);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 12px 14px;
  font-size: 13px;
  animation: pop .18s ease;
  word-break: break-word;
}

.toast.ok {
  border-left-color: var(--ok);
}

.toast.err {
  border-left-color: var(--danger);
}

.toast.warn {
  border-left-color: var(--accent);
}

/* ---------------- 登录页 ---------------- */
.auth-wrap {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  background: #fff;
}

.auth-side {
  background: linear-gradient(150deg, var(--brand-900), var(--brand-700) 60%, var(--brand-500));
  color: #fff;
  padding: 38px 34px;
  display: grid;
  align-content: space-between;
  gap: 26px;
}

.auth-side h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-side p {
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
}

.flow-list {
  display: grid;
  gap: 14px;
}

.flow-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.flow-item .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.flow-item b {
  font-size: 14px;
}

.flow-item span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
  line-height: 1.7;
}

.auth-main {
  padding: 38px 34px;
}

.tabs {
  display: flex;
  gap: 4px;
  background: #f2f5fa;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
}

.tab.active {
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 860px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-side {
    padding: 26px 22px;
  }

  .auth-main {
    padding: 26px 22px;
  }

  .view {
    padding: 18px 14px 44px;
  }

  .topbar-inner {
    padding: 12px 14px;
    gap: 10px;
  }

  .brand-text span {
    display: none;
  }

  .kv-row {
    grid-template-columns: 92px 1fr;
  }

  .modal {
    max-height: 94vh;
  }
}

/* ---------------- 平板/手机通用适配（≤720px） ---------------- */
@media (max-width: 720px) {
  /* 整体间距缩小 */
  .view {
    padding: 14px 12px 36px;
  }

  /* 顶部导航 */
  .topbar-inner {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .brand-text b {
    font-size: 14px;
  }

  .nav {
    gap: 4px;
    width: 100%;
    justify-content: flex-start;
  }

  .nav-item {
    padding: 6px 10px;
    font-size: 13px;
  }

  /* 用户区域紧凑：缩小头像、隐藏姓名部门细节 */
  .user-chip {
    gap: 6px;
    padding-left: 8px;
    margin-left: auto;
  }

  .avatar {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .user-meta b {
    font-size: 12px;
  }

  .user-meta {
    font-size: 11px;
  }

  /* 页面标题 */
  .page-head {
    margin-bottom: 14px;
    gap: 10px;
  }

  .page-title {
    font-size: 18px;
  }

  .page-sub {
    font-size: 12px;
  }

  /* 卡片 */
  .card-head {
    padding: 12px 14px;
    gap: 8px;
  }

  .card-head h3 {
    font-size: 15px;
  }

  .card-pad {
    padding: 14px;
  }

  /* 统计卡 */
  .stat {
    padding: 12px;
  }

  .stat .value {
    font-size: 18px;
  }

  .stat .label {
    font-size: 11px;
  }

  /* 商品卡 */
  .product-media {
    height: 150px;
  }

  .product-name {
    font-size: 15px;
  }

  .price {
    font-size: 20px;
  }

  /* 表格：横向滚动 + 紧凑单元格 */
  table.tbl {
    min-width: 720px;
  }

  table.tbl th,
  table.tbl td {
    padding: 9px 10px;
    font-size: 12px;
  }

  /* 筛选/工具条：换行更友好 */
  .order-line {
    gap: 8px;
  }

  /* 弹窗 */
  .modal-body {
    padding: 14px;
  }

  .modal-head {
    padding: 12px 14px;
  }

  .modal-head h3 {
    font-size: 15px;
  }

  .modal-foot {
    padding: 12px 14px;
  }

  /* 提示条 */
  .alert {
    font-size: 12px;
    padding: 10px 12px;
  }

  /* 空态 */
  .empty {
    padding: 36px 14px;
  }

  /* 按钮 */
  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
  }

  /* 表单 */
  .form-grid {
    gap: 10px;
  }

  .field label {
    font-size: 12px;
  }

  .field input,
  .field select,
  .field textarea {
    padding: 9px 10px;
    font-size: 13px;
  }

  /* Toast */
  .toast-root {
    top: 64px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  /* footer */
  .footer {
    padding: 18px 14px 30px;
    font-size: 11px;
  }
}

/* ---------------- 小屏手机适配（≤480px） ---------------- */
@media (max-width: 480px) {
  /* 顶部导航：双行布局：品牌+导航一行，用户区另起一行 */
  .topbar-inner {
    padding: 8px 10px;
    gap: 6px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .brand-text b {
    font-size: 13px;
    line-height: 1.2;
  }

  .nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    padding-top: 8px;
    margin-top: 4px;
  }

  .nav-item {
    padding: 5px 9px;
    font-size: 12px;
  }

  /* 用户区单独一行，隐藏部门等细节，只留头像+姓名 */
  .user-chip {
    order: 2;
    border-left: none;
    padding-left: 0;
    margin-left: auto;
    gap: 5px;
  }

  .user-meta {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .user-meta b {
    font-size: 12px;
  }

  .user-meta span {
    display: none;
  }

  /* 商品卡：更紧凑 */
  .product-media {
    height: 130px;
  }

  .product-media .icon-fallback {
    width: 64px;
    height: 64px;
  }

  .product-body {
    padding: 12px 12px 14px;
    gap: 8px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-summary {
    font-size: 12px;
    min-height: 32px;
  }

  .price {
    font-size: 18px;
  }

  .price small {
    font-size: 11px;
  }

  /* 页面标题 */
  .page-title {
    font-size: 16px;
  }

  /* 弹窗：全屏边到边 */
  .modal-backdrop {
    padding: 0;
  }

  .modal {
    max-height: 100vh;
    height: 100vh;
    width: 100%;
    border-radius: 0;
  }

  .modal-head {
    padding: 10px 12px;
  }

  .modal-body {
    padding: 12px;
  }

  .modal-foot {
    padding: 10px 12px;
    gap: 8px;
  }

  .modal-foot .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* 筛选工具栏全宽垂直堆叠 */
  .card-head .order-line {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .card-head .order-line select,
  .card-head .order-line input,
  .card-head .order-line button {
    width: 100%;
    min-width: 0 !important;
  }

  /* 表格进一步紧凑 */
  table.tbl {
    min-width: 600px;
  }

  table.tbl th,
  table.tbl td {
    padding: 7px 8px;
    font-size: 11px;
  }

  /* 卡片 */
  .card-pad {
    padding: 12px;
  }

  /* kv-row（订单详情） */
  .kv-row {
    grid-template-columns: 80px 1fr;
    font-size: 13px;
  }

  /* auth 页更紧凑 */
  .auth-side {
    padding: 22px 18px;
  }

  .auth-side h2 {
    font-size: 20px;
  }

  .auth-main {
    padding: 22px 18px;
  }

  /* 按钮 */
  .btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .btn-sm {
    padding: 4px 9px;
    font-size: 11px;
  }

  /* 状态徽章 */
  .badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  /* Toast：贴顶满宽 */
  .toast-root {
    top: 8px;
    right: 8px;
    left: 8px;
  }
}
\n.form-grid>label{display:flex;flex-direction:column;gap:6px}.form-grid>label>input,.form-grid>label>select,.form-grid>label>textarea{width:100%}\n