/* ========= 全局变量 & Reset ========= */
:root {
  --color-primary: #1677ff;
  --color-primary-hover: #4096ff;
  --color-primary-light: #e6f4ff;
  --color-success: #52c41a;
  --color-success-light: #f6ffed;
  --color-warning: #faad14;
  --color-warning-light: #fffbe6;
  --color-danger: #f5222d;
  --color-danger-light: #fff1f0;
  --color-black: #000;
  --color-text-1: #333;
  --color-text-2: #666;
  --color-text-3: #999;
  --color-border: #e5e7eb;
  --color-bg: #fafafa;
  --color-white: #fff;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.12);
  --header-height: 56px;
  --sidebar-width: 220px;
  --sidebar-width-collapsed: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--color-text-1);
  background: var(--color-bg);
  height: 100%;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
table { border-collapse: collapse; width: 100%; }

/* ========= 顶部进度条 ========= */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  width: 0;
  z-index: 9999;
  transition: width .3s ease, opacity .3s ease;
  opacity: 0;
  box-shadow: 0 0 6px rgba(22, 119, 255, 0.5);
}
.progress-bar.active { opacity: 1; }

/* ========= Header ========= */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-left { display: flex; align-items: center; gap: 8px; width: var(--sidebar-width); }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 17px; font-weight: 700; color: var(--color-text-1); letter-spacing: 0.5px; }
.header-center { flex: 1; text-align: center; }
.page-title { font-size: 16px; font-weight: 600; color: var(--color-text-1); }
.header-right { display: flex; align-items: center; gap: 12px; }

/* 顶部全局搜索框（默认显示，hover/focus 微交互） */
.global-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--color-white);
  border: 1px solid var(--color-border, #d9d9d9); border-radius: 20px;
  padding: 5px 12px; cursor: pointer;
  width: 210px; box-sizing: border-box;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}
.global-search:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 2px 10px rgba(22, 119, 255, .18);
  transform: translateY(-1px);
}
.global-search:focus-within,
.global-search.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .15);
  transform: scale(1.02);
}
.global-search .gs-icon { font-size: 14px; transition: transform .2s ease; }
.global-search:hover .gs-icon { transform: scale(1.2) rotate(-8deg); }
.global-search .gs-input {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: #333; flex: 1; min-width: 0; cursor: pointer;
}
.global-search .gs-input::placeholder { color: #999; }
.global-search .gs-shortcut {
  font-size: 11px; color: #bbb; background: #f5f5f5;
  border: 1px solid #eee; border-radius: 4px; padding: 1px 5px;
  transition: color .2s ease, border-color .2s ease;
}
.global-search:hover .gs-shortcut { color: var(--color-primary); border-color: var(--color-primary-light); }

/* 顶部全局搜索下拉面板（附着在搜索框下方，输入提示与大模型状态都显示在顶部） */
.global-search-panel {
  position: fixed; z-index: 1200;
  background: var(--color-white);
  border: 1px solid #e8e8e8; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 14px; width: 400px; max-width: 92vw;
  max-height: 72vh; overflow: auto;
  box-sizing: border-box;
  animation: gs-panel-in .18s ease;
}
.global-search-panel.hidden { display: none; }
@keyframes gs-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-demo {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-primary);
  background: var(--color-white);
  color: var(--color-primary);
  transition: all .2s;
}
.btn-demo:hover { background: var(--color-primary-light); }
.badge-demo { font-weight: 600; font-size: 12px; }
.badge-demo.off { color: var(--color-text-3); border-color: var(--color-text-3); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  cursor: pointer;
}

/* ========= Body 布局 ========= */
.app-body {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--color-white);
  border-right: 1px solid var(--color-border);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 90;
  transition: width .25s ease;
}
.sidebar-nav { padding: 12px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--color-text-2);
  border-left: 3px solid transparent;
  transition: all .15s;
  cursor: pointer;
}
.nav-item:hover { background: #f5faff; color: var(--color-primary); }
.nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
}
.nav-icon { font-size: 18px; min-width: 22px; text-align: center; }
.nav-text { white-space: nowrap; overflow: hidden; }

.main-container {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 20px;
  min-height: calc(100vh - var(--header-height));
  transition: margin-left .25s ease;
}

/* ========= 通用组件 ========= */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--color-text-3);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  border: 1px solid transparent;
  line-height: 1.4;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:disabled { background: #a0cfff; cursor: not-allowed; }
.btn-default {
  background: var(--color-white);
  border-color: var(--color-border);
  color: var(--color-text-1);
}
.btn-default:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-link { color: var(--color-primary); padding: 4px 8px; }
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { color: var(--color-text-3); cursor: not-allowed; text-decoration: none; }
.btn-ghost {
  background: transparent;
  border: 1px dashed var(--color-border);
  color: var(--color-text-2);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-1);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title .sub-info { font-size: 12px; color: var(--color-text-3); font-weight: normal; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-red { background: var(--color-danger-light); color: var(--color-danger); }
.badge-yellow { background: var(--color-warning-light); color: var(--color-warning); }
.badge-green { background: var(--color-success-light); color: var(--color-success); }
.badge-blue { background: var(--color-primary-light); color: var(--color-primary); }
.badge-purple { background: #efe7ff; color: #7c3aed; }
.badge-gray { background: #f0f0f0; color: var(--color-text-2); }
.badge-level-red { background: var(--color-danger); color: #fff; }
.badge-level-yellow { background: var(--color-warning); color: #fff; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-label {
  font-size: 13px; color: var(--color-text-2);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--color-text-1); line-height: 1.1; }
.stat-card .stat-icon {
  position: absolute;
  right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 36px; opacity: 0.2;
}
.stat-card.danger .stat-value { color: var(--color-danger); }
.stat-card.warning .stat-value { color: var(--color-warning); }
.stat-card.success .stat-value { color: var(--color-success); }

.corner-badge {
  position: absolute;
  top: 10px; right: 10px;
  min-width: 22px; height: 22px;
  border-radius: 11px;
  padding: 0 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.corner-badge.red { background: var(--color-danger); }
.corner-badge.yellow { background: var(--color-warning); }

/* ========= 首页待办 ========= */
.todo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.todo-list { list-style: none; }
.todo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: #fafafa;
  border-left: 3px solid var(--color-primary);
  transition: background .15s;
}
.todo-list li:hover { background: #f0f7ff; }
.todo-list li.red { border-left-color: var(--color-danger); }
.todo-list li.yellow { border-left-color: var(--color-warning); }
.todo-list .todo-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--color-text-1);
}
.todo-list .todo-type { font-size: 11px; color: var(--color-text-3); }

.quick-entry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quick-entry-card {
  background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
  border: 1px solid #d6e8ff;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow);
}
.quick-entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.quick-entry-card .entry-icon { font-size: 40px; margin-bottom: 10px; }
.quick-entry-card .entry-title { font-size: 16px; font-weight: 600; color: var(--color-text-1); }
.quick-entry-card .entry-desc { font-size: 12px; color: var(--color-text-3); margin-top: 4px; }

/* ========= 表格 ========= */
.data-table { width: 100%; background: var(--color-white); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: var(--color-text-2);
  font-size: 12px;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #fafbff; }
.data-table tbody tr.error-row { background: var(--color-danger-light); }
.data-table tbody tr.error-row td { color: var(--color-danger); }

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ========= Tabs ========= */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 16px;
}
.tab-item {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--color-text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.tab-item:hover { color: var(--color-primary); }
.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.tab-item .count {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--color-bg);
  color: var(--color-text-2);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.tab-item.active .count { background: var(--color-primary-light); color: var(--color-primary); }

.subtabs { display: flex; gap: 0; margin-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.subtab-item {
  padding: 8px 16px;
  cursor: pointer;
  color: var(--color-text-2);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subtab-item:hover { color: var(--color-primary); }
.subtab-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* ========= 步骤条 ========= */
.stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 8px 20px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow-x: auto;
  gap: 4px;
}
.step {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  gap: 6px;
  padding: 0 4px;
}
.step::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}
.step:last-child::after { display: none; }
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #f0f0f0;
  color: var(--color-text-3);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  font-size: 13px;
  border: 2px solid var(--color-border);
  transition: all .2s;
}
.step-label { font-size: 12px; color: var(--color-text-3); text-align: center; max-width: 80px; }
.step.done .step-circle { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.step.done::after { background: var(--color-success); }
.step.done .step-label { color: var(--color-success); font-weight: 600; }
.step.current .step-circle { background: var(--color-primary); color: #fff; border-color: var(--color-primary); transform: scale(1.1); }
.step.current .step-label { color: var(--color-primary); font-weight: 600; }

/* ========= 发货流程双栏 ========= */
.shipment-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.shipment-list-card { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; max-height: 640px; overflow-y: auto; }
.shipment-list-card .card-title { font-size: 14px; padding: 0 8px 10px; border-bottom: 1px solid var(--color-border); margin-bottom: 10px; }
.shipment-list { list-style: none; }
.shipment-list .ship-item {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.ship-item:hover { border-color: var(--color-primary); background: #f5faff; }
.ship-item.active { border-color: var(--color-primary); background: var(--color-primary-light); }
.ship-item .ship-no { font-weight: 600; font-size: 13px; color: var(--color-text-1); margin-bottom: 4px; }
.ship-item .ship-info { font-size: 12px; color: var(--color-text-3); display: flex; justify-content: space-between; margin-bottom: 4px; }
.ship-item .ship-status { font-size: 11px; }
.batch-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 2px 4px;
  border-radius: 4px;
}
.batch-check:hover { background: rgba(22, 93, 255, .06); }
.ship-item { padding-left: 34px; }

.step-content { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-height: 400px; }

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--color-primary);
  background: #f5faff;
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  color: var(--color-primary);
}
.upload-zone:hover, .upload-zone.dragover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-hover);
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone .upload-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.upload-zone .upload-desc { font-size: 13px; color: var(--color-text-3); }
.upload-zone input { display: none; }

/* 锁住的步骤 */
.locked-step {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-3);
}
.locked-step .lock-icon { font-size: 60px; opacity: 0.3; margin-bottom: 16px; }
.locked-step .lock-title { font-size: 16px; font-weight: 600; color: var(--color-text-2); margin-bottom: 8px; }

/* ========= 推荐对比 ========= */
.recommend-empty {
  text-align: center; padding: 80px 20px;
  color: var(--color-text-2);
}
.recommend-empty .empty-icon { font-size: 80px; opacity: .3; margin-bottom: 16px; }
.recommend-empty .empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.recommend-empty .empty-desc { color: var(--color-text-3); margin-bottom: 20px; }

.shipment-info-bar {
  background: linear-gradient(90deg, var(--color-primary-light), #f5faff);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.info-cell .info-label { font-size: 12px; color: var(--color-text-3); margin-bottom: 4px; }
.info-cell .info-value { font-size: 16px; font-weight: 700; color: var(--color-text-1); }

.top3-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.reco-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
  border-top: 4px solid var(--color-primary);
  transition: all .2s;
}
.reco-card.rank-1 { border-top-color: #ff7a00; box-shadow: 0 6px 20px rgba(255, 122, 0, 0.18); }
.reco-card.rank-2 { border-top-color: var(--color-primary); }
.reco-card.rank-3 { border-top-color: #8c8c8c; }
.reco-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.reco-card .rank-label {
  position: absolute; top: 14px; right: 14px;
  background: #ff7a00; color: #fff;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px; font-weight: 700;
}
.reco-card.rank-2 .rank-label { background: var(--color-primary); }
.reco-card.rank-3 .rank-label { background: #8c8c8c; }
.reco-card .reco-title { font-size: 15px; font-weight: 700; color: var(--color-text-1); margin-bottom: 12px; }
.reco-card .score-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.score-circle {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.score-circle .big { font-size: 28px; line-height: 1; }
.score-circle .small { font-size: 11px; opacity: 0.9; margin-top: 2px; }
.score-circle.green { background: linear-gradient(135deg, #52c41a, #73d13d); }
.score-circle.blue { background: linear-gradient(135deg, #1677ff, #4096ff); }
.score-circle.yellow { background: linear-gradient(135deg, #faad14, #ffc53d); }
.score-summary .price { font-size: 20px; font-weight: 700; color: var(--color-danger); }
.score-summary .timeline { font-size: 12px; color: var(--color-text-2); margin-top: 4px; }

.dim-list { margin-bottom: 14px; }
.dim { margin-bottom: 8px; }
.dim .dim-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-2); margin-bottom: 3px; }
.dim .dim-bar {
  height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden;
}
.dim .dim-fill { height: 100%; border-radius: 4px; }
.dim-fill.cost { background: var(--color-primary); }
.dim-fill.time { background: var(--color-success); }
.dim-fill.risk { background: var(--color-danger); }
.dim-fill.service { background: var(--color-warning); }

.reason-box {
  background: #fafafa;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--color-text-2);
  line-height: 1.7;
  margin-bottom: 12px;
}
.reason-box .strong { color: var(--color-text-1); font-weight: 600; }
.reason-box .pos { color: var(--color-success); }
.reason-box .neg { color: var(--color-danger); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 16px; height: 16px; cursor: pointer; }
.checkbox-row label { font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }

.filtered-list { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.filtered-list h3 { font-size: 14px; margin-bottom: 10px; color: var(--color-text-2); display: flex; align-items: center; gap: 6px; }
.filtered-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: var(--radius);
  background: #fafafa; color: var(--color-text-3);
  margin-bottom: 6px;
  font-size: 13px;
}
.exc-reason { background: #fff1f0; color: var(--color-danger); padding: 2px 10px; border-radius: 10px; font-size: 11px; }

.confirm-bar {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========= 单据中心 ========= */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.filter-bar .form-item { display: flex; align-items: center; gap: 6px; }
.form-item label { font-size: 13px; color: var(--color-text-2); white-space: nowrap; }
.form-item input, .form-item select {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.form-item input:focus, .form-item select:focus { border-color: var(--color-primary); }
.form-item input[type="date"] { width: 150px; }

/* ========= 报价管理 ========= */
.tab-action-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-2);
  min-width: 220px;
}
.progress-line {
  flex: 1; height: 6px;
  background: #f0f0f0; border-radius: 3px; overflow: hidden;
}
.progress-line .progress-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  transition: width .3s ease;
  width: 0;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 12px 0 0;
}
.page-btn {
  min-width: 30px; height: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text-1);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0 8px;
}
.page-btn:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.page-btn:disabled { opacity: .5; cursor: not-allowed; }
.page-info { margin: 0 10px; font-size: 12px; color: var(--color-text-3); }

/* ========= 模板管理 ========= */
.version-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.version-switch {
  display: flex;
  gap: 8px;
  align-items: center;
}
.version-tag {
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.version-tag.active {
  background: var(--color-success-light);
  border-color: var(--color-success);
  color: var(--color-success);
  font-weight: 600;
}
.version-tag .tiny { font-size: 10px; color: var(--color-text-3); }
.version-tag.active .tiny { color: var(--color-success); }

.editable-cell {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
  min-height: 30px;
}
.editable-cell:hover { background: #f0f7ff; }
.editable-cell.editing { background: var(--color-primary-light); padding: 4px 6px; }
.editable-cell input {
  width: 100%; height: 28px;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  padding: 0 6px;
  outline: none;
}

/* ========= Modal ========= */
.modal-root {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-root.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  max-height: 88vh;
  overflow: auto;
  min-width: 520px;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: #f0f0f0; color: var(--color-text-2);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--color-danger); color: #fff; }
.modal-body { padding: 18px 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ========= Toast ========= */
.toast-container {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  max-width: 360px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--color-primary);
  animation: toastIn .25s ease;
  pointer-events: auto;
}
.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }
.toast.info { border-left-color: var(--color-primary); }
.toast .t-icon { font-size: 18px; }
.toast .t-body { flex: 1; color: var(--color-text-1); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(60px); }
}

/* ========= 响应式 ========= */
@media (max-width: 1280px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .top3-grid { grid-template-columns: 1fr; }
  .shipment-info-bar { grid-template-columns: repeat(2, 1fr); }
  .quick-entry { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .header-left { width: var(--sidebar-width-collapsed); }
  .logo-text { display: none; }
  .app-sidebar { width: var(--sidebar-width-collapsed); }
  .nav-text { display: none; }
  .nav-item { padding: 12px 0; justify-content: center; border-left: 0; border-right: 3px solid transparent; }
  .nav-item.active { border-right-color: var(--color-primary); border-left-color: transparent; }
  .main-container { margin-left: var(--sidebar-width-collapsed); }
  .todo-grid { grid-template-columns: 1fr; }
  .shipment-layout { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 14px; }
  .modal-box { min-width: 90%; }
}

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
  .shipment-info-bar { grid-template-columns: 1fr; }
  .header-center { display: none; }
}

/* 额外：小工具类 */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--color-text-3); font-size: 12px; }
.text-primary { color: var(--color-primary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.empty-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-3);
  font-size: 13px;
}
.empty-box .e-icon { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }

/* Chart.js 容器 */
.chart-wrap {
  position: relative;
  height: 260px;
  background: #fff;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* ===== 导航分组（合并菜单） ===== */
.nav-group .nav-sub { display: none; }
.nav-group.open .nav-sub { display: block; }
.nav-group.open > .nav-group-title .nav-arrow { transform: rotate(180deg); }
.nav-arrow { margin-left: auto; font-size: 10px; opacity: .6; transition: transform .2s; }
.nav-subitem { display: block; padding: 8px 12px 8px 44px; color: var(--text-secondary, #666); font-size: 13px; text-decoration: none; border-left: 3px solid transparent; }
.nav-subitem:hover { color: var(--color-primary, #1677ff); background: rgba(22,119,255,.06); }
.nav-subitem.active { color: var(--color-primary, #1677ff); border-left-color: var(--color-primary, #1677ff); background: rgba(22,119,255,.08); font-weight: 600; }
.nav-group.open > .nav-group-title { color: var(--color-primary, #1677ff); }
