:root {
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --primary: #8a6d43;
  --primary-weak: #f0f0f3;
  --bg: #f5f5f7;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .8);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --border: #e5e5ea;
  --sidebar-bg: rgba(250, 250, 252, .72);
  --sidebar-text: #3a3a3c;
  --success: #34865a;
  --warning: #9a6b2f;
  --danger: #c8443a;
  --radius: 18px;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .22) transparent; }
::placeholder { color: var(--text-2); opacity: 1; }

a { color: var(--text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
a.strong { font-weight: 600; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse 55% 40% at 10% 0%, rgba(214, 200, 176, .22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border-right: 1px solid var(--glass-border);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: width .2s;
  flex-shrink: 0;
}
.layout.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.layout.collapsed .brand-name,
.layout.collapsed .nav-text,
.layout.collapsed .sidebar-footer { display: none; }

.brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  
  border-bottom: 1px solid rgba(120, 100, 70, .12);
}
.brand-logo {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #1d1d1f;
  color: #fff; font-size: 13px; letter-spacing: 0;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

.nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 2px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--sidebar-text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(0, 0, 0, .04); color: var(--text); }
.nav-item.active { background: rgba(0, 0, 0, .06); color: var(--text); font-weight: 600; }
.nav-icon { width: 20px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
/* 二级菜单：挂在当前模块下面，侧栏收起时隐藏 */
.nav-item.parent-active { color: var(--text); background: rgba(0, 0, 0, .04); font-weight: 600; }
.nav-sub-group { margin: -2px 0 6px; padding-left: 20px; }
.nav-sub { display: block; padding: 10px 14px 10px 26px; margin-bottom: 2px; border-radius: 10px; font-size: 14px; color: var(--sidebar-text); text-decoration: none; white-space: nowrap; position: relative; }
.nav-sub::before { content: ''; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: currentColor; opacity: .45; }
.nav-sub:hover { background: rgba(0, 0, 0, .04); color: var(--text); }
.nav-sub.active { background: rgba(0, 0, 0, .06); color: var(--text); font-weight: 600; }
.nav-sub.active::before { opacity: 1; }
.layout.collapsed .nav-sub-group { display: none; }
/* 报价方案：卡片视图 */
.qcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.qcard { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.qcard:hover { border-color: transparent; box-shadow: 0 2px 8px rgba(0, 0, 0, .05), 0 16px 36px rgba(0, 0, 0, .09); transform: translateY(-2px); }
.qcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qcard-title { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qcard-title:hover { color: var(--primary); }
.qcard-hl { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.qcard-price b { font-size: 22px; }
.qcard-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.qcard-actions { margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border); justify-content: flex-start; }
.view-switch { margin-left: auto; }
/* 报价筛选条：搜索框占满剩余宽度，整体加底色成一组 */
.quote-filters { gap: 8px 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .5); align-items: center; }
.quote-filters input[name=keyword] { flex: 1 1 280px; min-width: 220px; }
.quote-filters [data-act=reset] { margin-left: 0; }
/* 报价编辑：最终总价卡片固定在底部居中，窄屏也一样，不再占右侧栏 */
.qe-layout { padding-bottom: 160px; }
.qe-side { position: fixed; height: auto; pointer-events: none; left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2); bottom: 8px; transform: translateX(-50%); z-index: 650; width: auto; max-width: calc(100vw - var(--sidebar-w) - 32px); }
.layout.collapsed .qe-side { left: calc(var(--sidebar-w-collapsed) + (100vw - var(--sidebar-w-collapsed)) / 2); }
.qe-side > .card { pointer-events: auto; display: flex; align-items: center; gap: 28px; margin: 0; padding: 8px 24px; border-radius: 999px; background: var(--glass-strong); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); box-shadow: 0 2px 8px rgba(0, 0, 0, .06), 0 18px 48px rgba(0, 0, 0, .14); border-color: rgba(255, 255, 255, .9); }
.qe-side .stat-value { margin-top: 0; font-size: 26px; }
.qe-side .stat-sub { margin-top: 0; }
.qe-side details { margin-top: 0 !important; position: relative; }
.qe-side details[open] > div, .qe-side details[open] > p { position: absolute; bottom: 100%; right: 0; min-width: 260px; background: #fff; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.12); }
/* 预览：数量、单价、总价的表头与内容都居中；分组名（DAY 01）不换行 */
.quote-document .quote-table th.numeric, .quote-document .quote-table td.numeric.center { text-align: center; }
.quote-document .quote-table td.group-cell { white-space: nowrap !important; overflow-wrap: normal !important; word-break: keep-all; }

.sidebar-footer { padding: 12px 18px; font-size: 13px; opacity: .5; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: relative;
  z-index: 875;
  height: var(--topbar-h);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  flex-shrink: 0;
}
.breadcrumb { color: var(--text-2); }
.breadcrumb b { color: var(--text); font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.search {
  width: 220px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  outline: none;
}
.search:focus { border-color: var(--primary); }
.user { position: relative; display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-weak); color: var(--primary);
  display: grid; place-items: center; font-weight: 600;
}

.content { position: relative; z-index: 0; flex: 1; overflow-y: auto; padding: 48px 56px 120px; }

/* ---------- 通用组件 ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.page-desc { color: var(--text-2); margin-top: 10px; font-size: 16px; }

.card {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .9);
  padding: 32px 36px;
  margin-bottom: 28px;
}
.card-title { font-size: 19px; font-weight: 600; margin-bottom: 18px; }

.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .card { margin-bottom: 0; }

.stat-label { color: var(--text-2); font-size: 14px; }
.stat-value { font-size: 34px; font-weight: 600; margin-top: 12px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.btn {
  padding: 11px 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color .2s, color .2s, box-shadow .2s, background .2s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 16px rgba(120, 95, 55, .10); }
.btn-primary { background: #1d1d1f; border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.btn-primary:hover { background: #3a3a3c; color: #fff; border-color: transparent; }

.icon-btn {
  border: none; background: none; cursor: pointer;
  font-size: 20px; color: var(--text-2);
  display: grid; place-items: center;
}

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab {
  padding: 14px 20px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 16px 10px; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.table th:first-child, .table td:first-child { padding-left: 4px; }
.table th:last-child, .table td:last-child { padding-right: 4px; }
.table th { background: transparent; color: var(--text-2); font-weight: 500; font-size: 13px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }

.empty {
  text-align: center;
  color: var(--text-2);
  padding: 48px 0;
}
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: .55; color: #b9a78a; }
.icon { vertical-align: middle; flex-shrink: 0; }

.todo-list { list-style: none; }
.todo-list li { padding: 6px 0; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.todo-list li::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  border: 1.5px solid var(--primary);
  flex-shrink: 0;
}

.toast {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: rgba(43, 40, 36, .88); color: #fff;
  backdrop-filter: blur(10px);
  padding: 10px 22px;
  border-radius: 999px;
  transition: transform .25s;
  z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- 供应商渠道：地球仪 ---------- */
.supplier-map {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 120px);
  min-height: 480px;
  margin-bottom: 16px;
}
.globe-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(ellipse at center, #10213d 0%, #070d1a 100%);
}
.globe-stage { position: absolute; inset: 0; }
.globe canvas { display: block; }
.globe-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,.6);
}
.globe-tip {
  position: absolute;
  display: none;
  pointer-events: none;
  background: rgba(15,23,42,.92);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
}
.globe-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.btn-dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #dbe6ff; }
.btn-dark:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.globe-hint {
  position: absolute; left: 16px; bottom: 12px;
  color: rgba(255,255,255,.45);
  font-size: 13px;
  pointer-events: none;
}

.region-panel { margin-bottom: 0; display: flex; flex-direction: column; overflow: hidden; }
.card-title .muted { font-weight: 400; color: var(--text-2); font-size: 13px; margin-left: 8px; }
.region-name { display: flex; align-items: center; gap: 6px; }
.region-list { list-style: none; overflow-y: auto; flex: 1; margin: 0 -8px; }
.region-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
}
.region-list li[data-code] { cursor: pointer; }
.region-list li[data-code]:hover { background: var(--primary-weak); color: var(--primary); }
.region-count { color: var(--text-2); font-variant-numeric: tabular-nums; }
.link-btn {
  border: none; background: none; cursor: pointer;
  color: var(--primary);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; margin-bottom: 12px;
  font-size: 13px;
  align-self: flex-start;
}
.btn-block { width: 100%; justify-content: center; margin-bottom: 12px; }
.btn:disabled { opacity: .6; cursor: default; }
.region-note {
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
}
.globe-tip-sub { color: rgba(255,255,255,.55); }

/* ---------- 路线规划（浮动工具栏） ---------- */
.route-planner-float {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 720px;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1), 0 24px 56px rgba(0, 0, 0, .15);
  z-index: 500;
  max-height: calc(100% - 96px);
  display: flex;
  flex-direction: column;
}
.route-float-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(120, 100, 70, .12);
}
.route-float-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.route-float-count {
  font-weight: 400;
  color: var(--text-2);
  font-size: 13px;
}
.route-float-actions {
  display: flex;
  gap: 6px;
}
.route-float-body {
  padding: 12px 16px;
  overflow-y: auto;
  max-height: 400px;
}
.route-float-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--primary-weak);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
  justify-content: center;
}
.route-float-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.route-float-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background .2s;
}
.route-float-item:hover {
  background: rgba(255, 255, 255, .9);
}
.route-float-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
}
.route-float-num.start { background: #ff4d4f; }
.route-float-num.end { background: #52c41a; }
.route-float-num.mid { background: #1890ff; }
.route-float-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-float-distance {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.route-float-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .06);
  color: var(--danger);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  transition: background .2s;
  flex-shrink: 0;
}
.route-float-remove:hover {
  background: rgba(200, 68, 58, .15);
}
.route-float-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(138, 109, 67, .08);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.route-float-recommendations {
  padding: 10px 12px;
  background: rgba(24, 144, 255, .06);
  border: 1px solid rgba(24, 144, 255, .15);
  border-radius: 8px;
}
.route-rec-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
.route-rec-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .6);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
}
.route-rec-mini:last-child {
  margin-bottom: 0;
}
.route-rec-mini:hover {
  background: rgba(255, 255, 255, .9);
}
.route-rec-detour {
  color: var(--success);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 按钮补充 ---------- */
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; border-color: var(--danger); }
.btn-danger-ghost { color: var(--text-2); }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(60, 50, 38, .28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 900;
}
.modal {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .16);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(120, 100, 70, .10);
  font-size: 16px; font-weight: 500; 
}
.modal-body { padding: 24px 26px; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 26px;
  border-top: 1px solid rgba(120, 100, 70, .10);
}
.confirm-text { line-height: 1.7; }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-item { display: flex; flex-direction: column; gap: 8px; }
.form-item[hidden] { display: none; }
.form-label { color: var(--text-2); font-size: 14px; }
.form-label.required::after { content: "*"; color: var(--danger); margin-left: 3px; }
.input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .8);
  color: var(--text);
  font: inherit;
  outline: none;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(138, 109, 67, .14); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.input-group .btn { flex-shrink: 0; }
.form-hint { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.tab-hint { font-size: 15px; line-height: 1.7; color: var(--text-2); margin: 0 0 28px; padding: 12px 14px; border-radius: 8px; background: var(--primary-weak); }
.form-hint.warn { color: var(--warning); }

.settings-page { width: min(100%, 920px); }
.settings-section { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 28px; padding: 26px 0; border-top: 1px solid var(--border); }
.settings-section:first-child { border-top: 0; padding-top: 0; }
.settings-section-title { font-size: 17px; font-weight: 600; }
.settings-section-copy { color: var(--text-2); font-size: 13px; line-height: 1.65; margin-top: 6px; }
.settings-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-model-block { display: flex; flex-direction: column; gap: 12px; }
.settings-model-block + .settings-model-block { border-top: 1px solid var(--border); padding-top: 18px; }
.settings-model-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-model-heading h3 { font-size: 15px; font-weight: 600; }
.settings-logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.settings-logo-preview { width: 112px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-2); }
.settings-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.settings-logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-status { margin-left: auto; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.settings-section .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---------- 供应商详情 ---------- */
.region-list li[data-supplier] { cursor: pointer; }
.region-list li[data-supplier]:hover { background: var(--primary-weak); color: var(--primary); }
.info-list {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px 12px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.info-list dt { color: var(--text-2); }
.info-list dd { word-break: break-all; }
.info-list .muted { color: #b0b6bf; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 地图选点提示条 */
.globe-banner {
  position: absolute; top: 64px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 8px;
  background: rgba(255, 122, 26, .95);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.globe-banner[hidden] { display: none; }

/* ---------- 街道地图弹窗 ---------- */
.street-map {
  height: min(460px, 60vh);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.street-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.street-toolbar .input { flex: 1; }
.street-hint { margin-top: 8px; }
.street-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
  color: var(--text-2);
}
.street-head a { text-decoration: none; color: inherit; flex-shrink: 0; }

/* ---------- 通用补充 ---------- */
.muted { color: var(--text-2); }
.text-danger { color: var(--danger); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-header .card-title { margin-bottom: 0; }
.input-sm { width: auto; padding: 9px 16px; font-size: 14px; border-radius: 999px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url('data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 width=%2710%27 height=%276%27><path d=%27M1 1l4 4 4-4%27 fill=%27none%27 stroke=%27%238e8e93%27 stroke-width=%271.5%27/></svg>'); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
select.input-sm { padding-right: 30px; }
.table-scroll { overflow-x: auto; }
/* 窄屏时整表横向滚动，而不是把中文列挤成竖排 */
.table-scroll > .table { min-width: 0; }
.table td, .table th { word-break: keep-all; }
.table td:first-child { white-space: normal; min-width: 220px; max-width: 320px; }
.table td:first-child .muted { font-size: 13px; line-height: 1.5; margin-top: 2px; }
.table select.input-sm { padding: 7px 28px 7px 14px; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; }

.badge {
  display: inline-block;
  white-space: nowrap;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  background: #f2f2f4;
  color: var(--text-2);
}
.badge-success { background: #e8f4ed; color: var(--success); }
.badge-warning { background: #faf1de; color: var(--warning); }
.badge-danger { background: #fbe9e7; color: var(--danger); }
.badge-muted { background: #f2f2f4; color: #8e8e93; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips:empty { display: none; }
.chip {
  border: 1px solid var(--border);
  background: var(--glass-strong);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .2s, color .2s, background .2s;
  display: inline-flex; gap: 6px; align-items: center;
}
.chip span { color: var(--text-2); }
.chip.active { border-color: transparent; color: #fff; background: #1d1d1f; }
.chip.active span { color: rgba(255, 255, 255, .8); }

/* 信息展示 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 24px;
  line-height: 1.6;
}
.info-grid dt { color: var(--text-2); font-size: 13px; }
.info-grid dd { white-space: pre-wrap; word-break: break-all; }
.text-block { margin-top: 16px; white-space: pre-wrap; line-height: 1.7; }
.text-block-title { color: var(--text-2); font-size: 13px; margin-bottom: 4px; }
.summary-row { display: flex; flex-wrap: wrap; gap: 12px 40px; }
.summary-row > div { display: flex; align-items: center; gap: 10px; }

/* 合作项目卡片 */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.project-card:hover { border-color: transparent; box-shadow: 0 2px 8px rgba(0, 0, 0, .05), 0 16px 36px rgba(0, 0, 0, .09); }
.project-cover {
  width: 104px; flex-shrink: 0;
  background: var(--primary-weak); color: var(--primary);
  display: grid; place-items: center;
  font-size: 32px;
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 12px 14px; min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.project-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.project-price { color: var(--primary); font-weight: 500; }
.project-sub { font-size: 13px; color: var(--text-2); }
.project-counts { display: flex; gap: 12px; font-size: 13px; color: var(--text-2); }
.project-counts span { display: inline-flex; align-items: center; gap: 3px; }

/* 项目表单 */
.form-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 10px;
}
.form .form-section-title:first-child { border-top: none; padding-top: 0; }
.form-section-title .form-hint { font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.input-unit { display: flex; align-items: center; gap: 6px; }
.input-unit span { color: var(--text-2); white-space: nowrap; }
.input-sep { align-self: center; color: var(--text-2); }
.edit-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.edit-table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 13px; padding: 0 4px 6px; }
.edit-table td { padding: 3px 4px; }
.edit-table .input { padding: 5px 8px; }
.edit-table .w-unit { width: 80px; }
.edit-table .w-price { width: 110px; }
.edit-table .w-op { width: 32px; }
.project-validity-control { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.project-validity-control .input-group { flex: 1; min-width: 220px; }
.project-validity-control .input:disabled { background: #f1f1f3; color: var(--text-2); cursor: not-allowed; opacity: .72; }
.project-long-term { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; white-space: nowrap; cursor: pointer; }
.project-long-term input { width: 16px; height: 16px; accent-color: var(--primary); }
.price-entry-list { display: flex; flex-direction: column; gap: 10px; }
.price-entry { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.price-entry-top { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) 32px; gap: 10px; align-items: end; }
.price-entry-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.price-entry-details { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(160px, 1fr); gap: 10px; }
.price-entry .form-item { gap: 5px; min-width: 0; }
.price-entry .form-label { font-size: 12px; }
.price-entry .input { padding: 8px 10px; }
.price-entry-delete { margin-bottom: 3px; }
.supplier-price-list { display: flex; flex-direction: column; }
.supplier-price-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.supplier-price-row:first-child { padding-top: 0; }
.supplier-price-row:last-child { border-bottom: 0; padding-bottom: 0; }
.supplier-price-heading { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.supplier-price-includes { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; margin-top: 8px; line-height: 1.6; white-space: pre-line; }
.supplier-price-values { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.supplier-price-note { margin-top: 6px; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .form-grid > *, .price-entry > * { min-width: 0; }
  .project-validity-control { align-items: stretch; }
  .project-validity-control .input-group { min-width: 100%; }
  .price-entry-top { grid-template-columns: minmax(0, 1fr) 32px; }
  .price-entry-top .form-item:first-child { grid-column: 1; }
  .price-entry-top .form-item:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .price-entry-delete { grid-column: 2; grid-row: 1; }
  .price-entry-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-entry-details { grid-template-columns: 1fr; }
  .supplier-price-includes { grid-template-columns: 1fr; gap: 2px; }
}
.kv-row { display: grid; grid-template-columns: 200px 1fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }

/* 资料 */
.att-hint { margin: -4px 0 12px; }
.att-section { margin-top: 16px; }
.att-title { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-bottom: 10px; }
.att-title .muted { font-weight: 400; }
.drop-active { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary-weak); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
}
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 8px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: #fff; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-play {
  position: absolute; left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff;
  display: grid; place-items: center; font-size: 16px;
}
.media-del {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 6px;
  border: none; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff;
  display: none; place-items: center;
}
.media-tile:hover .media-del { display: grid; }
.media-del:hover { background: var(--danger); }
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.row-icon { color: var(--primary); font-size: 18px; display: grid; }
.row-main { flex: 1; min-width: 0; }
.row-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-decoration: none; }
a.row-name { color: var(--primary); }
a.row-name:hover { text-decoration: underline; }
.row-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 图片 / 视频预览 */
.viewer {
  position: relative;
  background: #0f172a;
  border-radius: 6px;
  display: grid; place-items: center;
  min-height: 300px;
}
.viewer img, .viewer video { max-width: 100%; max-height: 70vh; display: block; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.85);
  display: grid; place-items: center; font-size: 20px;
}
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }
.viewer-count { text-align: center; color: var(--text-2); margin-top: 8px; }
.form-block { display: flex; flex-direction: column; gap: 14px; }
.form-block:empty { display: none; }

/* ---------- 身份切换 ---------- */
/* ---------- 财务中心 ---------- */
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.badge-primary { background: #f0f0f3; color: var(--text); }
.stat-card .stat-value { display: flex; align-items: baseline; gap: 6px; }
.stat-unit { font-size: 15px; font-weight: 400; color: var(--text-2); margin-left: 0; }
.stat-card { position: relative; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s; }
.stat-card:hover { border-color: transparent; transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0, 0, 0, .05), 0 16px 36px rgba(0, 0, 0, .09); }
.stat-card.has-todo::after { content: ''; position: absolute; top: 22px; right: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.table td .text-warning { color: var(--text); font-weight: 600; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.list-toolbar .chips { margin-bottom: 0; row-gap: 6px; }
.list-toolbar > .toolbar { margin-left: auto; }
/* 列表页的高级筛选：一行字段，窄屏自动换行 */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px;
  padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .5);
}
.filter-bar:empty { display: none; }
.filter-item { display: flex; flex-direction: column; gap: 4px; }
.filter-item > span { color: var(--text-2); font-size: 13px; }
.filter-item .input { min-width: 120px; }
.filter-summary { margin-bottom: 10px; font-size: 13px; color: var(--text-2); }
.filter-summary:empty { display: none; }
/* 勾选列：不参与表格的最小宽度计算 */
.table th.sel, .table td.sel { width: 36px; padding-right: 0; text-align: center; }
.table td.sel input { cursor: pointer; }
.table-hover tbody tr { cursor: pointer; }
.table-hover tbody tr:hover td { background: rgba(0, 0, 0, .025); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.row-actions .btn-sm { padding: 6px 10px; }
.table .btn-primary, .qcard .btn-primary { background: #f0f0f3; color: var(--text); border: 1px solid transparent; box-shadow: none; }
.table .btn-primary:hover, .qcard .btn-primary:hover { background: #1d1d1f; color: #fff; border-color: transparent; }
.balance-tip {
  background: var(--primary-weak);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.6;
}
.balance-tip .muted { margin-left: 6px; font-size: 13px; }

/* 附件选择 */
.file-field { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chips:empty { display: none; }
.file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 260px;
  padding: 3px 6px 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  font-size: 13px;
}
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { border: none; background: none; cursor: pointer; color: var(--text-2); display: grid; padding: 0 2px; }
.file-chip button:hover { color: var(--danger); }
.file-chip.link { cursor: pointer; color: var(--primary); padding-right: 8px; font: inherit; font-size: 13px; }
.file-chip.link:hover { border-color: var(--primary); }

/* 详情弹窗 */
.detail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.detail-section { margin-top: 18px; }
.detail-title { font-weight: 600; margin-bottom: 8px; }
.timeline { list-style: none; border-left: 2px solid var(--border); padding-left: 14px; }
.timeline li { position: relative; padding: 4px 0; line-height: 1.6; display: flex; gap: 12px; }
.timeline li::before {
  content: ""; position: absolute; left: -19px; top: 11px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
}
.timeline-time { color: var(--text-2); font-size: 13px; white-space: nowrap; padding-top: 1px; }

/* ======================= AI 财务助手浮层 ======================= */
.ai-chat-host { position: fixed; bottom: 24px; right: 24px; z-index: 850; }
/* 浮层自己设了 display，[hidden] 会被盖掉，这里补回来（同 .globe-banner[hidden]） */
.ai-chat-win[hidden], .ai-chat-attach-list[hidden], .ai-chat-warn[hidden], .ai-chat-pending[hidden] { display: none; }
.ai-chat-host input[type="file"] { display: none; }

.ai-chat-fab {
  display: flex; align-items: center; gap: 6px;
  background: #1d1d1f; color: #fff; border: none; border-radius: 999px;
  padding: 11px 22px; font-size: 14px; font-weight: 500;  cursor: pointer;
  box-shadow: 0 8px 24px rgba(143,112,71,.34);
  transition: opacity .15s;
}
.ai-chat-fab:hover { opacity: .9; }
.ai-chat-fab .icon { flex-shrink: 0; }

/* 打开后占据页面右半边：从顶栏下方一直铺到底部，像和真人财务聊天 */
.ai-chat-win {
  position: fixed; top: var(--topbar-h, 56px); right: 0; bottom: 0;
  width: min(50vw, 960px); min-width: 420px; max-width: 100vw;
  background: var(--glass-strong); border-left: 1px solid var(--glass-border);
  backdrop-filter: blur(26px) saturate(1.3);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column; overflow: hidden;
}
.ai-chat-host.open .ai-chat-fab { display: none; }
/* 拖入文件时盖住整个面板的提示层 */
.ai-chat-drop {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(234,240,255,.94); color: var(--primary);
  border: 2px dashed var(--primary); margin: 10px; border-radius: 12px;
  font-size: 16px; font-weight: 600; pointer-events: none;
}
.ai-chat-drop small { font-size: 13px; font-weight: 400; color: var(--text-2); }
.ai-chat-drop[hidden] { display: none; }

.ai-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid rgba(120,100,70,.12);
  background: transparent; color: var(--text);
}
.ai-chat-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.ai-chat-title .icon { flex-shrink: 0; }
.ai-chat-head-actions { display: flex; gap: 2px; }
.ai-chat-head .icon-btn { color: var(--text-2); }
.ai-chat-head .icon-btn:hover { color: var(--primary); background: rgba(154,123,79,.10); border-radius: 8px; }

.ai-chat-warn {
  background: #f7eddc; border-bottom: 1px solid #ead7b0;
  color: #7a5a22; font-size: 13px; padding: 8px 14px;
}

.ai-chat-body {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0; background: transparent;
}

.ai-msg {
  max-width: 80%; padding: 11px 16px; border-radius: 12px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.ai-msg-bot {
  background: rgba(255,255,255,.7); border: 1px solid var(--glass-border);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.ai-msg-user {
  background: #1d1d1f; color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.ai-msg-err { background: #f9ecea; border-color: #e6bdb8; color: var(--danger); }

.ai-chat-pending {
  font-size: 13px; color: var(--text-2); padding: 6px 24px 8px;
  border-top: 1px solid var(--border); background: var(--card);
}

.ai-chat-attach-list {
  padding: 10px 20px 0; background: var(--card); border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ai-chat-attach-list:not([hidden]) + .ai-chat-input { border-top: none; padding-top: 10px; }
.ai-attach-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary-weak); color: var(--primary);
  border-radius: 6px; padding: 5px 10px; font-size: 13px;
}
.ai-attach-item .icon-btn { color: var(--primary); padding: 0; font-size: 13px; min-width: unset; }

.ai-chat-input {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 14px 20px 6px; border-top: 1px solid var(--border); background: var(--card);
}
.ai-chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; line-height: 1.6;
  min-height: 44px; max-height: 200px;
  background: var(--bg); color: var(--text); outline: none;
  transition: border-color .15s;
}
.ai-chat-input textarea:focus { border-color: var(--primary); }
.ai-chat-attach {
  flex-shrink: 0; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.ai-chat-attach:hover { border-color: var(--primary); color: var(--primary); }
.ai-chat-send {
  flex-shrink: 0; background: #1d1d1f; border: none;
  border-radius: 12px; padding: 12px 16px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.ai-chat-send:hover { opacity: .9; }
.ai-chat-send:disabled { opacity: .5; cursor: default; }

/* 回复下方的"按发票填表"按钮：加在 flex 列里要自己靠左 */
.ai-fill-btn { align-self: flex-start; margin-top: -4px; }

/* 批量识别入库的核对表：单元格里放输入框，行要紧凑。
   固定列宽，否则 9 列会把发票号码和类型压到看不清；窄屏时由外层 table-scroll 横向滚动 */
.batch-inv { table-layout: fixed; min-width: 1040px; }
.batch-inv td { padding: 6px 8px; vertical-align: middle; }
.batch-inv td .input { width: 100%; min-width: 0; }
/* 发票号码 20 位、发票类型名称较长，这两列要给足宽度 */
.batch-inv th:nth-child(3), .batch-inv td:nth-child(3) { width: 200px; }
.batch-inv td:nth-child(3) .input { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.batch-inv th:nth-child(4), .batch-inv td:nth-child(4) { width: 160px; }
.batch-inv th:nth-child(5), .batch-inv td:nth-child(5) { width: 160px; }
.batch-inv th:nth-child(6), .batch-inv td:nth-child(6) { width: 140px; }
.batch-inv th:nth-child(7), .batch-inv td:nth-child(7),
.batch-inv th:nth-child(8), .batch-inv td:nth-child(8) { width: 110px; }
.batch-inv td:nth-child(2) { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-inv tr.muted-row td { background: rgba(120, 100, 70, .04); }

/* ======================= 报价管理 ======================= */
.qe-main { min-width: 0; }
.qe-main .card { margin-bottom: 16px; }
.qe-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 18px; margin-top: 18px; }
.qe-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.qe-nav:empty { display: none; }
.qe-group { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 18px; padding: 0 12px 12px; overflow-x: auto; background: #fff; }
.qe-group-head { display: flex; align-items: center; gap: 12px; margin: 0 -12px 8px; padding: 12px 14px; background: #f5f5f7; }
.qe-other .qe-group-head { background: #fafafa; }
.qe-group-head .input { width: 160px; font-weight: 600; background: transparent; border-color: transparent; font-size: 15px;  }
.qe-group-head .input:hover { border-color: var(--border); }
.qe-group-head .input:focus { border-color: var(--primary); background: #fff; }
.qe-sub { margin-left: auto; white-space: nowrap; }
.qe-grid { display: grid; grid-template-columns: 22px 24px 110px minmax(150px, 1.4fr) 70px 64px 90px 100px minmax(170px, 1.3fr) 26px; gap: 6px; align-items: center; min-width: 900px; }
.qe-head { color: var(--text-2); font-size: 13px;  padding: 8px 0; }
.qe-head > span { padding-left: 4px; }
.qe-item { padding: 6px 0; border-bottom: 1px solid var(--border); }
.qe-item .input { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.qe-item [data-f=quantity], .qe-item [data-f=unitPrice], .qe-item [data-f=actualTotal] { text-align: right; font-variant-numeric: tabular-nums; }
.qe-item [data-f=actualTotal] { background: #f5f5f7; font-weight: 600; }
.qe-tax { background: #fafafa; }
.qe-tax [data-f=unitPrice], .qe-tax [data-f=actualTotal] { background: #efeff2; color: var(--text); }
.qe-drag { border: 0; background: transparent; cursor: grab; color: var(--text-2); padding: 0; }
.qe-drag:active { cursor: grabbing; }
.qe-no { text-align: center; color: var(--text-2); font-size: 13px; }
.qe-note { display: flex; gap: 4px; align-items: center; min-width: 0; }
.qe-note .input { flex: 1; min-width: 0; }
.qe-color { width: 30px; height: 30px; padding: 3px; flex: none; border: 1px solid var(--border); border-radius: 8px; background: transparent; cursor: pointer; }
.qe-x { border: 0; background: transparent; color: #b9b2a6; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; transition: color .2s; }
.qe-x:hover { color: var(--danger); }
.qe-note .qe-x { color: #d3cdc2; font-size: 15px; }
.qe-undo { position: fixed; bottom: 76px; left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2); transform: translateX(-50%); max-width: calc(100vw - var(--sidebar-w) - 32px); display: flex; align-items: center; gap: 16px; padding: 11px 20px; background: rgba(43, 40, 36, .9); backdrop-filter: blur(12px); color: #fff; border-radius: 999px; box-shadow: 0 12px 32px rgba(40, 30, 15, .25); z-index: 800; font-size: 13px; }
.qe-undo[hidden] { display: none; }
.qe-undo .btn { background: transparent; color: #e6cfa0; border-color: rgba(230, 207, 160, .5); }
.sortable-ghost { opacity: .4; background: var(--primary-weak); }
@media (max-width: 1100px) { .qe-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.qp-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qp-option { display: grid; gap: 4px; text-align: left; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s; }
.qp-option small { color: var(--text-2); font-size: 13px; }
.qp-option:hover { border-color: #c7c7cc; box-shadow: 0 6px 18px rgba(0, 0, 0, .06); }
.qp-option.active { border-color: #1d1d1f; background: #1d1d1f; color: #fff; }
.qp-option.active small { color: rgba(255, 255, 255, .7); }
.qp-canvas { padding: 40px 32px; background: #ececef; border: 1px solid var(--border); border-radius: 18px; overflow-x: auto; }
.preview-document { max-width: 1060px; margin: 0 auto; box-shadow: 0 2px 8px rgba(0, 0, 0, .06), 0 20px 50px rgba(0, 0, 0, .10); }
@media (max-width: 900px) { .qp-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  :root { --sidebar-w: 56px; --sidebar-w-collapsed: 56px; }
  .sidebar { width: var(--sidebar-w); }
  .brand { justify-content: center; padding: 0; }
  .brand-name, .nav-text, .sidebar-footer { display: none; }
  .nav { padding: 12px 6px; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-sub-group { display: none; }
  .main { width: calc(100% - var(--sidebar-w)); }
  .topbar { gap: 8px; padding: 0 12px; }
  .breadcrumb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .topbar-right { gap: 4px; }
  .search, .topbar .user-meta { display: none; }
  .content { padding: 24px 16px 96px; }
  .settings-section { grid-template-columns: 1fr; gap: 14px; }
  .settings-section .form-row { grid-template-columns: 1fr; }
  .settings-status { margin-left: 0; }
}

/* 报价文档：默认样式（蓝金明细表），导出图片也用它 */
.quote-document { --qd-navy: #12336d; --qd-yellow: #f9db72; --qd-accent: #12336d; --qd-tint: #eaf1f7; --qd-line: #d7dfe5; --qd-ink: #192238; --qd-muted: #5e6a77; width: 100%; color: var(--qd-ink); background: #fff; font-size: 13px; }
.quote-document .document-head { min-height: 100px; padding: 20px 26px; display: flex; justify-content: space-between; gap: 24px; color: #fff; background: var(--qd-navy); }
.quote-document .document-head h2 { margin: 0; font-size: 24px; }
.quote-document .document-head h3 { margin: 7px 0 0; font-size: 15px; font-weight: 600; }
.quote-document .document-contact { display: grid; align-content: center; color: #e4edff; line-height: 1.7; text-align: right; }
.quote-document .document-notice { padding: 11px 18px; display: grid; grid-template-columns: 92px 1fr; gap: 12px; border-bottom: 1px solid #dedede; color: #635a38; background: #fffcef; white-space: pre-line; }
.quote-document .document-table-wrap { width: 100%; overflow-x: auto; }
.quote-document .quote-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 820px; }
.quote-document .quote-table th { padding: 9px 7px; border-right: 1px solid rgba(115,89,0,.14); color: #4e410c; background: var(--qd-yellow); text-align: center; white-space: nowrap; }
.quote-document .quote-table td { padding: 9px 7px; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e1e1e1; overflow-wrap: anywhere; vertical-align: middle; }
.quote-document .quote-table th:nth-child(1) { width: 9%; min-width: 96px; }
.quote-document .quote-table th:nth-child(2) { width: 5%; }
.quote-document .quote-table th:nth-child(3) { width: 9%; }
.quote-document .quote-table th:nth-child(4) { width: 22%; }
.quote-document .quote-table th:nth-child(5) { width: 7%; }
.quote-document .quote-table th:nth-child(6) { width: 6%; }
.quote-document .quote-table th:nth-child(7), .quote-document .quote-table th:nth-child(8) { width: 9%; }
.quote-document .quote-table th:nth-child(9) { width: 25%; }
.quote-document .quote-table .numeric { text-align: right; white-space: nowrap; }
.quote-document .quote-table .center { text-align: center; }
.quote-document .quote-table .strong { color: var(--qd-navy); font-weight: 800; }
.quote-document .quote-table .group-cell { font-weight: 800; text-align: center; }
.quote-document .quote-table .subtotal-row td { background: #fafafa; font-weight: 800; }
.quote-document .document-total { padding: 14px 20px; display: flex; justify-content: space-between; gap: 15px; border-top: 2px solid var(--qd-navy); background: #fffcf0; font-weight: 700; }
.quote-document .document-total strong { color: var(--qd-navy); font-size: 17px; }
.quote-document.pricing-hidden .pricing-column, .quote-document.pricing-hidden .pricing-summary-row { display: none; }
.quote-document .document-template-brand, .quote-document .document-template-meta, .quote-document .document-business-summary, .quote-document .document-section-label, .quote-document .document-itinerary { display: none; }

/* 三种换肤样式：经典 / 商务 / 分日行程 */
.quote-document:not([data-template=default]) { --qd-accent: #255b85; --qd-tint: #e9f2f8; padding: 30px 28px 26px; font-size: 13px; line-height: 1.65; }
.quote-document:not([data-template=default]) .document-head { min-height: 0; padding: 0; color: var(--qd-ink); background: transparent; }
.quote-document:not([data-template=default]) .document-head h2 { color: var(--qd-accent); font-size: 27px; white-space: pre-line; }
.quote-document:not([data-template=default]) .document-head h3 { color: var(--qd-muted); font-weight: 400; white-space: pre-line; }
.quote-document:not([data-template=default]) .document-contact { color: var(--qd-muted); }
.quote-document:not([data-template=default]) .document-template-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 22px; }
.quote-document:not([data-template=default]) .document-template-meta dt { color: var(--qd-muted); }
.quote-document:not([data-template=default]) .document-template-meta dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; }
.quote-document:not([data-template=default]) .document-notice { display: block; margin: 0 0 20px; padding: 13px 15px; border: 1px solid var(--qd-line); background: #fafaf8; color: var(--qd-muted); }
.quote-document:not([data-template=default]) .document-notice strong { color: var(--qd-ink); margin-right: 8px; }
.quote-document:not([data-template=default]) .quote-table th { color: var(--qd-accent); background: var(--qd-tint); padding: 11px 7px; }
.quote-document:not([data-template=default]) .quote-table td { padding: 11px 8px; white-space: pre-line; }
.quote-document:not([data-template=default]) .quote-table td.numeric { white-space: nowrap; }
.quote-document:not([data-template=default]) .quote-table .subtotal-row td { color: var(--qd-muted); background: #f8f9fa; }
.quote-document:not([data-template=default]) .document-total { margin-top: 17px; border-top: 2px solid var(--qd-accent); color: var(--qd-accent); background: var(--qd-tint); }
.quote-document:not([data-template=default]) .document-total strong { color: var(--qd-accent); }
.quote-document:not([data-template=default]) .document-total span:last-child strong { font-size: 23px; }
.quote-document[data-template=classic] .document-head { display: block; padding-bottom: 20px; border-bottom: 2px solid var(--qd-accent); text-align: center; }
.quote-document[data-template=classic] .document-contact { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; text-align: center; }
.quote-document[data-template=classic] .quote-table th, .quote-document[data-template=classic] .quote-table td { border: 1px solid var(--qd-line); }
.quote-document[data-template=business] { --qd-accent: #79523c; --qd-tint: #f7f3ee; --qd-line: #ded7d0; --qd-ink: #332c26; --qd-muted: #70665c; }
.quote-document[data-template=business] .document-template-brand, .quote-document[data-template=itinerary] .document-template-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--qd-line); color: var(--qd-muted); }
.quote-document .document-template-brand strong { color: var(--qd-accent); font-size: 17px; }
.quote-document[data-template=business] .document-head { display: flex; align-items: flex-end; gap: 24px; padding: 24px 0 20px; }
.quote-document[data-template=business] .document-head > div:first-child { flex: 1; min-width: 0; }
.quote-document[data-template=business] .document-head h2 { color: var(--qd-ink); font-family: 'Noto Serif SC', 'Songti SC', SimSun, serif; font-size: 29px; }
.quote-document[data-template=business] .document-contact { max-width: 42%; text-align: right; }
.quote-document[data-template=business] .document-contact span:last-child { display: none; }
.quote-document[data-template=business] .document-template-meta { margin: 0 0 20px; }
.quote-document[data-template=business] .document-business-summary { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 20px; margin: 0 0 22px; padding: 16px 20px; border-top: 2px solid var(--qd-accent); background: var(--qd-tint); }
.quote-document .document-business-summary > div { display: grid; gap: 5px; }
.quote-document .document-business-summary span { color: var(--qd-muted); }
.quote-document .document-business-summary strong { font-size: 20px; font-weight: 600; }
.quote-document .document-business-summary > div:last-child strong { color: var(--qd-accent); font-size: 25px; }
.quote-document[data-template=business] .document-section-label { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.quote-document .document-section-label h4 { margin: 0; font-size: 15px; }
.quote-document[data-template=business] .quote-table th { color: var(--qd-muted); background: #f6f5f3; border: 0; border-bottom: 1px solid var(--qd-line); }
.quote-document[data-template=business] .quote-table td { border-right: 0; border-bottom: 1px solid var(--qd-line); }
.quote-document[data-template=business] .document-total { border-top: 1px solid var(--qd-line); padding: 14px 0 0; background: transparent; }
.quote-document[data-template=business].pricing-hidden .document-business-summary { display: none; }
.quote-document[data-template=itinerary] { --qd-accent: #24674f; --qd-tint: #eff6f1; --qd-line: #d9e3dc; --qd-ink: #263b31; --qd-muted: #5b6e63; }
.quote-document[data-template=itinerary] .document-head { display: block; margin: 22px 0 16px; }
.quote-document[data-template=itinerary] .document-head h2 { color: var(--qd-ink); font-size: 29px; }
.quote-document[data-template=itinerary] .document-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; text-align: left; }
.quote-document[data-template=itinerary] .document-contact span:last-child { display: none; }
.quote-document[data-template=itinerary] .document-template-meta { padding: 11px 15px; margin: 0 0 22px; background: var(--qd-tint); }
.quote-document[data-template=itinerary] .document-template-meta dt, .quote-document[data-template=itinerary] .document-template-meta dd { color: var(--qd-accent); }
.quote-document[data-template=itinerary] .document-table-wrap { display: none; }
.quote-document[data-template=itinerary] .document-itinerary { display: block; }
.quote-document .itinerary-day + .itinerary-day { margin-top: 26px; }
.quote-document .itinerary-day-head { display: flex; align-items: center; gap: 13px; padding: 11px 14px; background: var(--itinerary-day-fill); border-bottom: 1px solid var(--qd-line); color: var(--itinerary-day-ink); }
.quote-document .itinerary-day-number { font-size: 27px; font-weight: 650; line-height: 1; }
.quote-document .itinerary-day-head h4 { margin: 0; flex: 1; font-size: 16px; font-weight: 650; }
.quote-document .itinerary-day-subtotal { display: grid; text-align: right; }
.quote-document .itinerary-day-subtotal strong { font-size: 14px; white-space: nowrap; }
.quote-document .itinerary-items { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.quote-document .itinerary-time-column { width: 14%; }
.quote-document .itinerary-quantity-column { width: 23%; }
.quote-document .itinerary-items td { padding: 13px 12px; border-bottom: 1px solid var(--qd-line); vertical-align: middle; }
.quote-document .itinerary-stop-time { color: var(--qd-muted); white-space: pre-line; }
.quote-document .itinerary-stop-content { white-space: pre-line; overflow-wrap: anywhere; }
.quote-document .itinerary-stop-content p { margin: 3px 0 0; color: var(--qd-muted); }
.quote-document .itinerary-stop-amount { text-align: right; }
.quote-document .itinerary-stop-amount > strong { display: block; font-size: 14px; white-space: nowrap; }
.quote-document .itinerary-stop-quantity { display: block; color: var(--qd-muted); }
.quote-document .itinerary-empty { padding: 30px 14px; text-align: center; color: var(--qd-muted); }
.quote-document[data-template=itinerary] .document-total { margin-top: 24px; padding: 16px 0 0; background: transparent; }
.quote-document[data-template=itinerary].pricing-hidden .itinerary-quantity-column { width: 15%; }

/* ---------- 登录与用户菜单 ---------- */
.auth { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 60% 50% at 20% 10%, rgba(214,190,150,.5), transparent 70%), radial-gradient(ellipse 50% 45% at 85% 90%, rgba(196,205,190,.45), transparent 70%), var(--bg); padding: 20px; }
.auth[hidden] { display: none; }
.auth-card { width: 100%; max-width: 400px; background: var(--glass-strong); backdrop-filter: blur(26px) saturate(1.3); -webkit-backdrop-filter: blur(26px) saturate(1.3); border: 1px solid var(--glass-border); border-radius: 22px; padding: 38px 34px; box-shadow: 0 24px 70px rgba(0, 0, 0, .14); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px;  }
.auth-title { margin: 0 0 24px; font-size: 20px; font-weight: 500;  font-family: "Noto Serif SC", "Songti SC", "Source Han Serif SC", Georgia, serif; }
.auth-card .form-item { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.auth-error { min-height: 0; color: var(--danger, #d92d20); font-size: 13px; margin-bottom: 0; }
.auth-error:not(:empty) { margin-bottom: 12px; }
.auth-submit { width: 100%; justify-content: center; padding: 11px 18px; margin-top: 8px; }
.auth-hint { margin-top: 12px; text-align: center; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 8px; border-radius: 8px; font: inherit; color: inherit; }
.user-btn:hover { background: var(--hover, rgba(0, 0, 0, .05)); }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-meta small { color: var(--text-muted, #8a8f98); font-size: 13px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .12); padding: 6px; z-index: 50; }
.user-pop[hidden] { display: none; }
.user-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; text-decoration: none; }
.user-item:hover { background: var(--hover, rgba(0, 0, 0, .05)); }
a.btn { text-decoration: none; }
a.btn:not(.btn-primary) { color: inherit; }

.input-error { border-color: var(--danger, #d92d20) !important; box-shadow: 0 0 0 3px rgba(217, 45, 32, .15); }

.qe-info-sum { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.qe-info-sum::-webkit-details-marker { display: none; }
.qe-info-sum::before { content: '▾'; color: var(--text-2); }
.qe-info-card:not([open]) .qe-info-sum::before { content: '▸'; }
.qe-info-card[open] .qe-info-brief { display: none; }
.qe-info-brief { margin-left: auto; }
.qe-info [data-role=trip] { resize: none; white-space: normal; font-size: 14px; line-height: 1.5; min-height: 46px; display: flex; align-items: center; background: #f5f5f7; border-color: transparent; color: var(--text); }
textarea.input { resize: none; min-height: 88px; }
.modal-footer .btn { padding: 11px 24px; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .35); background-clip: content-box; border: 3px solid transparent; }
.layout.collapsed .qe-undo { left: calc(var(--sidebar-w-collapsed) + (100vw - var(--sidebar-w-collapsed)) / 2); }
.info-grid dd { font-size: 16px; font-weight: 500; }
.info-grid { gap: 22px 32px; }
.page-header .toolbar { gap: 10px; }
.page-header .btn-danger-ghost { padding: 11px 14px; }
.page-header { gap: 24px; flex-wrap: wrap; }
.page-header > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-header > div:last-child { flex: 0 0 auto; }
.ai-draft { align-self: flex-start; max-width: 80%; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; background: #fff; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.ai-draft-title { font-weight: 600; font-size: 16px; }
.ai-draft-price b { font-size: 24px; font-variant-numeric: tabular-nums; }
.ai-draft-warn { font-size: 13px; padding: 8px 12px; border-radius: 10px; background: #faf1de; color: var(--warning); }
.ai-draft .btn { align-self: flex-start; }
.ai-chat-mic { flex-shrink: 0; background: #f0f0f3; border: none; border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.ai-chat-mic:hover { background: #e4e4e8; }
.ai-chat-mic[hidden] { display: none; }
.ai-chat-mic.recording { background: var(--danger); color: #fff; animation: mic-pulse 1.2s infinite; }
@keyframes mic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
