/* ==========================================================================
 * 控制台样式（独立页 / 商家后台 / 平台后台）
 * ========================================================================== */

/* ================= 独立页（登录 / 入驻） ================= */
.page-plain {
  background: linear-gradient(140deg, var(--bg) 0%, var(--brand-soft) 55%, var(--accent-soft) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.plain-wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-4);
  display: grid;
  grid-template-columns: 0.85fr minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
}

/* 左侧品牌面板 */
.plain-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-6);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, var(--ink-800) 0%, var(--ink-900) 100%);
  color: #fff;
  box-shadow: var(--sh-3);
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.plain-brand::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  bottom: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 98, 42, 0.28), transparent 68%);
}

.plain-brand .brand {
  color: #fff;
  position: relative;
}

.plain-brand .brand:hover {
  background: rgba(255, 255, 255, 0.08);
}

.plain-brand .brand-slogan {
  color: rgba(255, 255, 255, 0.6);
}

.plain-brand .brand-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.plain-brand .brand-emblem-ring {
  border-color: rgba(255, 255, 255, 0.35);
}

/* 右侧表单卡片 */
.plain-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: var(--sp-8);
  animation: rise var(--t-slow) var(--ease) both;
}

.plain-card h1 {
  font-size: 24px;
  margin-bottom: var(--sp-2);
}

.plain-card .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: var(--sp-6);
}

.plain-foot {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: var(--sp-2);
  font-size: 13px;
  color: var(--text-sub);
}

.plain-foot a {
  color: var(--text-sub);
  font-weight: 600;
}

.plain-foot a:hover {
  color: var(--brand);
}

.plain-foot span {
  margin: 0 var(--sp-2);
  color: var(--line-strong);
}

.form-actions {
  margin-top: var(--sp-6);
}

.form-switch {
  text-align: center;
  margin-top: var(--sp-4);
  font-size: 13px;
  color: var(--muted);
}

.form-switch a {
  color: var(--brand);
  font-weight: 700;
}

/* ================= 控制台（商家 / 平台） ================= */
.page-console {
  background: var(--bg);
  min-height: 100vh;
}

.console-header {
  height: 62px;
  background: linear-gradient(90deg, var(--ink-900) 0%, var(--ink-700) 60%, #1f4a3b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 clamp(16px, 3vw, 28px);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 8px 22px rgba(12, 31, 24, 0.16);
}

.console-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.console-header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: 13px;
}

.console-header-right a {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  transition: all var(--t-fast) var(--ease);
}

.console-header-right a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.console-header-right .muted {
  color: rgba(255, 255, 255, 0.6);
}

.console-body {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 62px);
}

.console-side {
  width: 212px;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: var(--sp-4) var(--sp-3);
  flex-shrink: 0;
}

.console-side nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.console-side a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t) var(--ease);
}

.console-side a:hover {
  background: var(--bg-alt);
  color: var(--brand-700);
  transform: translateX(2px);
}

.console-side a.active {
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.console-main {
  flex: 1;
  padding: var(--sp-6);
  min-width: 0;
}

.console-main .alert {
  max-width: 100%;
}

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.stat-card-lite {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.stat-card-lite::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 100%);
}

.stat-card-lite:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
}

.stat-card-lite .label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: var(--sp-2);
}

.stat-card-lite .value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card-lite .value.brand {
  color: var(--brand);
}

/* 工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.toolbar form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.toolbar input[type='text'],
.toolbar input[type='search'],
.toolbar select {
  width: auto;
  min-width: 150px;
}

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

/* 状态筛选 */
.tab-filters {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.tab-filters a {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  transition: all var(--t) var(--ease);
}

.tab-filters a:hover {
  border-color: var(--brand);
  color: var(--brand-700);
  transform: translateY(-1px);
}

.tab-filters a.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(11, 86, 63, 0.22);
}

/* 内联表单（发货 / 审核） */
.inline-form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
  width: auto;
  min-width: 130px;
  padding: 7px 12px;
}

.section-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.section-card > h3:first-child {
  margin-top: 0;
  padding-left: var(--sp-3);
  border-left: 4px solid var(--accent);
}

.kv-list {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4);
  font-size: 13.5px;
  align-items: baseline;
}

.kv-list dt {
  color: var(--muted);
  font-weight: 600;
}

.kv-list dd {
  margin: 0;
  word-break: break-all;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(12, 31, 24, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--sp-4);
  animation: fade var(--t) var(--ease) both;
}

.modal-mask.hidden {
  display: none;
}

.modal-box {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  width: 440px;
  max-width: 100%;
  box-shadow: var(--sh-3);
  animation: rise var(--t) var(--ease) both;
}

/* 订单卡片底部信息 */
.order-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-1) var(--sp-1);
}

.order-foot-info {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.order-foot-amount {
  text-align: right;
}

.order-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: var(--sp-3);
}

.order-actions form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

/* 审核操作列 */
.audit-cell {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-start;
}

.audit-cell form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.audit-cell input[type='text'] {
  width: 150px;
  padding: 6px 10px;
  font-size: 12.5px;
}

/* ================= 响应式 ================= */
@media (max-width: 1000px) {
  .plain-wrap {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
    padding: var(--sp-8) var(--sp-4);
  }
  .plain-brand {
    min-height: 0;
    padding: var(--sp-6);
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 900px) {
  .console-body {
    flex-direction: column;
  }
  .console-side {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: var(--sp-2) var(--sp-3);
    position: sticky;
    top: 62px;
    z-index: 30;
  }
  .console-side nav {
    flex-direction: row;
    gap: var(--sp-1);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .console-side nav::-webkit-scrollbar {
    display: none;
  }
  .console-side a {
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    background: var(--bg-alt);
  }
  .console-side a:hover {
    transform: none;
  }
  .console-side a.active {
    box-shadow: none;
  }
  .console-main {
    padding: var(--sp-4);
  }
  .console-header {
    height: 56px;
  }
  .kv-list {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .plain-card {
    padding: var(--sp-5);
  }
  .console-header-right {
    gap: var(--sp-2);
    font-size: 12px;
  }
  .console-header-right a {
    padding: 5px 10px;
  }
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar input[type='text'],
  .toolbar input[type='search'],
  .toolbar select {
    min-width: 0;
    flex: 1;
  }
}

/* ==========================================================================
 * 骨架补充：侧栏分组 / 内容容器内衬 / 登录面板卖点
 * ========================================================================== */
.console-side-title {
  margin: 0 0 var(--sp-3);
  padding: 0 var(--sp-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.console-side-foot {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

.console-side-foot a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg-alt);
}

.console-side-foot a:hover {
  color: var(--brand-700);
  background: var(--brand-tint);
}

.console-main-inner {
  max-width: 1180px;
}

.console-shop {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 登录 / 入驻页左侧卖点 */
.plain-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  position: relative;
}

.plain-features li {
  position: relative;
  padding-left: var(--sp-6);
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.plain-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(232, 98, 42, 0.9);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9);
}

@media (max-width: 1000px) {
  .plain-brand {
    flex-direction: column;
    align-items: flex-start;
  }
  .plain-features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-5);
  }
}

@media (max-width: 900px) {
  .console-side {
    padding: var(--sp-2) var(--sp-3);
  }
  .console-side-title,
  .console-side-foot {
    display: none;
  }
  .console-shop {
    max-width: 120px;
  }
}
