/* 商户首页 — 顶栏 + 中区三列 + 底栏快捷 #4f46e5 */
:root {
  --mch-brand: #4f46e5;
  --mch-brand-dark: #4338ca;
  --mch-brand-soft: #eef2ff;
  --mch-brand-muted: #c7d2fe;
}

.mch-main__header--home {
  height: auto;
  min-height: 56px;
  padding: 10px 20px;
  flex-wrap: nowrap;
  gap: 12px 16px;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 100;
}

.mch-home-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.mch-home-cs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--mch-brand);
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s ease;
}

.mch-home-cs:hover {
  background: var(--mch-brand-dark);
}

.mch-home-cs.is-hidden {
  display: none;
}

.mch-home-cs__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mch-home-cs__icon svg {
  width: 18px;
  height: 18px;
}

.mch-home-cs__text {
  line-height: 1;
}

.mch-home-topbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-left: auto;
}

.mch-home-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  flex-shrink: 0;
  overflow: visible;
  position: relative;
  z-index: 1100;
}

.mch-home-topbar .portal-lang-switch,
.mch-home-topbar .portal-currency-switch {
  flex-shrink: 0;
}

.mch-home-topbar .mch-main__logout {
  flex-shrink: 0;
}

.mch-home-topbar .mch-home-user {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mch-home-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--mch-brand-soft);
  color: var(--mch-brand);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.mch-home-badge svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mch-home-badge--shield {
  background: #eff6ff;
  color: #2563eb;
}

.mch-home-badge--heart {
  background: #fdf2f8;
  color: #db2777;
}

.mch-home-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #475569;
  font-weight: 500;
}

.mch-home-user__role {
  color: #94a3b8;
  font-weight: 400;
}

.mch-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 第 1 行 */
.mch-dash-row1 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mch-hero-card {
  background: var(--mch-brand);
  border-radius: 14px;
  padding: 18px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  min-height: 96px;
}

.mch-hero-card__label {
  font-size: 0.875rem;
  opacity: 0.92;
  margin: 0 0 6px;
}

.mch-hero-card__value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.mch-hero-card__icon svg {
  width: 42px;
  height: 42px;
  stroke: rgba(255, 255, 255, 0.92);
  fill: none;
  stroke-width: 1.5;
}

/* 第 2 行：左 2×2 | 中订单 | 右设置+认证 */
.mch-dash-mid {
  display: grid;
  grid-template-columns: 2fr 1fr 0.85fr;
  gap: 16px;
  align-items: stretch;
}

.mch-dash-left-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  min-width: 0;
}

.mch-dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.mch-panel {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  min-width: 0;
}

.mch-panel__head {
  padding: 14px 16px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mch-brand);
  margin: 0;
}

.mch-panel__head-wrap {
  padding: 14px 16px 0;
}

.mch-panel__head-wrap .mch-panel__head {
  padding: 0;
}

.mch-panel__sub {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.mch-panel__body {
  padding: 10px 16px 16px;
}

.mch-panel__body--chart {
  padding: 2px 8px 10px;
}

.mch-area-chart {
  width: 100%;
  height: 120px;
  display: block;
}

.mch-mini-card .mch-panel__body {
  padding: 8px 16px 16px;
}

.mch-mini-amount {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mch-brand);
  line-height: 1.2;
}

.mch-mini-foot {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.mch-panel--orders {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mch-panel--orders .mch-panel__body {
  flex: 1;
  padding-top: 6px;
}

.mch-order-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.mch-order-stat:last-child {
  border-bottom: none;
}

.mch-order-stat__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--mch-brand-soft);
  color: var(--mch-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mch-order-stat__icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.mch-order-stat__label {
  flex: 1;
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.35;
  min-width: 0;
}

.mch-order-stat__value {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--mch-brand);
  flex-shrink: 0;
}

.mch-settings-body {
  padding: 10px 16px 18px;
  flex: 1;
}

.mch-settings-body .mch-empty-hint {
  margin-bottom: 14px;
  line-height: 1.55;
  color: #64748b;
}

.mch-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 4px;
}

.mch-settings-level-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: auto;
}

.mch-panel--deposit {
  flex: 1;
  min-height: 140px;
}

.mch-panel--deposit .mch-panel__head {
  padding: 12px 16px 0;
  margin: 0;
  font-size: 1rem;
}

.mch-deposit-card {
  padding: 12px 16px 18px;
}

.mch-deposit-card__label {
  margin: 0 0 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.mch-deposit-card__label--action {
  color: #b45309;
}

.mch-deposit-card__rows {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.mch-deposit-card__rows li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.8125rem;
  color: #64748b;
  border-bottom: 1px dashed #e8ecf1;
}

.mch-deposit-card__rows li:last-child {
  border-bottom: none;
}

.mch-deposit-card__rows strong {
  color: #0f172a;
  font-weight: 700;
}

.mch-deposit-card__rows strong.is-warn {
  color: #dc2626;
}

.mch-deposit-card__btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--mch-brand, #4f46e5);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.mch-deposit-card__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mch-deposit-card__btn:not(:disabled):hover {
  filter: brightness(1.05);
}

.mch-deposit-card__sub {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}

.mch-deposit-card__link {
  display: block;
  margin-top: 10px;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--mch-brand, #4f46e5);
  font-weight: 600;
  text-decoration: none;
}

.mch-deposit-card__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  text-align: center;
}

.mch-deposit-card__sum {
  margin: 4px 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--mch-brand, #4f46e5);
}

.mch-deposit-card__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 700;
}

.mch-btn-brand {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--mch-brand-soft);
  color: var(--mch-brand);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--mch-brand-muted);
}

.mch-btn-brand:hover {
  background: var(--mch-brand);
  color: #fff;
  border-color: var(--mch-brand);
}

.mch-empty-hint {
  color: #94a3b8;
  font-size: 0.8125rem;
  margin: 0;
}

.mch-mini-card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.mch-mini-card--link:hover {
  border-color: var(--mch-brand-muted);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

/* 第 3 行：快捷 */
.mch-dash-row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mch-quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  padding: 22px 20px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e8ecf1;
  text-decoration: none;
  color: var(--mch-brand);
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mch-quick-card:hover {
  background: var(--mch-brand-soft);
  border-color: var(--mch-brand-muted);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.mch-quick-card svg {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

@media (max-width: 1100px) {
  .mch-dash-mid {
    grid-template-columns: 1fr 1fr;
  }
  .mch-dash-right-col {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .mch-panel--deposit {
    flex: 1;
    min-height: 120px;
  }
}

@media (max-width: 768px) {
  .mch-dash-row1 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mch-dash-mid {
    grid-template-columns: 1fr;
  }
  .mch-dash-left-grid {
    grid-template-columns: 1fr;
  }
  .mch-dash-right-col {
    flex-direction: column;
  }
  .mch-dash-row3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .mch-dash-row1 {
    grid-template-columns: 1fr;
  }
}
