/* ==========================================================================
   摊街 · 运营后台样式
   原则：只做 Element Plus 的"补丁"，不重写组件。
   1) 用 CSS 变量把主色换成品牌橙，全站组件自动跟随；
   2) 布局（侧边栏 / 顶栏 / 内容区）自己写，不依赖 el-container 的默认间距。
   ========================================================================== */

:root {
  /* 品牌主色：与小程序、摊主 H5 保持一致 */
  --brand: #ff5a1f;
  --brand-dark: #e04a12;
  --brand-soft: #fff1eb;

  --el-color-primary: #ff5a1f;
  --el-color-primary-light-3: #ff8a5c;
  --el-color-primary-light-5: #ffab89;
  --el-color-primary-light-7: #ffccb7;
  --el-color-primary-light-8: #ffddce;
  --el-color-primary-light-9: #fff1eb;
  --el-color-primary-dark-2: #e04a12;

  --el-border-radius-base: 6px;

  --sidebar-w: 208px;
  --header-h: 56px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 13px;
  color: var(--el-text-color-primary);
  background: var(--el-bg-color-page, #f5f6f8);
}

#app {
  height: 100%;
}

/* ---------------- 启动占位 ---------------- */
.boot {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #a7adba;
}

.boot p {
  margin: 10px 0 0;
  font-size: 15px;
  color: #6b7280;
  letter-spacing: 2px;
}

.boot span {
  font-size: 12px;
}

.boot-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: boot-spin .8s linear infinite;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   登录页
   ========================================================================== */
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2b3244 0%, #444d63 60%, #5b4a44 100%);
}

.login-card {
  width: 380px;
  padding: 34px 34px 26px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 26px;
  line-height: 52px;
}

.login-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 3px;
}

.login-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--el-text-color-secondary);
}

.login-tip {
  margin-top: 16px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: #b64a1c;
  font-size: 12px;
  line-height: 1.7;
}

.login-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: #b3b8c2;
}

/* ==========================================================================
   主框架
   ========================================================================== */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.aside {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: #1f2430;
  overflow: hidden;
}

.aside-brand {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.aside-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand);
  text-align: center;
  line-height: 26px;
  font-size: 15px;
}

.aside-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.aside-name small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: #7d869a;
}

/* 侧边菜单：深色底、橙色高亮，不跟随 Element Plus 的浅色默认值 */
.aside .el-menu {
  flex: 1;
  overflow-y: auto;
  border-right: none;
  background: transparent;
  padding-bottom: 16px;
}

.aside .el-menu-item-group__title {
  padding: 14px 18px 6px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #626b7f;
}

.aside .el-menu-item {
  height: 38px;
  line-height: 38px;
  margin: 2px 8px;
  border-radius: 6px;
  color: #c3c9d6;
  font-size: 13px;
}

.aside .el-menu-item:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.aside .el-menu-item.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}

.aside .el-menu-item.is-active .el-badge__content {
  border-color: var(--brand);
}

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--el-border-color-light);
}

.header-title {
  font-size: 15px;
  font-weight: 600;
}

.header-title .el-breadcrumb {
  font-size: 12px;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--el-text-color-secondary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--el-text-color-primary);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
}

/* ==========================================================================
   通用块
   ========================================================================== */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.page-head p {
  margin: 0;
  font-size: 12px;
  color: var(--el-text-color-secondary);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
}

.filter-bar .spacer {
  flex: 1;
}

.pager {
  display: flex;
  justify-content: flex-end;
  padding: 14px 0 0;
}

/* 数据大盘数字卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
}

.stat-card .label {
  font-size: 12px;
  color: var(--el-text-color-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card .value small {
  font-size: 12px;
  font-weight: 400;
  color: var(--el-text-color-secondary);
  margin-left: 3px;
}

.stat-card .foot {
  margin-top: 6px;
  font-size: 11px;
  color: var(--el-text-color-placeholder);
}

.stat-card.is-brand {
  border-color: #ffd4c2;
  background: linear-gradient(180deg, #fff8f5, #fff);
}

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

/* 面板 */
.panel {
  background: #fff;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--el-border-color-lighter);
  font-size: 14px;
  font-weight: 600;
}

.panel-head .sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--el-text-color-secondary);
}

.panel-body {
  padding: 16px;
}

.panel-body.is-flush {
  padding: 0;
}

/* 表格里的单元格：主副两行 */
.cell-main {
  font-size: 13px;
  color: var(--el-text-color-primary);
}

.cell-sub {
  font-size: 11px;
  color: var(--el-text-color-secondary);
  margin-top: 2px;
}

.money {
  font-variant-numeric: tabular-nums;
  color: #d9363e;
  font-weight: 500;
}

.muted {
  color: var(--el-text-color-placeholder);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* 详情页描述表里的图片 */
.thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thumb-row img {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--el-border-color-lighter);
  cursor: zoom-in;
  background: #fafafa;
}

/*
 * 身份证正反面：按证件比例（85.6 × 54 mm ≈ 1.585）展示。
 * 不能用默认的 108×108 + object-fit:cover —— 会把证件四周裁掉，号码与头像都可能被切。
 */
.thumb-row.is-idcard img {
  width: 200px;
  height: 126px;
  object-fit: contain;
  background: var(--el-fill-color-light);
}

/* 合同卡片：一份合同一块，动作按钮靠右对齐 */
.contract-card {
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--el-fill-color-blank);
}

.contract-card:last-child {
  margin-bottom: 0;
}

.contract-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--el-border-color-lighter);
}

.contract-head .el-upload {
  display: inline-block;
  margin-right: 8px;
}

/* 材料 / 合同原件预览弹窗 */
.preview-img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.preview-frame {
  width: 100%;
  height: 70vh;
  border: 0;
  border-radius: 6px;
  background: var(--el-fill-color-light);
}

/* 资质 / 套餐等键值块 */
.kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}

.kv dt {
  color: var(--el-text-color-secondary);
}

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

/* 渠道 / 转化率进度块 */
.metric-lines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.metric-line .top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--el-text-color-secondary);
}

.metric-line .top b {
  color: var(--el-text-color-primary);
  font-variant-numeric: tabular-nums;
}

/* 空状态收紧一点，避免占满整屏 */
.el-empty {
  --el-empty-padding: 26px 0;
}

/* 表格紧凑（后台看数据密度优先） */
.el-table .cell {
  line-height: 1.5;
}

.el-table th.el-table__cell {
  background: #fafbfc !important;
  font-weight: 600;
  color: #4b5563;
}

/* 标签之间留点缝 */
.tag-gap .el-tag+.el-tag {
  margin-left: 4px;
}

/* 操作日志里的 payload JSON */
.log-json {
  margin: 0;
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #4b5563;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow: auto;
}

/* ==========================================================================
   大盘趋势图（纯 CSS 柱状，刻意不引图表库）
   ========================================================================== */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 190px;
  padding: 0 2px;
  border-bottom: 1px solid var(--el-border-color-lighter);
}

.trend-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 132px;
  width: 100%;
}

.trend-bars .bar {
  width: 12px;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height .22s ease;
}

.bar-order {
  background: var(--brand);
}

.bar-gmv {
  background: #8fb8ff;
}

.trend-val {
  margin-top: 6px;
  font-size: 11px;
  color: var(--el-text-color-regular);
  font-variant-numeric: tabular-nums;
}

.trend-label {
  font-size: 11px;
  color: var(--el-text-color-placeholder);
  white-space: nowrap;
}

.trend-legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--el-text-color-secondary);
}

.trend-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

.dot-order {
  background: var(--brand);
}

.dot-gmv {
  background: #8fb8ff;
}

/* 详情页抽屉里的分区标题 */
.section-title {
  margin: 18px 0 10px;
  padding-left: 8px;
  border-left: 3px solid var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.section-title:first-child {
  margin-top: 0;
}

/* ==========================================================================
   ECharts 容器与两栏布局（PRD 6.3 大盘 6 类图表）
   ========================================================================== */

/* 两栏：图表、概览卡等成对出现；窄屏自动落成单栏 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1180px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chart-box {
  min-width: 0;
}

.chart-title {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--el-text-color-primary);
}

/**
 * ECharts 挂载点。
 * 必须有一个确定的高度：容器为 0 高时 ECharts 会按 0 初始化并打 error，
 * app.js 里的 TS.chart.mount 已经对零尺寸做了兜底，但兜底只是不报错，
 * 真正画出图还是靠这里的固定高度。
 */
.ts-chart {
  width: 100%;
  height: 240px;
}

/* 段落/表格里的说明型小字，颜色弱于 muted，用于口径提示 */
.ts-hint {
  font-size: 12px;
  line-height: 1.7;
  color: var(--el-text-color-secondary);
}

/* 页内提示条：目前用于「有待处理的退出申请」这类必须立刻看见的事 */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  background: var(--el-color-primary-light-9);
  border: 1px solid var(--el-color-primary-light-7);
  color: var(--el-text-color-primary);
}

.notice-bar.is-warn {
  background: var(--el-color-warning-light-9);
  border-color: var(--el-color-warning-light-7);
}

.notice-bar .el-icon {
  flex: none;
  color: var(--el-color-warning);
}
