/**
 * 商家后台专属样式 (merchant.css) v2.0
 * 覆盖和扩展 main.css，提供完整的商家后台UI
 */

/* ══════════════════════════════════════════════════════
   商家后台变量
══════════════════════════════════════════════════════ */
:root {
  --mc-blue:    var(--color-blue);
  --mc-green:   var(--color-green);
  --mc-orange:  var(--color-orange);
  --mc-red:     var(--color-red);
  --mc-purple:  var(--color-purple);
  --mc-pink:    var(--color-pink);
  --mc-teal:    var(--color-teal);
  --mc-bg:      var(--bg-secondary);
  --mc-card:    var(--bg-primary);
  --mc-border:  var(--glass-border-dark);
  --mc-text-1:  var(--color-label-1);
  --mc-text-2:  var(--color-label-2);
  --mc-text-3:  var(--color-label-3);
  --mc-text-4:  var(--color-label-4);
  --mc-shadow:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --mc-shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --mc-radius:  12px;
  --mc-header-h: 60px;
  --mc-transition: all .2s cubic-bezier(.4,0,.2,1);
}

/* ══════════════════════════════════════════════════════
   隐藏前端tab栏（商家后台不需要）
══════════════════════════════════════════════════════ */
.tab-bar { display: none !important; }

/* ══════════════════════════════════════════════════════
   商家后台整体背景
══════════════════════════════════════════════════════ */
body.merchant-app {
  background: var(--mc-bg) !important;
}
body.merchant-app .main-content {
  padding-bottom: 40px !important;
}

/* ══════════════════════════════════════════════════════
   商家后台顶部导航
══════════════════════════════════════════════════════ */
.merchant-header {
  position: sticky;
  top: 0;
  left: 0; right: 0;
  height: var(--mc-header-h);
  background: var(--mc-card);
  border-bottom: 1px solid var(--mc-border);
  z-index: 200;
  box-shadow: var(--mc-shadow);
}
.merchant-header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 24px;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.merchant-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.merchant-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--mc-orange), #F59E0B);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.merchant-brand-icon svg { width: 16px; height: 16px; color: #fff; }
.merchant-brand-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--mc-text-1);
  white-space: nowrap;
}

/* 导航菜单 */
.merchant-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.merchant-nav::-webkit-scrollbar { display: none; }
.mnav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mc-text-3);
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--mc-transition);
}
.mnav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.mnav-item:hover { background: var(--mc-bg); color: var(--mc-text-1); }
.mnav-item.active { background: rgba(37,99,235,.08); color: var(--mc-blue); font-weight: 600; }

/* 右侧用户信息 */
.merchant-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.merchant-logout-mobile {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--mc-border);
  background: var(--mc-card);
  color: var(--mc-text-2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.merchant-logout-mobile svg { width: 16px; height: 16px; }
.merchant-profile-mobile {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--mc-border);
  background: var(--mc-card);
  color: var(--mc-text-2);
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.merchant-profile-mobile svg { width: 16px; height: 16px; }
.merchant-name-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--mc-text-2);
  background: var(--mc-bg);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--mc-border);
}

/* ══════════════════════════════════════════════════════
   主内容容器
══════════════════════════════════════════════════════ */
.merchant-main {
  min-height: calc(100vh - var(--mc-header-h));
}
.merchant-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ══════════════════════════════════════════════════════
   欢迎横幅
══════════════════════════════════════════════════════ */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--mc-blue) 0%, #60A5FA 100%);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(37,99,235,.25);
}
.dashboard-welcome h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.dashboard-welcome p {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  margin: 4px 0 0;
}
.dashboard-welcome .btn.btn-primary {
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
}
.dashboard-welcome .btn.btn-primary:hover {
  background: rgba(255,255,255,.3);
}

/* ══════════════════════════════════════════════════════
   统计卡片网格
══════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--mc-card);
  border-radius: var(--mc-radius);
  padding: 18px 20px;
  box-shadow: var(--mc-shadow);
  border: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--mc-transition);
}
.stat-card:hover {
  box-shadow: var(--mc-shadow-md);
  transform: translateY(-1px);
}
.stat-card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 22px; height: 22px; }
.icon-blue   { background: rgba(37,99,235,.1);  color: var(--mc-blue); }
.icon-green  { background: rgba(22,163,74,.1);  color: var(--mc-green); }
.icon-orange { background: rgba(217,119,6,.1);  color: var(--mc-orange); }
.icon-red    { background: rgba(220,38,38,.1);  color: var(--mc-red); }
.icon-purple { background: rgba(124,58,237,.1); color: var(--mc-purple); }
.icon-pink   { background: rgba(219,39,119,.1); color: var(--mc-pink); }
.icon-teal   { background: rgba(8,145,178,.1);  color: var(--mc-teal); }
.stat-card-info { flex: 1; min-width: 0; }
.stat-card-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--mc-text-1);
  line-height: 1;
  letter-spacing: -.5px;
  display: block;
}
.stat-card-label {
  font-size: 12px;
  color: var(--mc-text-3);
  margin-top: 4px;
  display: block;
}

/* ══════════════════════════════════════════════════════
   内容区块
══════════════════════════════════════════════════════ */
.dashboard-section {
  background: var(--mc-card);
  border-radius: var(--mc-radius);
  box-shadow: var(--mc-shadow);
  border: 1px solid var(--mc-border);
  overflow: hidden;
  margin-bottom: 20px;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mc-border);
  gap: 12px;
}
.section-header-row h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--mc-text-1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header-row h3 svg { width: 16px; height: 16px; opacity: .6; }

/* ══════════════════════════════════════════════════════
   产品表格
══════════════════════════════════════════════════════ */
.product-table {
  overflow-x: auto;
}
.table-header,
.table-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}
.table-header {
  background: #F8FAFC;
  border-bottom: 1px solid var(--mc-border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mc-text-3);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.table-row {
  border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background .1s;
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: #F8FAFC; }

.col-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.col-price  { width: 88px; flex-shrink: 0; font-weight: 600; color: var(--mc-text-1); }
.col-rooms  { width: 72px; flex-shrink: 0; color: var(--mc-text-3); font-size: 13px; }
.col-stat   { width: 90px; flex-shrink: 0; color: var(--mc-text-3); font-size: 13px; }
.col-status { width: 72px; flex-shrink: 0; }
.col-action { width: 120px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

.product-thumb-wrap {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mc-bg);
}
.product-thumb {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.product-name-info { min-width: 0; }
.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--mc-text-1);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-loc {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--mc-text-4);
  margin-top: 3px;
}
.product-loc svg { width: 11px; height: 11px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-online     { background: rgba(22,163,74,.1);   color: var(--mc-green); }
.badge-offline    { background: rgba(100,116,139,.1); color: var(--mc-text-3); }
.badge-pending    { background: rgba(217,119,6,.1);   color: var(--mc-orange); }
.badge-confirmed  { background: rgba(37,99,235,.1);   color: var(--mc-blue); }
.badge-completed  { background: rgba(22,163,74,.1);   color: var(--mc-green); }
.badge-cancelled  { background: rgba(100,116,139,.1); color: var(--mc-text-3); }
.badge-rejected   { background: rgba(220,38,38,.1);   color: var(--mc-red); }
.badge-info       { background: rgba(37,99,235,.1);   color: var(--mc-blue); }

.btn-success { background: var(--mc-green); color: #fff; border: none; }
.btn-success:hover { opacity: .85; }
.btn-danger  { background: var(--mc-red);   color: #fff; border: none; }
.btn-danger:hover  { opacity: .85; }

.action-link {
  font-size: 13px;
  color: var(--mc-blue);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.action-link:hover { background: rgba(37,99,235,.08); }
.action-link.danger { color: var(--mc-red); }
.action-link.danger:hover { background: rgba(220,38,38,.08); }

/* ══════════════════════════════════════════════════════
   空状态
══════════════════════════════════════════════════════ */
.empty-state-small {
  text-align: center;
  padding: 40px 20px;
  color: var(--mc-text-4);
}
.empty-state-small svg { width: 36px; height: 36px; margin: 0 auto 10px; display: block; }
.empty-state-small p { font-size: 14px; margin: 0; color: var(--mc-text-3); }

/* ══════════════════════════════════════════════════════
   商家信息卡片
══════════════════════════════════════════════════════ */
.merchant-info-card {
  padding: 4px 0;
}
.info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mc-text-3);
  flex-shrink: 0;
}
.info-value {
  font-size: 14px;
  color: var(--mc-text-1);
}

/* ══════════════════════════════════════════════════════
   页面标题行
══════════════════════════════════════════════════════ */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title-row h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--mc-text-1);
  margin: 0;
}

/* ══════════════════════════════════════════════════════
   表单
══════════════════════════════════════════════════════ */
.form-card {
  background: var(--mc-card);
  border-radius: var(--mc-radius);
  box-shadow: var(--mc-shadow);
  border: 1px solid var(--mc-border);
  padding: 24px;
  margin-bottom: 20px;
}
.form-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--mc-text-1);
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--mc-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-card-title svg { width: 16px; height: 16px; opacity: .6; }

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mc-text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required { color: var(--mc-red); }
.form-label .hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--mc-text-4);
}
.form-input,
.form-select,
.form-textarea {
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid rgba(0,0,0,.12);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--mc-text-1);
  transition: var(--mc-transition);
  font-family: inherit;
  width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--mc-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-textarea { height: 100px; padding: 10px 12px; resize: vertical; }
.form-textarea.description-editor { min-height: 200px; }
.form-hint { font-size: 12px; color: var(--mc-text-4); margin-top: 3px; }

/* 修复商家端图标输入框被通用 padding 覆盖导致的重叠 */
.input-icon-wrap > .form-input.input-with-icon {
  padding-left: 40px;
}
.input-icon-wrap > .form-input.input-with-right-icon {
  padding-right: 42px;
}
.input-icon-wrap > .input-icon,
.input-icon-wrap > .input-right-btn {
  z-index: 2;
}

.form-submit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--mc-border);
}

/* 4档价格网格 */
.price-4-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--mc-bg);
  border-radius: 10px;
  padding: 16px;
}
.price-4-item .input-icon-wrap { margin-top: 0; }

/* ══════════════════════════════════════════════════════
   状态过滤标签
══════════════════════════════════════════════════════ */
.status-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--mc-border);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--mc-card);
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mc-text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--mc-transition);
  text-decoration: none;
  border-radius: 0;
}
.status-tab:hover { color: var(--mc-text-1); }
.status-tab.active { color: var(--mc-blue); border-bottom-color: var(--mc-blue); font-weight: 600; }
.status-tab .tab-count {
  font-size: 11px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  background: var(--mc-bg);
  color: var(--mc-text-3);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.status-tab.active .tab-count { background: rgba(37,99,235,.1); color: var(--mc-blue); }

/* ══════════════════════════════════════════════════════
   订单卡片列表
══════════════════════════════════════════════════════ */
.order-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.order-card {
  background: var(--mc-card);
  border: 1px solid var(--mc-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: box-shadow .15s;
}
.order-card:hover { box-shadow: var(--mc-shadow-md); }
.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.order-no {
  font-size: 11px;
  color: var(--mc-text-4);
  font-family: monospace;
}
.order-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.order-field {}
.order-field-label {
  font-size: 10px;
  color: var(--mc-text-4);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 2px;
}
.order-field-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--mc-text-1);
  line-height: 1.35;
}
.order-product-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mc-text-1);
  margin-bottom: 4px;
}
.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--mc-border);
  flex-wrap: wrap;
}
.order-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--mc-text-1);
}
.order-price small { font-size: 12px; color: var(--mc-text-3); font-weight: 400; margin-left: 4px; }
.order-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.order-meta-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--mc-bg);
  color: var(--mc-text-3);
  font-size: 12px;
  line-height: 1.45;
}
.order-meta-note svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.order-meta-note-danger {
  color: var(--mc-red);
  background: rgba(220,38,38,.06);
}
.order-waiting-text {
  font-size: 12px;
  color: var(--mc-text-4);
}

/* ══════════════════════════════════════════════════════
   钱包页
══════════════════════════════════════════════════════ */
.wallet-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.wallet-balance-card {
  background: var(--mc-card);
  border-radius: var(--mc-radius);
  padding: 24px;
  box-shadow: var(--mc-shadow);
  border: 1px solid var(--mc-border);
}
.wallet-balance-card.primary {
  background: linear-gradient(135deg, var(--mc-blue), #60A5FA);
  border: none;
  box-shadow: 0 4px 20px rgba(37,99,235,.25);
}
.wallet-balance-card.primary * { color: #fff; }
.wallet-balance-label { font-size: 13px; opacity: .75; margin-bottom: 8px; }
.wallet-balance-amount { font-size: 36px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.wallet-balance-amount small { font-size: 18px; font-weight: 600; }
.wallet-balance-hint { font-size: 12px; opacity: .65; margin-top: 6px; }

/* ══════════════════════════════════════════════════════
   分页
══════════════════════════════════════════════════════ */
.merchant-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
}
.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--mc-border);
  background: var(--mc-card);
  color: var(--mc-text-2);
  font-size: 13px;
  text-decoration: none;
  transition: var(--mc-transition);
  cursor: pointer;
}
.mp-btn:hover { border-color: var(--mc-blue); color: var(--mc-blue); }
.mp-btn.active { background: var(--mc-blue); color: #fff; border-color: var(--mc-blue); font-weight: 600; }
.mp-btn svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════
   Toast通知
══════════════════════════════════════════════════════ */
#merchantToastContainer {
  position: fixed;
  top: 70px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.merchant-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--mc-card);
  border-radius: var(--mc-radius);
  box-shadow: var(--mc-shadow-md);
  font-size: 14px;
  animation: mToastIn .25s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
  border: 1px solid var(--mc-border);
  pointer-events: auto;
}
.merchant-toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.merchant-toast.success { border-left: 3px solid var(--mc-green); }
.merchant-toast.success svg { color: var(--mc-green); }
.merchant-toast.error   { border-left: 3px solid var(--mc-red); }
.merchant-toast.error   svg { color: var(--mc-red); }
.merchant-toast.info    { border-left: 3px solid var(--mc-blue); }
.merchant-toast.info    svg { color: var(--mc-blue); }
@keyframes mToastIn {
  from { opacity:0; transform:translateX(20px) scale(.9); }
  to   { opacity:1; transform:translateX(0) scale(1); }
}

/* ══════════════════════════════════════════════════════
   图片上传拖放高亮
══════════════════════════════════════════════════════ */
.upload-area.drag-over {
  border-color: var(--mc-blue);
  background: rgba(37,99,235,.04);
}

/* ══════════════════════════════════════════════════════
   入驻申请页
══════════════════════════════════════════════════════ */
.merchant-apply-page .apply-hero {
  background: linear-gradient(135deg, var(--mc-orange) 0%, #F59E0B 100%);
}

.merchant-auth-header {
  position: sticky;
  top: 0;
  z-index: 210;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid rgba(0,0,0,.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.merchant-auth-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--mc-text-1);
}

.merchant-auth-page {
  min-height: calc(100vh - 54px);
  padding-top: 14px;
  padding-bottom: calc(var(--mc-tabbar-h) + 18px);
}

.merchant-apply-page .main-content {
  padding-top: 12px;
  padding-bottom: calc(var(--mc-tabbar-h) + 18px);
}

.merchant-auth-tabbar {
  border-top: 1px solid rgba(0,0,0,.08);
}

/* ══════════════════════════════════════════════════════
   通知红点徽章
══════════════════════════════════════════════════════ */
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--mc-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   产品列表卡片 (.mp-card) — 桌面表格行 / 移动端卡片
══════════════════════════════════════════════════════ */

/* 桌面：复用 .table-row 的弹性布局 */
.mp-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background .1s;
}
.mp-card:last-child { border-bottom: none; }
.mp-card:hover { background: #F8FAFC; }

.mp-thumb-wrap {
  flex-shrink: 0;
  width: 64px; height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mc-bg);
}
.mp-thumb {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* 标题列（flex:1） */
.mp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mp-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--mc-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-loc {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--mc-text-4);
}
.mp-loc svg { width: 11px; height: 11px; }

/* 价格列 */
.mp-price-col {
  width: 88px;
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.mp-price { font-size: 15px; font-weight: 700; color: var(--mc-text-1); }
.mp-price-hint { font-size: 11px; color: var(--mc-text-4); }

/* 房间/床位列 */
.mp-rooms-col {
  width: 72px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--mc-text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 浏览/收藏列 */
.mp-stat-col {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--mc-text-3);
}
.mp-stat-col span { display: flex; align-items: center; gap: 3px; }
.mp-stat-col svg { width: 12px; height: 12px; }

/* 状态开关列 */
.mp-status-col { width: 72px; flex-shrink: 0; }
.mp-status-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
}
.mp-status-btn:hover { opacity: .8; }
.mp-status-on  { background: rgba(22,163,74,.1);   color: var(--mc-green); }
.mp-status-off { background: rgba(100,116,139,.1); color: var(--mc-text-3); }

/* 旧版 status-toggle（兼容别处用到的地方） */
.status-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
  font-family: inherit;
}
.status-toggle:hover { opacity: .8; }
.status-toggle.badge-online  { background: rgba(22,163,74,.1);   color: var(--mc-green); }
.status-toggle.badge-offline { background: rgba(100,116,139,.1); color: var(--mc-text-3); }

/* 操作按钮列 */
.mp-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--mc-border);
  background: var(--mc-card);
  color: var(--mc-text-2);
  cursor: pointer;
  text-decoration: none;
  transition: var(--mc-transition);
  white-space: nowrap;
  font-family: inherit;
}
.mp-action-btn svg { width: 13px; height: 13px; }
.mp-action-btn:hover { background: var(--mc-bg); border-color: rgba(0,0,0,.15); }
.mp-action-del { color: var(--mc-red); border-color: rgba(220,38,38,.2); }
.mp-action-del:hover { background: rgba(220,38,38,.06); border-color: var(--mc-red); }

/* ══════════════════════════════════════════════════════
   商家后台移动端底部导航 Tab Bar
══════════════════════════════════════════════════════ */
:root { --mc-tabbar-h: 58px; }

/* 默认隐藏底部导航（桌面不需要）*/
.merchant-tab-bar { display: none; }

@media (max-width: 767px) {
  /* 显示底部导航 */
  .merchant-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--mc-tabbar-h);
    background: rgba(255,255,255,.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0,0,0,.08);
    z-index: 300;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mctab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--mc-text-4);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 0 4px;
    position: relative;
    transition: color .15s;
  }
  .mctab-item.active { color: var(--mc-blue); }
  .mctab-item svg { width: 22px; height: 22px; }
  .mctab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    min-width: 16px; height: 16px;
    background: var(--mc-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border: 1.5px solid #fff;
  }

  /* 移动端精简顶部：只保留品牌Logo+名称，其余全部隐藏 */
  .merchant-nav         { display: none !important; }
  .merchant-name-badge  { display: none !important; }
  .merchant-header-user { display: none !important; }
  .merchant-logout-mobile { display: inline-flex; margin-left: auto; }
  .merchant-profile-mobile { display: inline-flex; }
  .merchant-header-inner { padding: 0 14px; gap: 8px; justify-content: flex-start; }
  .merchant-header { height: 50px; }
  .merchant-brand-text { font-size: 14px; font-weight: 700; }
  /* 内容区顶部间距配合精简后的header */
  .merchant-main { min-height: calc(100vh - 50px); }

  /* 内容区底部留空给 tab bar */
  .merchant-main { padding-bottom: var(--mc-tabbar-h); }
  .merchant-container { padding: 14px 12px calc(var(--mc-tabbar-h) + 16px); }

  /* 统计卡片 */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-card-num { font-size: 22px; }
  .stat-card-icon { width: 38px; height: 38px; }
  .stat-card-icon svg { width: 18px; height: 18px; }

  /* 欢迎卡片 */
  .dashboard-welcome {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    margin-bottom: 16px;
  }
  .dashboard-welcome h2 { font-size: 17px; }
  .dashboard-welcome .btn { width: 100%; justify-content: center; }

  /* 两栏内容改为单列 */
  .dashboard-2col {
    grid-template-columns: 1fr !important;
  }

  /* 表单 */
  .form-grid-2col { grid-template-columns: 1fr; }
  .form-submit-bar { flex-direction: column-reverse; }
  .form-submit-bar .btn { width: 100%; justify-content: center; }
  .price-4-grid { grid-template-columns: 1fr 1fr; }
  .page-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-title-row .btn { width: 100%; justify-content: center; }

  /* 普通旧式表格（订单等） */
  .table-header { display: none; }
  .table-row { flex-wrap: wrap; gap: 8px; }
  .col-price, .col-stat, .col-rooms { width: auto; }

  /* ── 产品卡片移动端重排 ── */
  /* 外层 product-table 取消 overflow */
  .product-table { overflow: visible; }

  /* 每张卡片：左图右文 + 底部一行操作 */
  .mp-card {
    padding: 14px 14px 12px;
    gap: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--mc-card);
    border-radius: 14px;
    border-bottom: none;
    box-shadow: var(--mc-shadow);
    margin-bottom: 10px;
  }
  .mp-card:hover { background: var(--mc-card); }

  /* 顶部：左图 + 右侧标题/价格/状态 */
  .mp-card .mp-thumb-wrap,
  .mp-card .mp-info,
  .mp-card .mp-price-col,
  .mp-card .mp-status-col {
    /* 全部参与 flex row */
  }

  /* 用伪元素包住图片+信息区域：直接把前几个子元素横排 */
  .mp-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "thumb main"
      "actions actions";
    gap: 0 12px;
  }

  .mp-thumb-wrap {
    grid-area: thumb;
    width: 80px; height: 80px;
    border-radius: 10px;
    align-self: center;
  }

  /* 右侧主信息区 */
  .mp-info {
    grid-area: main;
    align-self: start;
    padding-top: 2px;
    /* 拼接价格/状态 */
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 2px 8px;
  }

  .mp-title {
    grid-column: 1 / 3;
    font-size: 14px;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }
  .mp-loc  { grid-column: 1 / 2; }

  /* 价格/房间/浏览 — 移动端塞进 mp-info 下方 */
  .mp-price-col {
    grid-area: unset;
    grid-column: 1 / 2;
    width: auto;
    margin-top: 4px;
  }
  .mp-rooms-col, .mp-stat-col { display: none; }

  /* 状态角标对齐右上角 */
  .mp-status-col {
    grid-area: unset;
    width: auto;
    align-self: start;
    margin-top: 4px;
    text-align: right;
  }

  /* 底部操作栏 */
  .mp-actions {
    grid-area: actions;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--mc-border);
    display: flex;
    gap: 8px;
  }
  .mp-action-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 0;
    font-size: 13px;
  }

  /* 钱包 */
  .wallet-cards-grid { grid-template-columns: 1fr; gap: 12px; }
  .wallet-balance-amount { font-size: 28px; }

  /* 订单卡片字号 */
  .order-card { padding: 12px; }
  .order-price { font-size: 16px; }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .wallet-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .merchant-container { padding: 10px 10px calc(var(--mc-tabbar-h) + 12px); }
  .dashboard-welcome h2 { font-size: 16px; }
  .stat-card-num { font-size: 20px; }
}
