/* ==========================================================================
 * 控制台样式（平台审核端 / 商家后台 / 独立登录页）
 * ========================================================================== */

.page-console {
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- 顶部栏 ---------- */
.console-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 64px;
  padding: 0 var(--sp-6);
  background: linear-gradient(100deg, var(--ink-900) 0%, #21204a 52%, #2e2668 100%);
  box-shadow: 0 6px 24px rgba(15, 17, 32, 0.22);
}

.console-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--violet) 50%, var(--accent) 100%);
}

.console-brand {
  min-width: 0;
}

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

.console-shop {
  font-weight: 600;
  color: #fff;
}

.console-header-right a {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.82);
  transition: all var(--t) var(--ease);
}

.console-header-right a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* ---------- 主体骨架 ---------- */
.console-body {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: var(--sp-5);
  max-width: 1520px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-6) var(--sp-10);
}

.console-side {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: var(--sp-4);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--sh-1);
}

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

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

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

.console-side nav a::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--brand), var(--violet));
  transform: translateY(-50%);
  transition: height var(--t) var(--ease);
}

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

.console-side nav a.active {
  background: linear-gradient(120deg, var(--brand-tint) 0%, #f4ecff 100%);
  color: var(--brand-700);
  box-shadow: inset 0 0 0 1px var(--brand-soft);
}

.console-side nav a.active::before {
  height: 18px;
}

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

.console-side-foot a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  color: var(--muted);
}

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

.console-main {
  min-width: 0;
}

.console-main-inner {
  min-width: 0;
}

.console-main .page-head h1 {
  font-size: clamp(21px, 1vw + 17px, 26px);
}

/* ---------- 区块卡片 ---------- */
.section-card {
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--sh-1);
  margin-bottom: var(--sp-5);
  animation: rise var(--t-slow) var(--ease) both;
}

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

.section-card.empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  border-style: dashed;
  box-shadow: none;
}

/* ---------- 轻量数据卡 ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

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

.stat-card-lite::after {
  content: '';
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--brand-soft);
  transition: transform var(--t) var(--ease);
}

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

.stat-card-lite:hover::after {
  transform: scale(1.45);
}

.stat-card-lite .label {
  position: relative;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

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

/* ---------- 筛选 tabs 与工具条 ---------- */
.tab-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.tab-filters > a {
  height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--white);
  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);
}

.tab-filters > a.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.26);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  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='search'] {
  width: 260px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--white);
}

.spacer {
  flex: 1;
}

/* ---------- 表格内组件 ---------- */
.section-card .table-wrap {
  border: none;
  border-radius: var(--r-sm);
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.section-card .data-table {
  background: transparent;
  font-size: 13px;
}

.section-card .data-table th {
  background: var(--bg-alt);
  border-radius: 0;
}

.section-card .data-table th:first-child {
  border-top-left-radius: var(--r-sm);
  border-bottom-left-radius: var(--r-sm);
}

.section-card .data-table th:last-child {
  border-top-right-radius: var(--r-sm);
  border-bottom-right-radius: var(--r-sm);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.product-cell img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

.product-cell .title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.order-buyer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.audit-cell {
  min-width: 0;
}

.audit-cell .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-800);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.row-actions form,
.row-actions .inline-form {
  display: inline-flex;
  margin: 0;
}

/* ---------- 行内表单 / 发货表单 ---------- */
.inline-form,
.ship-form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin: 0;
}

.inline-form input,
.ship-form input {
  width: auto;
  min-width: 160px;
  flex: 1 1 180px;
}

/* ---------- 订单卡片（商家订单列表） ---------- */
.order-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
}

.order-foot-info {
  flex: 1;
  min-width: 240px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
}

.order-foot-amount {
  text-align: right;
  font-size: 13px;
  color: var(--text-sub);
}

.order-foot-amount .price-lg {
  margin-left: 4px;
}

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

/* ==========================================================================
 * 独立登录 / 入驻页（plain 布局）
 * ========================================================================== */
.page-plain {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(79, 70, 229, 0.16), transparent 68%),
    radial-gradient(760px 440px at 96% 6%, rgba(239, 143, 43, 0.12), transparent 70%),
    var(--bg);
}

.plain-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--sp-8);
  align-items: center;
  max-width: 1080px;
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6);
}

.plain-brand {
  color: #fff;
  padding: var(--sp-8);
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, var(--ink-900) 0%, #221f4d 55%, #2f2768 100%);
  box-shadow: var(--sh-3);
  position: relative;
  overflow: hidden;
}

.plain-brand::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 143, 43, 0.34), transparent 68%);
}

.plain-brand .brand {
  position: relative;
  z-index: 1;
  padding: 0;
  margin-bottom: var(--sp-6);
}

.plain-features {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.8);
}

.plain-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.plain-features li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(239, 143, 43, 0.26);
}

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

.plain-card h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

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

.plain-card .form-switch {
  text-align: center;
}

.plain-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

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

/* ==========================================================================
 * 控制台响应式
 * ========================================================================== */
@media (max-width: 1080px) {
  .console-body {
    grid-template-columns: 200px minmax(0, 1fr);
    padding: var(--sp-4) var(--sp-4) var(--sp-8);
  }
  .console-header {
    padding: 0 var(--sp-4);
  }
}

@media (max-width: 900px) {
  .console-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .console-side {
    position: static;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
    padding: var(--sp-3);
    overflow-x: auto;
  }
  .console-side-title,
  .console-side-foot {
    display: none;
  }
  .console-side nav {
    flex-direction: row;
    gap: 6px;
  }
  .console-side nav a {
    white-space: nowrap;
  }
  .console-side nav a::before {
    display: none;
  }
  .plain-wrap {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding: var(--sp-6) var(--sp-4);
    min-height: 0;
  }
  .plain-brand {
    padding: var(--sp-5);
    border-radius: var(--r-lg);
  }
  .plain-card {
    padding: var(--sp-5);
    border-radius: var(--r-lg);
  }
  .order-foot {
    align-items: flex-start;
  }
  .order-foot-amount {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .console-header {
    height: auto;
    min-height: 60px;
    padding: 10px var(--sp-4);
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .console-header-right {
    width: 100%;
    justify-content: flex-end;
    gap: var(--sp-2);
  }
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-card-lite {
    padding: var(--sp-3) var(--sp-4);
  }
  .stat-card-lite .value {
    font-size: 22px;
  }
  .section-card {
    padding: var(--sp-4);
  }
  .toolbar input[type='search'] {
    width: 100%;
  }
  .toolbar form {
    width: 100%;
  }
  .inline-form input,
  .ship-form input {
    flex: 1 1 100%;
  }
  .plain-foot {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .console-header-right .console-shop {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .product-cell img {
    width: 42px;
    height: 42px;
  }
  .order-foot-amount {
    width: 100%;
  }
}
