/* ============================================================
   柔和拟物风格（Soft UI）
   容器与控件用"浮起/凹陷"的柔光阴影，表格区域保持干净扁平，
   否则密集数字叠上浮雕会非常难读。
   ============================================================ */

:root {
  --bg-1: #eef1fb;
  --bg-2: #e6ecfa;
  --bg-3: #f2eefb;

  --panel: #ffffff;
  --panel-2: #f4f6fd;
  --panel-3: #eceffa;
  --line: #e6eaf6;

  --text: #2b3350;
  --muted: #7b85a6;
  --faint: #a6afc8;

  --brand: #5b6ef5;
  --brand-2: #8064f0;
  --brand-soft: #e8ebff;
  --green: #14a97c;
  --green-soft: #dff5ec;
  --amber: #c8871c;
  --amber-soft: #fbeed6;
  --red: #e0475f;
  --red-soft: #fde8ec;
  --purple: #7c5cf0;
  --purple-soft: #eee9fe;

  /* 柔光阴影：左上受光、右下落影 */
  --sh-1: 4px 4px 10px rgba(146, 160, 196, .22), -4px -4px 10px rgba(255, 255, 255, .95);
  --sh-2: 7px 7px 18px rgba(146, 160, 196, .26), -6px -6px 16px rgba(255, 255, 255, .95);
  --sh-3: 12px 12px 34px rgba(132, 147, 186, .3), -8px -8px 22px rgba(255, 255, 255, .9);
  --sh-in: inset 3px 3px 7px rgba(146, 160, 196, .28), inset -3px -3px 7px rgba(255, 255, 255, .95);
  --sh-in-sm: inset 2px 2px 5px rgba(146, 160, 196, .24), inset -2px -2px 5px rgba(255, 255, 255, .95);
  --sh-brand: 4px 6px 14px rgba(91, 110, 245, .38);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-1: #191d2b;
    --bg-2: #161a26;
    --bg-3: #1d1b2e;

    --panel: #222739;
    --panel-2: #272d42;
    --panel-3: #2d3350;
    --line: #313852;

    --text: #e6eaf7;
    --muted: #9aa4c2;
    --faint: #6f7999;

    --brand: #8494ff;
    --brand-2: #a08bff;
    --brand-soft: #2b3157;
    --green: #43d3a2;
    --green-soft: #1b3b33;
    --amber: #e8b45c;
    --amber-soft: #3d3117;
    --red: #ff7a8c;
    --red-soft: #402029;
    --purple: #a78bfa;
    --purple-soft: #2d2551;

    --sh-1: 4px 4px 10px rgba(0, 0, 0, .38), -3px -3px 9px rgba(255, 255, 255, .035);
    --sh-2: 7px 7px 18px rgba(0, 0, 0, .45), -5px -5px 14px rgba(255, 255, 255, .04);
    --sh-3: 12px 12px 34px rgba(0, 0, 0, .55), -7px -7px 20px rgba(255, 255, 255, .04);
    --sh-in: inset 3px 3px 7px rgba(0, 0, 0, .45), inset -3px -3px 7px rgba(255, 255, 255, .045);
    --sh-in-sm: inset 2px 2px 5px rgba(0, 0, 0, .4), inset -2px -2px 5px rgba(255, 255, 255, .04);
    --sh-brand: 4px 6px 16px rgba(91, 110, 245, .45);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg-2);
  background-image:
    radial-gradient(1100px 700px at 12% -8%, var(--bg-3), transparent 60%),
    radial-gradient(900px 600px at 105% 8%, var(--bg-1), transparent 55%),
    linear-gradient(170deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.2px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.strong { font-weight: 650; }

/* ------------------------------- 登录 ------------------------------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--panel);
  padding: 40px 34px 34px; border-radius: 30px; box-shadow: var(--sh-3);
}
.login-logo {
  width: 62px; height: 62px; margin: 0 auto; display: block;
  filter: drop-shadow(0 8px 18px rgba(100, 120, 247, .38));
}
.login-card h1 { margin: 18px 0 4px; font-size: 22px; text-align: center; letter-spacing: .5px; }
.login-card > p { margin: 0 0 26px; text-align: center; font-size: 13px; color: var(--muted); }
.login-card label { display: block; margin-bottom: 16px; font-size: 12.5px; color: var(--muted); }
.login-card input { margin-top: 7px; }
.login-err { color: var(--red); font-size: 13px; min-height: 22px; text-align: center; }

/* ------------------------------- 布局 ------------------------------- */
#app { display: flex; min-height: 100vh; gap: 0; }

/* 侧栏尽量窄：最长的标签「项目统计表」5 个中文字约 70px，
   加图标和内外边距 180px 足够，省下的宽度都给右边的表格 */
.sidebar {
  width: 180px; flex: 0 0 180px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 16px 10px;
}
.brand {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px 12px;
  font-size: 14.5px; font-weight: 650;
}
.brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .mark {
  width: 30px; height: 30px; flex: none; display: block;
  filter: drop-shadow(0 3px 8px rgba(100, 120, 247, .3));
}
#nav { padding: 4px 0; flex: 1; overflow: auto; display: grid; gap: 3px; align-content: start; }
#nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 13px; color: var(--muted); font-size: 13.5px; font-weight: 500;
  white-space: nowrap; transition: .16s ease;
}
#nav a i {
  font-style: normal; font-size: 14px; width: 26px; height: 26px; flex: none;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--panel-2); transition: .16s ease;
}
#nav a:hover { color: var(--text); text-decoration: none; }
#nav a:hover i { box-shadow: var(--sh-1); background: var(--panel); }
#nav a.active {
  color: var(--brand); font-weight: 650; background: var(--panel); box-shadow: var(--sh-1);
}
#nav a.active i { background: var(--brand-soft); box-shadow: none; }

.side-foot { padding: 12px 4px 2px; }
.who {
  display: flex; align-items: center; gap: 6px; margin-bottom: 9px;
  font-size: 12.5px; padding-left: 6px; min-width: 0;
}
.who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; min-width: 0; padding: 22px 22px 64px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap; padding: 0 4px;
}
.page-head h2 { margin: 0; font-size: 23px; letter-spacing: .3px; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 5px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ------------------------------- 控件 ------------------------------- */
input, select, textarea {
  width: 100%; padding: 10px 14px; border: 0; border-radius: 13px;
  background: var(--panel-2); color: var(--text); font: inherit; outline: none;
  box-shadow: var(--sh-in-sm); transition: box-shadow .16s;
}
input:focus, select:focus, textarea:focus {
  box-shadow: var(--sh-in), 0 0 0 2.5px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, select:disabled, textarea:disabled { opacity: .62; }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 15px top 18px, right 10px top 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input[type=date] { min-height: 40px; }
input[type=checkbox] {
  width: 17px; height: 17px; flex: none; box-shadow: none;
  accent-color: var(--brand); cursor: pointer;
}
textarea { min-height: 70px; resize: vertical; }
label.f { display: block; font-size: 12.5px; color: var(--muted); }
label.f > span { display: block; margin-bottom: 7px; padding-left: 3px; }

.btn {
  padding: 9px 18px; border: 0; border-radius: 999px;
  background: var(--panel); color: var(--text); font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap; box-shadow: var(--sh-1);
  transition: transform .12s ease, box-shadow .16s ease, filter .16s;
}
.btn:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.btn:active { box-shadow: var(--sh-in-sm); transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--sh-brand);
}
.btn.primary:hover { filter: brightness(1.07); box-shadow: 5px 8px 20px rgba(91, 110, 245, .45); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); font-weight: 500; }
.btn.ghost:hover { background: var(--panel); box-shadow: var(--sh-1); color: var(--text); transform: none; }
.btn.sm { padding: 5px 13px; font-size: 12.5px; }
.btn.block { width: 100%; display: block; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--sh-in-sm); }

.tag {
  display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted);
  white-space: nowrap;
}
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.purple { background: var(--purple-soft); color: var(--purple); }

.seg {
  display: inline-flex; padding: 4px; border-radius: 999px;
  background: var(--panel-2); box-shadow: var(--sh-in-sm);
}
.seg button {
  padding: 6px 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  transition: .16s;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--sh-brand);
}

/* ------------------------------- 卡片 ------------------------------- */
.card {
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--sh-2);
  margin-bottom: 18px; display: flex; flex-direction: column; min-width: 0;
}
.card-head {
  padding: 17px 22px 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.card-body { padding: 6px 22px 20px; }
.card-body.flush { padding: 0 0 8px; }
.card-foot {
  padding: 12px 22px 16px; font-size: 12.5px; color: var(--faint);
  border-top: 1px solid var(--line); margin-top: auto;
}

/* KPI 磁贴 */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.kpi {
  background: var(--panel); border-radius: var(--r-lg); padding: 18px 20px 17px;
  box-shadow: var(--sh-2); transition: transform .16s ease, box-shadow .16s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .v {
  font-size: 25px; font-weight: 700; margin-top: 8px; line-height: 1.15;
  font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.6px;
}
.kpi .s { font-size: 12px; color: var(--faint); margin-top: 6px; }
.kpi.accent-red .v { color: var(--red); }
.kpi.accent-green .v { color: var(--green); }
.kpi.accent-amber .v { color: var(--amber); }
.kpi.accent-brand .v { color: var(--brand); }

/* 两栏配对布局：同行卡片等高，底边永远齐 */
.pair-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px; align-items: stretch;
}
.pair-grid > .card { margin-bottom: 0; }
@media (max-width: 1120px) { .pair-grid { grid-template-columns: 1fr; } }

/* ------------------------------- 表格 ------------------------------- */
.table-wrap { overflow-x: auto; }
.table-wrap::-webkit-scrollbar { height: 9px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 999px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  position: sticky; top: 0; z-index: 2; background: var(--panel); text-align: left;
  padding: 9px 15px 10px; font-weight: 600; color: var(--muted); font-size: 12px;
  letter-spacing: .2px; white-space: nowrap; border-bottom: 1px solid var(--line);
}
table.grid td {
  padding: 10px 15px; border-bottom: 1px solid var(--line); vertical-align: middle;
  white-space: nowrap;
}
table.grid td.wrap { white-space: normal; }
/* 长文本截断成一行，完整内容挂 title */
.ell { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ell.sm { max-width: 130px; }
table.grid tbody tr { transition: background .14s; }
table.grid tbody tr:hover { background: var(--panel-2); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tfoot td {
  background: var(--panel-2); font-weight: 650; border-bottom: 0;
  border-top: 1px solid var(--line); position: sticky; bottom: 0;
}
table.grid tfoot tr td:first-child { border-bottom-left-radius: var(--r-md); }
table.grid tfoot tr td:last-child { border-bottom-right-radius: var(--r-md); }
table.grid tr.row-danger td { background: var(--red-soft); }
table.grid tr.row-danger:hover td { background: var(--red-soft); filter: brightness(.985); }
table.grid tr.row-current td { background: var(--brand-soft); }
/* 标为无效的流水：压暗 + 金额加删除线，一眼看出不计入统计 */
table.grid tr.row-ignored td { opacity: .55; }
table.grid tr.row-ignored td.right .num { text-decoration: line-through; }

.empty { padding: 46px 20px; text-align: center; color: var(--faint); font-size: 13.5px; }
.empty b { display: block; color: var(--muted); margin-bottom: 5px; font-size: 14px; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }

/* 宽表横向滚动时，操作列钉在右边，永远点得到 */
table.grid.sticky-last th:last-child,
table.grid.sticky-last td:last-child {
  position: sticky; right: 0; background: var(--panel);
  box-shadow: -10px 0 12px -10px rgba(120, 135, 175, .35);
}
table.grid.sticky-last tbody tr:hover td:last-child { background: var(--panel-2); }
table.grid.sticky-last tr.row-danger td:last-child { background: var(--red-soft); }
table.grid.sticky-last tfoot td:last-child { background: var(--panel-2); }

.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 4px 22px 16px;
}
.filters input, .filters select { width: auto; min-width: 128px; padding: 8px 14px; font-size: 13px; }
.filters select { padding-right: 32px; background-position: right 15px top 16px, right 10px top 16px; }
.filters .grow { flex: 1; min-width: 170px; }
.filters .check {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px;
  color: var(--muted); padding: 8px 15px; border-radius: 13px;
  background: var(--panel-2); box-shadow: var(--sh-in-sm); cursor: pointer; white-space: nowrap;
}
/* 别让上面的 .filters input 规则把复选框撑成 128px 宽 */
.filters input[type=checkbox], .check input[type=checkbox] { min-width: 0; width: 17px; padding: 0; }

/* ------------------------------- 弹窗 ------------------------------- */
.modal-bg {
  /* 遮罩本身就要够暗：某些机器/浏览器 backdrop-filter 会降级失效，不能只靠模糊 */
  position: fixed; inset: 0; background: rgba(40, 48, 76, .46);
  backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; z-index: 100;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: 26px;
  width: 100%; max-width: 580px; max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(48, 58, 96, .34), -8px -8px 24px rgba(255, 255, 255, .5);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes pop { from { transform: scale(.965) translateY(8px); opacity: 0; } }
.modal.wide { max-width: 960px; }
.modal.xwide { max-width: 1200px; }
.modal-head {
  padding: 22px 26px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
.modal-head .btn { padding: 6px 12px; }
.modal-body { padding: 4px 26px 20px; overflow: auto; flex: 1; }
.modal-foot {
  padding: 16px 26px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.modal-foot .left { margin-right: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.modal .card { box-shadow: var(--sh-in-sm); background: var(--panel-2); }
.modal .card table.grid th { background: transparent; }
.modal .kpi { box-shadow: var(--sh-in-sm); background: var(--panel-2); }
.modal .kpi:hover { transform: none; box-shadow: var(--sh-in-sm); }

#toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 10px; }
.toast {
  background: var(--panel); padding: 13px 20px; border-radius: 16px;
  box-shadow: var(--sh-3); font-size: 13.5px; max-width: 400px;
  animation: slide .22s cubic-bezier(.2, .9, .3, 1.1); display: flex; gap: 10px; align-items: center;
}
.toast::before {
  content: '·'; width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--brand); color: transparent; font-size: 0;
}
.toast.err::before { background: var(--red); }
.toast.ok::before { background: var(--green); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

/* ---------------------------- 现金流 / 看板 ---------------------------- */
.flowbar { display: flex; align-items: center; gap: 4px; height: 22px; }
.flowbar .b { height: 9px; border-radius: 999px; min-width: 3px; }
.flowbar .in { background: linear-gradient(90deg, var(--green), #4fd3a8); }
.flowbar .out { background: linear-gradient(90deg, #f07a8c, var(--red)); }

.board { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 18px; }
.board::-webkit-scrollbar { height: 9px; }
.board::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 999px; }
.board-col {
  flex: 0 0 282px; background: var(--panel); border-radius: var(--r-lg);
  box-shadow: var(--sh-2); display: flex; flex-direction: column;
  transition: box-shadow .16s, transform .16s;
}
.board-col.blank { background: transparent; box-shadow: var(--sh-in-sm); }
.board-col.current { box-shadow: var(--sh-2), 0 0 0 2px var(--brand-soft); }
.board-col.drop-on { box-shadow: var(--sh-3), 0 0 0 2.5px var(--brand); transform: translateY(-3px); }
.board-col .bc-head { padding: 16px 16px 13px; border-bottom: 1px solid var(--line); }
.board-col.blank .bc-head { border-bottom-color: transparent; }
.board-col .bc-head .m { font-weight: 650; font-size: 14.5px; }
/* 用 flex + flex:none，不能用 grid：列被拉高时 grid 行会把卡片压扁，
   第三行（项目·日期）会被悄悄裁掉 */
.board-col .bc-body {
  padding: 12px; display: flex; flex-direction: column; gap: 9px;
  max-height: 60vh; overflow-y: auto;
}
.board-col .bc-body::-webkit-scrollbar { width: 7px; }
.board-col .bc-body::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 999px; }

.pay-card {
  flex: 0 0 auto;             /* 绝不允许被压缩，否则内容会被裁 */
  border-radius: var(--r-sm); padding: 11px 13px; background: var(--panel);
  box-shadow: var(--sh-1); cursor: pointer;
  border-left: 4px solid var(--faint);
  transition: transform .14s ease, box-shadow .14s ease;
}
.pay-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.pay-card.planned { border-left-color: var(--amber); }
.pay-card.incurred { border-left-color: var(--purple); }
.pay-card.paid { border-left-color: var(--green); opacity: .74; }
.pay-card .p1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pay-card .nm { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-card .p2 {
  font-size: 11.5px; color: var(--muted); margin-top: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pay-card .p2 .tag { margin-right: 4px; }
/* 费用说明：合伙人/财务扫一眼就知道这笔钱买的是什么 */
.pay-card .pay-desc {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
  font-size: 11.5px; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pay-card .pay-desc.missing { color: var(--faint); font-style: italic; }

.aging { display: grid; gap: 13px; }
.aging-row { display: grid; grid-template-columns: 112px 1fr 118px; align-items: center; gap: 14px; font-size: 13px; }
.aging-bar { height: 11px; border-radius: 999px; background: var(--panel-2); box-shadow: var(--sh-in-sm); overflow: hidden; }
.aging-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }

/* ---------------------------- 导入向导 ---------------------------- */
.steps { display: flex; gap: 10px; margin-bottom: 20px; }
.steps .st {
  flex: 1; padding: 11px 12px; border-radius: 14px; background: var(--panel-2);
  box-shadow: var(--sh-in-sm); font-size: 12.5px; color: var(--muted); text-align: center;
  font-weight: 550; transition: .2s;
}
.steps .st.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: var(--sh-brand);
}
.preview-tbl { font-size: 12px; }
.preview-tbl td, .preview-tbl th {
  padding: 7px 12px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 15px; }
.scroll-box {
  max-height: 260px; overflow: auto; border-radius: var(--r-md);
  background: var(--panel-2); box-shadow: var(--sh-in-sm); padding: 4px;
}
.scroll-box::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 999px; }
.scroll-box table.grid th { background: var(--panel-2); }

.sugg {
  border-radius: var(--r-sm); padding: 12px 15px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  background: var(--panel); box-shadow: var(--sh-1); transition: .14s;
}
.sugg:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.sugg .s1 { font-weight: 650; }
.sugg .s2 { font-size: 12px; color: var(--muted); margin-top: 3px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.hint {
  font-size: 12.5px; color: var(--muted); background: var(--panel-2);
  border-radius: var(--r-md); padding: 13px 17px; box-shadow: var(--sh-in-sm); line-height: 1.7;
}
.hint b { color: var(--text); }
.spinner {
  display: inline-block; width: 16px; height: 16px; border: 2.5px solid var(--panel-3);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 选择列表（认领弹窗） */
select[size] {
  padding: 8px; border-radius: var(--r-md); line-height: 2.1;
  background-image: none; appearance: none;
}
select[size] option { padding: 7px 12px; border-radius: 9px; }

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 50;
    flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--bg-1); box-shadow: 0 6px 18px rgba(146, 160, 196, .18);
  }
  .brand { padding: 0 6px 0 2px; font-size: 14px; }
  .brand b { display: none; }
  /* 导航优先占宽：用户名和角色标签在窄屏上让位，只留一个退出按钮 */
  #nav { display: flex; gap: 6px; padding: 0; overflow-x: auto; flex: 1; min-width: 0; }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { white-space: nowrap; padding: 8px 13px; }
  #nav a i { display: none; }
  .side-foot { padding: 0; display: flex; align-items: center; flex: none; }
  .side-foot .who { display: none; }
  .side-foot .btn.block { width: auto; padding: 7px 13px; font-size: 12.5px; }
  main { padding: 18px 14px 56px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 20px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .kpi .v { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
