/* ================================================================
   DC 授权后台 · 业务样式
   （Element Plus 变量覆盖在 theme-override.css）
   设计：浅色商务科技风，主色 #2563eb
   ================================================================ */

html, body { height: 100%; margin: 0; }
body {
  background: var(--ep-bg-page, #f1f5f9);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ep-text-primary, #0f172a);
  font-size: 14px; -webkit-font-smoothing: antialiased;
}

.layout { height: 100vh; display: flex; overflow: hidden; }
.main-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ==================== 侧边栏 ==================== */
.aside {
  width: 220px; flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1; box-shadow: 2px 0 8px rgba(15,23,42,.08);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .2s;
}
.aside.collapsed { width: 64px; }
.aside.collapsed .menu-label, .aside.collapsed .logo-text, .aside.collapsed .side-footer { display: none; }
.aside.collapsed .el-menu-item { text-align: center; padding: 0 !important; }
.aside.collapsed .el-menu-item > *:first-child { margin: 0 auto; }

.logo {
  height: 60px; padding: 0 18px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: -1px;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.logo-text { color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; }

.menu-wrap { flex: 1; padding: 12px 10px; overflow-y: auto; }
.menu { border-right: 0; background: transparent; }
.menu .el-menu-item {
  color: #94a3b8; height: 44px; line-height: 44px; margin: 2px 0;
  border-radius: 8px; padding-left: 14px !important;
  font-size: 14px; transition: all .15s;
}
.menu .el-menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu .el-menu-item.is-active {
  background: linear-gradient(90deg, rgba(37,99,235,.35), rgba(37,99,235,.1));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.3);
}
.menu-label { margin-left: 4px; }

.side-footer {
  padding: 14px 18px; color: #475569; font-size: 11px;
  border-top: 1px solid rgba(255,255,255,.04); text-align: center;
}

/* ==================== 顶栏 ==================== */
.header {
  background: #fff; border-bottom: 1px solid var(--ep-border-light, #f1f5f9);
  display: flex; justify-content: space-between; align-items: center;
  height: 60px; padding: 0 24px; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.collapse-btn {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ep-text-secondary, #64748b); font-size: 16px;
  transition: background .15s;
}
.collapse-btn:hover { background: #f1f5f9; color: var(--ep-text-primary); }
.header-title { font-size: 16px; font-weight: 600; color: var(--ep-text-primary); }
.header-sub { color: var(--ep-text-placeholder, #94a3b8); font-size: 12px; margin-left: 8px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-user {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px; border-radius: 999px;
  background: #f1f5f9; color: var(--ep-text-secondary);
  font-size: 13px;
}
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}

/* ==================== 主内容 ==================== */
.main { flex: 1; width: 100%; max-width: 1680px; margin: 0 auto; padding: 24px; overflow-y: auto; box-sizing: border-box; }

/* ==================== KPI 卡片 ==================== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 4px;
}
.kpi {
  background: #fff; border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  transition: transform .15s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 10px;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,23,42,.1); }
.kpi-top { display: flex; justify-content: flex-start; }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.kpi-icon.blue   { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.kpi-icon.green  { background: linear-gradient(135deg, #16a34a, #22c55e); }
.kpi-icon.orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.kpi-icon.red    { background: linear-gradient(135deg, #dc2626, #ef4444); }
.kpi-icon.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.kpi-icon.gray   { background: linear-gradient(135deg, #475569, #64748b); }
.kpi-num { font-size: 28px; font-weight: 700; color: var(--ep-text-primary); line-height: 1.1; }
.kpi-label { color: var(--ep-text-secondary, #64748b); font-size: 13px; }

/* ==================== 图表区 ==================== */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr; } }

.card {
  background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.06);
  border: 1px solid #eef2f7; overflow: hidden;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--ep-border-light, #f1f5f9);
}
.card-title { font-weight: 600; color: var(--ep-text-primary); font-size: 15px; }
.card-extra { color: var(--ep-text-placeholder, #94a3b8); font-size: 12px; }
.card-pad { padding: 16px 20px; }
.chart-box { width: 100%; height: 280px; }

/* ==================== 工具栏 ==================== */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ==================== 表格区 ==================== */
.table-wrap { padding: 0 20px 20px; }
.customer-table .el-table__header th { height: 46px; }
.customer-table .el-table__row td { height: 68px; }
.customer-table .el-table__cell { padding: 10px 0; }
.customer-table .cell { line-height: 1.55; }
.cell-primary { color: #1e293b; font-weight: 600; }
.pager { display: flex; justify-content: flex-end; padding: 16px 0 0; }

/* ==================== 辅助类 ==================== */
.mono { font-family: Consolas, "SF Mono", monospace; font-size: 13px; }
.sub { color: var(--ep-text-placeholder, #94a3b8); font-size: 12px; }
.due-text { font-size: 12px; color: var(--ep-text-secondary, #64748b); margin-top: 4px; }
.mt16 { margin-top: 16px; }

.qq-name { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.avatar-fallback {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #94a3b8, #cbd5e1);
  color: #fff; font-weight: 600; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.machine-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ep-border-light, #f1f5f9); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
}
.empty-tip { color: var(--ep-text-secondary); padding: 32px; text-align: center; }

.help p { line-height: 1.9; margin: 4px 0; color: var(--ep-text-regular, #334155); font-size: 13px; }
.help b { color: var(--ep-primary, #2563eb); font-weight: 600; }

/* ==================== 登录页 ==================== */
body.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
body.login-body::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(59,130,246,.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(99,102,241,.25) 0%, transparent 40%);
}
body.login-body::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  position: relative; z-index: 1;
  width: 420px; background: rgba(255,255,255,.95); backdrop-filter: blur(20px);
  border-radius: 20px; padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.3);
}
.login-logo {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 20px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,99,235,.5);
}
.login-logo svg { width: 32px; height: 32px; }
.login-title {
  text-align: center; font-size: 22px; font-weight: 700;
  color: var(--ep-text-primary); margin-bottom: 6px;
}
.login-sub { text-align: center; color: var(--ep-text-secondary); font-size: 13px; margin-bottom: 28px; }

/* 登录页覆盖 Element Plus 样式 */
body.login-body .el-card { box-shadow: none !important; border: none !important; background: transparent !important; }
body.login-body .el-card__body { padding: 0; }

/* ==================== 页脚（版权 + 备案号） ==================== */
.site-footer {
  text-align: center;
  padding: 22px 12px 6px;
  font-size: 12px;            /* 小字号，低调 */
  line-height: 1.9;
  color: #999;                /* 页面是浅色底，用灰色字 */
  letter-spacing: .3px;
}
.site-footer .footer-sep { margin: 0 6px; color: #c0c4cc; }
.site-footer .footer-icp {
  color: inherit;             /* 跟页脚同色，不抢视线 */
  text-decoration: none;
  transition: color .2s;
}
.site-footer .footer-icp:hover { color: #2563eb; }

/* 登录页是深色渐变底：页脚改成浅一点的灰，并固定在窗口底部居中 */
body.login-body .login-footer {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  padding: 0 12px;
  color: rgba(255, 255, 255, .55);
  z-index: 1;
}
body.login-body .login-footer .footer-sep { color: rgba(255, 255, 255, .3); }
body.login-body .login-footer .footer-icp:hover { color: #bfdbfe; }
