/* ============================================================
   企业微信 OA + 项目管理系统  —— 样式
   ============================================================ */
:root {
  --primary: #4a6cf7;
  --primary-dark: #3b58d6;
  --primary-light: #eef1fe;
  --success: #12b76a;
  --success-light: #e7f8ef;
  --warning: #f79009;
  --warning-light: #fef4e6;
  --danger: #f04438;
  --danger-light: #fdecea;
  --gray: #667085;
  --gray-light: #f2f4f7;
  --border: #e4e7ec;
  --text: #101828;
  --text-secondary: #475467;
  --sidebar-bg: #1b2036;
  --sidebar-hover: #262c47;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--gray-light);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b58d6 0%, #6b4df7 55%, #22b3c9 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  padding: 36px 32px; box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.brand-logo { font-size: 40px; }
.login-brand h1 { font-size: 20px; margin: 10px 0 6px; }
.login-brand p { color: var(--text-secondary); font-size: 13px; margin: 0; }
.login-form label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--text-secondary); }
.login-form input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.login-quick { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 16px; }
.login-quick .tip { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.login-quick .quick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.login-quick button {
  border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px;
  font-size: 12px; cursor: pointer; color: var(--text-secondary);
}
.login-quick button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.login-tip { text-align: center; font-size: 12px; color: var(--gray); margin-top: 16px; }

/* ---------------- 布局 ---------------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 232px; background: var(--sidebar-bg); color: #c8cde0; display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sidebar-brand {
  height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  color: #fff; font-weight: 600; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo-sm { font-size: 20px; }
.menu { flex: 1; overflow-y: auto; padding: 12px 10px; }
.menu-group-title { font-size: 11px; color: #6b7292; padding: 14px 12px 6px; letter-spacing: .5px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; color: #c8cde0; margin-bottom: 2px; transition: .15s;
}
.menu-item:hover { background: var(--sidebar-hover); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; }
.menu-item .mi-icon { width: 18px; text-align: center; }
.sidebar-foot { padding: 12px 16px; font-size: 11px; color: #6b7292; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px; flex-shrink: 0;
}
.breadcrumb { font-size: 14px; color: var(--text-secondary); }
.breadcrumb b { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn { border: none; background: transparent; font-size: 16px; cursor: pointer; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--gray-light); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.user-meta { line-height: 1.25; }
.user-meta .un { font-size: 13px; font-weight: 600; }
.user-meta .ur { font-size: 11px; color: var(--gray); }

.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }
.app-footer { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; padding: 8px 16px; font-size: 12px; color: #98a2b3; border-top: 1px solid var(--border); background: #fff; }
.app-footer a { color: #98a2b3; text-decoration: none; }
.app-footer a:hover { color: var(--primary); }
.app-footer .sep { color: #d0d5dd; }
.login-footer { position: fixed; left: 0; right: 0; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; font-size: 12px; color: #98a2b3; }
.login-footer a { color: #98a2b3; text-decoration: none; }
.login-footer a:hover { color: var(--primary); }
.login-footer .sep { color: #d0d5dd; }

/* ---------------- 卡片 / 通用 ---------------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-pad { padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-title .ct-left { display: flex; align-items: center; gap: 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 19px; }
.page-head .sub { font-size: 12px; color: var(--gray); margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.ta-c { text-align: center !important; }
.ta-r { text-align: right !important; }
.text-danger { color: var(--danger); }
.text-warn { color: #d97706; }
.text-ok { color: var(--success); }

/* ---------- 项目管理仪表盘（我负责 / 参与 / 采购报销 / 开票回款） ---------- */
.ov-bars { display: flex; flex-direction: column; gap: 14px; }
.ov-bar-row { display: flex; flex-direction: column; gap: 6px; }
.ov-bar-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ov-bar-name { font-weight: 600; color: var(--text-primary); text-decoration: none; }
.ov-bar-name:hover { color: var(--primary); text-decoration: underline; }
.ov-bar-amount { font-weight: 600; color: var(--text-primary); }
.ov-bar-track { height: 12px; background: #eef2f7; border-radius: 8px; overflow: hidden; }
.ov-bar-fill { height: 100%; background: var(--primary); border-radius: 8px; transition: width .3s; }
.ov-bar-fill.warn { background: #f59e0b; }
.ov-bar-fill.danger { background: var(--danger); }
.ov-bar-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; }
.ov-bar-ops { display: flex; gap: 8px; margin-top: 2px; }
.ov-biz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ov-biz { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; }
.ov-action { margin-top: 12px; align-self: flex-start; }
.ov-pie .ov-action { align-self: stretch; text-align: center; }
.ov-biz-title { font-weight: 600; margin-bottom: 10px; }
.ov-biz-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
.ov-biz-metrics .k { display: block; font-size: 12px; color: var(--gray); margin-bottom: 2px; }
.ov-biz-metrics .v { font-size: 14px; font-weight: 600; }
.ov-pie-grid { display: flex; gap: 40px; flex-wrap: wrap; }
.ov-pie { display: flex; flex-direction: column; align-items: center; }
.ov-pie-title { font-weight: 600; margin-bottom: 6px; }
.legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-value { font-weight: 600; }
@media (max-width: 720px) {
  .ov-pie-grid { gap: 20px; justify-content: center; }
  .ov-bar-meta { gap: 8px; }
}
.muted { color: var(--gray); font-size: 12px; }
.mono { font-family: "Consolas", "Courier New", monospace; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  color: var(--text); font-size: 13.5px; cursor: pointer; transition: .15s; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; padding: 0; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid.col1 { grid-template-columns: 1fr; }
.form-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span2 { grid-column: span 2; }
.field.span3 { grid-column: span 3; }
.field > label { font-size: 13px; color: var(--text-secondary); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px;
  outline: none; font-family: inherit; background: #fff; color: var(--text); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field textarea { resize: vertical; min-height: 76px; }
.field .error-text { color: var(--danger); font-size: 12px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field .hint { color: var(--gray); font-size: 12px; }

/* 表单分区标题（立项：基础信息 / 干系人信息 / 资金信息） */
.form-section {
  display: flex; align-items: center; gap: 8px;
  grid-column: span 3; margin-top: 6px;
  font-size: 14.5px; font-weight: 600; color: var(--text-primary);
}
.form-section:first-child { margin-top: 0; }
.form-section .fs-bar { width: 4px; height: 15px; border-radius: 2px; background: var(--primary); display: inline-block; }
.form-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* 客户多联系人行 */
.contact-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.contact-row input { flex: 1; min-width: 0; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }
.contact-row input[name=c_id] { display: none; }
@media (max-width: 720px) {
  .form-section { grid-column: span 1; }
  .contact-row { flex-wrap: wrap; }
}
.radio-row, .checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.radio-row label, .checkbox-row label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; padding: 11px 12px; background: #fafbfc; color: var(--text-secondary);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover { background: #fafbff; }
table.data tr.summary-row td { background: var(--primary-light); font-weight: 600; border-top: 2px solid var(--primary); }
/* 客户列表：点击整行展开全部联系人 */
tr.row-clickable { cursor: pointer; }
tr.row-clickable .caret { display: inline-block; color: var(--gray); transition: transform .15s; font-size: 11px; margin-right: 2px; }
tr.row-clickable.expanded .caret { transform: rotate(90deg); color: var(--primary); }
tr.expand-row > td { background: #f8fafc; padding: 10px 18px; }
.contact-expand .ce-title { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
table.mini { border-collapse: collapse; font-size: 12.5px; }
table.mini th { text-align: left; padding: 5px 16px 5px 0; color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border); }
table.mini td { padding: 5px 16px 5px 0; border-bottom: 1px dashed var(--border); }
table.mini tr:last-child td { border-bottom: none; }
.align-right { text-align: right; }
.align-center { text-align: center; }
.empty { text-align: center; color: var(--gray); padding: 46px 0; }
.empty .icon { font-size: 34px; opacity: .5; }

/* ---------------- 标签 ---------------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: var(--warning); }
.tag-gray { background: var(--gray-light); color: var(--gray); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-purple { background: #f2ecfe; color: #7a5af8; }
.tag-cyan { background: #e6f6fb; color: #0e8ba8; }
.tag-teal { background: #e3f6f1; color: #0f9d7a; }

/* 项目补录：动态明细行 */
.bf-rows { margin: 4px 0 8px; }
.bf-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; margin-bottom: 8px; }
.bf-cell { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--gray); }
.bf-cell input, .bf-cell select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 13px; }
.bf-cell.bf-up { min-width: 240px; }

/* 项目全生命周期步骤条 */
.stage-bar { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 12px; }
.stage { padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.stage-done { background: var(--success-light); color: var(--success); }
.stage-todo { background: var(--gray-light); color: var(--gray); }
.stage-cur { font-weight: 700; box-shadow: inset 0 0 0 1px currentColor; }
.stage-sep { color: var(--border); margin: 0 1px; }
.progress-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }

/* ---------------- 指标卡 ---------------- */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.metric {
  background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  border-left: 3px solid var(--primary);
}
.metric .m-label { font-size: 12.5px; color: var(--gray); margin-bottom: 8px; }
.metric .m-value { font-size: 21px; font-weight: 600; letter-spacing: -.3px; }
.metric .m-sub { font-size: 12px; color: var(--gray); margin-top: 6px; }
.metric.green { border-left-color: var(--success); }
.metric.green .m-value { color: var(--success); }
.metric.red { border-left-color: var(--danger); }
.metric.red .m-value { color: var(--danger); }
.metric.orange { border-left-color: var(--warning); }
.metric.orange .m-value { color: var(--warning); }
.metric.gray { border-left-color: var(--gray); }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; cursor: pointer; font-size: 13.5px; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------------- 模态框 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: flex-start;
  justify-content: center; z-index: 1000; padding: 60px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  animation: modalIn .16s ease-out;
}
@keyframes modalIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 15.5px; }
.modal-close { border: none; background: transparent; font-size: 20px; cursor: pointer; color: var(--gray); line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ---------------- 提示 ---------------- */
.toast-box { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 380px; padding: 12px 16px; border-radius: 8px; background: #fff;
  box-shadow: var(--shadow-lg); font-size: 13.5px; border-left: 4px solid var(--primary);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 4px 2px; }
.pagination .pg-info { color: var(--gray); font-size: 12.5px; margin-right: auto; }
.pagination button {
  min-width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-secondary); font-family: inherit;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 附件 ---------------- */
.upload-zone {
  border: 1.5px dashed var(--border); border-radius: 10px; padding: 22px; text-align: center;
  color: var(--gray); cursor: pointer; transition: .15s; font-size: 13px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--gray-light); border-radius: 6px; font-size: 12.5px; }
.file-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 其他 ---------------- */
.searchable-select { position: relative; }

/* 多选下拉 */
.multi-select { position: relative; }
.ms-control { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; min-height: 38px; font-size: 13.5px; }
.ms-control .ms-arrow { color: #98a2b3; }
.ms-panel { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; max-height: 240px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.12); padding: 4px; }
.ms-option { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.ms-option:hover { background: #f2f4f7; }
.ms-option .ms-check { width: 14px; color: var(--primary); font-size: 12px; }
.ms-option .ss-sub { color: #98a2b3; }
.searchable-select .ss-input {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px;
  width: 100%; outline: none; font-family: inherit; background: #fff;
}
.searchable-select .ss-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ss-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; z-index: 50;
}
.ss-option { padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.ss-option:hover, .ss-option.highlight { background: var(--primary-light); color: var(--primary); }
.ss-empty { padding: 14px; text-align: center; color: var(--gray); font-size: 12.5px; }
.ss-option .ss-sub { font-size: 11.5px; color: var(--gray); }

.info-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.info-list.col2 { grid-template-columns: repeat(2, 1fr); }
.info-item .k { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.info-item .v { font-size: 13.5px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid.col3 { grid-template-columns: 1fr; }
  .field.span2, .field.span3 { grid-column: span 1; }
  .info-list { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
/* ---------------- 侧边栏抽屉 / 移动端适配 ---------------- */
.menu-toggle { display: none; font-size: 18px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 940; }

/* 登录页：企业微信扫码登录 */
.login-wx { margin-top: 2px; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--gray); font-size: 12px; margin: 16px 0 12px; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-wx { background: #07c160; border-color: #07c160; color: #fff; }
.btn-wx:hover { background: #06ad56; border-color: #06ad56; color: #fff; }
.btn-wx .wx-icon { font-size: 15px; }
.btn-lg { padding: 12px 18px; font-size: 15px; border-radius: 10px; }
.wx-qr-tip { text-align: center; color: var(--gray); font-size: 12px; margin-top: 8px; }
.login-alt-toggle { text-align: center; margin-top: 16px; }
.login-alt-toggle a { font-size: 12.5px; color: var(--gray); text-decoration: underline; }
.login-alt-toggle a:hover { color: var(--primary); }

@media (max-width: 760px) {
  .app { height: 100dvh; }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: 250px; z-index: 950;
    transform: translateX(-100%); transition: transform .22s ease; will-change: transform;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.show { display: block; }
  .main { width: 100%; }
  .topbar { height: 54px; padding: 0 10px; gap: 6px; }
  .breadcrumb { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 8px; }
  .user-chip .user-meta { display: none; }
  .content { padding: 14px 12px 32px; }
  .card-pad { padding: 14px; }
  .page-head h2 { font-size: 17px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { padding: 13px 14px; }
  .metric .m-value { font-size: 18px; }
  .info-list { grid-template-columns: 1fr; }
  .modal-mask { padding: 14px 10px; }
  .modal { max-width: 100%; }
  .modal-body { padding: 16px; }
  .toast-box { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: 100%; }
  .login-card { padding: 26px 20px; }
  .field input, .field select, .field textarea { font-size: 16px; } /* 防 iOS 聚焦自动放大 */
  .pagination { flex-wrap: wrap; }
  /* 页面里内联写死的 3/4/5 列网格，在手机上收到 2 列 */
  .info-list[style*="repeat(3,"], .info-list[style*="repeat(4,"], .info-list[style*="repeat(5,"] { grid-template-columns: repeat(2, 1fr) !important; }
  .metric-grid[style*="repeat(3,"], .metric-grid[style*="repeat(4,"], .metric-grid[style*="repeat(5,"] { grid-template-columns: repeat(2, 1fr) !important; }
  /* 顶部搜索框自适应宽度 */
  .row > input[style*="width"] { width: 100% !important; }
}
@media (max-width: 560px) {
  .info-list, .info-list[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.bar-col .bar { width: 14px; border-radius: 3px 3px 0 0; background: var(--primary); transition: height .4s; }
.bar-col .bar.cost { background: var(--warning); }
.bar-col .bar-label { font-size: 11px; color: var(--gray); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--gray); margin-top: 10px; }
.legend .dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }
/* 工作台：区间切换按钮组 + 趋势图横向滚动（今年/去年 12 根柱子） */
.range-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.range-tabs button { border: 1px solid var(--border); background: #fff; color: var(--gray); padding: 4px 10px; font-size: 12.5px; border-radius: 6px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.range-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bar-chart { overflow-x: auto; }
.bar-col { min-width: 34px; }
.chart-sum { font-size: 12px; color: var(--gray); margin-top: 8px; }
/* 工作台状态分布可点击行 */
.dist-row { cursor: pointer; border-radius: 8px; padding: 4px 6px; margin-left: -6px; transition: background .15s; }
.dist-row:hover { background: #f8fafc; }
.dist-go { color: var(--primary); font-weight: 700; }
/* 销售成本：环形图 + 图例 */
.pie-box { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 190px; height: 190px; flex: 0 0 auto; }
.pie-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pie-center .pc-val { font-size: 22px; font-weight: 700; color: var(--primary); }
.pie-center .pc-lb { font-size: 12px; color: var(--gray); margin-top: 2px; }
.pie-legend { flex: 1; min-width: 210px; }
.pl-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; }
.pl-row.clickable { cursor: pointer; }
.pl-row.clickable:hover { background: #f8fafc; }
.pl-row .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pl-name { flex: 0 0 58px; color: var(--gray); }
.pl-val { flex: 1; text-align: right; font-weight: 600; }
.pl-pct { flex: 0 0 56px; text-align: right; color: var(--gray); }
.pl-total { display: flex; justify-content: space-between; border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 8px; font-size: 13px; font-weight: 600; }
/* 可点击的指标卡（工作台跳转销售成本） */
.metric.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.metric.clickable:hover { box-shadow: 0 4px 14px rgba(0,0,0,.09); transform: translateY(-1px); }
.metric .m-go { color: var(--primary); font-weight: 700; font-size: 12px; margin-left: 4px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--gray); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--border);
}
.tl-item.done::before { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.tl-item.reject::before { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.tl-item .tl-title { font-size: 13.5px; font-weight: 500; }
.tl-item .tl-meta { font-size: 12px; color: var(--gray); margin-top: 2px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); }
.alert-warn { background: var(--warning-light); color: #b54708; }
.alert-danger { background: var(--danger-light); color: #b42318; }
.alert-success { background: var(--success-light); color: #027a48; }
