[hidden] { display: none !important; }
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --panel-3: #f2f4f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;
  --primary: #e70a2a;
  --primary-600: #c40824;
  --primary-weak: #fff0f2;
  --primary-border: #f5b8c2;
  --danger: #d92d20;
  --danger-weak: #fef3f2;
  --warn: #dc6803;
  --warn-weak: #fff6ed;
  --amber: #b54708;
  --amber-weak: #fffaeb;
  --ok: #079455;
  --ok-weak: #ecfdf3;
  --info: #175cd3;
  --info-weak: #eff8ff;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 12px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.16);
  --sidebar-w: 216px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 布局 ---------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
}
.brand-dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #e70a2a, #e70a2a);
  display: grid; place-items: center; color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: -0.03em;
  flex: 0 0 auto;
}
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 11px; color: var(--text-3); padding: 12px 8px 5px; letter-spacing: 0.04em;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px; margin-bottom: 2px;
  background: none; border: 0; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; color: var(--text-2); font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel-3); color: var(--text); }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 16px; text-align: center; font-size: 14px; opacity: .9; }
.nav-item .badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--danger-weak); color: var(--danger);
  padding: 1px 6px; border-radius: 999px; min-width: 20px; text-align: center;
}
.nav-item.active .badge { background: #fff; }

.side-foot {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 11.5px; color: var(--text-3);
  line-height: 1.7;
}
.side-foot-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px;
}
.side-foot-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text-2); font-size: 11.5px;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.side-foot-btn:hover { background: var(--panel-3); border-color: var(--border-strong); color: var(--text); }
.side-status { font-size: 11px; color: var(--text-3); line-height: 1.65; }

.mode-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  margin-bottom: 6px;
}
.mode-pill.live { background: var(--ok-weak); color: var(--ok); }
.mode-pill.demo { background: var(--amber-weak); color: var(--amber); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

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

/* ---- 全局顶部工具栏 ---- */
.global-toolbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; gap: 16px;
}
.global-toolbar-left { flex: 1; min-width: 0; }
.global-toolbar-center { flex: 1.6; min-width: 0; max-width: 520px; }
.global-toolbar-right { flex: 1; min-width: 0; display: flex; justify-content: flex-end; gap: 6px; align-items: center; }

.breadcrumb { display: flex; align-items: baseline; gap: 8px; }
.bc-main { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.bc-sub { font-size: 12px; color: var(--text-3); }

.global-search {
  position: relative; display: flex; align-items: center;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 10px; height: 36px;
  transition: border-color .12s, box-shadow .12s;
}
.global-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.global-search-icon { font-size: 12px; opacity: .55; margin-right: 8px; }
.global-search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font-size: 13px; }
.global-search-kbd { font-size: 10.5px; color: var(--text-3); background: var(--panel); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }

.toolbar-btn {
  position: relative; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.toolbar-btn:hover { background: var(--panel-2); border-color: var(--border-strong); color: var(--text); }
.toolbar-btn .ico { font-size: 13px; }
.toolbar-btn .badge {
  position: absolute; top: -5px; right: -5px;
  font-size: 10px; font-weight: 600; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; border: 2px solid var(--panel);
  display: grid; place-items: center;
}
.toolbar-avatar { background: var(--primary-weak); color: var(--primary); border-color: var(--primary-border); }
.toolbar-avatar:hover { background: var(--primary); color: #fff; }

/* ---- 左侧导航模块 ---- */
.nav-module { margin-bottom: 2px; }
.nav-module-head {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; color: var(--text-2); font-size: 13.5px;
  transition: background .12s, color .12s;
}
.nav-module-head:hover { background: var(--panel-3); color: var(--text); }
.nav-module-head .ico { width: 16px; text-align: center; font-size: 14px; opacity: .9; }
.nav-module-head .arrow { margin-left: auto; font-size: 10px; opacity: .6; transition: transform .18s; }
.nav-module.expanded > .nav-module-head .arrow { transform: rotate(180deg); }
.nav-module-body { display: none; padding: 2px 0 4px 26px; }
.nav-module.expanded > .nav-module-body { display: block; }
.nav-module-body .nav-item {
  padding: 6px 10px; font-size: 12.5px; color: var(--text-3);
  background: none; border-radius: var(--radius-sm);
}
.nav-module-body .nav-item:hover { background: var(--panel-3); color: var(--text); }
.nav-module-body .nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }

/* 一级 nav-item（如首页工作台） */
.nav > .nav-item { margin-bottom: 2px; }

.topbar {
  padding: 14px 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); background: var(--panel);
  position: relative;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.topbar .sub { font-size: 12px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 20px 24px 60px; max-width: 1400px; width: 100%; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------------- 组件 ---------------- */

.btn {
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--panel-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-3); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-weak); border-color: var(--danger); }

.input, .select, .textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; background: var(--panel); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak);
}
.textarea { min-height: 80px; resize: vertical; font-family: inherit; }
.select { cursor: pointer; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > * { flex: 1; min-width: 180px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.card-head .sub { font-size: 11.5px; color: var(--text-3); }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.kpi .value { font-size: 23px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.kpi .unit { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.kpi .foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.kpi.accent-danger { border-left: 3px solid var(--danger); }
.kpi.accent-warn { border-left: 3px solid var(--warn); }
.kpi.accent-primary { border-left: 3px solid var(--primary); }
.kpi.accent-ok { border-left: 3px solid var(--ok); }

.tabs { display: flex; gap: 4px; background: var(--panel-3); padding: 3px; border-radius: 8px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.tab .n {
  font-size: 11px; background: var(--panel-3); color: var(--text-2);
  padding: 0 6px; border-radius: 999px; font-weight: 600;
}
.tab.active .n { background: var(--primary-weak); color: var(--primary); }

.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 16px 0 12px;
}
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-width: 140px; }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 30px; min-width: 240px; }
.search-wrap::before {
  content: "🔍"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11px; opacity: .55; pointer-events: none;
}

/* 待办卡片 */
.follow-list { display: flex; flex-direction: column; gap: 8px; }
.follow-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px; display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s;
  cursor: pointer;
}
.follow-item:hover { border-color: var(--primary-border); box-shadow: var(--shadow); }

.urgency {
  flex: 0 0 68px; text-align: center; border-radius: var(--radius-sm);
  padding: 7px 4px; font-weight: 650;
}
.urgency .d { font-size: 19px; line-height: 1.15; letter-spacing: -0.02em; }
.urgency .t { font-size: 10.5px; font-weight: 500; opacity: .85; }
.u-overdue { background: var(--danger-weak); color: var(--danger); }
.u-today { background: var(--warn-weak); color: var(--warn); }
.u-soon { background: var(--amber-weak); color: var(--amber); }
.u-ok { background: var(--ok-weak); color: var(--ok); }

.follow-main { flex: 1; min-width: 0; }
.follow-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.follow-name { font-weight: 600; font-size: 14.5px; }
.follow-meta { font-size: 12.5px; color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.follow-meta .sep { color: var(--border-strong); }
.follow-last {
  font-size: 12.5px; color: var(--text-2); margin-top: 7px;
  background: var(--panel-2); border: 1px dashed var(--border);
  border-radius: 6px; padding: 6px 9px;
  display: flex; gap: 7px; align-items: baseline;
}
.follow-last .k { color: var(--text-3); font-size: 11.5px; flex: 0 0 auto; }
.follow-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex: 0 0 auto; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; padding: 1px 7px; border-radius: 5px;
  background: var(--panel-3); color: var(--text-2); font-weight: 500;
  white-space: nowrap;
}
.tag-primary { background: var(--primary-weak); color: var(--primary); }
.tag-danger { background: var(--danger-weak); color: var(--danger); }
.tag-warn { background: var(--warn-weak); color: var(--warn); }
.tag-ok { background: var(--ok-weak); color: var(--ok); }
.tag-info { background: var(--info-weak); color: var(--info); }
.tag-outline { background: transparent; border: 1px solid var(--border-strong); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3);
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: var(--panel-2); white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr { cursor: pointer; }
table.tbl tbody tr:hover { background: var(--panel-2); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .strong { font-weight: 600; }
.muted { color: var(--text-3); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bar-row .k { flex: 0 0 120px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .v { flex: 0 0 auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #e70a2a, #e70a2a); border-radius: 999px; }
.bar-fill.warn { background: linear-gradient(90deg, #fdb022, #dc6803); }
.bar-fill.danger { background: linear-gradient(90deg, #f97066, #d92d20); }

.spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.spark > div { flex: 1; background: var(--primary-weak); border-radius: 2px 2px 0 0; min-height: 2px; }

/* 时间线 */
.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: 0 0 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--text-3);
}
.tl-item.m-Emails::before { border-color: var(--info); }
.tl-item.m-Calls::before { border-color: var(--ok); }
.tl-item.m-Notes::before { border-color: var(--amber); }
.tl-item.m-Tasks::before { border-color: var(--warn); }
.tl-item.m-Events::before { border-color: var(--primary); }
.tl-head { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.tl-subject { font-weight: 600; font-size: 13.5px; }
.tl-time { font-size: 11.5px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.tl-body {
  font-size: 12.5px; color: var(--text-2); margin-top: 4px;
  background: var(--panel-2); border-radius: 6px; padding: 7px 10px;
  white-space: pre-wrap; word-break: break-word;
}
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.36);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 60;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 94vw);
  background: var(--bg); z-index: 61; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 16px 20px; display: flex; gap: 12px; align-items: flex-start;
}
.drawer-head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.drawer-close {
  margin-left: auto; background: none; border: 0; font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--text-3); padding: 2px 6px; border-radius: 6px;
}
.drawer-close:hover { background: var(--panel-3); color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1024px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr; } }

/* ---- 首页工作台 ---- */
.home-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.home-header h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.home-date { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.home-role-switch select { width: auto; min-width: 130px; }

.home-kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1200px) { .home-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .home-kpi-row { grid-template-columns: 1fr 1fr; } }

.home-progress { display: flex; flex-direction: column; gap: 12px; }
.home-progress-item { display: flex; flex-direction: column; gap: 5px; }
.home-progress-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.home-progress-bar { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.home-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e70a2a, #e70a2a); }
.home-progress-fill.warn { background: linear-gradient(90deg, #fdb022, #dc6803); }
.home-progress-fill.danger { background: linear-gradient(90deg, #f97066, #d92d20); }

.home-mini-list { display: flex; flex-direction: column; gap: 8px; }
.home-mini-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.home-mini-item .num { font-weight: 650; font-variant-numeric: tabular-nums; }
.home-mini-item .label { flex: 1; min-width: 0; font-size: 12.5px; }
.home-mini-item .sub { font-size: 11.5px; color: var(--text-3); }

.home-feed-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border);
}
.home-feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.home-feed-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.home-feed-dot.ok { background: var(--ok); }
.home-feed-dot.warn { background: var(--warn); }
.home-feed-dot.danger { background: var(--danger); }
.home-feed-dot.info { background: var(--info); }
.home-feed-text { flex: 1; font-size: 12.5px; line-height: 1.55; }
.home-feed-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; word-break: break-word; }

.empty {
  text-align: center; padding: 46px 20px; color: var(--text-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2);
}
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .6; }
.empty .t { font-size: 14px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.empty .d { font-size: 12.5px; max-width: 520px; margin: 0 auto 14px; line-height: 1.7; }

.steps { display: flex; gap: 0; margin-bottom: 20px; }
.step { flex: 1; text-align: center; position: relative; font-size: 12.5px; color: var(--text-3); }
.step .n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--panel-3);
  color: var(--text-3); display: grid; place-items: center; margin: 0 auto 6px;
  font-weight: 600; font-size: 12px; border: 2px solid var(--panel);
}
.step.done .n { background: var(--ok-weak); color: var(--ok); }
.step.active .n { background: var(--primary); color: #fff; }
.step.active { color: var(--text); font-weight: 600; }
.step::after {
  content: ""; position: absolute; top: 13px; left: 50%; width: 100%; height: 2px;
  background: var(--border); z-index: -1;
}
.step:last-child::after { display: none; }

.alert {
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px;
  display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; line-height: 1.65;
}
.alert-info { background: var(--info-weak); color: #1849a9; border: 1px solid #b2ddff; }
.alert-warn { background: var(--warn-weak); color: #b54708; border: 1px solid #f9dbaf; }
.alert-ok { background: var(--ok-weak); color: #067647; border: 1px solid #abefc6; }
.alert-danger { background: var(--danger-weak); color: #b42318; border: 1px solid #fecdca; }
.alert code {
  background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px;
}

.checklist { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.checklist li { display: flex; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.checklist li:last-child { border-bottom: 0; }
.checklist .ok { color: var(--ok); flex: 0 0 16px; font-weight: 700; }
.checklist .no { color: var(--danger); flex: 0 0 16px; font-weight: 700; }

.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #101828; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease;
  max-width: 520px;
}
.toast.ok { background: #054f31; }
.toast.err { background: #912018; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); transition: width .3s; }

pre.code {
  background: #101828; color: #e4e7ec; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 12px; overflow-x: auto; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  line-height: 1.6; margin: 0;
}
code.inline {
  background: var(--panel-3); padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
}
.rc { display: flex; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; }

/* =========================================================================
   订单导入 / 用友推送
   ========================================================================= */

/* 通用小字 */
.sub { font-size: 11.5px; color: var(--text-3); }
.hint { font-size: 11.5px; color: var(--text-3); line-height: 1.65; }
.warn-text { color: var(--warn); }
.kpi.accent-info { border-left: 3px solid var(--info); }

/* 状态药丸 */
.st {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.7;
}
.st-ok { background: var(--ok-weak); color: var(--ok); }
.st-warn { background: var(--warn-weak); color: var(--warn); }
.st-danger { background: var(--danger-weak); color: var(--danger); }
.st-info { background: var(--info-weak); color: var(--info); }
.st-muted { background: var(--panel-3); color: var(--text-3); }

/* 表格里的小字与空态 */
.cell-main { font-weight: 500; }
.cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.empty-tbl { padding: 34px 10px; text-align: center; color: var(--text-3); font-size: 13px; }
tr.row-click { cursor: pointer; }

/* 拖拽上传区 */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2); padding: 26px 18px; text-align: center;
  cursor: pointer; transition: border-color .16s, background .16s;
}
.dropzone:hover { border-color: var(--primary-border); background: var(--primary-weak); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-weak); }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dropzone-ico { font-size: 26px; color: var(--primary); line-height: 1.2; }
.dropzone-title { font-size: 13.5px; font-weight: 600; }
.dropzone-sub { font-size: 11.5px; color: var(--text-3); }

/* 待解析文件行 */
.import-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.import-row:last-child { border-bottom: 0; }
.import-thumb {
  flex: 0 0 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--panel-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.import-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdf-ico { font-size: 10.5px; font-weight: 700; color: var(--danger); letter-spacing: .04em; }
.import-meta { flex: 1; min-width: 0; }
.import-name { font-size: 13px; font-weight: 550; word-break: break-all; }
.import-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* 匹配结果框 */
.match-box {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; background: var(--panel-2); margin-bottom: 10px;
}
.match-box.ok { border-color: #abefc6; background: var(--ok-weak); }
.match-box.bad { border-color: #fecdca; background: var(--danger-weak); }
.match-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.match-line code, .hint code, .line-name code, .cell-sub code {
  background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px;
}

/* 候选列表 */
.cand-list { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 4px; }
.cand {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 11px; cursor: pointer; font-size: 12.5px; transition: border-color .14s, background .14s;
}
.cand:hover { border-color: var(--primary-border); background: var(--primary-weak); }
.cand.picked { border-color: var(--primary); background: var(--primary-weak); }
.cand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-code {
  flex: 0 0 auto; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px; color: var(--text-2); background: var(--panel-3); padding: 1px 6px; border-radius: 4px;
}
.cand-score { flex: 0 0 auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 明细行卡片 */
.line-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 9px; background: var(--panel-2);
}
.line-card.bad { border-color: #fecdca; background: #fffbfa; }
.line-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.line-no { font-size: 11.5px; color: var(--text-3); flex: 0 0 auto; }
.line-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; }
.line-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.line-actions { margin-top: 8px; display: flex; gap: 7px; flex-wrap: wrap; }

/* 小字段 */
.mini { display: flex; flex-direction: column; gap: 3px; flex: 1 1 88px; min-width: 78px; }
.mini > span { font-size: 11px; color: var(--text-3); }
.mini.wide { flex: 1 1 100%; }
.input-xs { padding: 4px 8px !important; font-size: 12.5px !important; }
.mini-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* 抽屉分区标题 */
.sec-title {
  font-size: 12px; font-weight: 650; color: var(--text-2);
  margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.sec-title:first-child { margin-top: 0; }
.sec-title .sub { font-weight: 400; }
.issue-list { margin: 4px 0 0; padding-left: 18px; }
.issue-list li { line-height: 1.7; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 迷你表格 / 代码块 */
.mini-tbl { font-size: 12.5px; }
.mini-tbl td { padding: 6px 10px; }
pre.code-box {
  background: #101828; color: #e4e7ec; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 12px; overflow: auto; max-height: 340px; margin: 8px 0 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; line-height: 1.6;
}
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-weak); border-color: #fecdca; }

/* 轻量弹窗 */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 1; }
.modal-card { position: relative; z-index: 2; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.18); width: min(520px, calc(100% - 40px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px; overflow: auto; }
.parse-preview { text-align: center; margin-bottom: 14px; }
.parse-preview img { max-width: 100%; max-height: 220px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.parse-preview .pdf-ico-big { display: inline-flex; align-items: center; justify-content: center; width: 120px; height: 120px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: 28px; color: var(--danger); background: var(--panel-2); }
.parse-desc { font-size: 13px; line-height: 1.7; color: var(--text-2); margin-bottom: 14px; }
.parse-cmd { display: flex; gap: 8px; }
.parse-cmd input { flex: 1; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.parse-tip { margin-top: 12px; font-size: 12px; color: var(--text-3); }
/* 解析进度区：有内容时才占位，避免"开始解析"按钮跳来跳去 */
.parse-status:not(:empty) { margin-bottom: 14px; }
.parse-status .spin { margin-right: 4px; }

/* 待解析列表里的失败行：一眼看出是哪个文件卡住了、为什么 */
.import-row.is-failed {
  background: var(--danger-weak);
  border-left: 3px solid var(--danger);
  padding-left: 9px;
  border-radius: var(--radius-sm);
}
.import-note {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  max-height: 2.6em;
  overflow: hidden;
  word-break: break-all;
}

/* 语义色文本（在 .hint / 小字里用） */
.ok-text { color: var(--ok); }
.danger-text { color: var(--danger); }

/* ============================================================
   开发客户（Prospecting）
   ============================================================ */

/* 目标公司抽屉比订单抽屉宽 —— 调研报告和开发信都要横向空间 */
.drawer-wide { width: min(940px, 96vw); }
.modal-wide { width: min(720px, calc(100% - 40px)); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.field .req { color: var(--danger); font-weight: 400; }
.field textarea.input { resize: vertical; min-height: 56px; line-height: 1.6; }

/* ---- 列表行 ---- */
.prospect-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.prospect-row:last-child { border-bottom: 0; }
.prospect-row:hover { background: var(--panel-2); }
.prospect-score {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: var(--panel-3); color: var(--text-3); border: 1px solid var(--border);
}
.prospect-score.s-hot { background: var(--ok-weak); color: var(--ok); border-color: #abefc6; }
.prospect-score.s-mid { background: var(--amber-weak); color: var(--amber); border-color: #fdecc8; }
.prospect-score.s-new { font-size: 11px; font-weight: 600; }
.prospect-main { flex: 1; min-width: 0; }
.prospect-name { font-weight: 620; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prospect-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; word-break: break-word; }
.prospect-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.prospect-actions { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }

.tag {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: var(--panel-3); color: var(--text-2); border: 1px solid var(--border);
}
.tag.t-ok { background: var(--ok-weak); color: var(--ok); border-color: #abefc6; }
.tag.t-warn { background: var(--warn-weak); color: var(--warn); border-color: #f9dbaf; }
.tag.t-info { background: var(--info-weak); color: var(--info); border-color: #b2ddff; }
.tag.t-muted { background: var(--panel-3); color: var(--text-3); }

/* ---- 抽屉分区 ---- */
.p-sec { margin-bottom: 20px; }
.p-sec > h4 {
  margin: 0 0 10px; font-size: 13px; font-weight: 650; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.p-sec > h4 .n {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  background: var(--panel-3); border-radius: 999px; padding: 0 7px;
}
.p-sec > h4 .right { margin-left: auto; font-weight: 400; }

/* 五个动作按钮：一行铺开，每个都带一句人话说明 */
.p-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.p-act {
  text-align: left; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.p-act:hover:not(:disabled) { border-color: var(--primary-border); background: var(--primary-weak); }
.p-act:disabled { opacity: .5; cursor: not-allowed; }
.p-act b { display: block; font-size: 13px; font-weight: 620; margin-bottom: 3px; }
.p-act span { font-size: 11.5px; color: var(--text-3); line-height: 1.45; display: block; }

.p-status:not(:empty) {
  margin-bottom: 14px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--info-weak); border: 1px solid #b2ddff; color: #175cd3; font-size: 12.5px;
}
.p-status.is-err { background: var(--danger-weak); border-color: #fecdca; color: #b42318; }
.p-status .spin { margin-right: 4px; }

/* ---- 调研报告 ---- */
.report { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.report-head {
  background: var(--panel-2); padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-3);
}
.report-head .score { font-weight: 700; font-size: 15px; color: var(--text); }
.report-body { padding: 14px; }
.report-row { margin-bottom: 12px; }
.report-row:last-child { margin-bottom: 0; }
.report-row dt { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.report-row dd { margin: 0; font-size: 13px; line-height: 1.65; }
.report-row ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.report-note {
  font-size: 11.5px; color: var(--text-3); padding: 8px 14px;
  border-top: 1px solid var(--border); background: var(--panel-2); line-height: 1.6;
}
.report-note.warn { background: var(--warn-weak); color: var(--amber); }

/* ---- 决策人 / 联系人 / 邮箱候选 ---- */
.dm-card, .p-contact, .p-mail, .p-task {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 8px; background: var(--panel);
}
.dm-card .t { font-weight: 620; font-size: 13.5px; }
.dm-card .why { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.dm-card .links { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.mail-cand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; font-size: 13px; background: var(--panel);
}
.mail-cand .addr { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; flex: 1; word-break: break-all; }
.mail-cand .right { margin-left: auto; display: flex; gap: 6px; align-items: center; white-space: nowrap; }

/* ---- 开发信 ---- */
.mail-subject { font-weight: 620; font-size: 13.5px; margin-bottom: 6px; }
.mail-body {
  white-space: pre-wrap; font-size: 13px; line-height: 1.7;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; max-height: 320px; overflow: auto;
}
.mail-meta { font-size: 11.5px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }

/* ---- 跟进计划 ---- */
.p-task { display: flex; gap: 11px; align-items: flex-start; }
.p-task .day {
  flex: 0 0 auto; width: 44px; font-size: 11.5px; color: var(--text-3);
  text-align: center; padding-top: 2px;
}
.p-task .day b { display: block; font-size: 14px; color: var(--text); }
.p-task.done { opacity: .55; }
.p-task.done .t { text-decoration: line-through; }
.p-task .t { font-weight: 600; font-size: 13px; }
.p-task .d { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.p-task .draft {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px; background: var(--panel-3); border-radius: 6px;
  padding: 7px 9px; margin-top: 6px; white-space: pre-wrap; line-height: 1.6;
}

/* ---- 底部联动区 ---- */
.p-convert { display: flex; gap: 8px; flex-wrap: wrap; }
.p-convert .btn { display: inline-flex; align-items: center; gap: 6px; }

.p-empty {
  padding: 22px 16px; text-align: center; color: var(--text-3); font-size: 12.5px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--panel-2);
}

/* 建订单弹窗里的明细行 */
.p-line { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.p-line .f-name { flex: 1; min-width: 0; }
.p-line .f-num { flex: 0 0 84px; }
.p-line .f-del { flex: 0 0 auto; }
.p-line label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }

/* ---- 成交预览 ---- */
.dp-trend { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 10px 0; }
.dp-trend-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 28px;
}
.dp-trend-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.dp-trend-bar { width: 10px; border-radius: 2px 2px 0 0; }
.dp-trend-bar.actual { background: var(--primary); }
.dp-trend-bar.plan { background: var(--text-3); opacity: 0.35; }
.dp-trend-label { font-size: 11px; color: var(--text-2); margin-top: 6px; }

.dp-line-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 120px;
}
.dp-line-title { font-weight: 600; font-size: 12px; margin-bottom: 6px; }

.accent-info .kpi-v { color: var(--info); }
.accent-info { border-top-color: var(--info); }

/* AKEEYO logo red, sampled from supplied brand reference. */
::selection{background:#ffd4dc;color:#262329}
input,textarea{caret-color:var(--primary)}
.brand-dot{background:var(--primary)}
