/* ==========================================================================
   询价工单管理系统 · 设计系统
   浅色卡片式后台：柔和渐变底 + 圆角卡片 + 明快多色强调
   ========================================================================== */

:root {
  /* 底色与层次 */
  --bg: #f1f5fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --line: #e8edf6;
  --line-strong: #dbe3f0;

  /* 文字 */
  --ink: #0f1a2e;
  --ink-2: #4a5670;
  --ink-3: #8b97b0;
  --ink-4: #aab4c8;

  /* 主题色 */
  --brand: #3b6cff;
  --brand-deep: #2550e0;
  --brand-soft: #eaf0ff;
  --teal: #12c9b6;
  --teal-soft: #e2faf7;
  --coral: #ff7a66;
  --coral-soft: #ffefe9;
  --amber: #ffb020;
  --amber-soft: #fff6e3;
  --violet: #8b6cf6;
  --violet-soft: #f1ecff;
  --danger: #ef3f3f;
  --danger-soft: #ffecec;
  --green: #16a34a;
  --green-soft: #e9f9ef;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --shadow-1: 0 1px 2px rgba(16, 26, 46, .04), 0 6px 18px -8px rgba(16, 26, 46, .10);
  --shadow-2: 0 2px 6px rgba(16, 26, 46, .05), 0 18px 40px -18px rgba(16, 26, 46, .20);
  --shadow-pop: 0 24px 60px -20px rgba(16, 26, 46, .32);

  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Source Han Sans SC", "Noto Sans SC", system-ui, sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, var(--font);

  --nav-h: 66px;
}

* { box-sizing: border-box; }

html, body, #app { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 背景氛围：柔和光斑，避免纯色平板感 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(680px 420px at 8% -8%, rgba(59, 108, 255, .13), transparent 62%),
    radial-gradient(560px 380px at 96% 2%, rgba(18, 201, 182, .13), transparent 60%),
    radial-gradient(700px 460px at 62% 104%, rgba(255, 176, 32, .10), transparent 62%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3dced; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bcc9e0; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 顶部导航 ============================ */

.topnav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #4a7bff, #2550e0 55%, #12c9b6);
  box-shadow: 0 6px 16px -6px rgba(37, 80, 224, .7);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

.menu { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }

.menu a {
  position: relative;
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.menu a:hover { background: var(--surface-2); color: var(--ink); }
.menu a.active {
  color: var(--brand-deep);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(59, 108, 255, .16);
}
.menu a .dot {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  margin-left: 6px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}

.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer; color: var(--ink-2);
  transition: .15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-1); }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: .15s;
}
.user-chip:hover { box-shadow: var(--shadow-1); border-color: var(--line-strong); }
.user-chip .meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip .nm { font-weight: 700; font-size: 13px; }
.user-chip .rl { font-size: 11px; color: var(--ink-3); }

.avatar {
  width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #6ea8ff, #3b6cff);
  flex-shrink: 0;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; border-radius: 14px; }

.dropdown {
  position: absolute; top: calc(var(--nav-h) - 8px); right: 22px;
  width: 224px; padding: 7px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-pop);
  z-index: 80;
}
.dropdown .dd-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown .dd-head .nm { font-weight: 700; }
.dropdown .dd-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.dropdown button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-xs);
  background: transparent; cursor: pointer; text-align: left; font-size: 13.5px; font-weight: 600;
}
.dropdown button:hover { background: var(--surface-2); }
.dropdown button.danger { color: var(--danger); }

/* ============================ 页面容器 ============================ */

.page {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 26px 64px;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-title { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.025em; }
.page-sub { margin: 5px 0 0; color: var(--ink-3); font-size: 13px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); margin-bottom: 9px; }
.breadcrumb a { color: var(--brand-deep); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* ============================ 按钮 ============================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650; font-size: 13.5px;
  cursor: pointer; white-space: nowrap;
  transition: .15s;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #4a7bff, #2550e0);
  box-shadow: 0 8px 20px -10px rgba(37, 80, 224, .9);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px -10px rgba(37, 80, 224, .95); }

.btn-teal { border-color: transparent; color: #fff; background: linear-gradient(135deg, #2fd8c6, #0eb3a1); box-shadow: 0 8px 20px -10px rgba(14,179,161,.9); }
.btn-coral { border-color: transparent; color: #fff; background: linear-gradient(135deg, #ff9078, #f2603f); box-shadow: 0 8px 20px -10px rgba(242,96,63,.9); }
.btn-danger { border-color: transparent; color: #fff; background: linear-gradient(135deg, #ff6b6b, #e02020); }
.btn-danger-ghost { color: var(--danger); border-color: #ffd9d9; background: var(--danger-soft); }
.btn-ghost { background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ============================ 卡片 ============================ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.card-title { font-weight: 750; font-size: 15px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-title .bar { width: 4px; height: 15px; border-radius: 999px; background: linear-gradient(180deg, #4a7bff, #12c9b6); }
.card-sub { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }

/* ============================ KPI ============================ */

.kpi {
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi::after {
  content: ''; position: absolute; right: -28px; top: -28px;
  width: 92px; height: 92px; border-radius: 999px;
  background: var(--accent, var(--brand)); opacity: .09;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.kpi-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--brand)) 13%, white);
  color: var(--accent, var(--brand));
}
.kpi-value { font-family: var(--font-num); font-size: 29px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { margin-top: 9px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi-foot b { color: var(--accent, var(--brand)); font-weight: 700; }

/* 可下钻的 KPI 卡片：点击进入对应的询价单筛选视图 */
a.kpi-link { display: block; color: inherit; }
a.kpi-link::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .18s;
}
a.kpi-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
a.kpi-link:hover::before { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent, var(--brand)) 42%, transparent); }
a.kpi-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.kpi-go {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  padding: 16px 15px 9px;
  font-size: 11.5px; font-weight: 650; color: var(--brand-deep);
  background: linear-gradient(to top, #fff 46%, rgba(255, 255, 255, 0));
  transform: translateY(102%); opacity: 0; pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
}
a.kpi-link:hover .kpi-go, a.kpi-link:focus-visible .kpi-go { transform: translateY(0); opacity: 1; }
/* 触屏无 hover：直接常显，保证可发现性 */
@media (hover: none) {
  .kpi-go {
    position: static; transform: none; opacity: 1; background: none;
    padding: 9px 0 0; justify-content: flex-start;
  }
}

/* 环形图图例可点击下钻 */
a.dl-link { border-radius: 8px; padding: 4px 7px; margin: -4px -7px; transition: background .13s; }
a.dl-link:hover { background: var(--surface-2); }
a.dl-link:hover .nm { color: var(--brand-deep); }
a.dl-link .nm::after { content: ' ›'; opacity: 0; transition: opacity .13s; }
a.dl-link:hover .nm::after { opacity: .8; }

/* ============================ 徽标 / 标签 ============================ */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.blue { background: var(--brand-soft); color: #1d43b8; border-color: #d5e0ff; }
.tag.teal { background: var(--teal-soft); color: #068b7d; border-color: #c8f2ec; }
.tag.coral { background: var(--coral-soft); color: #c8401f; border-color: #ffdccf; }
.tag.amber { background: var(--amber-soft); color: #a76a00; border-color: #ffe9bd; }
.tag.violet { background: var(--violet-soft); color: #5b3fc4; border-color: #e0d7ff; }
.tag.green { background: var(--green-soft); color: #0f7a3a; border-color: #cdeed9; }
.tag.red { background: var(--danger-soft); color: #b91c1c; border-color: #ffcdcd; }
.tag.gray { background: #f2f4f8; color: var(--ink-3); border-color: var(--line); }
.tag.dot::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

.ov-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
/* 呼吸光环：只动 transform/opacity，走合成层，避免 box-shadow 每帧重绘 */
.ov-badge::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  border: 2px solid var(--danger);
  animation: ring 2.4s ease-out infinite;
  will-change: transform, opacity;
  pointer-events: none;
}
@keyframes ring {
  0% { transform: scale(1); opacity: .75; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-badge::after { animation: none; display: none; }
}

.countdown { font-family: var(--font-num); font-size: 12px; font-weight: 700; }
.countdown.warn { color: var(--amber); }
.countdown.over { color: var(--danger); }

/* ============================ 表格 ============================ */

.table-wrap { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; font-weight: 700; font-size: 12px; letter-spacing: .03em;
  color: var(--ink-3); text-transform: none;
  background: var(--surface-2);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr { transition: background .13s; }
table.tbl tbody tr:hover { background: #f8faff; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.row-overdue { background: linear-gradient(90deg, rgba(239, 63, 63, .075), rgba(239, 63, 63, .015) 55%, transparent); }
table.tbl tbody tr.row-overdue:hover { background: linear-gradient(90deg, rgba(239, 63, 63, .12), rgba(239, 63, 63, .03) 55%, transparent); }
table.tbl tbody tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.tbl tbody tr.row-selected { background: #f3f7ff; }

.tbl-primary { font-weight: 700; color: var(--ink); }
.tbl-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tbl-num { font-family: var(--font-num); font-weight: 700; }
.tbl-empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.mono-no { font-family: var(--font-num); font-size: 12.5px; font-weight: 700; color: var(--brand-deep); }

.thumb-xs { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }

/* ============================ 表单 ============================ */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field > label .req { color: var(--danger); margin-left: 3px; }
.field .hint { font-size: 11.5px; color: var(--ink-4); }

.input, .select, .textarea {
  width: 100%; height: 39px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 78px; padding: 10px 12px; resize: vertical; line-height: 1.55; font-family: var(--font); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(59, 108, 255, .13);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%238b97b0' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-grid { display: grid; gap: 0 15px; }
.form-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 650; font-size: 13px; transition: .15s;
}
.chip:hover { border-color: var(--brand); }
.chip.on { border-color: transparent; color: #fff; background: linear-gradient(135deg, #4a7bff, #2550e0); box-shadow: 0 6px 16px -8px rgba(37,80,224,.85); }
.chip.on.warn { background: linear-gradient(135deg, #ffc247, #f59e0b); box-shadow: 0 6px 16px -8px rgba(245,158,11,.85); }
.chip.on.danger { background: linear-gradient(135deg, #ff7a7a, #e02020); box-shadow: 0 6px 16px -8px rgba(224,32,32,.85); }
.chip.on.teal { background: linear-gradient(135deg, #2fd8c6, #0eb3a1); box-shadow: 0 6px 16px -8px rgba(14,179,161,.85); }
.chip .sub { display: block; font-size: 11px; font-weight: 600; opacity: .82; margin-top: 1px; }

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.filter-bar .input, .filter-bar .select { height: 36px; }
.filter-bar .grow { flex: 1; min-width: 190px; }
.filter-bar .sep { width: 1px; height: 22px; background: var(--line); }

/* 生效中的筛选条件提示条（从看板下钻后让用户知道看的是子集） */
.active-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--brand-soft), rgba(255, 255, 255, .4) 62%, transparent);
}
.active-filters .af-label { font-size: 12px; font-weight: 700; color: var(--brand-deep); letter-spacing: .02em; }
.af-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid #c9dcff; background: #fff; color: #1d43b8;
  font-size: 12.5px; font-weight: 650; transition: .14s;
}
.af-chip:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }
.af-chip .af-x { font-size: 14px; line-height: 1; opacity: .55; }
.af-chip:hover .af-x { opacity: 1; color: var(--danger); }
.af-reset {
  border: 0; background: transparent; cursor: pointer; padding: 0 2px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-3);
}
.af-reset:hover { color: var(--brand-deep); text-decoration: underline; }

/* 图片上传 */
.uploader { display: flex; gap: 11px; flex-wrap: wrap; }
.up-tile {
  width: 92px; height: 92px; border-radius: 12px;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-3);
  transition: .15s; text-align: center; font-size: 11.5px; line-height: 1.3;
}
.up-tile:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.up-thumb { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-thumb .del {
  position: absolute; top: 4px; right: 4px;
  width: 21px; height: 21px; border-radius: 999px; border: 0;
  background: rgba(15, 26, 46, .68); color: #fff; cursor: pointer;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.up-thumb .del:hover { background: var(--danger); }
.up-thumb .tag-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 6px; font-size: 10.5px; color: #fff;
  background: linear-gradient(transparent, rgba(15,26,46,.78));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery { display: flex; gap: 11px; flex-wrap: wrap; }
.gallery figure { margin: 0; width: 132px; }
.gallery img {
  width: 132px; height: 132px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2);
  transition: transform .18s;
}
.gallery img:hover { transform: scale(1.025); }
.gallery figcaption { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 14, 26, .86); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 30px; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 14px; box-shadow: var(--shadow-pop); }

/* ============================ 弹窗 / 抽屉 ============================ */

.mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(15, 26, 46, .42); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(760px, 96vw); max-height: 90vh;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal.wide { width: min(1020px, 96vw); }
.modal.slim { width: min(520px, 96vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 780; letter-spacing: -.02em; }
.modal-body { padding: 20px 22px; overflow: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .left { margin-right: auto; }

/* ============================ 状态流转条 ============================ */

.steps { display: flex; align-items: center; gap: 0; padding: 4px 0; }
.steps .st { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.steps .st:last-child { flex: 0 0 auto; }
.steps .node {
  width: 27px; height: 27px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--surface-2); color: var(--ink-4); border: 1.5px solid var(--line-strong);
}
.steps .lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-4); white-space: nowrap; }
.steps .line { flex: 1; height: 2px; background: var(--line-strong); margin: 0 10px; border-radius: 999px; min-width: 14px; }
.steps .st.done .node { background: var(--teal-soft); color: #07887b; border-color: #a9ece3; }
.steps .st.done .lbl { color: var(--ink-2); }
.steps .st.done .line { background: #a9ece3; }
.steps .st.active .node { background: linear-gradient(135deg, #4a7bff, #2550e0); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px rgba(59,108,255,.16); }
.steps .st.active .lbl { color: var(--brand-deep); font-weight: 750; }
.steps .st.bad .node { background: var(--danger); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px rgba(239,63,63,.16); }
.steps .st.bad .lbl { color: var(--danger); font-weight: 750; }

/* ============================ 时间线 ============================ */

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: var(--line); border-radius: 999px; }
.tl-item { position: relative; padding-bottom: 17px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 4px;
  width: 11px; height: 11px; border-radius: 999px;
  background: #fff; border: 2.5px solid var(--brand);
}
.tl-item.teal::before { border-color: var(--teal); }
.tl-item.coral::before { border-color: var(--coral); }
.tl-item.amber::before { border-color: var(--amber); }
.tl-item.red::before { border-color: var(--danger); }
.tl-item.gray::before { border-color: var(--line-strong); }
.tl-who { font-weight: 700; font-size: 13px; }
.tl-what { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.tl-when { font-size: 11.5px; color: var(--ink-4); margin-top: 3px; font-family: var(--font-num); }

/* ============================ 信息表 ============================ */

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.info-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row .k { flex: 0 0 88px; font-size: 12.5px; color: var(--ink-3); }
.info-row .v { flex: 1; font-size: 13.5px; font-weight: 600; word-break: break-word; }

.quote-row {
  display: grid; grid-template-columns: minmax(0, 1.5fr) 116px 108px 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); margin-bottom: 10px; transition: .16s;
}
.quote-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.quote-row.best { border-color: #a9ece3; background: linear-gradient(180deg, #f3fdfb, #fff); }
/* 被业务员驳回的报价：红色描边 + 浅红底，与"最低价/已选定"明确区分 */
.quote-row.rejected { border-color: #ffcdcd; background: linear-gradient(180deg, #fff7f7, #fff); }
.quote-row.rejected .quote-price { color: var(--danger); }
.quote-row.rejected .quote-price small { color: var(--ink-3); }
.quote-row.rejected:hover { border-color: #ffb3b3; }

.reject-note {
  grid-column: 1 / -1;
  margin-top: 3px; padding: 9px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px dashed #ffcdcd;
  font-size: 12.5px; line-height: 1.65; color: #a32626;
  white-space: pre-wrap; word-break: break-word;
}
.reject-note b {
  display: block; margin-bottom: 3px;
  font-size: 11.5px; letter-spacing: .02em; color: #b91c1c;
}

/* 有效报价 / 已驳回 的口径说明条 */
.quote-tally {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  border-radius: 11px; background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.quote-tally .qt { display: inline-flex; align-items: center; gap: 6px; }
.quote-tally .qt b { font-family: var(--font-num); font-weight: 750; }
.quote-tally .qt.rej { color: #b91c1c; }
.quote-tally .qt.rej b { color: var(--danger); }
.quote-row.win { border-color: #c9dcff; background: linear-gradient(180deg, #f4f8ff, #fff); box-shadow: 0 0 0 1px rgba(59,108,255,.16); }
.quote-price { font-family: var(--font-num); font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.quote-price small { font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }

/* ============================ 空态 / 加载 ============================ */

.empty { padding: 52px 24px; text-align: center; color: var(--ink-3); }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 13px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-4); }
.empty .t { font-weight: 700; color: var(--ink-2); font-size: 14.5px; margin-bottom: 5px; }
.empty .d { font-size: 12.5px; }

.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 999px; animation: spin .7s linear infinite; }
.spinner.dark { border-color: rgba(59,108,255,.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block { padding: 60px; display: grid; place-items: center; }
.loading-block .spinner { width: 26px; height: 26px; border-width: 3px; }

/* ============================ 提示 ============================ */

.toast-wrap { position: fixed; top: 82px; right: 26px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-pop); font-size: 13.5px; font-weight: 600;
  animation: slidein .22s cubic-bezier(.2,.9,.3,1.05);
}
@keyframes slidein { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
.toast .ic { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-size: 12px; margin-top: 1px; }
.toast.ok .ic { background: var(--green); }
.toast.err .ic { background: var(--danger); }
.toast.info .ic { background: var(--brand); }

/* ============================ 分页 ============================ */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.pager .pgs { display: flex; gap: 6px; align-items: center; }
.pager .pgs button {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 650; font-size: 13px;
}
.pager .pgs button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-deep); }
.pager .pgs button.on { background: var(--brand-soft); border-color: #c9dcff; color: var(--brand-deep); }
.pager .pgs button:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ 登录页 ============================ */

.login-wrap {
  position: relative; z-index: 1;
  min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr;
}
.login-art {
  position: relative; overflow: hidden;
  padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #1d2f6b 0%, #2b4bc4 42%, #0e9c9a 100%);
  color: #fff;
}
.login-art::before, .login-art::after { content: ''; position: absolute; border-radius: 999px; }
.login-art::before { width: 460px; height: 460px; right: -150px; top: -120px; background: radial-gradient(circle, rgba(255,255,255,.20), transparent 68%); }
.login-art::after { width: 380px; height: 380px; left: -120px; bottom: -140px; background: radial-gradient(circle, rgba(18,201,182,.42), transparent 68%); }
.login-art .la-head { position: relative; }
.login-art h1 { font-size: 40px; line-height: 1.22; font-weight: 800; letter-spacing: -.03em; margin: 26px 0 14px; }
.login-art p { font-size: 14.5px; color: rgba(255,255,255,.82); max-width: 460px; line-height: 1.75; margin: 0; }
.login-feats { position: relative; display: grid; gap: 11px; margin-top: 30px; }
.login-feat { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: rgba(255,255,255,.92); }
.login-feat .fi { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.16); flex-shrink: 0; }
.login-art .la-foot { position: relative; font-size: 12.5px; color: rgba(255,255,255,.62); }

.login-panel { display: grid; place-items: center; padding: 40px 28px; }
.login-card { width: min(404px, 100%); }
.login-card h2 { font-size: 23px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 6px; }
.login-card .lc-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 26px; }
.login-hint {
  margin-top: 20px; padding: 14px 16px; border-radius: 13px;
  background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--ink-2);
}
.login-hint .t { font-weight: 700; margin-bottom: 7px; color: var(--ink); }
.login-hint button {
  border: 0; background: transparent; cursor: pointer; padding: 2px 0;
  color: var(--brand-deep); font-weight: 650; font-size: 12.5px; display: block; text-align: left;
}
.login-hint button:hover { text-decoration: underline; }

/* ============================ 权限矩阵 ============================ */

.perm-grp { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-bottom: 13px; }
.perm-grp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 15px; background: var(--surface-2); font-weight: 750; font-size: 13.5px;
}
.perm-grp-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 2px; padding: 10px; }
.perm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: background .13s;
}
.perm-item:hover { background: var(--surface-2); }
.perm-item input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.perm-item.fromRole { color: var(--ink-2); }
.perm-item.over-grant { background: var(--teal-soft); }
.perm-item.over-deny { background: var(--danger-soft); }
.perm-item .mark { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.perm-item.over-grant .mark { background: #c8f2ec; color: #068b7d; }
.perm-item.over-deny .mark { background: #ffcdcd; color: #b91c1c; }

/* ============================ 图表 ============================ */

.chart-box { width: 100%; overflow: hidden; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.chart-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { flex: 1; min-width: 168px; display: grid; gap: 9px; }
.donut-legend .dl { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.donut-legend .dl .sw { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.donut-legend .dl .nm { flex: 1; color: var(--ink-2); font-weight: 600; }
.donut-legend .dl .vl { font-family: var(--font-num); font-weight: 750; }

/* ============================ 工具类 ============================ */

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row.tight { gap: 6px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-4); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.clickable { cursor: pointer; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ 响应式 ============================ */

@media (max-width: 1280px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .grid-main, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: span 1; }
  .form-grid.c3, .form-grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
}

@media (max-width: 760px) {
  :root { --nav-h: 60px; }
  .page { padding: 16px 14px 52px; }
  .topnav { padding: 0 14px; gap: 12px; }
  .brand-text, .user-chip .meta { display: none; }
  .menu { gap: 2px; }
  .menu a { padding: 7px 11px; font-size: 12.5px; }
  .grid-4, .grid-5, .form-grid.c2, .form-grid.c3, .form-grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 20px; }
  .kpi-value { font-size: 24px; }
  .quote-row { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .quote-row .qr-actions { display: flex; gap: 8px; }
  .modal { max-height: 94vh; }
  .card-body { padding: 14px; }
  .filter-bar { padding: 12px 14px; }
  .toast-wrap { right: 12px; left: 12px; }
  .toast { max-width: none; }
  .steps { overflow-x: auto; }
  .steps .lbl { font-size: 11.5px; }
}

@media (max-width: 620px) {
  .hide-sm { display: none !important; }
  .page-head { align-items: flex-start; }
  .table-wrap { overflow-x: auto; }
  table.tbl { min-width: 720px; }
}

/* ============================ 站内提醒（通知） ============================ */

.icon-btn.bell { position: relative; }
.bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.dropdown.notify-dd {
  width: 392px;
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: hidden;
}
.nt-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid var(--line);
}
.nt-head .nm { font-weight: 750; }
.nt-head .sub { font-size: 12px; color: var(--ink-3); }

.nt-list { max-height: 58vh; overflow: auto; padding: 6px; }
.nt-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 11px; border-radius: 11px;
  text-decoration: none; color: inherit;
}
.nt-item:hover { background: var(--surface-2); }
.nt-item.unread { background: linear-gradient(90deg, var(--brand-soft), transparent 72%); }

.nt-dot {
  width: 8px; height: 8px; margin-top: 5px; flex-shrink: 0;
  border-radius: 999px; background: var(--ink-3);
}
.nt-dot.blue { background: var(--brand); }
.nt-dot.teal { background: var(--teal); }
.nt-dot.red { background: var(--danger); }
.nt-dot.violet { background: var(--violet); }

.nt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-title { font-size: 13.5px; font-weight: 700; }
.nt-body { font-size: 12.5px; color: var(--ink-2); word-break: break-word; }
.nt-meta { font-size: 11.5px; color: var(--ink-4); }
.nt-empty { padding: 28px 0; text-align: center; color: var(--ink-3); font-size: 13px; }

.nt-readall {
  display: block; width: 100%; padding: 11px;
  border: 0; border-top: 1px solid var(--line);
  background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--brand-deep);
}
.nt-readall:hover { background: var(--surface-2); }

/* ============================== 留言板 ============================== */

.cmt-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cmt { display: flex; gap: 10px; align-items: flex-start; }
.cmt-main {
  flex: 1; min-width: 0;
  padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.cmt.mine .cmt-main { background: var(--brand-soft); border-color: #cfe0ff; }
.cmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.cmt-head b { font-size: 13.5px; }
.cmt-body {
  font-size: 13.5px; line-height: 1.72; color: var(--ink);
  word-break: break-word; white-space: pre-wrap;
}
.cmt-del {
  margin-left: auto; padding: 2px 4px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-4); cursor: pointer;
}
.cmt-del:hover { color: var(--danger); background: var(--danger-soft); }
.cmt-form { border-top: 1px dashed var(--line); padding-top: 14px; }
.cmt-form .input { width: 100%; min-height: 74px; line-height: 1.7; resize: vertical; }

/* 上传区里数据异常的图片 */
.up-broken {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 100%; height: 100%;
  background: var(--danger-soft); color: var(--danger); font-size: 11.5px;
}

/* 供应商介绍信息被隐藏 */
.intro-hidden {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-radius: 11px;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  color: var(--ink-3); font-size: 13px;
}

.avatar.sm { width: 26px; height: 26px; font-size: 12px; }

@media (max-width: 760px) {
  .dropdown.notify-dd { right: 10px; width: calc(100vw - 20px); }
}

/* ==================== 已加入比价但尚未报价的供应商行 ==================== */

.quote-row.pending {
  border-style: dashed;
  background: linear-gradient(180deg, #fbfcff, var(--surface));
}
.quote-row.pending:hover { border-color: var(--line-strong); }

/* ============ 「找不到？直接新增一家供应商」折叠区 ============ */

.new-sup {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.new-sup > summary {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 700; color: var(--brand-deep);
}
.new-sup > summary::-webkit-details-marker { display: none; }
.new-sup > summary:hover { color: var(--brand); }
.new-sup[open] > summary { margin-bottom: 4px; }

/* ======================= 柱状图（DOM 实现，真实像素） =======================
   不用拉伸的 SVG 坐标系，避免圆角被压扁、柱子过粗、文字被横向拉宽。
   柱宽上限 22px、轴标签 11.5px，全部按像素控制。 */

.bar-chart { width: 100%; }

.bc-plot {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 22px;              /* 给柱顶数值标签留出空间 */
}

/* 背景网格线 */
.bc-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.bc-grid i { display: block; height: 1px; background: var(--line); }
.bc-grid i:last-child { background: var(--line-strong); }

.bc-col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bc-bar {
  position: relative;
  display: block;
  width: 100%;
  max-width: 22px;                /* 柱宽按像素封顶，不再被拉伸变粗 */
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #7fa2ff 0%, #3b6cff 100%);
  box-shadow: 0 2px 6px rgba(59, 108, 255, .18);
  transition: filter .15s ease;
}
.bc-col:hover .bc-bar { filter: brightness(1.07); }

.bc-bar.last {
  background: linear-gradient(180deg, #52e0cf 0%, #12c9b6 100%);
  box-shadow: 0 2px 6px rgba(18, 201, 182, .2);
}
.bc-bar.is-zero {
  height: 2px !important;
  border-radius: 2px;
  background: var(--line-strong);
  box-shadow: none;
}

/* 柱顶数值 */
.bc-val {
  position: absolute;
  left: 50%;
  top: -17px;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-2);
  white-space: nowrap;
}
.bc-val.last { color: #0e9d8d; }

/* x 轴标签：与柱子列一一对齐 */
.bc-axis { display: flex; gap: 10px; margin-top: 9px; }
.bc-x {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================ 站点备案信息 ============================ */
/*
 * 备案号展示位：主界面页脚 + 登录页底部。
 * 遵守一条铁律：**没填就不渲染**（整块 hidden），
 * 不能因为它留出一条空白横条 —— 公安号还没批下来时就是这种状态。
 */

.site-foot {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 26px 30px;
}
.site-foot[hidden] { display: none; }

.site-foot .sf-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.site-foot .sf-note { font-weight: 600; color: var(--ink-2); }
.site-foot .sf-beian { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-foot .sf-beian a,
.login-beian a { color: var(--ink-3); text-decoration: none; }
.site-foot .sf-beian a:hover,
.login-beian a:hover { color: var(--brand-deep); text-decoration: underline; }
.site-foot .sf-beian img,
.login-beian img { vertical-align: middle; }

.beian-sep { color: var(--line-strong); margin: 0 6px; }

/* 登录页 / 初始化页的一行备案号 */
.login-beian {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.9;
}
.login-beian .beian-sep { display: inline-block; }

/* 备案设置页的实时预览框 */
.preview-box {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--ink-3);
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.9;
}
.preview-box.center { justify-content: center; }

@media (max-width: 720px) {
  .site-foot { padding: 0 16px 22px; }
  .site-foot .sf-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ==========================================================================
   手机端修补：导航可达性 + 「卡片 / 表格」视图
   —— 手机端原来的问题是：① 顶栏 8 个菜单项在窄屏放不下、后面几个点不到；
      ② table.tbl 被强制 min-width:720px，只能左右滑。
      这里全部在 max-width:760px 内生效（卡片视图另有一段 >=761px 的，方便在电脑上预览），
      所以桌面端布局不变。
   ========================================================================== */

/* ---------- 顶栏：☰ 菜单按钮（只在窄屏出现）---------- */
.nav-toggle {
  display: none;
}
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }
  /* 窄屏下顶栏菜单条让位给 ☰（链接改由抽屉提供），避免被裁切 */
  .menu {
    display: none;
  }
}

/* ---------- 抽屉菜单 ---------- */
.nav-sheet {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #E5E8EF);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 10px 12px 14px;
  max-height: calc(100dvh - var(--nav-h) - 20px);
  overflow-y: auto;
}
.nav-sheet .ns-head {
  font-size: 12px;
  color: var(--ink-3, #6b7280);
  padding: 4px 6px 8px;
}
.nav-sheet .ns-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.nav-sheet .ns-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line, #E5E8EF);
  border-radius: 12px;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
}
.nav-sheet .ns-links a.active {
  border-color: var(--accent, #3b6cff);
  color: var(--accent, #3b6cff);
  font-weight: 600;
}
.nav-sheet .ns-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line, #E5E8EF);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-3, #6b7280);
}
.nav-sheet .ns-foot .view-toggle {
  margin-left: auto;
}

/* ---------- 「卡片 / 表格」开关 ---------- */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line, #E5E8EF);
  border-radius: 999px;
  background: var(--surface, #fff);
}
.view-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--ink-3, #6b7280);
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  padding: 8px 12px;
  min-height: 32px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.view-toggle-btn.is-on {
  background: var(--accent, #3b6cff);
  color: #fff;
}
/* 顶栏里那枚在窄屏只显示「卡 / 表」两个字，省地方 */
@media (max-width: 760px) {
  .nav-right .view-toggle-btn {
    padding: 8px 9px;
    font-size: 12px;
  }
}

/* ---------- 卡片视图（窄屏：2 列月份/字段）---------- */
@media (max-width: 760px) {
  body[data-view='card'] .table-wrap {
    overflow-x: visible;
  }
  body[data-view='card'] table.tbl {
    display: block;
    width: 100%;
    min-width: 0 !important; /* 覆盖 620px 断点里的 min-width:720px */
  }
  body[data-view='card'] table.tbl thead {
    display: none;
  }
  body[data-view='card'] table.tbl tbody {
    display: block;
  }
  body[data-view='card'] table.tbl tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px 14px;
    margin: 0 0 10px;
    border: 1px solid var(--line, #E5E8EF);
    border-radius: 14px;
    background: var(--surface, #fff);
  }
  body[data-view='card'] table.tbl tr > * {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    white-space: normal;
  }
  /* 首列（单号 / 名称 / 时间）做成卡片标题 */
  body[data-view='card'] table.tbl tr > *:first-child {
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line, #E5E8EF);
  }
  body[data-view='card'] table.tbl tr > *:first-child::before {
    display: none; /* 标题格不再重复显示列名 */
  }
  body[data-view='card'] table.tbl td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    line-height: 1.4;
    color: var(--ink-3, #6b7280);
    margin-bottom: 2px;
  }
  body[data-view='card'] table.tbl tr:hover {
    background: var(--surface, #fff);
  }
}

/* ---------- 卡片视图（电脑上也能切，方便预览手机排版）---------- */
@media (min-width: 761px) {
  body[data-view='card'] .table-wrap {
    overflow-x: visible;
  }
  body[data-view='card'] table.tbl {
    display: block;
    width: 100%;
    min-width: 0 !important;
  }
  body[data-view='card'] table.tbl thead {
    display: none;
  }
  body[data-view='card'] table.tbl tbody {
    display: block;
  }
  body[data-view='card'] table.tbl tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px 16px;
    margin: 0 0 12px;
    border: 1px solid var(--line, #E5E8EF);
    border-radius: 14px;
    background: var(--surface, #fff);
  }
  body[data-view='card'] table.tbl tr > * {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    white-space: normal;
  }
  body[data-view='card'] table.tbl tr > *:first-child {
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--line, #E5E8EF);
  }
  body[data-view='card'] table.tbl tr > *:first-child::before {
    display: none;
  }
  body[data-view='card'] table.tbl td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    line-height: 1.4;
    color: var(--ink-3, #6b7280);
    margin-bottom: 2px;
  }
}

/* 窄屏下环形图居中：
   .donut-wrap 是 flex + wrap，环形图固定 158px、flex-shrink:0，图例（min-width:168px）换行后，
   环形图就孤零零留在左边（右边一大片空白）。这里在窄屏改成竖排并把环形图居中，图例仍占满整行。
   注意只在 ≤760px 生效 —— 桌面端"环形图在左、图例在右"的排版不动。 */
@media (max-width: 760px) {
  .donut-wrap {
    flex-direction: column;
    align-items: center;
  }
  .donut-wrap > .donut-legend {
    width: 100%;
  }
}

/* 窄屏顶栏精简：把「显示方式」开关从顶栏撤掉（顶栏挤了 ☰ + 开关 + 铃铛 + 刷新 + 头像）。
   它仍留在 ☰ 抽屉底部，手机上一路可达；电脑端（≥761px）顶栏那个继续保留，
   方便在电脑上直接切换核对手机排版。 */
@media (max-width: 760px) {
  .nav-right > .view-toggle {
    display: none;
  }
}
