/* 大创业务工作台 · 基础样式（浅色主题，无外部依赖） */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #1f6feb;
  --primary-dark: #1554b8;
  --ok: #16794c;
  --warn: #b45309;
  --danger: #b42318;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: var(--text);
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); }
.btn {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: #9db8e8; cursor: not-allowed; }
.btn.ghost {
  background: #fff; color: var(--text); border: 1px solid var(--border); width: auto;
}
.alert {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3f2;
  border: 1px solid #fecdc9;
  color: var(--danger);
  font-size: 13px;
}
.alert.show { display: block; }
.hint { margin-top: 18px; color: var(--muted); font-size: 12px; text-align: center; }

/* 登录页：企业微信一键登录分隔与按钮 */
.divider {
  display: flex; align-items: center; text-align: center;
  margin: 18px 0 14px; color: var(--muted); font-size: 12px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.divider span { padding: 0 12px; }
.btn-wecom {
  display: block; text-align: center; text-decoration: none;
  background: #07c160; /* 企业微信绿 */
}
.btn-wecom:hover { background: #06ad56; }

/* ---------- 概览工作台 ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .brand { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; }
.topbar .who b { color: var(--text); }

.container { max-width: 1560px; margin: 0 auto; padding: 20px 28px 48px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card .label { color: var(--muted); font-size: 12px; }
.card .value { font-size: 22px; font-weight: 650; margin-top: 6px; letter-spacing: .2px; }
.card .value.ok { color: var(--ok); }
.card .value.warn { color: var(--warn); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 18px;
}
.panel h2 { margin: 0 0 14px; font-size: 15px; }

.stage-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stage-row .name { width: 92px; color: var(--muted); font-size: 12px; }
.stage-row .bar { flex: 1; height: 10px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.stage-row .bar > i { display: block; height: 100%; background: var(--primary); }
.stage-row .num { width: 56px; text-align: right; font-size: 12px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab {
  padding: 8px 14px; cursor: pointer; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; color: var(--text);
}
.toolbar .grow { flex: 1; min-width: 160px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
tbody tr:hover { background: #f8fafc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  background: #eef2f7; color: #344054; border: 1px solid var(--border);
}
.tag.SIGNED { background: #e7f6ee; color: var(--ok); border-color: #cdebdc; }
.tag.LOST, .tag.ABORTED { background: #fdecec; color: var(--danger); border-color: #f8d4d2; }
.tag.REPORTED { background: #eaf2fe; color: var(--primary); border-color: #d3e4fd; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.pager button {
  padding: 6px 12px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .jump-box { display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.pager .jump-box input { width: 64px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

/* ---------- 顶部导航 ---------- */
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px;
}
.nav a:hover { background: #f1f5f9; color: var(--text); }
.nav a.active { background: #eaf2fe; color: var(--primary); font-weight: 600; }

/* ---------- 抽屉（详情/编辑）---------- */
.drawer-mask {
  display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 30;
}
.drawer-mask.show { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border); z-index: 31;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .18s ease;
}
.drawer-mask.show .drawer { transform: translateX(0); }
.drawer header {
  padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
}
.drawer header h3 { margin: 0; font-size: 16px; flex: 1; }
.drawer .body { flex: 1; overflow: auto; padding: 16px 18px; }
.drawer footer {
  padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .field { margin-bottom: 0; }
.field .static { padding: 8px 0; color: var(--muted); font-size: 13px; }
.btn.sm { width: auto; padding: 6px 14px; font-size: 13px; }
.link { cursor: pointer; color: var(--primary); }
tbody tr.link-row { cursor: pointer; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px;
  z-index: 60; display: none;
}
.toast.show { display: block; }
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 22px; width: 340px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

/* ================= 界面美化（v2） ================= */
:root {
  --radius-lg: 14px;
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --soft: #f8fafc;
}
body { -webkit-font-smoothing: antialiased; }

.topbar {
  padding: 10px 24px;
  box-shadow: var(--shadow-sm);
  background: linear-gradient(180deg, #ffffff 0%, #fdfdfe 100%);
}
.topbar .brand { letter-spacing: .3px; }
.topbar .brand::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 3px;
  background: var(--primary); margin-right: 8px; vertical-align: 2px;
}
.topbar button { padding: 6px 12px; font-size: 13px; border-radius: 8px; transition: all .15s; }
.topbar button:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--text); }

.card { border-radius: var(--radius-lg); transition: box-shadow .18s, transform .18s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card .label { font-size: 12px; letter-spacing: .2px; }
.card .value { font-size: 24px; font-weight: 700; }

.panel { border-radius: var(--radius-lg); padding: 18px 20px; }
.panel h2 {
  font-size: 14px; letter-spacing: .3px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.panel h2::before {
  content: ''; display: inline-block; width: 3px; height: 13px; border-radius: 2px;
  background: var(--primary); margin-right: 8px; vertical-align: -1px;
}

.tabs { gap: 10px; }
.tab { border-radius: 8px 8px 0 0; padding: 9px 16px; transition: all .15s; }
.tab:hover { color: var(--text); background: #f1f5f9; }
.tab.active { background: #eaf2fe; }

table { font-size: 13px; }
th {
  background: var(--soft); font-size: 12px; letter-spacing: .3px;
  border-bottom: 1px solid var(--border); padding: 10px;
}
td { padding: 10px; }
tbody tr:hover { background: #f6f9fd; }
tbody tr:nth-child(even) { background: #fcfdfe; }
tbody tr:nth-child(even):hover { background: #f6f9fd; }
.table-wrap { border-radius: var(--radius-lg); }

.btn { border-radius: 9px; font-weight: 600; transition: all .15s; }
.btn:hover { box-shadow: var(--shadow-md); }
.btn.ghost:hover { background: #f1f5f9; }
input, select { transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); outline: none; }

.field label { font-size: 12px; letter-spacing: .2px; }
.field input, .field select { padding: 9px 11px; border-radius: 9px; }

.tag { font-weight: 500; }
.muted { color: var(--muted); font-size: 12px; }

/* ================= 报价中心 ================= */
.quote-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .quote-layout { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: 13px; transition: all .15s;
}
.chip span:hover { border-color: var(--primary); background: #f6f9fd; }
.chip input:checked + span {
  border-color: var(--primary); background: #eaf2fe; color: var(--primary-dark); font-weight: 600;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .1);
}
.chip span em { font-style: normal; font-size: 11px; color: var(--muted); }
.chip input:checked + span em { color: var(--primary); }

.cat-form {
  margin-top: 14px; padding: 14px; border: 1px dashed var(--border);
  border-radius: 12px; background: #fcfdfe;
}
.cat-form h2 { border: 0; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--primary-dark); }
.cat-form h2::before { display: none; }

.addon-list { max-height: 210px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.addon {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9; font-size: 13px; cursor: pointer;
}
.addon:last-child { border-bottom: 0; }
.addon:hover { background: #f6f9fd; }
.addon input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); }
.addon > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addon em { font-style: normal; color: var(--muted); font-size: 12px; }
.addon em.nego { color: var(--warn); }
.addon .qty { width: 56px; padding: 3px 6px; font-size: 12px; text-align: right; }
.addon i.appr, .addon i.days {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 6px;
  background: #fff7ed; color: var(--warn); border: 1px solid #fed7aa; white-space: nowrap;
}
.addon i.days { background: #eef2f7; color: var(--muted); border-color: var(--border); }

.hint-box {
  margin: 10px 0; padding: 9px 12px; border-radius: 9px; font-size: 12px;
  background: #f8fafc; border: 1px solid var(--border); color: var(--muted); line-height: 1.7;
}
.auth-box {
  margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.7;
  background: #eef7f2; border: 1px solid #cdebdc; color: #14663f;
}
.cb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cb input { width: 15px; height: 15px; accent-color: var(--primary); }

.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sum-cell {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.sum-cell span { display: block; font-size: 12px; color: var(--muted); }
.sum-cell b { display: block; margin-top: 4px; font-size: 18px; font-variant-numeric: tabular-nums; }
.sum-cell.primary { background: linear-gradient(180deg, #eaf2fe, #f5f9ff); border-color: #cfe0fb; }
.sum-cell.primary b { color: var(--primary-dark); font-size: 22px; }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }

.warn-line {
  margin-bottom: 6px; padding: 8px 12px; border-radius: 9px; font-size: 12px; line-height: 1.7;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
}
.warn-line.danger { background: #fef2f2; border-color: #fecaca; color: var(--danger); font-weight: 600; }

.calc-note { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.sub { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 2px; }
td.wrap, .wrap { white-space: normal; }
i.appr {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 6px;
  background: #fff7ed; color: var(--warn); border: 1px solid #fed7aa; white-space: nowrap;
}

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.kv-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: #f8fafc; border-radius: 9px; }
.kv-row span { font-size: 11px; color: var(--muted); }
.kv-row b { font-size: 13px; }
