:root {
  --zx-primary: #1d4ed8;
  --zx-primary-light: #3b82f6;
  --zx-sidebar: #0f172a;
  --zx-sidebar-hover: #1e293b;
  --zx-bg: #f1f5f9;
  --zx-card: #ffffff;
  --zx-border: #e2e8f0;
  --zx-text: #0f172a;
  --zx-muted: #64748b;
  --zx-accent: #0ea5e9;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--zx-text);
  background: var(--zx-bg);
}

.zx-layout { height: 100%; }
.zx-layout > .el-container {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.zx-aside {
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 55%, #111827 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.zx-brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.zx-brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.zx-brand-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.zx-brand-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.zx-aside .el-menu {
  border-right: none;
  background: transparent;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}
.zx-aside .el-menu-item,
.zx-aside .el-sub-menu__title {
  color: #cbd5e1 !important;
  height: 44px;
  line-height: 44px;
}
.zx-aside .el-menu-item:hover,
.zx-aside .el-sub-menu__title:hover {
  background: var(--zx-sidebar-hover) !important;
  color: #fff !important;
}
.zx-aside .el-menu-item.is-active {
  background: linear-gradient(90deg, rgba(37,99,235,.35), transparent) !important;
  color: #fff !important;
  border-right: 3px solid #3b82f6;
}
.zx-aside .el-sub-menu .el-menu-item { padding-left: 48px !important; min-width: auto; }
.zx-aside .el-sub-menu__icon-arrow { color: #94a3b8; }

.zx-header {
  height: 56px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--zx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 8px;
}
.zx-header-left { display: flex; align-items: center; gap: 8px; }
.zx-breadcrumb { font-size: 13px; color: var(--zx-muted); }
.zx-header-right { display: flex; align-items: center; gap: 12px; }
.zx-search { width: 240px; }
.zx-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.zx-user:hover { background: #f8fafc; }
.zx-user-meta { line-height: 1.2; }
.zx-user-name { font-size: 13px; font-weight: 600; }
.zx-user-role { font-size: 11px; color: var(--zx-muted); }

.zx-main {
  background: var(--zx-bg);
  padding: 0 !important;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.zx-tabs-bar {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--zx-border);
  padding: 0 12px;
}
.zx-tabs-bar .el-tabs__header { margin: 0; }
.zx-tabs-bar .el-tabs__nav-wrap::after { height: 1px; }
.zx-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.zx-page-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.zx-page-title h2 {
  margin: 0; font-size: 18px; font-weight: 650;
}
.zx-page-title .sub {
  margin-top: 4px; font-size: 12px; color: var(--zx-muted);
}

.zx-card {
  background: var(--zx-card);
  border: 1px solid var(--zx-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
.zx-card-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.zx-card-hd h3 { margin: 0; font-size: 14px; font-weight: 650; }

.zx-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.zx-stat {
  background: #fff;
  border: 1px solid var(--zx-border);
  border-radius: 10px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.zx-stat::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--c, var(--zx-primary));
}
.zx-stat .label { font-size: 12px; color: var(--zx-muted); }
.zx-stat .value {
  margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: -.5px;
}
.zx-stat .unit { font-size: 12px; color: var(--zx-muted); margin-left: 4px; }

.zx-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
.zx-todo-item, .zx-notice-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--zx-border);
  gap: 12px;
}
.zx-todo-item:last-child, .zx-notice-item:last-child { border-bottom: none; }
.zx-todo-title { font-size: 13px; }
.zx-todo-meta { font-size: 12px; color: var(--zx-muted); margin-top: 4px; }

.zx-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.zx-toolbar .spacer { flex: 1; }
.zx-filter-bar {
  background: #fff;
  border: 1px solid var(--zx-border);
  border-radius: 10px;
  padding: 12px 12px 4px;
  margin-bottom: 12px;
}

.zx-module-banner-slot { display: none; }

/* 菜单直达单页时隐藏页签头，避免多入口共用同一套页签 */
.zx-tabs-solo > .el-tabs__header { display: none; }
.zx-tabs-solo > .el-tabs__content { padding-top: 0; }

.zx-progress-cell { display: flex; align-items: center; gap: 8px; }
.zx-progress-cell .el-progress { flex: 1; }

.zx-empty-tip {
  text-align: center; color: var(--zx-muted); padding: 40px 20px; font-size: 13px;
}

.zx-footer-note {
  text-align: center; color: #94a3b8; font-size: 11px; padding: 8px 0 4px;
}

.zx-drawer-section { margin-bottom: 18px; }
.zx-drawer-section h4 {
  margin: 0 0 10px; font-size: 13px; color: var(--zx-muted); font-weight: 600;
}

.zx-tag-urgent { margin-left: 6px; }

.zx-bi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.zx-bi-panel {
  background: #fff; border: 1px solid var(--zx-border); border-radius: 10px; padding: 14px;
  min-height: 180px;
}
.zx-bi-panel h4 { margin: 0 0 12px; font-size: 13px; }
.zx-chart-bars {
  display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px;
}
.zx-chart-bars .bar {
  flex: 1; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  position: relative;
}
.zx-chart-bars .bar span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--zx-muted); white-space: nowrap;
}
.zx-chart-bars .bar i {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--zx-muted); font-style: normal;
}

@media (max-width: 1200px) {
  .zx-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .zx-grid-2, .zx-bi-grid { grid-template-columns: 1fr; }
}

/* ========== CRM 细化 ========== */
.crm-main-tabs { margin-bottom: 8px; }
.crm-main-tabs .el-tabs__header { margin-bottom: 8px; }
.crm-org-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 12px;
  align-items: start;
}
.crm-tree-panel { margin-bottom: 0; max-height: calc(100vh - 220px); overflow: auto; }
.crm-tree-node { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.crm-tree-node .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-tree-tip {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--zx-border);
  font-size: 11px; color: var(--zx-muted); line-height: 1.5;
}
.crm-detail-panel { min-width: 0; }
.crm-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.crm-follow-card {
  background: #f8fafc; border: 1px solid var(--zx-border); border-radius: 8px; padding: 10px 12px;
  font-size: 13px; line-height: 1.6;
}
.crm-follow-card .hd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; color: var(--zx-muted); }
.crm-follow-card .next { margin-top: 6px; color: #1d4ed8; font-size: 12px; }
.crm-sec-title { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
@media (max-width: 1100px) {
  .crm-org-layout { grid-template-columns: 1fr; }
}

/* ========== 项目 OP-02 细化 ========== */
.prj-four-layers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.prj-four-layers .layer {
  background: #fff;
  border: 1px solid var(--zx-border);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
}
.prj-four-layers .name { font-size: 12px; color: var(--zx-muted); }
.prj-four-layers .val { margin-top: 6px; font-size: 20px; font-weight: 700; }
.prj-four-layers .tip { margin-top: 4px; font-size: 11px; color: #94a3b8; }
.prj-four-layers .arrow {
  position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 14px; z-index: 1;
}
.prj-sec { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
.prj-budget-sum {
  margin-top: 8px; font-size: 12px; color: var(--zx-muted);
  background: #f8fafc; border-radius: 6px; padding: 8px 10px;
}
.prj-ledger {
  display: flex; flex-wrap: wrap; gap: 0; align-items: flex-start;
  padding: 8px 0 4px;
}
.prj-ledger .node {
  display: flex; flex-direction: column; align-items: center;
  position: relative; width: 72px; margin-bottom: 8px;
}
.prj-ledger .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #e2e8f0; border: 2px solid #cbd5e1;
}
.prj-ledger .dot.on {
  background: #2563eb; border-color: #1d4ed8;
}
.prj-ledger .lab { margin-top: 6px; font-size: 11px; color: var(--zx-muted); }
.prj-ledger .line {
  position: absolute; top: 5px; left: calc(50% + 8px);
  width: 56px; height: 2px; background: #e2e8f0;
}
@media (max-width: 1100px) {
  .prj-four-layers { grid-template-columns: repeat(2, 1fr); }
  .prj-four-layers .arrow { display: none; }
}

/* ========== 工单 OP-01 细化 ========== */
.wo-flow { padding: 16px 12px 8px; }
.wo-talk-card {
  background: #f8fafc; border: 1px solid var(--zx-border); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; line-height: 1.6;
}
.wo-triple {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
.wo-triple .item {
  border-radius: 10px; padding: 14px; border: 1px solid var(--zx-border); background: #fff;
}
.wo-triple .item.ok { border-color: #86efac; background: #f0fdf4; }
.wo-triple .item.bad { border-color: #fca5a5; background: #fef2f2; }
.wo-triple .name { font-size: 13px; font-weight: 650; }
.wo-triple .res { margin-top: 8px; font-size: 18px; font-weight: 700; }
.wo-triple .item.ok .res { color: #059669; }
.wo-triple .item.bad .res { color: #dc2626; }
.wo-triple .tip { margin-top: 4px; font-size: 12px; color: var(--zx-muted); }
.wo-sec { margin: 14px 0 8px; font-size: 13px; font-weight: 650; }
@media (max-width: 900px) {
  .wo-triple { grid-template-columns: 1fr; }
}

/* ========== 合同 BS-03 细化 ========== */
.ct-flow { padding: 16px 12px 8px; }
.ct-sec { margin: 14px 0 8px; font-size: 13px; font-weight: 650; }
.ct-payer {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
}
.ct-payer .tip { margin-top: 4px; font-size: 12px; color: #64748b; }

/* ========== 采购 BS-05 / 供应商 SR 细化 ========== */
.pu-page .pu-sec, .sr-page .pu-sec {
  margin: 14px 0 8px; font-size: 13px; font-weight: 650;
}
.pu-page .el-alert, .sr-page .el-alert { border-radius: 8px; }

/* ========== 结算 OP-05 / 费控 BS-06 细化 ========== */
.fin-page .fin-sec {
  margin: 14px 0 8px; font-size: 13px; font-weight: 650;
}
.fin-page .el-alert { border-radius: 8px; }

/* ========== 招投标 BS-02 细化 ========== */
.bd-page .bd-sec {
  margin: 10px 0 8px; font-size: 13px; font-weight: 650;
}
.bd-page .bd-steps {
  background: #fff; padding: 14px 8px 8px; border-radius: 10px;
  border: 1px solid var(--zx-border); margin-bottom: 4px;
}
.bd-page .bd-margin {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px;
  font-size: 12px; color: #475569; padding: 8px 10px;
  background: #f8fafc; border-radius: 8px; border: 1px solid var(--zx-border);
}
.bd-page .el-alert { border-radius: 8px; }

/* ========== 安全 OP-03 / 工器具 OP-04 细化 ========== */
.sf-page .sf-sec, .tl-page .sf-sec {
  margin: 10px 0 8px; font-size: 13px; font-weight: 650;
}
.sf-page .el-alert, .tl-page .el-alert { border-radius: 8px; }

/* ========== 人事 SP-01 / 看板 SP-05 细化 ========== */
.hr-page .hr-sec, .bi-page .bi-sec {
  margin: 12px 0 8px; font-size: 13px; font-weight: 650;
}
.hr-page .hr-radar {
  display: block; margin: 4px auto 8px;
  background: #f8fafc; border-radius: 10px; border: 1px solid var(--zx-border);
}
.hr-page .el-alert, .bi-page .el-alert { border-radius: 8px; }
.bi-page .bi-filter { margin-bottom: 8px; }
.bi-page .zx-stat { cursor: pointer; }

/* ========== 车辆 SP-02 / 行政 SP-03 细化 ========== */
.vh-page .vh-sec, .ad-page .ad-sec {
  margin: 10px 0 8px; font-size: 13px; font-weight: 650;
}
.vh-page .el-alert, .ad-page .el-alert { border-radius: 8px; }

/* ========== 租赁 SUB-13 细化 ========== */
.le-page .le-sec {
  margin: 10px 0 8px; font-size: 13px; font-weight: 650;
}
.le-page .el-alert { border-radius: 8px; }

/* ========== 技术文档 SP-04 细化 ========== */
.doc-page .doc-sec {
  margin: 10px 0 8px; font-size: 13px; font-weight: 650;
}
.doc-page .el-alert { border-radius: 8px; }

/* ========== 移动端 SUB-09 手机框 ========== */
.mb-page .mb-sec { margin: 12px 0 8px; font-size: 13px; font-weight: 650; }
.mb-page .el-alert { border-radius: 8px; }
.mb-layout { margin-top: 8px; align-items: flex-start; }
.zx-phone-shell {
  width: 320px; margin: 0 auto; padding: 12px 10px 18px;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border-radius: 28px; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  position: relative;
}
.zx-phone-notch {
  width: 96px; height: 8px; background: #020617; border-radius: 0 0 8px 8px;
  margin: 0 auto 8px;
}
.zx-phone-screen {
  background: #f8fafc; border-radius: 18px; overflow: hidden;
  min-height: 560px; display: flex; flex-direction: column;
}
.zx-phone-status {
  display: flex; justify-content: space-between; padding: 6px 12px;
  font-size: 10px; color: #64748b; background: #fff;
}
.zx-phone-title {
  padding: 8px 12px; font-size: 14px; font-weight: 700; color: #0f172a;
  border-bottom: 1px solid #e2e8f0; background: #fff;
}
.zx-phone-body { flex: 1; padding: 10px; overflow: auto; background: #f1f5f9; }
.zx-phone-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px;
}
.zx-phone-tile {
  background: #fff; border-radius: 10px; padding: 12px 4px; text-align: center;
  font-size: 12px; font-weight: 600; color: #334155; cursor: pointer;
  position: relative; border: 1px solid #e2e8f0;
}
.zx-phone-tile em {
  position: absolute; top: 4px; right: 6px; background: #dc2626; color: #fff;
  font-style: normal; font-size: 10px; min-width: 14px; height: 14px; line-height: 14px;
  border-radius: 7px; padding: 0 3px;
}
.zx-phone-sec {
  font-size: 12px; font-weight: 650; color: #475569; margin: 6px 0 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.zx-phone-card {
  background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}
.zx-phone-card.dim { opacity: 0.65; }
.zx-phone-card .t { font-size: 12px; font-weight: 650; color: #0f172a; }
.zx-phone-card .d { font-size: 11px; color: #64748b; margin-top: 4px; }
.zx-phone-card .s { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.zx-phone-card .sync { font-size: 10px; color: #94a3b8; }
.zx-phone-card .acts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.zx-phone-tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #e2e8f0;
  background: #fff;
}
.zx-phone-tabbar button {
  border: 0; background: transparent; padding: 10px 0; font-size: 11px;
  color: #94a3b8; cursor: pointer;
}
.zx-phone-tabbar button.on { color: #2563eb; font-weight: 700; }

/* ========== 公共底座 PT-02 / PT-03 ========== */
.pt-page .pt-sec { margin: 12px 0 8px; font-size: 13px; font-weight: 650; }
.pt-page .el-alert { border-radius: 8px; }
