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

/* ==========================================================================
 * 独立页（登录 / 入驻）
 * ========================================================================== */
.page-plain {
  background: radial-gradient(900px 520px at 12% 0%, rgba(43, 77, 255, 0.22), transparent 62%),
    radial-gradient(760px 460px at 92% 96%, rgba(255, 90, 31, 0.16), transparent 66%),
    linear-gradient(160deg, var(--ink-900) 0%, var(--ink-850) 55%, var(--ink-800) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

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

/* 左侧品牌面板 */
.plain-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-5);
  padding: var(--sp-8) var(--sp-6);
  border-radius: var(--r-2xl);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  color: #fff;
  overflow: hidden;
  min-height: 340px;
}

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

.plain-brand::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -100px;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 77, 255, 0.42), 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.62);
}

.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.38);
}

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

.plain-card h1 {
  font-size: 26px;
  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-4);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.plain-foot a {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.plain-foot a:hover {
  color: #fff;
}

.plain-foot span {
  margin: 0 var(--sp-3);
  color: rgba(255, 255, 255, 0.28);
}

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

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

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

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

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

.plain-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-600) 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.9);
}

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

.console-header {
  height: 64px;
  background: linear-gradient(90deg, var(--ink-900) 0%, var(--brand-700) 62%, var(--brand) 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 10px 26px rgba(16, 24, 40, 0.18);
}

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

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

.console-header-right a {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  padding: 7px 15px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: all var(--t-fast) var(--ease);
}

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

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

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

.console-side {
  width: 224px;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: var(--sp-5) var(--sp-4);
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  align-self: flex-start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.console-side nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.console-side a {
  display: block;
  padding: 11px 15px;
  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(3px);
}

.console-side a.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--sh-brand);
}

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

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

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

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

.console-side-title {
  margin: 0 0 var(--sp-3);
  padding: 0 var(--sp-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.console-side-foot a {
  display: block;
  padding: 9px 15px;
  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);
}

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

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

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

.stat-card-lite:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-2);
  border-color: var(--brand-soft);
}

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

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

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

/* 工具栏 */
.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: 8px 17px;
  border-radius: var(--r-sm);
  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(-2px);
}

.tab-filters a.active {
  background: linear-gradient(135deg, var(--ink-900) 0%, var(--ink-700) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-2);
}

/* 内联表单（发货 / 审核） */
.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: 8px 12px;
}

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

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

.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;
  margin: 0;
}

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

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

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 20, 0.55);
  backdrop-filter: blur(4px);
  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-2xl);
  padding: var(--sp-6);
  width: 460px;
  max-width: 100%;
  box-shadow: var(--sh-4);
  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: 7px 10px;
  font-size: 12.5px;
}

/* ==========================================================================
 * 响应式
 * ========================================================================== */
@media (max-width: 1000px) {
  .plain-wrap {
    grid-template-columns: minmax(0, 1fr);
    max-width: 580px;
    padding: var(--sp-8) var(--sp-4);
  }
  .plain-brand {
    min-height: 0;
    padding: var(--sp-6);
    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-body {
    flex-direction: column;
  }
  .console-side {
    width: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: var(--sp-3);
    position: sticky;
    top: 64px;
    z-index: 30;
  }
  .console-side nav {
    flex-direction: row;
    gap: var(--sp-2);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .console-side nav::-webkit-scrollbar {
    display: none;
  }
  .console-side a {
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: var(--r-sm);
    background: var(--bg-alt);
  }
  .console-side a:hover {
    transform: none;
  }
  .console-side a.active {
    box-shadow: var(--sh-brand);
  }
  .console-main {
    padding: var(--sp-4);
  }
  .console-header {
    height: 58px;
  }
  .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: 6px 11px;
  }
  .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-shop {
    max-width: 120px;
  }
}
