/* ==========================================================================
   算数 · 资产管理 —— 管理端样式
   设计语言：深色侧边 + 浅色工作区，数据密集型 ERP 风格
   ========================================================================== */
:root {
  --brand: #1256a0;
  --brand-600: #0e4a8c;
  --brand-50: #eef5fd;
  --brand-100: #dbe9f9;
  --nav: #0f2233;
  --nav-2: #16324a;
  --nav-line: #24435f;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e4e9f0;
  --line-2: #eef2f7;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #0f9d58;
  --ok-bg: #e7f6ee;
  --warn: #d97706;
  --warn-bg: #fdf3e3;
  --danger: #d92d20;
  --danger-bg: #fdecea;
  --info: #1256a0;
  --info-bg: #eef5fd;
  --purple: #6d4aff;
  --purple-bg: #f0ecff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px -8px rgba(15, 23, 42, .14);
  --shadow-lg: 0 24px 60px -18px rgba(15, 23, 42, .35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
input, select, textarea, button { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 布局 */
/* 视口锁定：左侧导航与右侧内容各自独立滚动，页脚常驻底部可见 */
.app { display: flex; height: 100vh; overflow: hidden; }

.side {
  width: 224px;
  flex: 0 0 224px;
  background: var(--nav);
  color: #cbd8e5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .18s ease, flex-basis .18s ease;
}
/* 品牌与页脚固定，中间导航独立滚动，保证底部版权始终可见 */
.side > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.side > nav::-webkit-scrollbar { width: 6px; }
.side > nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 20px; }
.side > nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }
.side > nav::-webkit-scrollbar-track { background: transparent; }
.side__brand, .side__foot { flex: 0 0 auto; }
.side__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--nav-line);
}
.side__logo {
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 32px;
  background: linear-gradient(135deg, #2f8bfd, #0b3d78);
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff;
}
.side__title { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.25; }
.side__sub { font-size: 11px; color: #7d99b4; letter-spacing: .04em; }

.side__group { padding: 12px 10px 2px; font-size: 11px; color: #6f8ba6; letter-spacing: .08em; }
.side__item {
  display: flex; align-items: center; gap: 9px;
  margin: 1px 8px; padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #c3d2e0; cursor: pointer; user-select: none;
  transition: background .15s, color .15s;
}
.side__item:hover { background: var(--nav-2); color: #fff; }
.side__item.is-active { background: var(--brand); color: #fff; font-weight: 500; }
.side__item .ico { width: 16px; text-align: center; opacity: .9; font-size: 14px; }
.side__badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 16px; height: 16px; min-width: 16px;
  padding: 0 4px; border-radius: 8px; text-align: center;
}
.side__foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--nav-line); font-size: 11.5px; color: #7d99b4; }
.side__foot-line { line-height: 1.6; }
.side__foot-link {
  display: inline-block; margin-top: 6px; color: #9db8d4;
  text-decoration: none; border-bottom: 1px dashed rgba(157,184,212,.45);
}
.side__foot-link:hover { color: #fff; border-bottom-color: #fff; }

/* ---------- 页面水印（演示环境防截图外流） ---------- */
.wm {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  overflow: hidden; opacity: .075;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
}
.wm__item {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: #0b2a5b; white-space: nowrap;
  transform: rotate(-26deg); letter-spacing: .06em;
  user-select: none; -webkit-user-select: none;
}
body.big .wm { opacity: .11; }
body.big .wm__item { color: #dbe6f5; font-size: 12px; }
@media (max-width: 820px) {
  .wm { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(6, 1fr); }
  .wm__item { font-size: 11px; }
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- 应用页脚（版权 / 商务联系） ---------- */
.app-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 9px 20px; border-top: 1px solid var(--line);
  background: #fff; font-size: 11.5px; color: #8b97a8;
}
.app-foot__links { display: inline-flex; align-items: center; gap: 14px; }
.app-foot a { color: #5b7ba3; text-decoration: none; border-bottom: 1px dashed rgba(91,123,163,.45); }
.app-foot a:hover { color: var(--brand, #1256a0); border-bottom-color: var(--brand, #1256a0); }
@media (max-width: 820px) {
  .app-foot { justify-content: center; text-align: center; padding: 8px 12px; }
  .app-foot > span:first-child { display: none; }
}

.topbar {
  height: 54px; flex: 0 0 54px;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__crumbs { color: var(--muted); font-size: 12px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__user {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line); border-radius: 20px; cursor: pointer; background: #fff;
}
.topbar__user:hover { border-color: var(--brand); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-100); color: var(--brand);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}

.content { padding: 16px 18px 40px; flex: 1; min-height: 0; overflow-y: auto; }

/* ---------------------------------------------------------------- 通用组件 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
}
.card__head h3 { font-size: 13.5px; }
.card__head .grow { flex: 1; }
.card__body { padding: 14px; }
.card__body--flush { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: #c7d2de; background: #fafcff; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn--danger { color: var(--danger); border-color: #f4c8c4; background: #fff; }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--line-2); }
.btn--sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn--icon { width: 30px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  height: 30px; padding: 0 9px; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 7px 9px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 86, 160, .1); }
.input[readonly] { background: var(--line-2); color: var(--muted); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 24px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; color: var(--muted); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 11.5px; color: var(--muted-2); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 130px; }
.filters .input--search { min-width: 210px; }

.grid { display: grid; gap: 12px; }
.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)); }
@media (max-width: 1180px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.kpi { padding: 13px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi__label { font-size: 12px; color: var(--muted); }
.kpi__value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi__foot { font-size: 11.5px; color: var(--muted-2); }
.kpi__spark { position: absolute; right: 10px; top: 12px; font-size: 20px; opacity: .18; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl th, table.tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.tbl th {
  background: #f8fafc; font-weight: 500; color: var(--muted); font-size: 12px;
  position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line);
}
table.tbl tbody tr:hover { background: #f8fbff; }
table.tbl tbody tr.is-checked { background: var(--brand-50); }
table.tbl tbody tr.row--click { cursor: pointer; }
table.tbl tbody tr.row--click:hover { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
table.tbl tbody tr.row--click td:first-child { position: relative; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
table.tbl td.wrap { white-space: normal; min-width: 180px; }
table.tbl .code { font-family: var(--mono); font-size: 12px; color: var(--brand); }
.tbl__empty { padding: 40px; text-align: center; color: var(--muted-2); }
.tbl__foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.tbl__foot .grow { flex: 1; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: 4px;
  font-size: 11.5px; line-height: 1; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.tag--ok { background: var(--ok-bg); color: var(--ok); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.tag--info { background: var(--info-bg); color: var(--info); }
.tag--purple { background: var(--purple-bg); color: var(--purple); }
.tag--muted { background: #f1f5f9; color: var(--muted); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs__item {
  padding: 9px 14px; cursor: pointer; color: var(--muted); font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs__item:hover { color: var(--ink); }
.tabs__item.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

.pager { display: flex; gap: 6px; align-items: center; }
.pager button {
  min-width: 28px; height: 26px; padding: 0 7px; font-size: 12.5px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); cursor: pointer;
}
.pager button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button[disabled] { opacity: .45; cursor: not-allowed; }

/* 抽屉 / 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60;
}
.mask.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 94vw);
  background: var(--bg); z-index: 61; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s cubic-bezier(.4, 0, .2, 1);
  box-shadow: var(--shadow-lg);
}
.drawer.is-open { transform: none; }
.drawer--sm { width: min(560px, 96vw); }
.drawer__head {
  flex: 0 0 auto; padding: 13px 16px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.drawer__head h3 { font-size: 15px; }
.drawer__head .grow { flex: 1; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer__foot {
  flex: 0 0 auto; padding: 11px 16px; background: #fff; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}

.modal {
  position: fixed; z-index: 62; left: 50%; top: 12vh; transform: translate(-50%, -12px);
  width: min(520px, 92vw); background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .18s;
}
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.modal__head { padding: 14px 16px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.modal__body { padding: 16px; max-height: 60vh; overflow-y: auto; }
.modal__foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; }

/* 描述列表 */
.desc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.desc--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.desc__item { background: #fff; padding: 9px 12px; }
.desc__label { font-size: 11.5px; color: var(--muted-2); margin-bottom: 2px; }
.desc__value { font-size: 13px; word-break: break-all; }
.desc__value.num { font-family: var(--mono); }
.pre {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  background: #f8fafc; border: 1px solid var(--line-2); border-radius: 6px;
  padding: 12px; max-height: 52vh; overflow: auto;
}
@media (max-width: 900px) { .desc, .desc--2 { grid-template-columns: 1fr; } }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline__item { position: relative; padding: 0 0 14px; }
.timeline__item::before {
  content: ""; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand);
}
.timeline__item.is-warn::before { border-color: var(--warn); }
.timeline__item.is-danger::before { border-color: var(--danger); }
.timeline__title { font-size: 13px; font-weight: 500; }
.timeline__meta { font-size: 11.5px; color: var(--muted-2); }
.timeline__body { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 图表：纯 CSS 条形 */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bars__row { display: grid; grid-template-columns: 118px 1fr 92px; gap: 10px; align-items: center; font-size: 12.5px; }
.bars__name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { height: 9px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bars__fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2f8bfd, #1256a0); transition: width .4s; }
.bars__val { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut__chart { width: 132px; height: 132px; border-radius: 50%; flex: 0 0 132px; position: relative; }
.donut__chart::after { content: ""; position: absolute; inset: 27px; background: #fff; border-radius: 50%; }
.donut__center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 1; }
.donut__center b { display: block; font-size: 19px; }
.donut__center span { font-size: 11px; color: var(--muted); }
.donut__legend { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 6px; }
.donut__legend div { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.donut__legend i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 9px; }
.donut__legend b { margin-left: auto; font-family: var(--mono); font-weight: 500; }

.cols { display: flex; align-items: flex-end; gap: 10px; height: 148px; padding-top: 6px; }
.cols__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.cols__bar { width: 100%; max-width: 42px; background: linear-gradient(180deg, #4b9bfd, #1256a0); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .4s; }
.cols__label { font-size: 11px; color: var(--muted-2); }

/* 清单 */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.list__item:last-child { border-bottom: 0; }
.list__item:hover { background: #fafcff; }
.list__main { flex: 1; min-width: 0; }
.list__main b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__main span { color: var(--muted-2); font-size: 11.5px; }

/* 步骤条 */
.steps { display: flex; gap: 0; align-items: center; flex-wrap: wrap; }
.steps__item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted-2); }
.steps__dot { width: 19px; height: 19px; border-radius: 50%; background: var(--line); color: var(--muted); display: grid; place-items: center; font-size: 11px; }
.steps__item.is-done .steps__dot { background: var(--ok); color: #fff; }
.steps__item.is-cur .steps__dot { background: var(--brand); color: #fff; }
.steps__item.is-cur { color: var(--brand); font-weight: 500; }
.steps__line { width: 26px; height: 1px; background: var(--line); margin: 0 8px; }

/* 二维码 */
.qr { display: grid; grid-template-columns: repeat(25, 1fr); width: 150px; height: 150px; gap: 0; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.qr i { background: #fff; }
.qr i.on { background: #0f172a; }

/* 提示 */
.toast-wrap { position: fixed; right: 18px; top: 66px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 220px; max-width: 380px; padding: 10px 13px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  font-size: 13px; animation: toast-in .2s ease-out;
}
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--danger); }
.toast--warn { border-left-color: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.empty { padding: 46px 20px; text-align: center; color: var(--muted-2); }
.empty__icon { font-size: 30px; opacity: .35; margin-bottom: 6px; }
.loading { padding: 44px; text-align: center; color: var(--muted-2); }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint { font-size: 12px; color: var(--muted); }
/* 键值行（CN 补漏专项 / 采购与税务合规页共用） */
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--muted); }
.kv > b { font-family: var(--mono); font-weight: 600; color: var(--ink); text-align: right; }
.bar { overflow: hidden; }
.bar > div { transition: width .4s; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.tc { text-align: center; } .tr { text-align: right; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.checkbox { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; vertical-align: -2px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f2233, #1256a0 65%, #2f8bfd); padding: 20px; }
.login {
  width: min(880px, 96vw); background: #fff; border-radius: 14px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 340px; box-shadow: var(--shadow-lg);
}
.login__intro { padding: 34px 32px; color: #fff; background: linear-gradient(150deg, #0f2233, #1256a0); }
.login__intro h1 { font-size: 24px; margin-bottom: 8px; }
.login__intro p { color: #b9cde3; font-size: 13px; margin: 0 0 18px; }
.login__feats { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: #d3e2f1; }
.login__feats span::before { content: "◆ "; color: #4b9bfd; }
.login__contact {
  display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.login__contact img { width: 92px; height: 92px; border-radius: 8px; background: #fff; padding: 4px; flex: 0 0 92px; }
.login__contact-txt { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.login__contact-txt b { font-size: 13px; color: #fff; }
.login__contact-txt a { color: #cfe0f3; text-decoration: none; border-bottom: 1px dashed rgba(207,224,243,.45); align-self: flex-start; }
.login__contact-txt a:hover { color: #fff; border-bottom-color: #fff; }
.login__contact-txt span { color: #8fa9c6; }
.login__form { padding: 32px 28px; }
.login__foot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; font-size: 12px; color: #cfe0f3;
}
.login__foot > span { color: #9fbcd9; }
.login__foot a { color: #fff; text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.5); }
.login__foot a:hover { border-bottom-color: #fff; }
.login__form h2 { font-size: 17px; margin-bottom: 4px; }
.login__accounts { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.login__accounts button { font-size: 11.5px; height: 24px; }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login__intro { display: none; } }

@media (max-width: 820px) {
  .side { position: fixed; left: 0; top: 0; z-index: 70; transform: translateX(-100%); transition: transform .2s; }
  .side.is-open { transform: none; }
}

/* ==========================================================================
   v1.1 易用性增强层：导航折叠 · 顶栏快捷区 · 说明抽屉 · 外观皮肤 ·
   导入导出打印 · 懒加载骨架 · 权限矩阵 · 打印排版
   ========================================================================== */

/* ---------------------------------------------------------- 主题 / 皮肤 */
:root { --radius-base: 10px; --radius-smb: 6px; --row-pad: 8px; --gap: 12px; }
html[data-radius="square"] { --radius-base: 4px; --radius-smb: 3px; --radius: 4px; --radius-sm: 3px; }
html[data-radius="round"] { --radius-base: 14px; --radius-smb: 10px; --radius: 14px; --radius-sm: 10px; }
html[data-density="compact"] { --row-pad: 4px; --gap: 9px; }
html[data-density="compact"] body { font-size: 12.8px; }
html[data-density="compact"] .tbl td { padding: 5px 10px; }
html[data-density="compact"] .card__body { padding: 10px; }
html[data-density="compact"] .card__head { padding: 8px 12px; }
html[data-density="compact"] .kpi__value { font-size: 19px; }
html[data-width="fixed"] .content > * { max-width: 1440px; margin-left: auto; margin-right: auto; }

/* 深色模式：只覆盖「面」与「字」，品牌色与状态色仍由变量控制，避免花屏 */
html[data-theme="dark"] {
  --ink: #e8eef6; --ink-2: #c4d0de; --muted: #93a4b8; --muted-2: #7b8ca0;
  --line: #24344a; --line-2: #1c2a3d; --bg: #0b1522; --card: #122032;
  --nav: #08111c; --nav-2: #14263a; --nav-line: #1e3247;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 26px 60px -20px rgba(0,0,0,.7);
  --ok-bg: #10321f; --warn-bg: #3a2a0e; --danger-bg: #3a1a17; --purple-bg: #241c46;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .filters { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .btn { background: #16273c; border-color: var(--line); color: var(--ink-2); }
html[data-theme="dark"] .btn:hover { background: #1c3049; color: #fff; }
html[data-theme="dark"] .btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
html[data-theme="dark"] .input, html[data-theme="dark"] .select, html[data-theme="dark"] .textarea { background: #0e1b2b; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .input[readonly], html[data-theme="dark"] .field .input[style] { background: #0c1727; }
html[data-theme="dark"] .tbl th { background: #152438; color: var(--muted); }
html[data-theme="dark"] .tbl tr:hover td { background: #16273c; }
html[data-theme="dark"] .tbl td { border-color: var(--line-2); }
html[data-theme="dark"] .desc, html[data-theme="dark"] .kv { background: var(--line-2); border-color: var(--line-2); }
html[data-theme="dark"] .desc__item, html[data-theme="dark"] .kv { background: var(--card); }
html[data-theme="dark"] .bars__fill, html[data-theme="dark"] .cols__bar { opacity: .9; }
html[data-theme="dark"] .app-foot { background: transparent; border-color: var(--line); }
html[data-theme="dark"] .wm { opacity: .07; }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #16273c 25%, #1e3550 37%, #16273c 63%); }

/* ---------------------------------------------------------- 左侧导航优化 */
.side { position: relative; }
.side__brandtxt { min-width: 0; }
.side__search { padding: 0 10px 8px; }
.side__search .input { width: 100%; background: rgba(255,255,255,.07); border-color: transparent; color: #dbe6f5; height: 28px; }
.side__search .input::placeholder { color: #7d99b4; }
.side__search .input:focus { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); box-shadow: none; }
.side__item { position: relative; padding: 8px 10px; border-radius: var(--radius-sm); }
.side__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__hint { display: none; font-size: 11px; color: #7d99b4; }
.side__item.is-active .side__hint { color: rgba(255,255,255,.8); }
.side__badge { background: #d92d20; color: #fff; border-radius: 20px; padding: 0 6px; font-size: 10.5px; min-width: 18px; text-align: center; }
.side__toggle {
  position: absolute; right: -12px; top: 46px; z-index: 5;
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--nav-line);
  background: var(--nav-2); color: #9db6cf; cursor: pointer; font-size: 12px; line-height: 1;
  display: grid; place-items: center;
}
.side__toggle:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 收起态：仅留图标 + 悬浮展开提示 */
.side.is-collapsed { width: 56px; flex: 0 0 56px; }
.side.is-collapsed .side__brandtxt,
.side.is-collapsed .side__search,
.side.is-collapsed .side__label,
.side.is-collapsed .side__hint,
.side.is-collapsed .side__group,
.side.is-collapsed .side__foot-line,
.side.is-collapsed .side__foot-link { display: none; }
.side.is-collapsed .side__brand { padding-left: 14px; }
.side.is-collapsed .side__item { justify-content: center; padding: 9px 0; }
.side.is-collapsed .side__item .ico { font-size: 16px; }
.side.is-collapsed .side__item { position: relative; }
.side.is-collapsed .side__item:hover::after {
  content: attr(title); position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 8px; background: #0f172a; color: #fff; padding: 4px 8px; border-radius: 6px;
  font-size: 12px; white-space: nowrap; z-index: 90; box-shadow: var(--shadow);
}
.side.is-collapsed .side__item--first { margin-top: 8px; }
.side.is-collapsed .side__badge { position: absolute; top: 2px; right: 6px; padding: 0 4px; font-size: 9.5px; min-width: 14px; }

/* ---------------------------------------------------------- 顶栏 */
.topbar { gap: 8px; }
.topbar__left { min-width: 0; max-width: 30%; }
.topbar__left .topbar__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__crumbs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__crumbs a { color: var(--brand); }
.topbar__crumbs .sep { margin: 0 5px; color: var(--muted-2); }
.topbar__sep { width: 1px; height: 20px; background: var(--line); }
.topbar__uname { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__user { cursor: pointer; }
.topbar__user .caret { color: var(--muted-2); font-size: 10px; }
.topbar__right { flex-wrap: nowrap; overflow: visible; }
.pill {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 20px;
  font-size: 11px; line-height: 16px; background: #e2e8f0; color: #475569;
}
.pill--danger { background: #fdecea; color: #d92d20; }
.pill--warn { background: #fdf3e3; color: #d97706; }
.pill--muted { background: #f1f5f9; color: #64748b; }
html[data-theme="dark"] .pill { background: #1e3550; color: #a9bad0; }
html[data-theme="dark"] .pill--danger { background: #3a1a17; color: #fca5a5; }
html[data-theme="dark"] .pill--warn { background: #3a2a0e; color: #fcd34d; }
.menu { position: relative; }
.menu__list {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 190px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 5px;
}
.menu.is-open .menu__list { display: block; }
.menu__list a { display: block; padding: 6px 9px; border-radius: 5px; color: var(--ink-2); text-decoration: none; font-size: 12.5px; }
.menu__list a:hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
@media (max-width: 1180px) { .hide-sm { display: none !important; } }
@media (max-width: 960px) { .topbar__left { max-width: 22%; } }

/* ---------------------------------------------------------- 说明 / 帮助抽屉 */
.help { display: flex; flex-direction: column; gap: 14px; }
.help__sec h4 { font-size: 13.5px; color: var(--brand); margin-bottom: 6px; padding-left: 9px; border-left: 3px solid var(--brand); line-height: 1.2; }
.help__sec p { margin: 0 0 6px; color: var(--ink-2); }
.help__sec ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.help__sec li { margin-bottom: 3px; }
.help__note { background: var(--brand-50); border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0; padding: 8px 10px; font-size: 12.5px; color: var(--brand-600); margin-top: 6px; }
.help__faq { border-bottom: 1px dashed var(--line); padding: 7px 0; }
.help__faq:last-child { border-bottom: 0; }
.help__faq b { display: block; font-size: 12.5px; }
.help__faq p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
html[data-theme="dark"] .help__note { background: #16273c; color: #9dc4ee; }

/* ---------------------------------------------------------- 待办 / 消息 */
.todo { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.todo__item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: var(--card); }
.todo__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.todo__main b { font-size: 13px; }
.todo__main span { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------- 外观面板 */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch.is-active { border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-100); }
.segwrap { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-size: 12.5px; color: var(--muted); border-right: 1px solid var(--line); }
.seg:last-child { border-right: 0; }
.seg.is-active { background: var(--brand); color: #fff; }
.seg:hover:not(.is-active) { background: var(--brand-50); color: var(--brand); }

/* ---------------------------------------------------------- 角色切换 */
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-card {
  text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm);
  padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; line-height: 1.45;
}
.role-card:hover { border-color: var(--brand); background: var(--brand-50); }
.role-card.is-active { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.role-card b { font-size: 12.5px; }
.role-card span { font-size: 11.5px; color: var(--muted); }
.role-card em { font-size: 11px; color: var(--muted-2); font-style: normal; }
.qr-entry { display: grid; place-items: center; padding: 6px 0 10px; }
.qr-entry .qr { width: 190px; height: 190px; }
.center { text-align: center; }

/* ---------------------------------------------------------- 懒加载骨架 */
.skeleton-wrap { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 6px; }
.skeleton--row { height: 26px; }
.skeleton--card { height: 108px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------- 小型控件 */
.input--mini, .select--mini { height: 24px; padding: 0 6px; font-size: 12px; }
.select--mini { padding-right: 20px; background-position: right 6px center; }
.input--mini[type="number"] { width: 56px; }

/* ---------------------------------------------------------- 导入 / 导出 */
.io-drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 20px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--bg); transition: .15s;
}
.io-drop:hover, .io-drop.is-over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.io-drop b { color: var(--brand); }
.io-map { display: flex; flex-wrap: wrap; gap: 6px; }
.io-preview { max-height: 42vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.io-preview .tbl th { position: sticky; top: 0; z-index: 2; }
.io-preview tr.is-bad td { background: #fdf3f2; }
html[data-theme="dark"] .io-preview tr.is-bad td { background: #3a1a17; }
.io-preview td .tag { max-width: 210px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------------------------------------------------------- 登录页角色入口 */
.login { grid-template-columns: 1fr 392px; }
.login__roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.login__role {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; transition: .15s;
}
.login__role:hover { border-color: var(--brand); background: var(--brand-50); }
.login__role.is-active { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.login__role b { font-size: 12.5px; }
.login__role span { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.login__form details summary { cursor: pointer; }

/* ---------------------------------------------------------- 打印排版 */
.print-body { background: #fff; color: #0f172a; font-size: 12px; }
.pr-wrap { padding: 0; }
.pr-head { display: flex; align-items: flex-end; gap: 14px; border-bottom: 2px solid #0f172a; padding-bottom: 8px; margin-bottom: 12px; }
.pr-brand { display: flex; flex-direction: column; }
.pr-brand b { font-size: 15px; }
.pr-brand span { font-size: 11px; color: #64748b; }
.pr-meta { flex: 1; display: flex; flex-direction: column; }
.pr-meta h1 { font-size: 16px; margin: 0; }
.pr-meta span { font-size: 11.5px; color: #64748b; }
.pr-meta--right { text-align: right; flex: 0 0 auto; }
.pr-tbl { width: 100%; border-collapse: collapse; }
.pr-tbl th, .pr-tbl td { border: 1px solid #94a3b8; padding: 5px 7px; font-size: 11.5px; vertical-align: top; }
.pr-tbl th { background: #eef5fd; font-weight: 600; }
.pr-tbl .tr { text-align: right; }
.pr-tbl tbody tr:nth-child(even) td { background: #fafcff; }
.pr-count, .pr-sum { margin-top: 8px; font-size: 11.5px; color: #475569; }
.pr-intro { margin-bottom: 10px; font-size: 12px; color: #334155; }
.pr-foot { margin-top: 16px; padding-top: 8px; border-top: 1px dashed #94a3b8; display: flex; justify-content: space-between; font-size: 11px; color: #64748b; }
.pr-labels { display: block; }
.label-page { display: grid; gap: 5mm; margin-bottom: 5mm; page-break-after: always; }
.label-page:last-child { page-break-after: auto; }
.label { display: flex; gap: 6px; border: 1px dashed #94a3b8; border-radius: 4px; padding: 5px 6px; height: 34mm; overflow: hidden; page-break-inside: avoid; }
.label__qr { flex: 0 0 auto; }
.label__qr .qr { width: 26mm; height: 26mm; padding: 1mm; border: 0; }
.label__info { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.label__org { font-size: 9.5px; color: #64748b; }
.label__code { font-size: 12.5px; font-weight: 700; font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.label__name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label__line { font-size: 11px; color: #334155; }
.pr-doc { padding: 4mm 0; }
.pr-doc--break { page-break-after: always; border-bottom: 1px dashed #cbd5e1; }
.pr-doc h4 { font-size: 13px; margin-bottom: 6px; }

/* 权限矩阵 */
.perm { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.perm th, .perm td { border-bottom: 1px solid var(--line-2); padding: 6px 8px; text-align: center; }
.perm th:first-child, .perm td:first-child { text-align: left; }
.perm thead th { background: var(--brand-50); color: var(--brand-600); font-weight: 600; position: sticky; top: 0; }
.perm tbody tr:hover td { background: var(--line-2); }
.perm__group td { background: var(--bg); font-weight: 600; }
.perm__box { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* 统计磁贴 / 穿透入口 */
.kpi--link { cursor: pointer; transition: .15s; }
.kpi--link:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi__go { font-size: 11px; color: var(--brand); opacity: 0; transition: .15s; }
.kpi--link:hover .kpi__go { opacity: 1; }
.drill { cursor: pointer; }
.drill:hover { opacity: .85; }
.bars__row.is-link:hover .bars__name, .bars__row.is-link:hover .bars__val { color: var(--brand); font-weight: 600; }
.bars__row.is-link { cursor: pointer; }
.donut__legend > div { cursor: pointer; border-radius: 4px; }
.donut__legend > div:hover { background: var(--brand-50); }
.cols__item.is-link { cursor: pointer; border-radius: 6px; }
.cols__item.is-link:hover { background: var(--brand-50); }
.cols__item.is-link:hover .cols__label { color: var(--brand); font-weight: 600; }
.timeline__item.is-link { cursor: pointer; border-radius: 6px; }
.timeline__item.is-link:hover { background: var(--brand-50); }
.list__item:has(button) { gap: 8px; }

/* 穿透结果提示条：说明「这条结果集是从哪个指标点进来的」，并给一键清除 */
.drill-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 12px; font-size: 12.5px;
  background: var(--brand-50); border: 1px solid var(--brand-100, var(--line));
  border-left: 3px solid var(--brand); border-radius: 8px; color: var(--text);
}
.drill-bar__txt b { color: var(--brand-600); font-weight: 600; }
html[data-theme="dark"] .drill-bar { background: rgba(47,139,253,.12); }

/* ---------------------------------------------------------- 系统管理 */
/* 权限矩阵：格子按钮，客户一眼看清「授予 / 取消」，大屏投屏也不糊 */
.perm-tbl th, .perm-tbl td { border-bottom: 1px solid var(--line-2); padding: 5px 6px; }
.perm-tbl td.tc { text-align: center; }
.perm-cell {
  width: 24px; height: 24px; line-height: 22px; text-align: center; padding: 0;
  border: 1px solid var(--line); border-radius: 5px; background: #fff; color: transparent;
  cursor: pointer; font-size: 13px; font-weight: 700; transition: .12s;
}
.perm-cell:hover:not([disabled]) { border-color: var(--brand); background: var(--brand-50); }
.perm-cell.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.perm-cell[disabled] { opacity: .5; cursor: not-allowed; }
html[data-theme="dark"] .perm-cell { background: #1b2534; }

/* 导入导出中心：集合卡片 */
.io-set { transition: .15s; }
.io-set:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.io-set .card__body { display: flex; flex-direction: column; height: 100%; }

/* 系统管理标签页图标与文本对齐 */
.tabs__item .ico { margin-right: 4px; opacity: .75; }

/* 表格级数据出入口（每张表都自带导出 / 打印） */
.tbl__io { display: flex; align-items: center; gap: 6px; padding: 6px 14px 8px; border-top: 1px dashed var(--line-2); }
.tbl__io .grow { flex: 1; }
.tbl__io .btn { font-size: 11.5px; padding: 3px 8px; }
html[data-density="compact"] .tbl__io { padding: 4px 12px 6px; }

/* 列表页「运行环境 / 概览」描述网格自适应 */
.desc--2 .desc__value { word-break: break-all; }


