/* ================= 全局 ================= */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #1f2329;
  background: #f5f6f8;
}
:root {
  --brand: #1664ff;
  --topbar-bg: #17171f;
}

/* ================= 登录页 ================= */
.login-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #17171f 0%, #1d2b53 60%, #1664ff 130%);
}
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 10px;
  padding: 40px 44px 32px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 6px;
  font-size: 24px;
  font-weight: 600;
}
.login-logo .logo-badge { width: 34px; height: 34px; font-size: 18px; }
.login-sub { text-align: center; color: #8a919f; margin-bottom: 28px; font-size: 13px; }
.login-tip {
  margin-top: 18px;
  background: #f5f8ff;
  border: 1px solid #e0eaff;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #5e6673;
  line-height: 1.9;
}
.login-tip b { color: var(--brand); font-weight: 600; }

/* ================= 顶部导航 ================= */
.topbar {
  height: 52px;
  background: var(--topbar-bg);
  color: #e8e9ec;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}
.logo-badge {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.topbar .brand { font-size: 17px; font-weight: 600; margin-right: 28px; white-space: nowrap; }
.top-menu { display: flex; height: 100%; }
.top-menu .item {
  padding: 0 18px;
  display: flex;
  align-items: center;
  height: 100%;
  cursor: pointer;
  position: relative;
  color: #c2c6cf;
  white-space: nowrap;
}
.top-menu .item.active { color: #fff; font-weight: 600; }
.top-menu .item.active::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 0;
  height: 3px; background: var(--brand); border-radius: 2px 2px 0 0;
}
.top-menu .item.disabled { cursor: not-allowed; opacity: .5; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-right .scope-select { width: 200px; }
.topbar-right .g-search { width: 210px; }
.topbar-right .el-input__wrapper { background: #26262f; box-shadow: none !important; }
.topbar-right .el-input__inner { color: #e8e9ec; }
.topbar-right .icon-btn { color: #c2c6cf; font-size: 17px; cursor: pointer; }
.topbar-right .icon-btn:hover { color: #fff; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.user-chip .name { font-size: 13px; }

/* ================= 主体布局 ================= */
.layout { display: flex; height: calc(100% - 52px); }
.sidebar {
  width: 200px;
  background: #fff;
  border-right: 1px solid #e8eaee;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar .el-menu { border-right: none; }
.main { flex: 1; overflow-y: auto; padding: 12px 16px 40px; }

/* ================= 页头工具条 ================= */
.page-head {
  background: #fff;
  border-radius: 6px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.head-tabs { display: flex; gap: 26px; }
.head-tabs .tab {
  padding: 8px 2px;
  cursor: pointer;
  color: #4e5561;
  position: relative;
  font-size: 15px;
  white-space: nowrap;
}
.head-tabs .tab.active { color: var(--brand); font-weight: 600; }
.head-tabs .tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px;
  height: 2px; background: var(--brand);
}
.head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.quick-chip {
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 14px;
  font-size: 12px;
  padding: 3px 12px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.quick-chip:hover { background: #f0f6ff; }

/* ================= 卡片与区块 ================= */
.card {
  background: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.sec-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.sec-title::before {
  content: ""; width: 4px; height: 15px;
  background: var(--brand); border-radius: 2px; margin-right: 8px;
}
.sec-title .tools { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 13px; }

/* ================= 筛选区 ================= */
.filter-toprow { display: flex; align-items: center; margin-bottom: 6px; }
.seg-group { display: flex; align-items: center; gap: 8px; margin-left: 18px; }
.seg-label { color: #4e5561; font-size: 13px; white-space: nowrap; }
.seg-options-box {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid #e3e8f2; border-radius: 6px;
  background: #fff;
}
.seg {
  padding: 3px 10px; border-radius: 4px; cursor: pointer;
  color: #4e5561; font-size: 13px; user-select: none; white-space: nowrap;
}
.seg.active { color: var(--brand); background: #eef4ff; font-weight: 600; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 10px; }
.filter-item { width: 300px; }
.filter-item .f-label { font-size: 13px; color: #4e5561; margin-bottom: 6px; }
.filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; }
.link-btn { color: var(--brand); cursor: pointer; font-size: 13px; white-space: nowrap; }

/* ================= 指标分析(环形图) ================= */
.rank-row { display: flex; gap: 12px; }
.rank-row .card { flex: 1; margin-bottom: 0; min-width: 0; }
.donut-wrap { display: flex; align-items: center; min-height: 320px; }
.donut-chart { width: 46%; min-width: 240px; height: 320px; }
.donut-legend { flex: 1; max-height: 300px; overflow-y: auto; padding-right: 6px; }
.legend-item {
  display: flex; align-items: center; padding: 9px 6px;
  border-radius: 4px; font-size: 14px;
}
.legend-item:hover { background: #f6f8fb; }
.legend-item .dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; flex-shrink: 0; }
.legend-item .lname { font-weight: 600; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-item .lval { color: #1f2329; margin-right: 18px; }
.legend-item .lpct { color: #8a919f; width: 66px; text-align: right; }

/* ================= 业务概况卡片 ================= */
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 190px;
  border: 1px solid #e8eaee; border-radius: 6px;
  padding: 14px 16px;
}
.stat-card .s-name { color: #4e5561; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.stat-card .s-value { font-size: 26px; font-weight: 700; margin: 8px 0 6px; }
.stat-card .s-chain { font-size: 12px; color: #8a919f; }
.chain-up { color: #f04438; font-weight: 600; }
.chain-down { color: #12b76a; font-weight: 600; }

/* ================= 图表 ================= */
.trend-chart { width: 100%; height: 380px; }
.chart-tools { display: flex; align-items: center; gap: 10px; }

/* ================= 状态 ================= */
.state-box { padding: 60px 0; text-align: center; color: #8a919f; }
.state-box .el-button { margin-top: 12px; }

/* ================= 表格微调 ================= */
.el-table th.el-table__cell { background: #f7f8fa !important; color: #4e5561; }
.tbl-tools { display: flex; align-items: center; gap: 16px; font-size: 13px; }

/* 数据汇总总计行 */
.el-table .summary-total-row td.el-table__cell {
  background: #f0f6ff !important;
  font-weight: 600;
  color: #1f2329;
}
.tbl-tools .el-checkbox { margin-right: 14px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3d7de; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
