/* ==========================================================================
   宜站式医疗管理系统 · 设计系统
   简约商务科技风 · 主色 #1a3c6e / 辅色 #2c5f9e · 背景 #f5f7fa
   ========================================================================== */
:root {
  --primary: #1a3c6e;
  --primary-2: #2c5f9e;
  --primary-3: #4a86c8;
  --primary-light: #e9f0f9;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1d2b3a;
  --text-2: #55677c;
  --muted: #8d9aaa;
  --border: #e6ebf2;
  --border-strong: #d6dfeb;

  --green: #21875a;  --green-bg: #e6f6ee;
  --orange: #b96c14; --orange-bg: #fdf1e1;
  --yellow: #94721a; --yellow-bg: #fbf5e0;
  --red: #c33d3d;    --red-bg: #fdecec;
  --red-deep: #b3261e;  --red-soft: #c76b6b;  /* 到期预警分级：7 天内 / 8~30 天 */
  --gray: #6b7889;   --gray-bg: #eef1f5;
  --blue: #1e5fa8;   --blue-bg: #e8f1fb;
  --purple: #5b4baf; --purple-bg: #eeebfa;
  --cyan: #16767f;   --cyan-bg: #e2f5f6;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 32px rgba(15, 34, 62, .16);
  --sidebar-w: 220px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局 ---------------- */
.layout { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, #16345f 0%, #1a3c6e 42%, #142c50 100%);
  color: #cfdcec; display: flex; flex-direction: column; z-index: 40;
}
.brand { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; color: #fff; flex: 0 0 auto; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #4a86c8, #8fc0f0);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #0f2748; flex: 0 0 auto;
}
.brand-text { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: #8fa8c8; letter-spacing: 1.2px; margin-top: -4px; }

.nav { padding: 10px 12px 24px; overflow-y: auto; flex: 1; }

/* 一级菜单：可折叠分组 */
.nav-sec { margin-bottom: 2px; }
.nav-sec-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border: 0; background: transparent; cursor: pointer;
  color: #eef4fc; font-family: inherit; font-size: 14px; font-weight: 700;
  letter-spacing: .3px; text-align: left; border-radius: 7px; transition: background .15s;
}
.nav-sec-head:hover { background: rgba(255, 255, 255, .07); }
.nav-sec-head > span:first-child { flex: 1; }
.nav-sec-right { display: flex; align-items: center; gap: 6px; }
.nav-sec-right .badge {
  background: #e0563f; color: #fff; font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 9px; display: grid; place-items: center; padding: 0 5px; font-weight: 600;
}
.nav-sec-right svg { width: 14px; height: 14px; opacity: .5; transition: transform .18s; }
.nav-sec.collapsed .nav-sec-right svg { transform: rotate(-90deg); }
.nav-sec:not(.collapsed) .nav-sec-right .badge { display: none; }

/* 二级菜单 */
.nav-sub { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px; }
.nav-sub::before {
  content: ""; position: absolute; left: 21px; top: 4px; bottom: 10px; width: 1px;
  background: rgba(255, 255, 255, .09);
}
.nav-sec.collapsed .nav-sub { display: none; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 34px; margin: 0; border-radius: 6px;
  color: #adc2d9; font-size: 12.5px; font-weight: 400; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #eef4fb; }
.nav-item.active { background: rgba(255, 255, 255, .15); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 13px; border-radius: 2px; background: #8fc0f0;
}
.nav-item svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .78; }
.nav-item.active svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto; background: #e0563f; color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center;
  padding: 0 5px; font-weight: 600;
}

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-crumb { color: var(--muted); font-size: 12.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #e0563f; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 20px; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #2c5f9e, #6ba2e0);
  color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
}
.user-meta { line-height: 1.15; }
.user-meta b { font-size: 13px; font-weight: 600; display: block; }
.user-meta span { font-size: 11.5px; color: var(--muted); }

.content { padding: 24px; flex: 1; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; letter-spacing: .3px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .spacer { flex: 1; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230, 235, 242, .9); }
.content > .card + .card, .content > .grid + .grid { margin-top: 16px; }
.grid > .card { display: flex; flex-direction: column; }
.grid > .card > .card-body { flex: 1; }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-head h3 { font-size: 14.5px; }
.card-head .sub { color: var(--muted); font-size: 12px; margin-left: 2px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* 指标卡 */
.stat { position: relative; padding: 16px 16px 14px 18px; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -18px; top: -22px; width: 74px; height: 74px; border-radius: 50%; opacity: .1; background: var(--primary-2); }
.stat-top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.stat-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-foot { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.blue .stat-ico { background: var(--blue-bg); color: var(--blue); }
.stat.orange .stat-ico { background: var(--orange-bg); color: var(--orange); }
.stat.green .stat-ico { background: var(--green-bg); color: var(--green); }
.stat.purple .stat-ico { background: var(--purple-bg); color: var(--purple); }
.stat.cyan .stat-ico { background: var(--cyan-bg); color: var(--cyan); }
.stat.red .stat-ico { background: var(--red-bg); color: var(--red); }
.stat.red .stat-num { color: var(--red); }
.stat.red.alarm::after { background: var(--red); opacity: .16; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: .1; transform: scale(1); } 50% { opacity: .22; transform: scale(1.12); } }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary-3); color: var(--primary-2); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #15335f; border-color: #15335f; color: #fff; }
.btn-blue { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.btn-blue:hover { background: #25528a; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary-2); }
.btn-ghost:hover { background: var(--primary-light); border-color: transparent; }
.btn-danger { color: var(--red); border-color: #f0c9c9; background: #fff; }
.btn-danger:hover { background: var(--red-bg); border-color: #e3a9a9; color: var(--red); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0 4px; color: var(--primary-2); cursor: pointer; font-size: 12.5px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field > label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 13.5px; color: var(--text); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s; width: 100%; font-family: inherit;
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 76px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-3); box-shadow: 0 0 0 3px rgba(74, 134, 200, .13); }
.input::placeholder, .textarea::placeholder { color: #a9b4c2; }
.input[disabled], .select[disabled] { background: #f7f9fc; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span2 { grid-column: span 2; }
/* 省 / 市 / 区三级选择 */
.region-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.region-row .select { padding: 0 8px; }
.form-section { font-size: 12px; color: var(--muted); letter-spacing: .5px; margin: 4px 0 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary-2); }

/* 筛选栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.filter-bar .fitem { display: flex; flex-direction: column; gap: 5px; }
.filter-bar .fitem > span { font-size: 11.5px; color: var(--muted); }
.filter-bar .input, .filter-bar .select { height: 33px; font-size: 13px; min-width: 130px; }
.filter-bar .grow { flex: 1; min-width: 200px; }
.filter-bar .grow .input { min-width: 100%; }
.filter-bar .fbtns { display: flex; gap: 8px; margin-left: auto; }
.m-ftoggle { display: none; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  background: #f7f9fc; color: var(--text-2); font-weight: 600; font-size: 12.5px;
  text-align: center; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td {
  padding: 11px 14px; border-bottom: 1px solid #f0f3f8; vertical-align: middle;
  text-align: center;
}
table.tbl tbody tr:hover { background: #f9fbfe; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
/* 金额/数量列保持等宽数字，但同样水平居中 */
table.tbl td.num, table.tbl th.num { text-align: center; font-variant-numeric: tabular-nums; }
table.tbl .nowrap { white-space: nowrap; }
table.tbl .ops { display: flex; gap: 2px; white-space: nowrap; justify-content: center; }
/* 超长文本省略号：块本身居中，块内文字从左开始，避免开头被裁掉 */
table.tbl .ellip { text-align: left; }
/* 需要左对齐的列（如角色名称、功能权限） */
table.tbl th.col-left, table.tbl td.col-left { text-align: left; }
/* 移动端卡片化包装层：桌面端不产生任何盒模型影响 */
table.tbl .m-val { display: contents; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.cell-ellipsis {
  display: block; width: fit-content; max-width: 240px; margin: 0 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle; text-align: left;
}
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.neg { color: var(--red); }
.money.pos { color: var(--green); }
.text-muted { color: var(--muted); }
.text-red { color: var(--red); }
.text-red-deep { color: var(--red-deep); }
.text-red-soft { color: var(--red-soft); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.tiny { font-size: 11.5px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.yellow { background: var(--yellow-bg); color: var(--yellow); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.red-deep { background: #fbe4e2; color: var(--red-deep); }
.tag.red-soft { background: #fbedeb; color: var(--red-soft); }
.tag.gray { background: var(--gray-bg); color: var(--gray); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.cyan { background: var(--cyan-bg); color: var(--cyan); }
.tag.outline { background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pager .info { color: var(--muted); font-size: 12.5px; margin-right: auto; }
.pager button {
  min-width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2); cursor: pointer; font-size: 12.5px; padding: 0 8px;
}
.pager button:hover:not([disabled]) { border-color: var(--primary-3); color: var(--primary-2); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 30, 50, .42); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg);
  animation: rise .18s ease; margin: auto 0;
}
.modal.wide { max-width: 760px; }
.modal.slim { max-width: 440px; }
@keyframes rise { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { font-size: 15px; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--muted); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; }
.modal-head .x:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 18px 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Toast */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #22344c; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: rise .2s ease; display: flex; align-items: center; gap: 8px; max-width: 76vw;
}
.toast.success { background: #1f7a52; }
.toast.error { background: #b93b3b; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tab {
  padding: 12px 12px 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--primary-2); }
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary-2); }
.tab-panel { padding: 18px; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border-strong); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -22px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--primary-3); }
.tl-item.done .tl-dot { background: var(--primary-2); border-color: var(--primary-2); }
.tl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-head b { font-size: 13.5px; }
.tl-time { color: var(--muted); font-size: 12px; }
.tl-body { color: var(--text-2); font-size: 13px; margin-top: 3px; white-space: pre-wrap; }

/* 详情信息 */
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.kv .k { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.kv .v { font-size: 13.5px; color: var(--text); word-break: break-all; }
.kv.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 进度步骤条 */
.steps { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 2px; }
.step { flex: 1; min-width: 92px; position: relative; text-align: center; font-size: 12px; color: var(--muted); padding-top: 26px; }
.step::before {
  content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: var(--border-strong);
}
.step::after {
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--border-strong);
}
.step:first-child::before { left: 50%; }
.step:last-child::before { right: 50%; }
.step.done { color: var(--primary-2); font-weight: 600; }
.step.done::before, .step.done::after { background: var(--primary-2); border-color: var(--primary-2); }
.step.current::after { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26, 60, 110, .14); }
.step.current { color: var(--primary); font-weight: 700; }

/* 空状态 */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.empty b { display: block; color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.empty span { font-size: 12.5px; }

/* 列表条目 */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #f0f3f8; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f9fbfe; }
.list-row .lr-main { min-width: 0; flex: 1; }
.list-row .lr-main b { font-size: 13px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-main span { font-size: 11.5px; color: var(--muted); }
.list-row .lr-right { text-align: right; white-space: nowrap; }

/* 图表 */
.chart-box { position: relative; width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* 饼图布局 */
.pie-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pie-legend { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 7px; }
.lg-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.lg-row i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.lg-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-val { font-variant-numeric: tabular-nums; color: var(--text); }
.lg-pct { width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 待办列表 */
@media (max-width: 1320px) { .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 900px) { .todo-grid { grid-template-columns: 1fr !important; } }
.todo-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.todo-title .cnt { background: var(--gray-bg); color: var(--gray); font-size: 11px; padding: 0 6px; border-radius: 9px; height: 17px; display: inline-grid; place-items: center; font-weight: 600; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.todo-item:hover { background: #f6f9fd; }
.todo-item .t-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.todo-item .t-sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
/* 待办里的预警文字：优先级需高于 .todo-item .t-sub */
.todo-item .t-sub.text-red { color: var(--red-deep); font-weight: 700; }
.todo-item .t-sub.text-red-soft { color: var(--red-soft); font-weight: 600; }


/* 登录页 */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.06fr .94fr; background: #fff;
}

/* 左侧品牌区 */
.login-visual {
  position: relative; overflow: hidden; color: #fff; padding: 52px 56px 38px;
  background:
    radial-gradient(900px 520px at 6% 2%, rgba(58, 120, 184, .5), transparent 62%),
    radial-gradient(700px 520px at 98% 100%, rgba(32, 88, 148, .5), transparent 64%),
    linear-gradient(155deg, #0a1c33 0%, #102c4c 44%, #17406a 100%);
  display: flex; flex-direction: column;
}
.login-visual::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(78% 68% at 30% 28%, #000 0%, transparent 78%);
  mask-image: radial-gradient(78% 68% at 30% 28%, #000 0%, transparent 78%);
}
.login-visual::after {
  content: ""; position: absolute; right: -190px; top: -150px; width: 540px; height: 540px;
  border-radius: 50%; border: 1px solid rgba(150, 195, 240, .13);
  box-shadow: 0 0 0 64px rgba(150, 195, 240, .035), 0 0 0 150px rgba(150, 195, 240, .02);
  pointer-events: none;
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-mark {
  width: 42px; height: 42px; border-radius: 12px; font-size: 18px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.lb-text b { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: .4px; }
.lb-text span { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 2px; color: #7c9fc5; }

.login-hero { position: relative; z-index: 1; margin: auto 0; max-width: 530px; padding: 26px 0; }
.lv-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 12px;
  border-radius: 999px; font-size: 11.5px; letter-spacing: .6px; color: #a9cbe9;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
}
.lv-eyebrow i {
  width: 6px; height: 6px; border-radius: 50%; background: #4ea0e8;
  box-shadow: 0 0 0 3px rgba(78, 160, 232, .18);
}
.login-hero h1 { margin-top: 20px; font-size: 36px; line-height: 1.34; font-weight: 700; letter-spacing: .5px; }
.login-hero p { margin-top: 16px; max-width: 470px; color: #a6c2dd; font-size: 13.5px; line-height: 1.95; }

.login-points { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.lv-point {
  flex: 1 1 150px; min-width: 142px; padding: 14px 15px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .09);
}
.lv-ico {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: rgba(110, 170, 230, .16); color: #9ecbf3; margin-bottom: 9px;
}
.lv-point b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .2px; }
.lv-point em { display: block; margin-top: 4px; font-style: normal; font-size: 10.5px; line-height: 1.75; letter-spacing: .1px; color: #8db0d1; white-space: nowrap; }

/* 右侧表单区 */
.login-form-wrap { position: relative; display: grid; place-items: center; padding: 48px 40px; background: #fff; }
.login-form-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(620px 420px at 78% 10%, #f1f7fd 0%, transparent 72%);
}
.login-form { position: relative; z-index: 1; width: 100%; max-width: 360px; }
.lf-head { margin-bottom: 26px; }
.lf-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -.2px; }
.lf-head p { margin-top: 8px; font-size: 13px; color: var(--muted); }

.lf-field { display: block; margin-bottom: 16px; }
.lf-field > span { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.lf-input { position: relative; display: flex; align-items: center; }
.lf-input > svg { position: absolute; left: 14px; width: 16px; height: 16px; color: #94a6bb; pointer-events: none; }
.lf-input input {
  width: 100%; height: 46px; padding: 0 42px 0 40px;
  border: 1px solid #dde6f1; border-radius: 10px; background: #f8fafd;
  font-size: 14px; color: var(--text); font-family: inherit;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.lf-input input::placeholder { color: #aab7c8; }
.lf-input input:hover { border-color: #cddbeb; }
.lf-input input:focus {
  outline: 0; background: #fff; border-color: #2f6da8;
  box-shadow: 0 0 0 3px rgba(47, 109, 168, .12);
}
.lf-eye {
  position: absolute; right: 8px; width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #9aa9bc; cursor: pointer;
}
.lf-eye:hover { background: #eef4fb; color: #4a6c92; }
.lf-eye.on { color: #2f6da8; background: #eaf2fb; }

.lf-submit {
  width: 100%; height: 46px; margin-top: 8px; border: 0; border-radius: 10px;
  background: linear-gradient(135deg, #1d4a7a 0%, #2f6da8 100%);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px; font-family: inherit;
  cursor: pointer; box-shadow: 0 8px 20px rgba(31, 78, 128, .22);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.lf-submit:hover { filter: brightness(1.06); box-shadow: 0 10px 24px rgba(31, 78, 128, .28); }
.lf-submit:active { transform: translateY(1px); }
.lf-submit:disabled { opacity: .65; cursor: default; box-shadow: none; }

.lf-tip { margin-top: 16px; text-align: center; font-size: 12px; color: #9aa9bc; }

/* 移动端底部导航 */
.bottom-nav { display: none; }

/* 工具类 */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.hide { display: none !important; }
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.loading-line { height: 14px; margin: 10px 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1400px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: 62px; }
  .topbar { padding: 0 14px; height: 54px; }
  .topbar-title { font-size: 15px; }
  .topbar-crumb, .user-meta { display: none; }
  .content { padding: 14px; }
  .page-head h1 { font-size: 18px; }
  .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-6 .stat .stat-num { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .filter-bar { padding: 12px; }
  .filter-bar .fitem { flex: 1 1 44%; }
  .filter-bar .fbtns { margin-left: 0; width: 100%; }
  .filter-bar .fbtns .btn { flex: 1; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; overflow-y: auto; padding-bottom: 26px; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; }
  .kv { grid-template-columns: 1fr 1fr; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 9px 10px; white-space: nowrap; }
  .cell-main, .cell-sub {
    display: inline-block; max-width: 168px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  }
  .cell-sub { max-width: 168px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-wrap { padding: 24px; min-height: 100vh; align-items: center; }
  .tabs { padding: 0 12px; }
  .tab-panel { padding: 14px; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; background: #fff;
    border-top: 1px solid var(--border); z-index: 50; padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 10.5px; color: var(--muted);
  }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a.active { color: var(--primary-2); font-weight: 600; }
}
@media (max-width: 520px) {
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .grid-4, .grid-6 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stat { padding: 13px 12px 12px 14px; }
  .stat-num { font-size: 20px; letter-spacing: -.3px; word-break: break-all; }
  .stat-top { font-size: 12px; }
  .stat-foot { font-size: 11px; }
  .stat-ico { width: 22px; height: 22px; }
}

/* 用户浮层菜单 */
.menu-list { padding: 6px; }
.menu-row { display: block; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.menu-row:hover { background: var(--bg); color: var(--primary-2); }
.menu-row.danger { color: var(--red); }
.menu-row.danger:hover { background: var(--red-bg); }

/* 详情页头 */
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding: 18px; }
.detail-title { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.detail-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 文件条目 */
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; font-size: 12.5px; }
.file-item svg { color: var(--primary-2); flex: 0 0 auto; }
.file-item a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 上传控件 */
.upload-box { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; background: #fbfcfe; }
.upload-box:hover { border-color: var(--primary-3); color: var(--primary-2); background: var(--primary-light); }
.upload-box b { color: var(--primary-2); }

/* 排行榜 */
.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.rank-row .idx { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--gray-bg); color: var(--gray); flex: 0 0 auto; }
.rank-row .idx.top { background: var(--primary-light); color: var(--primary-2); }
.rank-row .name { width: 62px; flex: 0 0 auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .bar { flex: 1; height: 7px; background: #f0f3f8; border-radius: 4px; overflow: hidden; }
.rank-row .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4a86c8, #2c5f9e); }
.rank-row .val { width: 68px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }

/* 提示条 */
.callout { background: var(--primary-light); border: 1px solid #d5e4f4; color: var(--text-2); border-radius: var(--radius-sm); padding: 10px 13px; font-size: 12.5px; line-height: 1.8; }
.callout b { color: var(--primary); }
.callout.warn { background: var(--yellow-bg); border-color: #f0e2b8; }
.callout.danger { background: var(--red-bg); border-color: #f2cdcd; }

/* ---------------- 分段控件 / 工具条 / 开关 ---------------- */
.seg { display: inline-flex; gap: 2px; background: #f0f3f8; border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.seg-item {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 7px 16px; border-radius: 7px; font-size: 13px; color: var(--text-2);
  transition: all .15s; white-space: nowrap;
}
.seg-item:hover { color: var(--primary-2); }
.seg-item.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(20, 45, 80, .12); }

.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar .label { font-size: 12.5px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 34px; height: 19px; border-radius: 10px; background: #cdd7e3;
  position: relative; transition: background .18s; flex: 0 0 auto;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .18s;
}
.switch input:checked + .track { background: var(--primary-2); }
.switch input:checked + .track::after { transform: translateX(15px); }

/* 设置页局部 */
.set-card { box-shadow: none; border: 1px solid var(--border); }
.set-card .card-head { padding: 13px 16px; }
.set-card .card-head h3 { font-size: 13.5px; }
.panel-pad { padding: 18px; }
.code-chip { font-family: Consolas, Monaco, monospace; font-size: 12px; background: var(--gray-bg); color: var(--text-2); padding: 1px 6px; border-radius: 4px; }
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row .ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; background: var(--primary-light); color: var(--primary-2); }
.info-row .t { flex: 1; }
.info-row .t b { display: block; font-size: 13px; font-weight: 600; }
.info-row .t span { font-size: 12px; color: var(--muted); line-height: 1.7; }
.dict-name { font-weight: 500; }
.empty-cell { padding: 26px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 环形图 + 条形排行 */
.dwb { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.dwb > svg { flex: 0 0 auto; }
.dwb-list { flex: 1; min-width: 210px; display: flex; flex-direction: column; gap: 11px; }
.bl-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.bl-name { width: 72px; flex: 0 0 auto; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { flex: 1; height: 7px; background: #f0f3f8; border-radius: 4px; overflow: hidden; }
.bl-track i { display: block; height: 100%; border-radius: 4px; }
.bl-val { width: 50px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.bl-pct { width: 44px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.rank-foot {
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--muted);
}
.rank-foot b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }

/* 移动端：分段控件单行滚动（覆盖基础样式，需置于文件末尾） */
@media (max-width: 900px) {
  .seg { flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar { display: none; }
  .seg-item { padding: 7px 13px; font-size: 12.5px; flex: 0 0 auto; }
  .toolbar { padding: 12px 14px; gap: 10px; }
  .toolbar .select, .toolbar .input { flex: 1; min-width: 140px; }
}

/* 单元格内多标签：换行也保持间距 */
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; justify-content: center; }
.todo-title .cnt { flex: 0 0 auto; line-height: 1; }

/* ---------------- 品牌 / 页脚 / 刷新动画 ---------------- */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.sidebar-foot {
  flex: 0 0 auto; padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 11px; line-height: 1.75; color: #7c93b2; background: rgba(0, 0, 0, .08);
  text-align: center;
}
.sidebar-foot .sf-text { color: #a7bcd6; }
.sidebar-foot .sf-sub { color: #6e86a5; }
.sidebar-foot .sf-icp { display: inline-block; margin-top: 3px; color: #8fb2d8; }
.sidebar-foot .sf-icp:hover { color: #fff; text-decoration: underline; }

.icon-btn.spin svg { animation: spin .7s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

.chart-box svg { animation: chartIn .45s ease both; }
@keyframes chartIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.live-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.live-tag i {
  width: 6px; height: 6px; border-radius: 50%; background: #2e9e6b;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(46, 158, 107, .45); }
  70% { box-shadow: 0 0 0 6px rgba(46, 158, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 158, 107, 0); }
}

/* ---------------- 系统装修 ---------------- */
.appear-wrap { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 16px; align-items: start; }
.appear-nav { padding: 8px; position: sticky; top: 76px; }
.an-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px;
  border: 0; background: transparent; border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--text-2); text-align: left;
}
.an-item:hover { background: var(--bg); color: var(--primary-2); }
.an-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.an-item svg { width: 15px; height: 15px; opacity: .8; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fcfdff; border-radius: 0 0 var(--radius) var(--radius); }
.form-tip { background: #f8fafd; border: 1px dashed var(--border-strong); border-radius: 7px; padding: 10px 12px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.logo-preview {
  width: 62px; height: 62px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #16345f, #2c5f9e); color: #fff; font-weight: 700; font-size: 22px; flex: 0 0 auto;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.favicon-preview { width: 32px; height: 32px; border-radius: 7px; background: var(--primary); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.favicon-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.upload-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .appear-wrap { grid-template-columns: 1fr; }
  .appear-nav { position: static; display: flex; gap: 6px; overflow-x: auto; }
  .an-item { white-space: nowrap; width: auto; }
}

/* 登录页页脚 */
.login-foot { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #7f9cc0; z-index: 1; }
.login-foot a { color: #9db9d8; }
.login-foot a:hover { color: #fff; text-decoration: underline; }
.login-foot-mobile { display: none; margin-top: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.login-foot-mobile a { color: var(--primary-2); }
@media (max-width: 900px) { .login-foot-mobile { display: block; } }

/* 个人中心头像 */
.avatar-picker { position: relative; cursor: pointer; flex: 0 0 auto; }
.avatar-picker .avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: var(--primary-2); display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(20, 45, 80, .22); border: 1px solid var(--border);
}
.avatar-picker:hover .avatar-cam { background: var(--primary-2); color: #fff; }
.avatar-picker.loading { opacity: .55; pointer-events: none; }

/* 表格文本省略 */
.ellip { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
@media (max-width: 1280px) {
  table.tbl th, table.tbl td { padding: 9px 10px; }
  .col-md-hide { display: none !important; }
}

/* 角色权限 */
.perm-group { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.perm-group:last-of-type { border-bottom: 0; }
.perm-group-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; letter-spacing: .3px; }
.perm-group .checkbox { font-size: 13px; min-width: 132px; }

/* 提成规则摘要：单行展示 */
.rule-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 纵向环形图 */
.ds-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ds-legend { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.ds-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ds-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.ds-name { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.ds-pct { width: 52px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-empty { height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }

/* 利润统计布局 */
[data-chart] { width: 100%; }
[data-chart] svg { width: 100%; height: auto; display: block; }
.legend-inline { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--text-2); }
.legend-inline i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.pie-card .card-body { padding: 18px 18px 20px; display: flex; align-items: center; justify-content: center; }
.pie-card .ds-wrap { width: 100%; }

/* ==========================================================================
   移动端视觉升级（≤640px）
   ========================================================================== */
@media (max-width: 640px) {
  body { background: #f3f6fb; }

  /* 顶栏：紧凑 + 毛玻璃 */
  .topbar {
    height: 52px; padding: 0 14px; gap: 8px;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, .85);
  }
  .topbar-title { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
  .topbar-right { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
  .icon-btn:active { background: var(--primary-light); }
  .avatar { width: 30px; height: 30px; font-size: 12px; box-shadow: 0 2px 6px rgba(26, 60, 110, .18); }

  .content { padding: 12px 12px 20px; }

  /* 页头：标题交给顶栏，避免重复占屏 */
  .page-head { margin-bottom: 10px; gap: 8px; align-items: center; }
  .page-head h1, .page-head p { display: none; }
  .page-head .spacer { display: none; }
  .page-actions { width: 100%; gap: 8px; }
  .page-actions .btn { flex: 1 1 0; min-width: 0; }

  .card {
    border-radius: 14px; border-color: rgba(226, 232, 240, .85);
    box-shadow: 0 2px 10px rgba(20, 45, 80, .05);
  }
  .card-head { padding: 13px 14px; gap: 8px; flex-wrap: wrap; }
  .card-head h3 { font-size: 14px; }
  .card-head .sub { font-size: 11.5px; }
  .card-body { padding: 14px; }
  .card-foot { padding: 12px 14px; }

  /* 触控尺寸 */
  .btn { height: 38px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; }
  .btn-sm { height: 32px; font-size: 12.5px; }
  .btn svg { width: 16px; height: 16px; }
  .input, .select { height: 40px; border-radius: 9px; font-size: 14px; }
  .textarea { border-radius: 9px; font-size: 14px; }

  /* 指标卡 */
  .grid { gap: 12px; }
  .grid-4, .grid-6 { gap: 10px; }
  .stat { padding: 12px 12px 11px; border-radius: 14px; }
  .stat-top { font-size: 11.5px; gap: 6px; }
  .stat-ico { width: 22px; height: 22px; border-radius: 7px; }
  .stat-ico svg { width: 13px; height: 13px; }
  .stat-num { font-size: 19px; margin-top: 6px; letter-spacing: -.4px; }
  .stat-foot { font-size: 10.5px; margin-top: 3px; line-height: 1.5; }

  /* 筛选栏 */
  .filter-bar { padding: 12px; gap: 8px; border-bottom: 0; }
  .filter-bar .m-fmore { display: none; }
  .filter-bar.m-fopen .m-fmore { display: flex; }
  .m-ftoggle {
    flex: 1 1 100%; height: 32px; border: 0; border-radius: 8px; background: #f4f7fc;
    cursor: pointer; color: var(--primary-2); font-family: inherit; font-size: 12.5px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
  }
  .m-ftoggle::after { content: "⌄"; font-size: 13px; line-height: 1; transform: translateY(-1px); }
  .filter-bar.m-fopen .m-ftoggle::after { content: "⌃"; }
  .filter-bar .input, .filter-bar .select { height: 38px; font-size: 13.5px; }
  .filter-bar .fitem { flex: 1 1 46%; }
  .filter-bar .grow { flex: 1 1 100%; }

  /* 提成规则：移动端允许换行，完整展示 */
  .rule-line { white-space: normal; line-height: 1.7; }

  /* 页签 */
  .tabs { padding: 0 8px; gap: 0; }
  .tab { padding: 12px 8px 10px; font-size: 12.5px; }
  .tab .text-muted { display: none; }

  .empty { padding: 24px 16px; }
  .empty svg { width: 30px; height: 30px; }
  .empty b { font-size: 13px; }
  .empty span { font-size: 12px; }

  /* ---------------- 表格 → 字段卡片 ---------------- */
  .table-wrap { overflow: visible; }
  table.tbl { display: block; width: 100%; font-size: 13px; }
  table.tbl thead { display: none; }
  table.tbl tbody { display: block; }
  table.tbl tr {
    display: flex; flex-direction: column; padding: 12px 14px 12px;
    border-bottom: 1px solid #f1f4f9;
  }
  table.tbl tbody tr:last-child { border-bottom: 0; }
  table.tbl td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    padding: 3px 0; border: 0; text-align: right; white-space: normal; line-height: 1.65;
  }
  table.tbl td::before {
    content: attr(data-label); flex: 0 0 auto; color: var(--muted);
    font-size: 12px; line-height: 1.65; text-align: left;
  }
  table.tbl td > .m-val { display: block; flex: 0 1 auto; min-width: 0; text-align: right; color: var(--text); }

  /* 长文本 / 多标签：标签在上、内容在下 */
  table.tbl td.m-stack { display: block; }
  table.tbl td.m-stack::before { display: block; text-align: left; margin-bottom: 2px; }
  table.tbl td.m-stack > .m-val { text-align: left; }
  table.tbl td.m-stack .tag { margin: 2px 4px 2px 0; }

  /* 主标题行 */
  table.tbl td.m-title {
    display: block; order: -1; text-align: left; padding: 0 0 8px; margin-bottom: 5px;
    border-bottom: 1px dashed var(--border);
  }
  table.tbl td.m-title::before { display: none; }
  table.tbl td.m-title > .m-val { text-align: left; font-size: 14.5px; font-weight: 700; letter-spacing: .1px; }
  table.tbl td.m-title .cell-main { font-size: 14.5px; }
  table.tbl td.m-title .cell-sub { font-size: 11.5px; font-weight: 400; margin-top: 2px; color: var(--muted); }
  table.tbl td.m-title .tag { margin-top: 4px; }

  /* 操作行 */
  table.tbl td.m-actions {
    display: block; padding: 10px 0 0; margin-top: 7px; border-top: 1px dashed var(--border);
  }
  table.tbl td.m-actions::before { display: none; }
  table.tbl td.m-actions > .m-val { display: block; }
  table.tbl td.m-actions .ops { justify-content: flex-end; gap: 8px; }
  table.tbl td.m-actions .btn-link {
    padding: 5px 12px; border-radius: 8px; background: var(--primary-light);
    color: var(--primary); font-size: 12.5px;
  }
  table.tbl td.m-actions .btn-link.danger { background: var(--red-bg); color: var(--red); }

  /* 空状态行 / 合计行 */
  table.tbl .m-hide { display: none !important; }
  table.tbl td[colspan] { display: block; text-align: center; padding: 12px 0; }
  table.tbl td[colspan]::before { display: none; }
  table.tbl tfoot { display: block; }
  table.tbl tfoot tr {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 10px; padding: 11px 14px; border-radius: 10px;
    background: #f7f9fc; border-bottom: 0;
  }
  table.tbl tfoot td { display: block; padding: 0; border: 0; text-align: left; }
  table.tbl tfoot td::before { display: none; }
  table.tbl tfoot td[colspan] { text-align: right; }

  /* 移除 900px 下的截断限制 */
  table.tbl .cell-main, table.tbl .cell-sub {
    display: block; max-width: none; overflow: visible; white-space: normal;
  }
  table.tbl .cell-ellipsis {
    display: block; width: auto; max-width: none; overflow: visible; white-space: normal;
  }
  table.tbl .tag-row { justify-content: flex-start; }
  /* 移动端不再截断单元格内的长文本 */
  table.tbl .ellip { max-width: none !important; white-space: normal; }

  /* 分页 */
  .pager { flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
  .pager .info { width: 100%; margin: 0 0 2px; font-size: 12px; }
  .pager button { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; }

  /* 底部导航 */
  .main { padding-bottom: 66px; }
  .bottom-nav {
    height: 60px; border-top: 1px solid rgba(226, 232, 240, .8);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 -2px 16px rgba(20, 45, 80, .06);
  }
  .bottom-nav a { gap: 3px; font-size: 10px; color: #8d9aaa; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--primary); font-weight: 600; }

  /* 弹窗 */
  .modal { border-radius: 18px 18px 0 0; max-height: 90vh; }
  .modal-head { padding: 14px 16px 12px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }

  /* 详情页 */
  .detail-head { padding: 14px; gap: 12px; }
  .detail-title { font-size: 17px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1 1 0; }
}

/* 登录页移动端：品牌头 + 白色卡片 */
.login-mobile-head { display: none; }
@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
    background:
      radial-gradient(520px 360px at 10% 0%, rgba(58, 120, 184, .45), transparent 62%),
      linear-gradient(165deg, #0a1c33 0%, #143c63 58%, #1d5583 100%);
  }
  .login-visual { display: none; }
  .login-form-wrap { padding: 28px 20px; min-height: 100vh; align-content: center; background: transparent; }
  .login-form-wrap::before { display: none; }
  .login-mobile-head {
    display: flex; align-items: center; gap: 12px; width: 100%; max-width: 372px;
    margin: 0 0 16px; color: #fff;
  }
  .lm-mark {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    font-size: 18px; font-weight: 700; overflow: hidden; flex: 0 0 auto;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  }
  .lm-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
  .lm-text b { display: block; font-size: 15.5px; letter-spacing: .3px; }
  .lm-text span { font-size: 10px; letter-spacing: 1.6px; color: #9db9d8; }
  .login-form {
    max-width: 372px; background: #fff; border-radius: 20px; padding: 26px 22px 20px;
    box-shadow: 0 22px 52px rgba(4, 14, 28, .42);
  }
  .lf-head { margin-bottom: 20px; }
  .lf-head h2 { font-size: 22px; }
  .lf-head p { font-size: 12.5px; }
  .lf-submit { margin-top: 10px; }
  .login-foot-mobile { text-align: center; }
}

/* 移动端：省份 / 城市并排，区县独占一行 */
@media (max-width: 640px) {
  .region-row { grid-template-columns: 1fr 1fr; }
  .region-row [data-region="district"] { grid-column: span 2; }
}

/* 证书查询卡片：查看证书 / 申请使用 */
.cert-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cert-expire { flex: 1 1 auto; min-width: 0; }
.cert-btns { display: flex; gap: 6px; margin-left: auto; }
.cert-btns .btn { padding: 0 10px; }
.cert-view-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); }
.cert-view-name { font-size: 15.5px; font-weight: 700; }
.cert-kv { margin-top: 14px; }

/* 客户名称列：保证最小宽度，超长省略并保留 title 提示 */
table.tbl td.col-name { min-width: 150px; }
table.tbl td.col-name .cell-main {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle;
}

/* 客户表列多，窄屏收紧单元格内边距，保证操作列完整可见 */
@media (max-width: 1280px) {
  table.tbl.tbl-customers th, table.tbl.tbl-customers td { padding-left: 8px; padding-right: 8px; }
}

/* ---------------- 全国客户分布地图：左地图 / 右详情 ---------------- */
.map-card .card-body { padding: 14px 18px 18px; }
.map-body { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(300px, 1fr); gap: 22px; align-items: start; }

/* 左侧：地图舞台紧贴地图实际尺寸 */
.map-canvas {
  position: relative; width: 100%; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  padding: 10px; border-radius: 16px;
  background: radial-gradient(120% 110% at 46% 4%, #fbfdff 0%, #ecf5fe 56%, #dfedfb 100%);
  border: 1px solid #e2edfa;
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(20, 45, 80, .05);
}
.china-map { display: block; width: 100%; height: auto; }
.china-map .map-main { filter: drop-shadow(0 4px 6px rgba(26, 60, 110, .09)); }
.china-map path.province { stroke: #fff; stroke-width: .9; transition: filter .15s, stroke .15s; }
.china-map path.province:hover { filter: brightness(.92); stroke: #14335c; stroke-width: 1.15; }
.china-map.is-clickable path.province { cursor: pointer; }
.map-counts text {
  font-size: 11.5px; font-weight: 700; fill: #14335c; pointer-events: none;
  paint-order: stroke; stroke: #fff; stroke-width: 3.2px;
}
.map-inset rect { fill: #eef6ff; stroke: #cfe0f4; stroke-width: 1; }
.map-inset path { stroke: #1a3c6e; stroke-width: .4; }
.map-inset text { font-size: 7.5px; fill: var(--muted); }
.map-hint {
  position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: var(--muted);
  background: rgba(255, 255, 255, .92); border: 1px solid var(--border); border-radius: 7px;
  padding: 3px 9px; pointer-events: none;
}
.map-tip {
  position: absolute; transform: translate(10px, -50%); z-index: 5; pointer-events: none;
  background: rgba(18, 36, 60, .92); color: #fff; padding: 5px 9px; border-radius: 6px;
  font-size: 12px; white-space: nowrap;
}

/* 右侧：数据详情 */
.map-detail {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: 2px 0 2px 22px; border-left: 1px dashed var(--border);
}
.map-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.map-kpi {
  background: #f7fafd; border: 1px solid #edf2f9; border-radius: 12px;
  padding: 10px 12px 9px;
}
.map-kpi span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 1px; }
.map-kpi b {
  font-size: 22px; font-weight: 700; letter-spacing: -.4px;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.map-kpi em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 3px; }

.map-sec { display: flex; flex-direction: column; gap: 7px; }
.map-sec-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.map-sec-head span { font-size: 11px; font-weight: 400; color: var(--muted); }

.map-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.map-legend span {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px;
  border-radius: 7px; background: #f7fafd; border: 1px solid #edf2f9;
  font-size: 11px; color: var(--text-2);
}
.map-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }

.map-ranks { display: flex; flex-direction: column; }
.map-rank-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; padding: 4px 0; }
.map-rank-row + .map-rank-row { border-top: 1px solid #f5f8fc; }
.map-rank-row .idx {
  width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; background: var(--gray-bg); color: var(--gray); flex: 0 0 auto;
}
.map-rank-row .idx.top { background: var(--primary-light); color: var(--primary-2); }
.map-rank-row .nm {
  width: 84px; flex: 0 0 auto; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-rank-row .bar { flex: 1; height: 7px; background: #f0f4f9; border-radius: 4px; overflow: hidden; }
.map-rank-row .bar i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #76a8dc, #24578f);
}
.map-rank-row b { width: 26px; text-align: right; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.map-rank-row .pct { width: 34px; text-align: right; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.map-aside { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.map-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: #a3aebd; }
.map-foot b { color: var(--text-2); font-weight: 600; }

@media (max-width: 1200px) {
  .map-detail { padding-left: 16px; gap: 12px; }
  .map-kpi { padding: 9px 10px 8px; }
  .map-kpi b { font-size: 19px; }
  .map-rank-row { padding: 4px 0; }
}
@media (max-width: 1100px) {
  .map-body { grid-template-columns: 1fr; gap: 14px; }
  .map-canvas { max-width: 640px; margin: 0 auto; }
  .map-detail {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px 26px;
    padding: 16px 0 0; border-left: 0; border-top: 1px dashed var(--border);
  }
  .map-kpis { grid-column: 1 / -1; }
  .map-aside { margin-top: 0; height: 100%; justify-content: space-between; }
}
@media (max-width: 640px) {
  .map-card .card-body { padding: 10px 12px 12px; }
  .map-canvas { padding: 6px; border-radius: 12px; max-width: 100%; }
  .map-counts { display: none; }
  .map-detail { display: flex; flex-direction: column; gap: 12px; }
  .map-kpis { gap: 8px; }
  .map-kpi { padding: 9px 10px 8px; }
  .map-kpi b { font-size: 18px; }
  .map-hint { left: 8px; bottom: 6px; }
  .map-legend span { height: 22px; padding: 0 7px; font-size: 10.5px; }
}

/* 筛选条件提示 */
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.active-chips:not(:empty) { padding: 10px 18px 0; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px;
  background: var(--primary-light); color: var(--primary-2); border-radius: 6px; font-size: 12px;
}
.filter-chip b { color: var(--primary); }
.filter-chip button {
  border: 0; background: transparent; color: var(--primary-2); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 3px;
}
@media (max-width: 640px) {
  .active-chips:not(:empty) { padding: 10px 12px 0; }
}

/* 证书表操作列较多，1440 左右收紧单元格内边距，避免操作按钮被裁切 */
@media (max-width: 1500px) {
  table.tbl.tbl-certs th, table.tbl.tbl-certs td { padding-left: 10px; padding-right: 10px; }
}
