/* =========================================================================
   昌远供应链 CRM 管理系统 · 全局样式
   浅色企业主题 + 科技感深蓝侧边栏
   ========================================================================= */
:root {
  --brand-900: #061a33;
  --brand-800: #0b2a4a;
  --brand-700: #103761;
  --brand-600: #164e8b;
  --brand-500: #1d6fe8;
  --brand-400: #3d8bfd;
  --accent: #21c7d4;
  --accent-soft: #e6f9fb;

  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --line: #e5e9f0;
  --line-strong: #d5dbe6;

  --text: #1a2233;
  --text-2: #4a5568;
  --text-3: #8a94a6;
  --text-inv: #eaf2ff;

  --ok: #16a34a;
  --ok-bg: #eafaf0;
  --warn: #d97706;
  --warn-bg: #fff7e8;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --info: #2563eb;
  --info-bg: #eaf1fe;
  --purple: #7c3aed;
  --purple-bg: #f3edff;
  --gold: #b8860b;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .06), 0 1px 3px rgba(16, 30, 54, .04);
  --shadow: 0 2px 8px rgba(16, 30, 54, .07), 0 8px 24px rgba(16, 30, 54, .05);
  --shadow-lg: 0 12px 40px rgba(10, 26, 48, .16);
  --sidebar-w: 216px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-500); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c8d0dd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aeb8c9; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 登录页 */
#app { height: 100%; }
.login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 15% 10%, #123a66 0%, #061a33 60%, #04101f 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35;
}
.login-wrap::before { width: 520px; height: 520px; background: #1d6fe8; top: -160px; right: -100px; }
.login-wrap::after { width: 420px; height: 420px; background: #21c7d4; bottom: -140px; left: -80px; opacity: .22; }
.login-card {
  position: relative; z-index: 2; width: 880px; max-width: 94vw; min-height: 460px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: rgba(255, 255, 255, .97); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.login-left {
  padding: 44px 40px; color: #dce9ff;
  background: linear-gradient(150deg, #0b2a4a 0%, #164e8b 55%, #1d6fe8 100%);
  display: flex; flex-direction: column;
}
.login-left .logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-left .logo-mark {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  border: 1px solid rgba(255, 255, 255, .2);
}
.login-left h1 { font-size: 21px; margin: 0; letter-spacing: .5px; }
.login-left .sub { font-size: 12px; color: #9fc4f5; letter-spacing: 2px; margin-top: 2px; }
.login-left h2 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.login-left p.desc { font-size: 12.5px; line-height: 1.9; color: #b9d4f4; margin: 0 0 22px; }
.login-feature { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 11px; font-size: 12.5px; color: #cfe1fa; }
.login-feature .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.login-left .foot { margin-top: auto; font-size: 11px; color: #7ea6d6; }
.login-right { padding: 52px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-right h3 { font-size: 19px; margin: 0 0 6px; color: var(--text); }
.login-right .tip { font-size: 12px; color: var(--text-3); margin-bottom: 26px; }
.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.login-form input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: #fff; transition: .18s;
}
.login-form input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(29, 111, 232, .12); }
.login-btn {
  width: 100%; height: 42px; border: none; border-radius: var(--radius); margin-top: 8px;
  background: linear-gradient(100deg, #1d6fe8, #2f8bf5); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; letter-spacing: 1px; transition: .2s;
}
.login-btn:hover { filter: brightness(1.07); box-shadow: 0 8px 20px rgba(29, 111, 232, .34); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-err { color: var(--danger); font-size: 12px; margin-top: 10px; min-height: 16px; }
.login-accounts { margin-top: 22px; border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.login-accounts .t { font-size: 11px; color: var(--text-3); margin-bottom: 8px; }
.acc-chip {
  display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; padding: 4px 9px; margin: 0 6px 6px 0;
  border: 1px solid var(--line-strong); border-radius: 20px; cursor: pointer; background: #fff; color: var(--text-2);
}
.acc-chip:hover { border-color: var(--brand-400); color: var(--brand-500); background: #f3f8ff; }

/* ---------------------------------------------------------------- 布局 */
.layout { display: flex; height: 100%; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, var(--brand-800) 0%, #071f3a 100%);
  display: flex; flex-direction: column; color: var(--text-inv); position: relative; z-index: 20;
}
.sidebar .brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 9px; padding: 0 16px; flex: none;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar .brand .mark {
  width: 28px; height: 28px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-400), var(--accent)); font-size: 15px;
}
.sidebar .brand .txt { line-height: 1.15; }
.sidebar .brand .txt b { font-size: 13px; letter-spacing: .3px; display: block; }
.sidebar .brand .txt span { font-size: 9.5px; color: #7ea6d6; letter-spacing: 1.4px; }
.nav { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); }
.nav-group { padding: 12px 16px 5px; font-size: 10.5px; color: #5b7ea8; letter-spacing: 1.6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; margin: 1px 8px;
  border-radius: 7px; cursor: pointer; color: #b9cfe8; font-size: 13px; transition: .15s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(45, 130, 240, .32), rgba(45, 130, 240, .1)); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent);
}
.nav-item .ico { width: 17px; text-align: center; font-size: 14px; flex: none; opacity: .95; }
.nav-item .badge {
  margin-left: auto; background: #ef4444; color: #fff; font-size: 10px; min-width: 17px; height: 17px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 600;
}
.sidebar .sfoot { padding: 10px 16px 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 10.5px; color: #5b7ea8; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 18px; position: relative; z-index: 15;
}
.crumb { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.crumb b { color: var(--text); font-weight: 600; font-size: 14px; }
.gsearch { position: relative; margin-left: auto; }
.gsearch input {
  width: 250px; height: 34px; padding: 0 12px 0 32px; border: 1px solid var(--line-strong);
  border-radius: 18px; background: var(--panel-2); transition: .2s;
}
.gsearch input:focus { outline: none; border-color: var(--brand-400); background: #fff; width: 300px; box-shadow: 0 0 0 3px rgba(29, 111, 232, .1); }
.gsearch .ico { position: absolute; left: 11px; top: 9px; font-size: 13px; color: var(--text-3); }
.gs-panel {
  position: absolute; top: 42px; left: 0; width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px; max-height: 460px; overflow-y: auto;
}
.gs-group { font-size: 11px; color: var(--text-3); padding: 8px 10px 4px; }
.gs-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.gs-item:hover { background: var(--info-bg); }
.gs-item .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--text-2);
}
.topbar .icon-btn:hover { background: var(--panel-2); border-color: var(--line-strong); }
.topbar .icon-btn .dot {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 9.5px;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; cursor: pointer; border: 1px solid var(--line); }
.user-chip:hover { background: var(--panel-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none;
}
.user-chip .un { font-size: 12.5px; line-height: 1.15; }
.user-chip .un small { display: block; color: var(--text-3); font-size: 10.5px; }
.dropdown {
  position: absolute; right: 18px; top: 50px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; z-index: 60;
}
.dropdown .dd-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.dropdown .dd-item:hover { background: var(--panel-2); }
.dropdown .dd-sep { height: 1px; background: var(--line); margin: 5px 4px; }

.content { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0 0 3px; font-size: 17px; }
.page-head .desc { font-size: 12px; color: var(--text-3); }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 通用组件 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-h h3 { margin: 0; font-size: 13.5px; }
.card-h .sub { font-size: 11.5px; color: var(--text-3); }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 16px; }
.card-b.nopad { padding: 0; }

.btn {
  height: 32px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: #fff; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-400); color: var(--brand-500); background: #f6faff; }
.btn.primary { background: linear-gradient(100deg, #1d6fe8, #3d8bfd); border-color: transparent; color: #fff; font-weight: 500; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; box-shadow: 0 4px 12px rgba(29, 111, 232, .3); }
.btn.accent { background: linear-gradient(100deg, #0ea5b7, #21c7d4); border-color: transparent; color: #fff; }
.btn.danger { color: var(--danger); border-color: #f2bfbf; }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); border-color: transparent; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.lg { height: 38px; padding: 0 18px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.link { border: none; background: none; color: var(--brand-500); padding: 0 3px; height: auto; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.link.danger { color: var(--danger); }

.tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 4px;
  font-size: 11.5px; line-height: 18px; white-space: nowrap;
}
.tag.gray { background: #f1f3f7; color: var(--text-2); }
.tag.blue { background: var(--info-bg); color: var(--info); }
.tag.green { background: var(--ok-bg); color: var(--ok); }
.tag.orange { background: var(--warn-bg); color: var(--warn); }
.tag.red { background: var(--danger-bg); color: var(--danger); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.cyan { background: var(--accent-soft); color: #0e8b98; }
.tag.gold { background: #fdf6e3; color: var(--gold); }
.tag.line { background: #fff; border: 1px solid var(--line-strong); color: var(--text-2); }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters input[type=text], .filters input[type=date], .filters select {
  height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; min-width: 120px;
}
.filters input:focus, .filters select:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(29, 111, 232, .1); }
.filters .sp { margin-left: auto; }
.filters .fl { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); }

table.tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tb th {
  text-align: left; padding: 10px 12px; background: var(--panel-2); color: var(--text-2);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tb td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tb tbody tr:hover { background: #f7faff; }
table.tb tbody tr.selected { background: var(--info-bg); }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .nowrap { white-space: nowrap; }
table.tb .ops { white-space: nowrap; display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
table.tb .ops .btn { flex: none; }
.tb-wrap { overflow: auto; max-height: calc(100vh - 320px); }

.pager { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.pager .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pager select { height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; }

.empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.empty .ico { font-size: 34px; opacity: .5; margin-bottom: 8px; }
.empty .t { font-size: 13px; margin-bottom: 4px; color: var(--text-2); }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden; cursor: default;
}
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: var(--brand-400); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat .lbl { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.stat .val { font-size: 25px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat .val small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat .ext { font-size: 11.5px; color: var(--text-3); }
.stat .ext b { color: var(--brand-500); }
.stat .bg-ico { position: absolute; right: 8px; bottom: 2px; font-size: 42px; opacity: .06; }
.stat.b .val { color: var(--brand-500); }
.stat.g .val { color: var(--ok); }
.stat.o .val { color: var(--warn); }
.stat.r .val { color: var(--danger); }
.stat.p .val { color: var(--purple); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
@media (max-width: 1180px) { .grid2, .grid3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; } }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel-row .nm { width: 74px; color: var(--text-2); flex: none; }
.funnel-row .bar-wrap { flex: 1; background: #f1f4f9; border-radius: 5px; height: 24px; position: relative; overflow: hidden; }
.funnel-row .bar {
  height: 100%; border-radius: 5px; background: linear-gradient(90deg, #3d8bfd, #1d6fe8);
  display: flex; align-items: center; padding-left: 9px; color: #fff; font-size: 11.5px; min-width: 26px; transition: width .5s;
}
.funnel-row .amt { width: 108px; text-align: right; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }

/* 简易柱状图 */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 128px; padding-top: 6px; }
.bars .b { flex: 1; background: linear-gradient(180deg, #6aa8ff, #1d6fe8); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.bars .b:hover { filter: brightness(1.12); }
.bars .b span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-3); white-space: nowrap; }
.bar-x { display: flex; gap: 3px; margin-top: 4px; }
.bar-x div { flex: 1; text-align: center; font-size: 9.5px; color: var(--text-3); overflow: hidden; }

/* 进度条 */
.prog { height: 5px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3d8bfd, #1d6fe8); }

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs .tab {
  padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: .15s;
}
.tabs .tab:hover { color: var(--brand-500); }
.tabs .tab.active { color: var(--brand-500); border-bottom-color: var(--brand-500); font-weight: 600; }
.tabs .tab .cnt { font-size: 11px; color: var(--text-3); margin-left: 3px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px 16px; }
.form-grid.c1 { grid-template-columns: 1fr; }
.form-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  min-height: 32px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff;
  width: 100%; transition: .15s;
}
.field textarea { min-height: 68px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(29, 111, 232, .1); }
.field .hint { font-size: 11px; color: var(--text-3); }
.field .unit { font-size: 11.5px; color: var(--text-3); }
.section-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 4px 0 2px; padding-left: 8px;
  border-left: 3px solid var(--brand-500); line-height: 1.2;
}
.check-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chk {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line-strong);
  border-radius: 15px; cursor: pointer; font-size: 12px; background: #fff; user-select: none; transition: .15s;
}
.chk:hover { border-color: var(--brand-400); }
.chk.on { background: var(--info-bg); border-color: var(--brand-400); color: var(--brand-500); font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; }
.switch .tr { width: 34px; height: 19px; border-radius: 10px; background: #cfd7e3; position: relative; transition: .2s; }
.switch .tr::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on .tr { background: var(--brand-500); }
.switch.on .tr::after { left: 17px; }
.upload-box {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 14px; text-align: center;
  color: var(--text-3); cursor: pointer; font-size: 12px; transition: .15s; background: var(--panel-2);
}
.upload-box:hover { border-color: var(--brand-400); background: #f7faff; color: var(--brand-500); }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(12, 22, 38, .45); z-index: 100; display: flex; align-items: center; justify-content: center; animation: fade .16s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 640px; max-width: 94vw;
  max-height: 92vh; display: flex; flex-direction: column; animation: pop .18s;
}
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: .6; } }
.modal.w800 { width: 800px; }
.modal.w960 { width: 960px; }
.modal.w1080 { width: 1080px; }
.modal.w460 { width: 460px; }
.modal-h { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex: none; }
.modal-h h3 { margin: 0; font-size: 15px; }
.modal-h .sub { font-size: 11.5px; color: var(--text-3); }
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 5px; }
.modal-h .x:hover { background: var(--panel-2); color: var(--text); }
.modal-b { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; flex: none; background: var(--panel-2); border-radius: 0 0 14px 14px; }
.modal-f .left { margin-right: auto; }

/* 抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(12, 22, 38, .42); z-index: 100; animation: fade .16s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 780px; max-width: 96vw; background: #fff; z-index: 101;
  display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(10, 26, 48, .18); animation: slide .22s;
}
.drawer.w960 { width: 960px; }
@keyframes slide { from { transform: translateX(36px); opacity: .5; } }

/* Toast */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 18px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg); font-size: 13px;
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); animation: drop .2s; max-width: 70vw;
}
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }
.toast.ok { border-color: #b7e4c7; color: #12603a; background: #f3fcf6; }
.toast.err { border-color: #f3c2c2; color: #8c1c1c; background: #fef5f5; }
.toast.info { border-color: #c3d8fb; color: #18509e; background: #f5f9ff; }

/* 时间轴 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 4px; }
.tl-item::before {
  content: ''; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand-400);
}
.tl-item.ok::before { border-color: var(--ok); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.tl-head b { font-weight: 600; }
.tl-time { font-size: 11px; color: var(--text-3); }
.tl-body { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.7; white-space: pre-wrap; }

/* 看板 */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.board-col {
  width: 236px; flex: none; background: #eef1f7; border-radius: var(--radius-lg); display: flex; flex-direction: column;
  max-height: calc(100vh - 258px);
}
.board-col.drop-on { background: #dbeafe; box-shadow: inset 0 0 0 2px var(--brand-400); }
.board-col .ch { padding: 10px 12px; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; flex: none; }
.board-col .ch .cnt { background: #fff; color: var(--text-2); font-size: 11px; padding: 1px 6px; border-radius: 9px; font-weight: 500; }
.board-col .ch .sum { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 500; }
.board-col .cb { padding: 0 8px 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.bcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px;
  cursor: grab; box-shadow: var(--shadow-sm); transition: .15s;
}
.bcard:hover { box-shadow: var(--shadow); border-color: var(--brand-400); transform: translateY(-1px); }
.bcard.dragging { opacity: .45; }
.bcard .t { font-size: 12.5px; font-weight: 600; line-height: 1.5; margin-bottom: 6px; }
.bcard .m { font-size: 11.5px; color: var(--text-3); display: flex; flex-direction: column; gap: 3px; }
.bcard .amt { color: #c2410c; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.bcard .row { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.board-col .cb.dragover { background: #e8f0fe; border-radius: 8px; }

/* 详情信息组 */
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 9px 12px; font-size: 12.5px; align-items: baseline; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }
.info-block + .info-block { margin-top: 18px; }

/* 其他 */
.small { font-size: 11.5px; color: var(--text-3); }
.muted { color: var(--text-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex.wrap { flex-wrap: wrap; }
.flex.col { flex-direction: column; align-items: stretch; }
.ml-auto { margin-left: auto; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.w100 { width: 100%; }
.pre { white-space: pre-wrap; line-height: 1.75; font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.stat-inline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; }
.stat-inline .i { display: flex; align-items: baseline; gap: 5px; }
.stat-inline .i b { font-size: 17px; font-variant-numeric: tabular-nums; }
.tip-box {
  background: var(--accent-soft); border: 1px solid #bde8ed; color: #0e6b75; border-radius: var(--radius);
  padding: 9px 12px; font-size: 12px; line-height: 1.7;
}
.tip-box.warn { background: var(--warn-bg); border-color: #f5dcaa; color: #92500a; }
.tip-box.info { background: var(--info-bg); border-color: #c3d8fb; color: #1b4f9c; }
.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }
.spin {
  width: 22px; height: 22px; border: 2.5px solid #dbe3ef; border-top-color: var(--brand-500);
  border-radius: 50%; animation: sp .7s linear infinite; margin: 0 auto 10px;
}
@keyframes sp { to { transform: rotate(360deg); } }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-no { width: 19px; height: 19px; border-radius: 5px; background: #eef1f7; color: var(--text-2); font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.rank-no.t1 { background: linear-gradient(135deg, #f5b301, #f7d774); color: #6b4b00; }
.rank-no.t2 { background: linear-gradient(135deg, #b9c3d1, #dbe1ea); color: #3f4c60; }
.rank-no.t3 { background: linear-gradient(135deg, #d9a066, #f0c9a0); color: #5f3a10; }
.perm-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-head { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 9px 0; font-size: 13px; font-weight: 600; }
.acc-head .ar { margin-left: auto; color: var(--text-3); font-size: 11px; transition: .2s; }
.acc-head.open .ar { transform: rotate(90deg); }
.hscroll { overflow-x: auto; }
