/* ===== 合同信息登记系统 · 全局样式 ===== */
* { box-sizing: border-box; }
[v-cloak] { display: none; }

:root {
  /* 品牌色阶：由「界面外观」面板在运行时改写（见 assets/theme.js） */
  --brand: #1f4e79;
  --brand-2: #2f6fa8;
  --brand-3: #7fb2e0;
  --brand-mid: #1d4266;
  --brand-deep: #16324f;
  --brand-rgb: 31, 78, 121;
  --brand-text: #1f4e79;
  --brand-surface: #1f4e79;   /* 主色当文字用时（浅色主色会自动加深） */
  --brand-nav: #1f4e79;       /* 深色侧栏底部色，保证 85% 白字仍清晰 */
  --brand-light: #eaf2fa;
  --brand-soft: #f4f8fd;
  --on-brand: #ffffff;   /* 主色上的文字色，浅色皮肤时自动转为深色 */
  --ink: #1c2733;
  --ink-2: #55677a;
  --ink-3: #8b9aab;
  --line: #e2e8f0;
  --line-2: #eef2f7;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ok: #1f9d55;
  --warn: #d98324;
  --danger: #cf3b45;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 55, .06), 0 6px 20px rgba(16, 35, 55, .06);
  --shadow-lg: 0 12px 48px rgba(16, 35, 55, .18);
}

html, body { height: 100%; margin: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ================= 登录 ================= */
.login-wrap { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-bg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-mid) 45%, var(--brand-surface) 100%); }
/* 管理员自定义了登录页背景图：图片铺满 + 半透明遮罩保证卡片清楚 */
.login-bg.has-img {
  background-color: var(--brand-deep); background-repeat: no-repeat;
  background-position: center; background-size: cover;
}
.login-bg.has-img::after { background-image: none; background-color: rgba(6, 18, 32, var(--mask, .45)); }
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.16), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.10), transparent 46%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 22px);
}
.login-card {
  position: relative; width: 380px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 16px; padding: 34px 32px 22px;
  box-shadow: 0 24px 70px rgba(8, 24, 40, .38);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-logo {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-surface)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
}
.login-logo.img { background: none; overflow: hidden; }
.login-logo.img img, .side-logo.img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-brand h1 { font-size: 18px; letter-spacing: .5px; }
.login-brand p { margin: 3px 0 0; font-size: 11px; color: var(--ink-3); letter-spacing: .6px; }
.login-copy { margin: 10px 0 0; text-align: center; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.login-form .field { margin-bottom: 16px; }
.field { display: block; }
.field > span { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 13px; }
.field > span em { color: var(--danger); font-style: normal; margin-left: 3px; }
.field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fbfcfe; color: var(--ink); outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.field textarea { height: auto; min-height: 74px; padding: 9px 12px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .13);
}
.login-err { color: var(--danger); font-size: 13px; margin: -4px 0 12px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 12px; color: var(--ink-3); }
.login-foot .dot { color: #cfd8e3; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: #c3d0df; background: #f7fafd; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand, #fff); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-danger { color: var(--danger); border-color: #f0cdd0; background: #fff6f6; }
.btn-danger:hover { background: #fdecec; border-color: #e6b4b8; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; height: 40px; }
.btn-link { border: 0; background: none; color: var(--brand-text); cursor: pointer; padding: 0 4px; height: auto; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

/* ================= 布局 ================= */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: none; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-deep), var(--brand-mid) 60%, var(--brand-nav));
  color: rgba(255,255,255,.85); transition: width .18s ease; position: sticky; top: 0; height: 100vh;
  z-index: 210;   /* 压在弹窗遮罩之上：新增/修改弹窗打开时也能点菜单换页面 */
}
.sidebar.collapsed { width: 62px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; }
.side-logo {
  width: 34px; height: 34px; flex: none; border-radius: 9px; color: #fff;
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
}
.side-title { min-width: 0; }
.side-title b { display: block; color: #fff; font-size: 14px; letter-spacing: .3px; white-space: nowrap; }
.side-title small { display: block; color: rgba(255,255,255,.62); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.nav-group { margin-bottom: 4px; }
.nav-group-head {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  padding: 8px 10px 6px; color: rgba(255,255,255,.55); font-size: 11.5px; letter-spacing: .5px;
  user-select: none; white-space: nowrap;
}
.nav-group-head:hover { color: rgba(255,255,255,.92); }
.nav-group-text { overflow: hidden; text-overflow: ellipsis; }
.nav-caret { font-size: 10px; transition: transform .15s; opacity: .8; }
.nav-caret.closed { transform: rotate(-90deg); }
.nav-sub { padding-left: 12px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 40px;
  border-radius: 8px; color: rgba(255,255,255,.85); font-size: 13.5px; margin-bottom: 2px;
  transition: background .15s, color .15s; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand-text); font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.nav-ico { width: 18px; height: 18px; flex: none; display: inline-flex; }
.nav-ico svg { width: 18px; height: 18px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }

/* 浅色侧栏皮肤：界面外观里可切换，其它配色沿用主题变量 */
html[data-nav="light"] .sidebar { background: #fff; border-right: 1px solid var(--line); color: var(--ink-2); }
html[data-nav="light"] .side-logo { background: var(--brand-surface); color: #fff; }
html[data-nav="light"] .side-title b { color: var(--ink); }
html[data-nav="light"] .side-title small { color: var(--ink-3); }
html[data-nav="light"] .nav-group-head { color: var(--ink-3); }
html[data-nav="light"] .nav-group-head:hover { color: var(--brand-text); }
html[data-nav="light"] .nav-item { color: var(--ink-2); }
html[data-nav="light"] .nav-item:hover { background: var(--brand-soft); color: var(--brand-text); }
html[data-nav="light"] .nav-item.active { background: var(--brand-light); color: var(--brand-text); box-shadow: none; }
html[data-nav="light"] .nav-item.active::before { background: var(--brand-surface); }
html[data-nav="light"] .side-nav::-webkit-scrollbar-thumb { background: #d5dee8; }
html[data-nav="light"] .side-brand { border-bottom-color: var(--line-2); }
html[data-nav="light"] .nav-group + .nav-group { border-top-color: var(--line-2); }
html[data-nav="light"] .side-foot { border-top-color: var(--line-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 16px; letter-spacing: .3px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  height: 30px; min-width: 40px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--line);
  background: #f7fafd; color: var(--ink-2); font-size: 12.5px; display: inline-flex;
  align-items: center; justify-content: center;
}
.lang-switch:hover { border-color: var(--brand-text); color: var(--brand-text); }

.user-chip { position: relative; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-chip:hover, .user-chip.open { background: #f5f8fc; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; color: var(--on-brand, #fff); font-size: 14px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  display: flex; align-items: center; justify-content: center;
}
.user-meta b { display: block; font-size: 13px; font-weight: 600; }
.user-meta small { display: block; color: var(--ink-3); font-size: 11px; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 136px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 60;
}
/* 头像与菜单之间的透明“桥”：鼠标划过不掉链，菜单不会闪掉 */
.user-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.user-menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 13px; }
.user-menu a:hover { background: var(--brand-light); color: var(--brand-text); }
.user-menu a.danger { color: #dc2626; }
.user-menu a.danger:hover { background: #fef2f2; color: #dc2626; }

/* ---------- 多页签 ---------- */
.tabbar {
  flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 7px 16px 0;
  background: #f7f9fc; border-bottom: 1px solid var(--line);
  position: sticky; top: 58px; z-index: 29; overflow-x: auto; overflow-y: hidden;
}
.tabbar::-webkit-scrollbar { height: 4px; }
.tabbar::-webkit-scrollbar-thumb { background: #cfdae6; border-radius: 4px; }
.tab-item {
  display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 220px;
  height: 32px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 9px 9px 0 0; background: #eef3f9; color: var(--ink-2);
  font-size: 13px; cursor: pointer; user-select: none; transition: background .15s, color .15s;
}
.tab-item:hover { background: #e4edf7; color: var(--brand-text); }
.tab-item.on { background: #fff; color: var(--brand-text); font-weight: 600; box-shadow: 0 -2px 0 var(--brand) inset; }
.tab-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-x {
  border: 0; background: none; cursor: pointer; color: #9aa9b8; font-size: 15px;
  line-height: 1; padding: 1px 3px; border-radius: 4px;
}
.tab-x:hover { background: #dbe4ee; color: #c0392b; }
.tab-pane { min-height: 100%; }

/* ================= 首页看板 ================= */
.nav-home { margin: 8px 10px 4px; border-radius: 8px; }
.home { display: flex; flex-direction: column; gap: 14px; }
.home .grow { flex: 1; }
.home .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.home-hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: 12px; color: #fff;
  background: linear-gradient(120deg, var(--brand-deep) 0%, var(--brand-mid) 55%, var(--brand-surface) 100%);
  box-shadow: var(--shadow);
}
.hero-hi { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.hero-sub { margin-top: 6px; font-size: 12.5px; color: #c7d8e8; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-dot { opacity: .5; }
.hero-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.auto-refresh { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #cfe0ee; cursor: pointer; }
.auto-refresh input { accent-color: #7fb2e0; }
.home .hero-tools .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.home .hero-tools .btn:hover { background: rgba(255,255,255,.24); color: #fff; }

.kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px 12px; box-shadow: var(--shadow);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.kpi.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi.clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 35, 55, .10); }
.kpi-label { font-size: 12.5px; color: var(--ink-2); }
.kpi-value { margin-top: 6px; font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value.small { font-size: 20px; }
.kpi-value small { margin-left: 3px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.kpi-foot { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-blue::before { background: var(--brand); }
.kpi-teal::before { background: #3fb1a0; }
.kpi-gold::before { background: #d99a3f; }
.kpi-red::before { background: #cf3b45; }
.kpi-violet::before { background: #7a6fd0; }
.kpi-orange::before { background: #e07b39; }

/* 首页「录入统计」：本月 / 本季度 / 本年，点开弹窗看明细 */
.pstat-card { margin-top: 14px; }
.pstat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.pstat {
  position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px 12px;
  cursor: pointer; background: linear-gradient(180deg, var(--brand-soft), #fff 62%);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.pstat:hover { transform: translateY(-2px); border-color: var(--brand-3); box-shadow: 0 10px 26px -14px rgba(var(--brand-rgb), .75); }
.pstat-top { display: flex; align-items: center; gap: 8px; }
.pstat-name { font-size: 13px; color: var(--ink-2); }
.pstat-badge {
  margin-left: auto; padding: 1px 7px; border-radius: 9px; font-size: 11.5px;
  background: #eef2f7; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.pstat-badge.pd-up { background: #e8f6ee; color: #17804a; }
.pstat-badge.pd-down { background: #fdecec; color: #b3363f; }
.pstat-num {
  margin-top: 6px; font-size: 30px; font-weight: 700; line-height: 1.1;
  color: var(--brand-text); font-variant-numeric: tabular-nums;
}
.pstat-num small { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.pstat-sub { margin-top: 3px; font-size: 12px; color: var(--ink-2); }
.pstat-bar { margin-top: 10px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.pstat-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .35s ease; }
.pstat-foot { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }
.pstat-go { color: var(--brand-text); opacity: .55; transition: opacity .15s; }
.pstat:hover .pstat-go { opacity: 1; }
/* 周期卡上的哈市 / 非哈市拆分 */
.pstat-area { margin-top: 7px; display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.pstat-area b { margin-left: 3px; color: var(--ink); font-weight: 600; }
.pa-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.pa-dot.hb { background: var(--brand-2); }
.pa-dot.non { background: #c99a4a; }

/* 哈市 / 非哈市 分类统计表 */
.area-card .area-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg-2, #f2f5f9); }
.area-card .seg-btn {
  border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); transition: .15s;
}
.area-card .seg-btn.on { background: #fff; color: var(--brand-text); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 38, 60, .14); }
.area-wrap { margin-top: 4px; }
.area-table { width: 100%; border-collapse: collapse; }
.area-table th, .area-table td { padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.area-table th { text-align: left; color: var(--ink-2); font-weight: 500; background: var(--bg-2, #f7f9fc); }
.area-table th.num, .area-table td.num { text-align: right; }
.area-table tbody tr:hover { background: var(--brand-soft); }
.area-table tfoot td { border-bottom: 0; border-top: 2px solid var(--line-2); font-weight: 600; background: #fbfcfe; }
.area-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.area-num {
  border: 0; background: none; padding: 2px 7px; border-radius: 7px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--brand-text); transition: .15s;
}
.area-num:hover { background: var(--brand-light); }
.area-num.zero { color: var(--ink-3); font-weight: 400; cursor: default; }
.area-num.sum { font-size: 15px; }
.area-hint { margin: 8px 2px 0; }
@media (max-width: 760px) { .area-table th, .area-table td { padding: 8px 6px; font-size: 12px; } }

/* 区域权限徽标：只有单一区域权限时，卡片上标注「哈市」或「非哈市」 */
.scope-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
  color: var(--brand-text); background: var(--brand-light); border: 1px solid rgba(var(--brand-rgb), .22);
}

/* 项目 × 月份 主合同录入表 */
.proj-card { margin-top: 14px; }
.proj-card .proj-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg-2, #f2f5f9); }
.proj-card .seg-btn {
  border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); transition: .15s; white-space: nowrap;
}
.proj-card .seg-btn.on { background: #fff; color: var(--brand-text); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 38, 60, .14); }
.proj-wrap { margin-top: 4px; overflow-x: auto; }
.proj-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.proj-table th, .proj-table td {
  padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.proj-table th { text-align: left; color: var(--ink-2); font-weight: 500; background: var(--bg-2, #f7f9fc); }
.proj-table th.num, .proj-table td.num { text-align: right; min-width: 54px; }
.proj-table th.proj-th-name, .proj-table td.proj-name {
  position: sticky; left: 0; z-index: 2; text-align: left; background: #fff;
  min-width: 130px; max-width: 210px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 1px 0 0 var(--line-2);
}
.proj-table thead th.proj-th-name { z-index: 3; background: var(--bg-2, #f7f9fc); }
.proj-table td.proj-name { font-weight: 500; color: var(--ink); }
.proj-table tbody tr:hover td { background: var(--brand-soft); }
.proj-table .proj-th-sum, .proj-table .proj-sum { color: var(--brand-text); font-weight: 700; }
.proj-table tfoot td { border-top: 2px solid var(--line-2); border-bottom: 0; background: #fbfcfe; font-weight: 600; }
.proj-foot { margin-top: 8px; text-align: center; }
.link-btn { border: 0; background: none; color: var(--brand-text); font-size: 12.5px; cursor: pointer; padding: 4px 10px; border-radius: 6px; }
.link-btn:hover { background: var(--brand-light); }
.proj-hint { margin: 6px 2px 0; }
@media (max-width: 760px) {
  .proj-table th, .proj-table td { padding: 7px 6px; font-size: 12px; }
  .proj-table th.num, .proj-table td.num { min-width: 46px; }
}

/* 首页明细弹窗 */
.pd-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pd-kpi { background: var(--brand-soft); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 13px; }
.pd-kpi span { display: block; font-size: 12px; color: var(--ink-3); }
.pd-kpi b { display: block; margin-top: 3px; font-size: 20px; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.pd-kpi b.sm { font-size: 14px; font-weight: 600; }
.pd-types { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pd-types-label { font-size: 12px; color: var(--ink-3); }
.pd-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.pd-chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pd-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-chip:hover:not(.empty) { border-color: var(--brand-3); color: var(--brand-text); }
.pd-chip.on { background: var(--brand-light); border-color: var(--brand-3); color: var(--brand-text); }
.pd-chip.on b { color: var(--brand-text); }
.pd-chip.empty { opacity: .45; cursor: default; }
.pd-chip.ghost { border-style: dashed; color: var(--ink-3); }
.table-wrap.pd-table { max-height: 42vh; border: 1px solid var(--line-2); border-radius: 10px; }
.pd-table table.grid thead th { background: var(--brand-soft); }
.pd-table .pd-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-table .pd-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pd-pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pd-page { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .pstat-row, .pd-sum { grid-template-columns: 1fr; }
  .pstat-go { opacity: 1; transform: none; }
}

.home-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.chart-card { grid-column: span 8; }
.todo-card { grid-column: span 4; }
.donut-card { grid-column: span 4; }
.rank-card { grid-column: span 8; }
.quick-card { grid-column: span 4; }
.log-card { grid-column: span 8; }

.home .card-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.home .card-head b { font-size: 14px; }
.home .card-head .hint, .home .card-head .lg { font-size: 12px; color: var(--ink-3); }
.home .card-head .more { font-size: 12.5px; }
.home .card-head .badge { margin-left: 2px; }

.chart-wrap { padding: 8px 8px 2px; position: relative; }
.chart { width: 100%; height: 252px; display: block; cursor: crosshair; }
.chart .grid line { stroke: #eef2f7; stroke-width: 1; }
.chart .grid text { font-size: 10px; fill: #9aa9b8; }
.chart .xtick { font-size: 10.5px; fill: #9aa9b8; }
.chart .xtick.hot { fill: var(--brand-text); font-weight: 700; }
.ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ln-created { stroke: var(--brand-text); }
.chart .gs-created { stop-color: var(--brand-text); }
.ln-approved { stroke: #3fb1a0; stroke-dasharray: 4 3; }
.pt-created { fill: #fff; stroke: var(--brand-text); stroke-width: 2; }
.pt-approved { fill: #3fb1a0; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 11px; height: 3px; border-radius: 2px; display: inline-block; }
.lg-created { background: var(--brand-text); }
.lg-approved { background: #3fb1a0; }

/* 图表悬停读数 */
.chart .guide { stroke: #b9c7d6; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.pt-hot { pointer-events: none; }
.pt-hot-created { fill: #fff; stroke: var(--brand-text); stroke-width: 2.4; }
.pt-hot-approved { fill: #3fb1a0; stroke: #fff; stroke-width: 1.6; }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 4;
  background: rgba(22, 34, 48, .95); color: #fff; border-radius: 8px;
  padding: 7px 11px; font-size: 12px; line-height: 1.6; white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 32, 52, .28);
}
.chart-tip::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px;
  background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 1px;
}
.chart-tip .tip-title { color: #cfe0f1; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .tip-row b { margin-left: auto; padding-left: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-tip .lg-dot { width: 10px; height: 3px; }
.chart-tip.tip-side { transform: translate(0, -100%); }
.chart-tip.tip-side::after { display: none; }
.chart-tip.tip-below { transform: translate(-50%, 0); }
.chart-tip.tip-below::after { bottom: auto; top: -4px; }
.chart-tip.tip-side.tip-below { transform: translate(0, 0); }

/* 待办 */
.todo-list { max-height: 272px; overflow: auto; }
.todo-item { padding: 9px 14px; border-bottom: 1px dashed var(--line-2); cursor: pointer; }
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: #f7fbff; }
.todo-main { display: flex; align-items: center; gap: 8px; }
.todo-main b { font-size: 13px; max-width: 48%; }
.chip-step { background: var(--brand-light); color: var(--brand-text); }
.todo-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--ink-2); }
.todo-amt { margin-left: auto; color: #b96a12; font-weight: 600; }
.todo-meta { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.empty-mini { padding: 26px 0; text-align: center; color: var(--ink-3); font-size: 12.5px; }

/* 环形分布 */
.donut-body { display: flex; align-items: center; gap: 10px; padding: 10px 14px 14px; position: relative; }
.donut { width: 158px; height: 158px; flex: none; }
.donut .seg { transition: stroke-width .15s ease, opacity .15s ease; cursor: pointer; }
.donut-body.hovering .seg { opacity: .35; }
.donut-body.hovering .seg.on { opacity: 1; stroke-width: 23; }
.donut-num { font-size: 22px; font-weight: 700; fill: #1c2733; }
.donut-cap { font-size: 10.5px; fill: #8b9aab; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dlg-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.dlg-row.on { background: #f1f6fc; }
.dlg-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dlg-name { flex: 1; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-count { font-variant-numeric: tabular-nums; }
.dlg-pct { width: 46px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 金额排行 */
.rank-list { padding: 4px 14px 12px; }
.rank-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.rank-item:last-child { border-bottom: 0; }
.rank-no {
  flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 5px;
  background: #eef2f7; color: #68809a; font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
}
.rank-no.top3 { background: var(--brand); color: var(--on-brand, #fff); }
.rank-main { flex: 1; min-width: 0; }
.rank-line { display: flex; align-items: center; gap: 8px; }
.rank-line b { font-size: 12.5px; }
.rank-amt { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--brand-text); }
.rank-bar { height: 5px; margin: 5px 0 3px; border-radius: 3px; background: #eef2f7; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand-2), var(--brand-3)); }
.rank-sub { font-size: 11.5px; color: var(--ink-3); }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 14px; }
.quick-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfdff;
  color: var(--ink); font-size: 12.5px; transition: .14s;
}
.quick-item:hover { border-color: var(--brand-3); background: var(--brand-soft); color: var(--brand-text); transform: translateY(-1px); }
.quick-ico { width: 18px; height: 18px; color: var(--brand-text); display: inline-flex; flex: none; }
.quick-ico svg { width: 100%; height: 100%; }
.quick-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 系统动态 */
.log-list { max-height: 236px; padding: 6px 14px 12px; overflow: auto; }
.log-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.log-item:last-child { border-bottom: 0; }
.log-dot { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #8b9aab; }
.dot-in { background: #2f87c8; }
.dot-add { background: #1f9d55; }
.dot-edit { background: #d99a3f; }
.dot-ok { background: #1f9d55; }
.dot-bad { background: #cf3b45; }
.log-main { flex: 1; min-width: 0; }
.log-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.log-line b { font-weight: 600; }
.log-act { color: var(--ink-2); }
.log-at { margin-left: auto; color: var(--ink-3); font-size: 11.5px; }
.log-sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 1560px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1280px) {
  .chart-card, .todo-card, .donut-card, .rank-card, .quick-card, .log-card { grid-column: span 12; }
}
@media (max-width: 760px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: 1fr; }
  .donut-body { flex-wrap: wrap; }
}

.content { flex: 1; padding: 16px 20px 26px; }

/* ================= 卡片 / 工具条 ================= */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.toolbar .grow { flex: 1; }
.toolbar .search {
  position: relative; display: flex; align-items: center;
}
.toolbar .search input {
  height: 34px; width: 246px; padding: 0 12px 0 32px; border: 1px solid var(--line);
  border-radius: 8px; background: #fbfcfe; outline: none;
}
.toolbar .search input:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(47,111,168,.12); }
.toolbar .search::before {
  content: ""; position: absolute; left: 11px; width: 13px; height: 13px;
  border: 2px solid var(--ink-3); border-radius: 50%;
}
.toolbar .search::after {
  content: ""; position: absolute; left: 22px; top: 20px; width: 6px; height: 2px;
  background: var(--ink-3); transform: rotate(45deg);
}
.toolbar select {
  height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: #fbfcfe; color: var(--ink); outline: none; max-width: 150px;
}

/* ================= 表格 ================= */
.table-wrap { overflow: auto; max-height: calc(100vh - 292px); }
.table-wrap.tall { max-height: calc(100vh - 252px); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid thead th {
  position: sticky; top: 0; z-index: 5; background: #f2f6fb; color: #33475c;
  font-weight: 600; text-align: left; padding: 9px 10px; white-space: nowrap;
  border-bottom: 1px solid var(--line); user-select: none;
}
table.grid thead th .th-in { display: flex; align-items: center; gap: 6px; }
table.grid tbody td {
  padding: 8px 10px; border-bottom: 1px solid var(--line-2); color: #2c3b4b;
  vertical-align: middle; line-height: 1.5;
}
table.grid tbody tr:hover td { background: #f8fbff; }
table.grid tbody tr.sel td { background: var(--brand-light); }
table.grid td.num { font-variant-numeric: tabular-nums; }
table.grid .ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid .op { white-space: nowrap; }
table.grid .op .btn-link + .btn-link { margin-left: 6px; }
.col-op { position: sticky; right: 0; background: #fff; box-shadow: -6px 0 12px -8px rgba(16,35,55,.28); }
thead .col-op { background: #f2f6fb; }
tbody tr:hover .col-op { background: #f8fbff; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 11px; font-size: 12px; white-space: nowrap;
}
.badge-pending { background: #fff4e5; color: #b96a12; }
.badge-approved { background: #e8f6ee; color: #17804a; }
.badge-voided { background: #fdecec; color: #b3363f; }
.badge-gray { background: #eef2f7; color: #58738d; }
.badge-blue { background: var(--brand-light); color: var(--brand-text); }
.file-flag { color: var(--ink-3); font-size: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .info { color: var(--ink-2); font-size: 13px; }
.pager .pages { display: flex; align-items: center; gap: 6px; }
.pager .pages button {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line);
  background: #fff; border-radius: 7px; cursor: pointer; color: var(--ink-2);
}
.pager .pages button:hover { border-color: var(--brand-text); color: var(--brand-text); }
.pager .pages button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .pages button:disabled { opacity: .45; cursor: not-allowed; }
.pager select { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

.empty { padding: 54px 0; text-align: center; color: var(--ink-3); }
.empty-hint { padding: 60px 0; text-align: center; color: var(--ink-3); }
.loading { padding: 40px 0; text-align: center; color: var(--ink-3); }
.spinner {
  width: 22px; height: 22px; margin: 0 auto 10px; border-radius: 50%;
  border: 2px solid #dbe5ef; border-top-color: var(--brand-2); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 弹窗 ================= */
.modal-mask {
  /* top 从页签栏下面开始：弹窗打开时顶栏、页签栏仍然可见可点，可以随时切到别的页面看 */
  position: fixed; top: 97px; right: 0; bottom: 0; left: 0;
  background: rgba(14, 30, 46, .46); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 200; padding: 16px 20px 24px;
  overflow-y: auto; animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 560px; max-width: 100%; max-height: 100%; display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.wide { width: 900px; }
.modal.xwide { width: 1120px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 15px; }
.modal-head .x { border: 0; background: none; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-head .x:hover { background: #f2f6fb; color: var(--ink); }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--line-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
/* 登录页设置：左侧表单 + 右侧实时预览 */
.brand-set { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.brand-form .brand-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.brand-imgs { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; margin: 4px 0 8px; }
.brand-img-box {
  height: 100px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg-2, #f7f9fc);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.brand-img-tip { font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.7; }
.brand-img-btns { display: flex; gap: 8px; margin-top: 8px; }
.brand-img.wide .brand-img-box { height: 100px; min-height: 100px; }
.brand-preview { position: sticky; top: 8px; }
.brand-pv-bg {
  height: 300px; border-radius: 12px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid) 45%, var(--brand-surface));
}
.brand-pv-bg.img::after {
  content: ""; position: absolute; inset: 0; background: rgba(6, 18, 32, var(--mask, .45));
}
.brand-pv-card {
  position: relative; z-index: 1; width: 100%; max-width: 250px; background: #fff; border-radius: 12px;
  padding: 16px; box-shadow: 0 16px 40px rgba(9, 24, 40, .26);
}
.brand-pv-brand { display: flex; align-items: center; gap: 10px; }
.brand-pv-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none; overflow: hidden;
  background: linear-gradient(140deg, var(--brand-2), var(--brand-3)); color: #fff;
  font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.brand-pv-logo.img { background: none; }
.brand-pv-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-pv-txt { min-width: 0; }
.brand-pv-txt b { display: block; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pv-txt small { display: block; font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pv-line { height: 8px; border-radius: 5px; background: #eef3f9; margin-top: 10px; }
.brand-pv-line.short { width: 60%; margin-top: 7px; }
.brand-pv-btn { height: 26px; border-radius: 7px; margin-top: 12px; background: linear-gradient(120deg, var(--brand-2), var(--brand-3)); }
.brand-pv-copy { margin: 10px 0 0; font-size: 10px; color: var(--ink-3); text-align: center; }
@media (max-width: 1100px) { .brand-set { grid-template-columns: 1fr; } .brand-preview { position: static; } }

.form-msg { margin-top: 8px; font-size: 13px; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }

/* ================= 抽屉（列设置） ================= */
.drawer-mask { position: fixed; inset: 0; background: rgba(14,30,46,.34); z-index: 190; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 430px; max-width: 96vw; background: #fff;
  z-index: 195; box-shadow: -10px 0 40px rgba(16,35,55,.22); display: flex; flex-direction: column;
  animation: slide .2s ease;
}
@keyframes slide { from { transform: translateX(24px); opacity: .5 } to { transform: none; opacity: 1 } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.drawer-body { flex: 1; overflow: auto; padding: 12px 16px 20px; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 10px; }
.col-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-2);
}
.col-row .nm { flex: 1; min-width: 0; font-size: 13px; }
.col-row .nm small { display: block; color: var(--ink-3); font-size: 11px; }
.col-row input[type=number] { width: 62px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; }
.col-row .lock { color: var(--ink-3); font-size: 11px; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }

/* ================= 标签页 ================= */
.tabs { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.tabs a {
  padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); border-bottom: 2px solid transparent;
}
.tabs a.on { color: var(--brand-text); border-bottom-color: var(--brand-text); font-weight: 600; }
.tabs-sub { border-top: 1px dashed var(--line-2); border-bottom: 1px solid var(--line); background: #fbfcfe; padding-left: 14px; flex-wrap: wrap; }
.tabs-sub a { padding: 9px 10px; font-size: 12.5px; }
.tabs-label { padding: 10px 6px 10px 0; font-size: 11.5px; color: #8b9aab; letter-spacing: .5px; }

/* ================= 附件列表 ================= */
.file-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #f8fbff; }
.file-row .fi { width: 26px; height: 26px; border-radius: 6px; background: var(--brand-light); color: var(--brand-text); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none; }
.file-row .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fs { color: var(--ink-3); font-size: 12px; }
.file-row.missing .fn { color: var(--ink-3); text-decoration: line-through; }
.upload-box {
  margin-top: 10px; border: 1px dashed #c6d5e4; border-radius: 8px; padding: 14px;
  text-align: center; color: var(--ink-2); font-size: 13px; background: #fafcfe; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-box:hover, .upload-box.drag { border-color: var(--brand-text); background: var(--brand-soft); color: var(--brand-text); }
/* 上传中：进度条 */
.upload-box.uploading { cursor: default; text-align: left; padding: 12px 14px; border-style: solid; border-color: #cfe0ef; background: #fbfdff; }
.upload-box.uploading:hover { border-color: #cfe0ef; background: #fbfdff; }
.up-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.up-head .up-icon {
  width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--brand-light);
  color: var(--brand-text); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
  animation: up-bounce 1.1s ease-in-out infinite;
}
@keyframes up-bounce { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }
.up-head .up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.up-head .up-pct { font-size: 15px; font-weight: 700; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.up-head .up-pct i { font-size: 11px; font-weight: 400; margin-left: 1px; }
.up-bar { height: 8px; border-radius: 99px; background: #e6eef6; overflow: hidden; position: relative; }
.up-bar i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background-image: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  transition: width .18s ease-out;
  position: relative; overflow: hidden;
}
.up-bar i::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(115deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.45) 45%, rgba(255,255,255,0) 90%);
  background-size: 200% 100%;
  animation: up-shine 1.2s linear infinite;
}
@keyframes up-shine { from { background-position: 200% 0 } to { background-position: -100% 0 } }
.up-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.up-note { margin: 6px 0 0; font-size: 12px; }

/* ================= 提示 ================= */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 18px; border-radius: 8px; background: #22384c; color: #fff; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: drop .2s ease;
}
@keyframes drop { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }
.toast-ok { background: #17804a; }
.toast-err { background: #b3363f; }
.toast-warn { background: #b96a12; }

/* ================= 系统页 ================= */
.panel { padding: 16px 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.kv .item { background: #f7fafd; border: 1px solid var(--line-2); border-radius: 9px; padding: 12px 14px; }
.kv .item b { display: block; font-size: 18px; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.kv .item span { color: var(--ink-2); font-size: 12.5px; }
.hint { color: var(--ink-3); font-size: 12.5px; line-height: 1.7; }

/* 启动占位 */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* ================= 视觉升级 ================= */
:root {
  --brand: #1c4d78;
  --brand-2: #2e77b8;
  --brand-light: #e9f2fb;
  --line: #e3e9f1;
  --bg: #f2f6fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 35, 55, .05), 0 10px 26px -16px rgba(16, 35, 55, .28);
  --shadow-lg: 0 18px 60px -20px rgba(10, 30, 50, .38);
  --ring: 0 0 0 3px rgba(46, 119, 184, .16);
}

body {
  background:
    radial-gradient(1200px 420px at 100% -8%, rgba(var(--brand-rgb), .10) 0%, rgba(var(--brand-rgb), 0) 62%),
    radial-gradient(900px 380px at -6% 100%, rgba(var(--brand-rgb), .07) 0%, rgba(var(--brand-rgb), 0) 60%),
    var(--bg);
}

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb {
  background: #c6d4e3; border-radius: 8px; border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #a7bacc; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* 侧栏：层次与选中态（配色全部走主题变量，换肤时整条菜单一起变） */
.sidebar {
  background: linear-gradient(180deg, var(--brand-deep) 0%, var(--brand-mid) 55%, var(--brand-nav) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
}
.side-brand { border-bottom: 1px solid rgba(255, 255, 255, .07); padding-bottom: 14px; }
.side-logo { background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.10)); }
.nav-item { position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, .10); }
.nav-item.active {
  background: linear-gradient(90deg, #ffffff, var(--brand-soft));
  color: var(--brand-text); font-weight: 600;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--brand-3);
}
.nav-group-head { text-transform: none; }
.nav-group + .nav-group { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.05); }

/* 顶栏：毛玻璃 */
.topbar {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(227, 233, 241, .9);
}
.topbar h2 { font-weight: 700; letter-spacing: .4px; }
.topbar h2::before {
  content: ""; display: inline-block; width: 4px; height: 15px; margin-right: 9px;
  border-radius: 3px; vertical-align: -2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
}

/* 卡片与按钮 */
.card { border-radius: var(--radius); box-shadow: var(--shadow); }
.btn { border-radius: 9px; }
.btn:hover { border-color: #bccbdb; background: #f8fbff; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-color: var(--brand); box-shadow: 0 6px 16px -8px rgba(var(--brand-rgb), .8);
  color: var(--on-brand, #fff);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); border-color: var(--brand-2); }
.btn-ok { background: linear-gradient(135deg, #17804a, #24a85f); border-color: #17804a; }
.btn-link { color: var(--brand-text); font-weight: 500; }

/* 表格 */
table.grid thead th {
  background: linear-gradient(180deg, #f6f9fd, #eaf1f9);
  color: #3a4f66; font-weight: 600; letter-spacing: .2px;
  border-bottom: 1px solid #dbe4ee;
}
table.grid tbody tr:nth-child(even) td { background: #fcfdff; }
table.grid tbody tr:hover td { background: #f2f8ff; }
table.grid tbody tr.row-off td { opacity: .55; }
table.grid tbody td { border-bottom: 1px solid #f0f4f9; }
table.grid td.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; color: #43586d; }
table.grid td.center, table.grid th.center { text-align: center; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 0; }
.empty::before {
  content: "□"; font-size: 26px; color: #c3d2e2;
}

/* 页签 */
.tabs { gap: 2px; padding: 0 16px; }
.tabs a { position: relative; transition: color .15s; }
.tabs a:hover { color: var(--brand-text); }
.tabs a.on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
}

/* 徽章 / 标签 */
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; white-space: nowrap; background: #eef2f7; color: #58738d;
}
.chip-ok { background: #e8f6ee; color: #17804a; }
.chip-warn { background: #fff4e5; color: #b96a12; }
.chip-bad { background: #fdecec; color: #b3363f; }
.tag-line { font-size: 12.5px; color: #3a4f66; }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 16px 0; }
.stat-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 35, 55, .04);
  transition: transform .16s, box-shadow .16s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(16, 35, 55, .5); }
.stat-card b { display: block; font-size: 21px; line-height: 1.2; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.stat-card span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stat-ico {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.stat-ico-blue { background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); }
.stat-ico-teal { background: linear-gradient(135deg, #158a8a, #4fc3bd); }
.stat-ico-red { background: linear-gradient(135deg, #b3363f, #e2737b); }
.stat-ico-amber { background: linear-gradient(135deg, #b96a12, #f0b15a); font-size: 13px; }

/* 表单小控件 */
.sel {
  height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbfcfe; color: var(--ink); outline: none; max-width: 170px;
}
.sel:focus { border-color: var(--brand-2); background: #fff; box-shadow: var(--ring); }
.inp-num {
  width: 66px; height: 30px; padding: 0 8px; text-align: right;
  border: 1px solid var(--line); border-radius: 7px; background: #fbfcfe;
  font-variant-numeric: tabular-nums;
}
.inp-num:focus { border-color: var(--brand-2); background: #fff; box-shadow: var(--ring); outline: none; }
.grid-func tbody tr:hover td { background: #f6faff; }

/* 弹窗头 */
.modal-head h3 { font-weight: 700; }
.modal-foot { background: #fbfcfe; border-radius: 0 0 12px 12px; }

/* 到期状态（原系统「是否到期」） */
.expired { color: #cf3b45; font-weight: 600; }
.valid { color: #1f9d55; }

/* 列表排序控件 */
.sort-group {
  display: flex; align-items: center; gap: 6px;
  padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line-2);
}
.sort-group > label { font-size: 12px; color: var(--ink-3); letter-spacing: .3px; }

/* 弹窗内的紧凑表单（两列）与勾选行 */
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 12px; }
.form2 .field { margin: 0; }
.field-inline { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.field-inline input[type=checkbox] { width: auto; height: auto; margin: 0; flex: none; }
.field-inline > span { margin: 0; color: var(--ink-2); }

/* 明文密码显示（账号管理 / 密码管理），点一下复制 */
.pwd-plain { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: #0f766e;
  background: #f0fdfa; border: 1px dashed #99f6e4; border-radius: 4px; padding: 1px 6px;
  cursor: pointer; user-select: all; }
.pwd-plain:hover { background: #ccfbf1; border-color: #2dd4bf; }

/* 附件在线查看 */
.pv-wrap { display: flex; align-items: center; justify-content: center; min-height: 56vh; }
.pv-img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 6px; }
.pv-frame { width: 100%; height: 68vh; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.pv-other { text-align: center; color: #5b6b7c; padding: 40px 0; }
.pv-other p { margin: 0 0 14px; }

/* 列表操作列的附件按钮 */
.btn-file { display: inline-flex; align-items: center; gap: 3px; }
.btn-file.zero { color: #8b9aab; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex: none; flex-direction: row; align-items: center; overflow-x: auto; }
  .side-brand { padding: 8px 10px; }
  .side-title, .side-foot { display: none; }
  .side-nav { display: flex; flex-direction: row; flex: 1; padding: 4px; overflow: visible; }
  .nav-item { height: 34px; margin: 0 2px; padding: 0 8px; }
  .nav-text { display: none !important; }
  .topbar { height: 50px; padding: 0 12px; }
  .topbar h2 { font-size: 14px; }
  .user-meta { display: none; }
  .content { padding: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .search input { width: 150px; }
  .toolbar { gap: 6px; }
  .table-wrap { max-height: calc(100vh - 230px); }
  .modal { width: 100%; }
  .drawer { width: 100%; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= 界面外观（皮肤 / 主色） ================= */
.skin-panel { display: flex; flex-direction: column; gap: 15px; }
.skin-sec-title { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.skin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.skin-card {
  position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 7px;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s;
}
.skin-card:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.skin-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .16); }
.skin-preview { height: 44px; border-radius: 6px; overflow: hidden; display: flex; }
.skin-pv-nav { width: 24%; }
.skin-pv-main { flex: 1; background: #f2f6fb; padding: 6px 6px 0; display: flex; flex-direction: column; gap: 4px; }
.skin-pv-main u { display: block; height: 6px; border-radius: 3px; background: #fff; list-style: none; }
.skin-pv-main u.w70 { width: 72%; }
.skin-pv-main u.w45 { width: 46%; background: #e8eef6; }
.skin-name { margin-top: 6px; font-size: 12px; color: var(--ink-2); text-align: center; }
.skin-card.on .skin-name { color: var(--brand-text); font-weight: 600; }
.skin-check {
  position: absolute; right: 5px; top: 5px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10px; line-height: 15px; text-align: center;
}
.skin-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.skin-color {
  width: 40px; height: 30px; padding: 1px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; cursor: pointer; flex: none;
}
.skin-hex {
  width: 100px; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px;
  font-family: Consolas, Menlo, monospace; font-size: 12.5px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink); background: #fbfcfe;
}
.skin-swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.skin-swatch {
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(15, 32, 52, .12);
}
.skin-swatch:hover { transform: scale(1.12); }
.skin-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.skin-seg button { height: 30px; padding: 0 14px; border: 0; background: #fff; color: var(--ink-2); font-size: 12.5px; cursor: pointer; }
.skin-seg button + button { border-left: 1px solid var(--line); }
.skin-seg button.on { background: var(--brand-light); color: var(--brand-text); font-weight: 600; }
.skin-tip { font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }

