/* ==========================================================================
   周边管理平台 · 高保真原型 · 设计系统
   ========================================================================== */

:root {
  /* 中性色 */
  --bg:          #F5F6F8;
  --surface:     #FFFFFF;
  --surface-2:   #FAFBFC;
  --border:      #E5E7EB;
  --border-2:    #EEF0F3;
  --text:        #14161B;
  --text-2:      #5A6172;
  --text-3:      #8B92A1;
  --text-4:      #AEB4C0;

  /* 主色 */
  --primary:     #4F46E5;
  --primary-d:   #4338CA;
  --primary-l:   #EEF0FF;
  --primary-b:   #C7CAFA;

  /* 语义色 */
  --amber:       #B45309;
  --amber-bg:    #FFF7ED;
  --red:         #C0271F;
  --red-bg:      #FEF3F2;
  --green:       #15734A;
  --green-bg:    #ECFDF3;
  --cyan:        #0E7490;
  --cyan-bg:     #ECFAFE;
  --purple:      #6D28D9;
  --purple-bg:   #F5F1FF;
  --teal:        #0F766E;
  --teal-bg:     #EAFBF7;
  --orange:      #C2410C;
  --orange-bg:   #FFF4EC;
  --blue:        #1D4ED8;
  --blue-bg:     #EEF3FF;

  /* 形状 */
  --r-sm: 6px;
  --r:    9px;
  --r-lg: 13px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 30, .05);
  --shadow:    0 1px 3px rgba(16, 20, 30, .06), 0 6px 18px -6px rgba(16, 20, 30, .08);
  --shadow-lg: 0 12px 40px -8px rgba(16, 20, 30, .18);

  --sidebar-w: 232px;
  --topbar-h: 56px;

  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
svg.i { width: 15px; height: 15px; flex: none; }
::selection { background: var(--primary-l); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D6DAE1; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C2C7D0; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 原型横幅 ---------- */
.proto-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 18px;
  background: linear-gradient(90deg, #2A2350, #3B3170);
  color: #DDD9FF;
  font-size: 12px;
  letter-spacing: .2px;
}
.proto-banner strong { color: #fff; font-weight: 600; }
.proto-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #8B7BFF; box-shadow: 0 0 0 3px rgba(139,123,255,.25);
  flex: none;
}
.proto-sep { color: #6E63A8; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - 31px); }

.sidebar {
  width: var(--sidebar-w); flex: none;
  background: #1B1D24;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: calc(100vh - 31px);
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar-thumb { background: #33363F; border-color: #1B1D24; }

.side-brand {
  padding: 16px 16px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #282B33;
}
.side-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #6D5DF6, #4F46E5);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 8px rgba(79,70,229,.4);
}
.side-brand-text { min-width: 0; }
.side-brand-name { color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: .3px; }
.side-brand-sub { color: #767D8D; font-size: 11px; }

.side-nav { padding: 10px 8px 24px; }
.nav-group-title {
  color: #5E6473; font-size: 10.5px; font-weight: 600;
  letter-spacing: 1px; padding: 14px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: var(--r-sm);
  color: #A9AFBC; font-size: 13px;
  cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
  position: relative;
}
.nav-item:hover { background: #24262E; color: #E6E8EE; }
.nav-item.active { background: #2C2A4A; color: #fff; font-weight: 500; }
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: #7C6CFF;
}
.nav-item .nav-icon { flex: none; width: 16px; height: 16px; opacity: .85; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto; background: #C0271F; color: #fff;
  font-size: 10.5px; line-height: 1; padding: 3px 6px; border-radius: 20px;
  font-weight: 600;
}

.side-foot {
  margin-top: auto; padding: 12px 16px;
  border-top: 1px solid #282B33;
  color: #5E6473; font-size: 11px;
}

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); }
.breadcrumb .bc-sep { color: var(--text-4); }
.breadcrumb .bc-cur { color: var(--text); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 6px 11px; width: 260px;
  color: var(--text-3); font-size: 12.5px;
}
.search-box input {
  border: 0; outline: 0; background: transparent; flex: 1;
  font-family: inherit; font-size: 12.5px; color: var(--text);
}
.search-box input::placeholder { color: var(--text-4); }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--text-2);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: #E5484D;
  box-shadow: 0 0 0 2px #fff;
}
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #7C6CFF, #4F46E5);
  color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.user-meta { line-height: 1.25; }
.user-name { font-size: 12.5px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-3); }

.page { padding: 22px 22px 60px; max-width: 1560px; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 18px;
}
.page-title { font-size: 19px; font-weight: 650; letter-spacing: -.2px; margin: 0 0 3px; }
.page-sub { color: var(--text-3); font-size: 12.5px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: var(--r);
  padding: 7px 13px; font-size: 12.5px; font-weight: 500;
  transition: background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #D8DCE3; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--red); border-color: #F3D2CF; background: #fff; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .i { width: 14px; height: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  margin-bottom: 16px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border-2);
}
.card-title { font-size: 13.5px; font-weight: 600; margin: 0; }
.card-title .cnt { color: var(--text-3); font-weight: 400; margin-left: 5px; font-size: 12px; }
.card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-label { color: var(--text-3); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 25px; font-weight: 650; letter-spacing: -.5px; margin-top: 4px; line-height: 1.15; }
.stat-value .unit { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-foot { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.stat.warn .stat-value { color: var(--red); }
.stat.accent .stat-value { color: var(--primary); }
.stat-bar { height: 3px; border-radius: 3px; background: var(--border-2); margin-top: 10px; overflow: hidden; }
.stat-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: #F1F2F4; color: var(--text-2);
  border: 1px solid transparent;
}
.badge .bdot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--planning  { background: #F1F2F4; color: #5A6172; }
.badge--spec      { background: var(--amber-bg);  color: var(--amber); }
.badge--specready { background: var(--blue-bg);   color: var(--blue); }
.badge--sourcing  { background: var(--cyan-bg);   color: var(--cyan); }
.badge--sampling  { background: var(--purple-bg); color: var(--purple); }
.badge--samplerev { background: var(--orange-bg); color: var(--orange); }
.badge--bulkpend  { background: var(--primary-l); color: var(--primary-d); }
.badge--bulk      { background: #FEF3C7;          color: #92400E; }
.badge--shipping  { background: var(--teal-bg);   color: var(--teal); }
.badge--received  { background: var(--green-bg);  color: #1B7A4B; }
.badge--done      { background: #DCF5E7;          color: #12633C; }
.badge--cancelled { background: #F1F2F4;          color: var(--text-3); }
.badge--overdue   { background: var(--red-bg);    color: var(--red); border-color: #F6D5D2; }
.badge--info      { background: var(--primary-l); color: var(--primary-d); }
.badge--muted     { background: #F6F7F9; color: var(--text-3); border-color: var(--border); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--text-3);
  font-size: 11.5px; letter-spacing: .3px;
  padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0;
}
table.tbl td {
  padding: 10px 14px; border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #FBFBFD; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: -.2px; }
.row-title { font-weight: 500; color: var(--text); }
.row-sub { color: var(--text-3); font-size: 11.5px; }

/* ---------- 编码 chip ---------- */
.code-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .3px;
  background: #F4F5F8; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 2px 7px;
  color: #3A3F4C; white-space: nowrap;
}
.code-chip.big { font-size: 13px; padding: 5px 10px; letter-spacing: 1px; }
.code-chip .seg { color: var(--primary); font-weight: 600; }
.code-chip .seg2 { color: #0E7490; font-weight: 600; }
.code-chip .seg3 { color: #B45309; font-weight: 600; }
.code-chip .seg4 { color: #6D28D9; font-weight: 600; }
.code-chip .seg5 { color: #C0271F; font-weight: 600; }
.copy-btn {
  border: 0; background: transparent; color: var(--text-4);
  padding: 0 0 0 2px; display: grid; place-items: center;
}
.copy-btn:hover { color: var(--primary); }
.copy-btn .i { width: 12px; height: 12px; }

.code-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11.5px; color: var(--text-3); margin-top: 8px;
}
.code-legend b { font-family: var(--mono); font-weight: 600; }

/* ---------- 键值列表 ---------- */
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 7px 12px; font-size: 12.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); }
.kv.wide { grid-template-columns: 120px 1fr; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  padding: 0 16px; background: var(--surface);
  overflow-x: auto;
}
.tab {
  padding: 10px 12px; font-size: 12.5px; color: var(--text-2);
  border: 0; background: transparent; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .cnt {
  margin-left: 5px; font-size: 11px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0 5px; border-radius: 20px;
}
.tab.active .cnt { color: var(--primary-d); background: var(--primary-l); border-color: var(--primary-b); }

/* ---------- 筛选条 ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-2);
  background: var(--surface-2);
}
.field { display: flex; align-items: center; gap: 6px; }
.field > label { color: var(--text-3); font-size: 12px; white-space: nowrap; }
select.ctl, input.ctl {
  font-family: inherit; font-size: 12.5px; color: var(--text);
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-sm); padding: 5px 9px; outline: 0;
  min-width: 0;
}
select.ctl:focus, input.ctl:focus { border-color: var(--primary-b); box-shadow: 0 0 0 3px var(--primary-l); }
.filters .spacer { margin-left: auto; }

/* ---------- 看板 ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col {
  flex: none; width: 250px; background: #EFF1F4;
  border-radius: var(--r-lg); padding: 10px;
  max-height: calc(100vh - 260px); display: flex; flex-direction: column;
}
.kanban-col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 4px 9px; font-size: 12.5px; font-weight: 600;
}
.kanban-col-head .cnt {
  margin-left: auto; color: var(--text-3); font-weight: 500; font-size: 11.5px;
  background: #fff; border-radius: 20px; padding: 1px 7px; border: 1px solid var(--border);
}
.kanban-cards { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 1px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 11px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .13s, transform .13s, border-color .13s;
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #D9DDE4; }
.kcard.overdue { border-left: 3px solid #E5484D; }
.kcard-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.kcard-name { font-size: 12.5px; font-weight: 550; line-height: 1.4; margin-bottom: 4px; }
.kcard-code { font-family: var(--mono); font-size: 10.5px; color: var(--text-4); letter-spacing: -.1px; }
.kcard-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border-2);
  font-size: 11px; color: var(--text-3);
}
.kcard-meta .mi { display: flex; align-items: center; gap: 4px; }
.kcard-meta .i { width: 12px; height: 12px; }
.kcard-flag {
  font-size: 10.5px; padding: 1px 6px; border-radius: 4px;
  background: var(--red-bg); color: var(--red); font-weight: 600;
}

/* ---------- 看板（按批次分段） ---------- */
.board-batch { margin-bottom: 14px; }
.board-batch.is-done { opacity: .78; }
.board-batch-body {
  padding: 12px; background: var(--surface-2);
  border-top: 1px solid var(--border-2);
}
.kanban.slim { padding-bottom: 2px; }
.kanban.slim .kanban-col { width: 218px; border-radius: var(--r); }
.kanban.slim .kanban-col-head { padding: 1px 3px 7px; }
.kanban.slim .kanban-cards { max-height: none; }
.board-batch .card-head { flex-wrap: wrap; row-gap: 6px; }
.board-batch .card-actions { gap: 9px; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -22px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border);
  display: grid; place-items: center;
}
.tl-dot.done { border-color: #34A853; background: #34A853; }
.tl-dot.done::after {
  content: ""; width: 5px; height: 3px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.tl-dot.cur { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.tl-dot.late { border-color: #E5484D; background: #E5484D; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title { font-size: 12.5px; font-weight: 550; }
.tl-date { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.tl-body { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.tl-item.future .tl-title { color: var(--text-3); font-weight: 400; }

/* ---------- 进度条 ---------- */
.progress { height: 6px; background: var(--border-2); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
.progress.sm { height: 4px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 5px; }

/* ---------- 布局辅助 ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--text-3); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.overdue-text { color: var(--red); font-weight: 550; }
.nowrap { white-space: nowrap; }
.section-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
.divider { height: 1px; background: var(--border-2); margin: 14px 0; }

/* ---------- 素材缩略图 ---------- */
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.asset {
  border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; background: var(--surface-2); cursor: pointer;
  transition: border-color .13s, box-shadow .13s;
}
.asset:hover { border-color: var(--primary-b); box-shadow: var(--shadow-sm); }
.asset-thumb {
  height: 92px; display: grid; place-items: center;
  color: #fff; font-size: 20px; font-weight: 600; letter-spacing: 1px;
}
.asset-meta { padding: 7px 9px; }
.asset-name { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-sub { font-size: 10.5px; color: var(--text-3); display: flex; justify-content: space-between; }

/* ---------- 头像组 ---------- */
.avatars { display: flex; }
.avatars .avatar { width: 24px; height: 24px; font-size: 10px; margin-left: -6px; border: 2px solid #fff; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- 供应商比价 ---------- */
tr.best { background: #F4FBF6 !important; }
tr.best:hover { background: #EFF9F2 !important; }
.best-flag {
  display: inline-flex; align-items: center; gap: 3px;
  color: #15734A; font-size: 11px; font-weight: 600;
}
.reject-reason { color: var(--text-3); font-size: 11.5px; }

/* ---------- 打样轮次 ---------- */
.round {
  border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 10px; overflow: hidden;
}
.round-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border-2);
}
.round-no {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 1px 7px; color: var(--text-2);
}
.round-body { padding: 10px 12px; }
.round-suppliers { display: flex; flex-direction: column; gap: 7px; }
.rs-row {
  display: grid; grid-template-columns: 150px 70px 92px 1fr;
  gap: 10px; align-items: center; font-size: 12px;
}
.rs-row .rs-sup { font-weight: 500; }
.rs-row .rs-fee { font-family: var(--mono); font-size: 11.5px; text-align: right; }
.rs-row .rs-note { color: var(--text-3); font-size: 11.5px; }
.winner-tag {
  font-size: 10.5px; font-weight: 600; color: #15734A;
  background: var(--green-bg); border-radius: 4px; padding: 1px 6px;
}

/* ---------- 视图切换 ---------- */
.seg {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r); padding: 2px;
}
.seg button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500;
}
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- toast ---------- */
.toast-root {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #1B1D24; color: #fff; font-size: 12.5px;
  padding: 9px 16px; border-radius: 20px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in .18s ease-out;
}
.toast .i { width: 14px; height: 14px; color: #7BEA9E; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 空状态 ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ---------- 条形图 ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 62px; gap: 10px; align-items: center; font-size: 12px; }
.bar-track { height: 18px; background: var(--surface-2); border-radius: var(--r-sm); overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: var(--r-sm); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11.5px; }

/* ---------- 提示块 ---------- */
.hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: #F7F8FF; border: 1px solid #E3E4FB;
  border-left: 3px solid var(--primary);
  border-radius: var(--r); padding: 11px 14px;
  font-size: 12.5px; color: #3B3F52; margin-bottom: 16px; line-height: 1.7;
}
.hint-icon { color: var(--primary); flex: none; margin-top: 2px; }
.hint b { color: var(--text); }
.hint-body { margin-top: 2px; }
.best-flag .i { width: 13px; height: 13px; }
.card-body code {
  background: #F1F2F5; border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: 11.5px;
}

/* ---------- A2 实测录入（一次性调研工具，仅管理员） ----------
   这一块是**现场手机上用**的：64 个输入框 + 每项一段「为什么记」。
   所以布局只做一件事——把「标签 → 为什么 → 输入框」压成一条竖列，
   让拇指区域的输入框永远占满整行（手机上横着放两个控件必然点偏）。 */
.a2-bar {
  height: 6px; border-radius: 3px; background: var(--border-2);
  overflow: hidden; margin: 4px 0 14px;
}
.a2-bar > i { display: block; height: 100%; background: var(--primary); transition: width .2s; }

.a2-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 10px;
}
.a2-card-main { flex: 1; min-width: 0; cursor: pointer; }
.a2-progress { margin-top: 6px; }
.a2-card .a2-bar { margin: 6px 0 0; }

.a2-sec {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  margin-bottom: 10px; overflow: hidden;
}
.a2-sec > summary {
  cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 13.5px;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.a2-sec > summary:hover { background: var(--surface-2); }
.a2-count { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-3); }
.a2-count.done { color: var(--green); }
.a2-note { padding: 0 14px 6px; line-height: 1.6; }
.a2-row { padding: 10px 14px 14px; border-top: 1px dashed var(--border-2); }
.a2-label { font-size: 13px; font-weight: 600; line-height: 1.55; color: var(--text); }
.a2-label .badge { margin-left: 4px; vertical-align: 1px; }
.a2-why { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.65; }
.a2-src { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.a2-in {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  resize: vertical; font-family: inherit; font-size: 13px; line-height: 1.6;
}
.a2-nondecidable .a2-label { color: var(--text-2); }

/* ---------- 响应式 ---------- */

/* 窄一点的桌面 / 横屏平板 */
@media (max-width: 1240px) {
  .split { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 平板：侧栏收成图标条 */
@media (max-width: 1080px) {
  :root { --sidebar-w: 62px; }
  .side-brand-text, .nav-item span:not(.nav-badge), .nav-group-title, .side-foot { display: none; }
  .nav-item { justify-content: center; }
  .nav-badge { position: absolute; top: 2px; right: 4px; margin: 0; }
  .nav-item.active::before { left: -8px; }
  .search-box { width: 170px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* 平板竖屏起，页头就允许换行 ——
   页头右侧那排控件（品牌/授权方筛选 + 按钮）加起来有 690px，
   不给换行就会把整个页面撑宽，这是移动端横向滚动的根源。 */
@media (max-width: 900px) {
  .page-head { flex-wrap: wrap; }
  .page-head-actions, .page-actions { flex-wrap: wrap; }
}

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  :root { --sidebar-w: 54px; }
  .page { padding: 14px 12px 44px; }

  /* 页头：标题独占一行，控件区换到下一行并占满 */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .page-title { font-size: 17px; }
  .page-head-actions, .page-actions {
    margin-left: 0; width: 100%; flex-wrap: wrap; gap: 6px;
  }
  /* 下拉框按剩余空间伸缩，最小 140px；放不下就换行 */
  .page-head-actions .ctl, .page-actions .ctl { flex: 1 1 140px; min-width: 0; }
  /* 勾选框那行文字单独占一行，避免和下拉框挤在一起 */
  .page-head-actions label.small { flex: 1 1 100%; }
  .page-head-actions .btn, .page-actions .btn { flex: 0 0 auto; }

  /* 触控目标：小于 36px 手指容易点偏 */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; padding: 6px 10px; }
  .nav-item { min-height: 40px; }

  /* 卡片：内边距收紧，头部控件换行 */
  .card-head { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .card-body { padding: 12px; }
  .card-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }

  .kv, .kv.wide { grid-template-columns: 76px 1fr; font-size: 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .search-box { display: none; }

  /* 表格：横向滚动（.table-wrap 已有 overflow-x），并让滚动更顺手 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 8px 10px; }

  /* 看板列窄一点，一屏能露出下一列，暗示可以横滑 */
  .kanban-col { width: 232px; max-height: calc(100vh - 220px); }

  /* 弹窗铺满可用宽度（.login-card 原本 460px 定宽） */
  .login-card { max-width: calc(100vw - 24px); }

  /* A2 实测：现场用的是手机 */
  .a2-row { padding: 10px 12px 14px; }
  .a2-sec > summary { padding: 11px 12px; }
  .a2-note { padding: 0 12px 6px; }
  /* ⚠️ 16px 是**有意义**的：iOS Safari 在聚焦 `font-size < 16px` 的输入框时
     会自动放大整页，而这一页有 64 个输入框——不修的话每点一个就跳一次版。
     这是这一页唯一一处故意偏离 .ctl 的 12.5px。 */
  .a2-in { font-size: 16px; }
}

