/* ===== Virsical 综合能源管理系统 · 主题与布局 ===== */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px; color: var(--c-text); background: var(--c-page-bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 主题 T1 工业经典 ---------- */
:root, [data-theme="t1"] {
  --c-primary: #2b6cb0;
  --c-primary-2: #1e4e86;
  --c-accent: #e8813a;
  --c-side-bg: #1b2b3a;
  --c-side-bg-2: #16232f;
  --c-side-text: #c7d3df;
  --c-side-sub: #8ea0b3;
  --c-side-hover: rgba(255,255,255,.07);
  --c-side-active-bg: #2b6cb0;
  --c-side-active-text: #ffffff;
  --c-header-bg: #ffffff;
  --c-page-bg: #eef1f5;
  --c-card-bg: #ffffff;
  --c-border: #e2e8f0;
  --c-text: #1c2733;
  --c-text-2: #66788c;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(20,35,50,.08);
}
/* ---------- 主题 T2 Virsical 深蓝 ---------- */
[data-theme="t2"] {
  --c-primary: #1668dc;
  --c-primary-2: #0b47a1;
  --c-accent: #40c4ff;
  --c-side-bg: #04162e;
  --c-side-bg-2: #082647;
  --c-side-text: #cfe2ff;
  --c-side-sub: #7fa3d0;
  --c-side-hover: rgba(64,196,255,.10);
  --c-side-active-bg: linear-gradient(90deg,#1668dc,#0b47a1);
  --c-side-active-text: #ffffff;
  --c-header-bg: #ffffff;
  --c-page-bg: #f2f6fd;
  --c-card-bg: #ffffff;
  --c-border: #dbe6f5;
  --c-text: #10233d;
  --c-text-2: #5d7a96;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(11,71,161,.10);
}
/* ---------- 主题 T3 浅色节能绿 ---------- */
[data-theme="t3"] {
  --c-primary: #16a34a;
  --c-primary-2: #0f7a37;
  --c-accent: #f0b429;
  --c-side-bg: #ffffff;
  --c-side-bg-2: #f6faf7;
  --c-side-text: #2f3e35;
  --c-side-sub: #7b8b80;
  --c-side-hover: rgba(22,163,74,.08);
  --c-side-active-bg: #e7f7ee;
  --c-side-active-text: #0f7a37;
  --c-header-bg: #ffffff;
  --c-page-bg: #f4f8f5;
  --c-card-bg: #ffffff;
  --c-border: #e3ebe6;
  --c-text: #22302a;
  --c-text-2: #6b7d72;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(22,163,74,.08);
}
[data-theme="t3"] .side { border-right: 1px solid var(--c-border); }

/* ---------- 登录页 ---------- */
.login-wrap { display: flex; height: 100vh; background: #0b1a2b; }
.login-left {
  flex: 1.15; position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1000px 600px at 20% 20%, #17457a 0%, #0a1c31 55%, #06111d 100%);
  display: flex; flex-direction: column; justify-content: center; padding: 0 8vw;
}
.login-left::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(96,165,250,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(96,165,250,.10) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: linear-gradient(160deg, #000 20%, transparent 78%);
}
.login-left h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: 1px; z-index: 2; }
.login-left h2 { font-size: 15px; font-weight: 400; color: #a9c4e4; margin: 0 0 34px; z-index: 2; }
.login-left ul { list-style: none; padding: 0; margin: 0; z-index: 2; }
.login-left li { color: #9fb8d6; font-size: 13px; margin: 12px 0; display: flex; align-items: center; gap: 10px; }
.login-left li i { width: 6px; height: 6px; border-radius: 50%; background: #40c4ff; display: inline-block; }
.login-right { width: 468px; background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 0 54px; }
.login-right h3 { font-size: 22px; margin: 0 0 6px; color: #10233d; }
.login-right p.tip { color: #8496a8; font-size: 12px; margin: 0 0 26px; }
.login-right .field { margin-bottom: 16px; }
.login-right .field label { display: block; font-size: 12px; color: #55677a; margin-bottom: 6px; }
.login-accounts { margin-top: 18px; border-top: 1px dashed #dde5ee; padding-top: 14px; }
.login-accounts .t { font-size: 12px; color: #8496a8; margin-bottom: 8px; }
.login-accounts .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.login-accounts .chip {
  font-size: 12px; padding: 4px 10px; border-radius: 12px; cursor: pointer;
  background: #f1f5fb; color: #2b4a6f; border: 1px solid transparent; transition: .15s;
}
.login-accounts .chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.login-brand { position: absolute; top: 34px; left: 8vw; display: flex; align-items: center; gap: 10px; z-index: 2; }
.login-brand .dot { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg,#40c4ff,#1668dc); }

/* ---------- 主框架 ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.side {
  width: 230px; flex: 0 0 230px; background: linear-gradient(180deg, var(--c-side-bg), var(--c-side-bg-2));
  display: flex; flex-direction: column; transition: width .18s, flex-basis .18s; overflow: hidden;
}
.side.collapsed { width: 62px; flex-basis: 62px; }
.side-brand { height: 56px; display: flex; align-items: center; gap: 9px; padding: 0 14px; flex: 0 0 56px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-brand .logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--c-accent), var(--c-primary)); flex: 0 0 26px; }
.side-brand .txt { color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; letter-spacing: .5px; }
.side-brand .txt small { display: block; font-size: 10px; color: var(--c-side-sub); font-weight: 400; letter-spacing: 0; }
.side-search { padding: 8px 12px; }
.side-search input {
  width: 100%; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.06);
  color: #dfe9f3; border-radius: var(--radius); padding: 6px 9px; font-size: 12px; outline: none;
}
.side-search input::placeholder { color: var(--c-side-sub); }
.side-menu { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 16px; }
.side-menu::-webkit-scrollbar { width: 6px; }
.side-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 3px; }
.dom { margin-bottom: 2px; }
.dom-head {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; cursor: pointer;
  color: var(--c-side-text); border-radius: var(--radius); user-select: none; font-size: 13px;
}
.dom-head:hover { background: var(--c-side-hover); }
.dom-head .ic { width: 18px; text-align: center; opacity: .85; font-size: 13px; }
.dom-head .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dom-head .cnt { font-size: 10px; color: var(--c-side-sub); }
.dom-head .ar { font-size: 10px; color: var(--c-side-sub); transition: transform .16s; }
.dom.open .dom-head .ar { transform: rotate(90deg); }
.dom-pages { display: none; padding: 2px 0 6px 0; }
.dom.open .dom-pages { display: block; }
.pg {
  display: block; padding: 7px 10px 7px 38px; color: var(--c-side-sub); font-size: 12.5px;
  cursor: pointer; border-radius: var(--radius); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid transparent;
}
.pg:hover { background: var(--c-side-hover); color: var(--c-side-text); }
.pg.active { background: var(--c-side-active-bg); color: var(--c-side-active-text); font-weight: 500; }
.side.collapsed .dom-head .nm, .side.collapsed .dom-head .cnt, .side.collapsed .dom-head .ar,
.side.collapsed .side-search, .side.collapsed .side-brand .txt, .side.collapsed .dom-pages { display: none; }
.side.collapsed .dom-head { justify-content: center; padding: 10px 0; }
.side-foot { padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.07); color: var(--c-side-sub); font-size: 11px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hd {
  height: 56px; flex: 0 0 56px; background: var(--c-header-bg); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 14px; padding: 0 16px; box-shadow: var(--shadow); z-index: 5;
}
.hd .fold { cursor: pointer; color: var(--c-text-2); font-size: 16px; padding: 4px 6px; border-radius: 4px; }
.hd .fold:hover { background: #f0f4f9; }
.crumb { font-size: 12px; color: var(--c-text-2); display: flex; align-items: center; gap: 6px; }
.crumb b { color: var(--c-text); font-weight: 600; font-size: 13px; }
.hd .grow { flex: 1; }
.hd .item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-text-2); }
.hd select, .hd .sel {
  border: 1px solid var(--c-border); border-radius: var(--radius); padding: 5px 8px; font-size: 12px;
  color: var(--c-text); background: #fff; outline: none;
}
.hd .user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.hd .user:hover { background: #f2f6fb; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.hd .user .u-nm { font-size: 12.5px; color: var(--c-text); line-height: 1.2; }
.hd .user .u-rl { font-size: 10.5px; color: var(--c-text-2); }

.views { flex: 1; overflow-y: auto; padding: 14px; }
.views::-webkit-scrollbar { width: 9px; }
.views::-webkit-scrollbar-thumb { background: #c9d4e0; border-radius: 5px; }

/* ---------- 卡片 / 筛选 / 表格 ---------- */
.card { background: var(--c-card-bg); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--c-border); }
.card-hd .ttl { font-size: 13.5px; font-weight: 600; }
.card-hd .sub { font-size: 11.5px; color: var(--c-text-2); }
.card-bd { padding: 12px 14px; }
.card-bd.tight { padding: 8px 10px; }

.page-title-row { display: flex; align-items: center; margin-bottom: 12px; gap: 10px; }
.page-title-row h2 { font-size: 17px; margin: 0; }
.page-title-row .tag { font-size: 11px; color: var(--c-text-2); border: 1px solid var(--c-border); padding: 2px 7px; border-radius: 10px; }
.page-title-row .cost { font-size: 11px; color: var(--c-text-2); margin-left: auto; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-bar .fl { display: flex; align-items: center; gap: 6px; }
.filter-bar .fl > span { font-size: 12px; color: var(--c-text-2); white-space: nowrap; }
.filter-bar .grow { flex: 1; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--c-card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 3px solid var(--c-primary); }
.kpi .k-lb { font-size: 12px; color: var(--c-text-2); display: flex; justify-content: space-between; }
.kpi .k-vl { font-size: 24px; font-weight: 600; margin: 8px 0 4px; letter-spacing: .5px; }
.kpi .k-vl small { font-size: 12px; font-weight: 400; color: var(--c-text-2); margin-left: 4px; }
.kpi .k-ft { font-size: 11.5px; color: var(--c-text-2); }
.kpi .up { color: #d64545; } .kpi .down { color: #16a34a; }

.chart-grid { display: grid; gap: 12px; }
.chart-grid.g2 { grid-template-columns: 1fr 1fr; }
.chart-box { width: 100%; height: 310px; }
.chart-box.sm { height: 268px; }
.chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: #9aa9b8; font-size: 12px; }

.tb-tools { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.tb-tools .grow { flex: 1; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; justify-content: flex-end; }
.pager .info { font-size: 12px; color: var(--c-text-2); margin-right: auto; }

.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--c-text-2); }
.badge { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; line-height: 17px; }
.b-red { background: #fdeaea; color: #c53030; }
.b-org { background: #fff3e6; color: #c0651a; }
.b-blue { background: #e8f1fd; color: #1a5fb4; }
.b-green { background: #e9f7ee; color: #17794a; }
.b-gray { background: #eff2f5; color: #5f7080; }

.empty-box { padding: 40px 0; text-align: center; color: #9aa9b8; font-size: 13px; }
.loading-mask { display: flex; align-items: center; justify-content: center; padding: 50px 0; color: var(--c-text-2); }

/* 对话框里的表单网格 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.perm-box { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px; max-height: 340px; overflow: auto; }
.perm-dom { margin-bottom: 8px; }
.perm-dom .dh { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.perm-pages { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 6px; }

/* Element Plus 覆写为主色主题 */
.el-button--primary { background: var(--c-primary); border-color: var(--c-primary); }
.el-button--primary:hover { background: var(--c-primary-2); border-color: var(--c-primary-2); }
.el-link.el-link--primary { color: var(--c-primary); }
.el-tabs__item.is-active { color: var(--c-primary); }
.el-tabs__active-bar { background-color: var(--c-primary); }
.el-table th.el-table__cell { background: #f5f8fb !important; color: #46586b; font-weight: 600; }
.el-table .cell { font-size: 12.5px; }
.el-pagination.is-background .el-pager li.is-active { background: var(--c-primary); }
