/* ====== Notion 风格 · v1.12 ======
   设计语言：
   - 背景纯白，卡片零阴影，靠留白 + 极细线分割
   - 文字用 Notion 灰 #37352F，非纯黑
   - KPI 扁平，微妙底色，无重色左边框
   - 表格干净，hover 淡灰
   - 字体 Inter
*/
:root {
  --primary: #2383E2;
  --primary-hover: #1A6BC4;
  --primary-light: rgba(35,131,226,0.08);
  --accent: #E03E2D;
  --accent-green: #0F7B4E;
  --accent-orange: #D9730D;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --text: #37352F;
  --text-sec: rgba(55,53,47,0.65);
  --text-ter: rgba(55,53,47,0.4);
  --border: rgba(55,53,47,0.09);
  --border-strong: rgba(55,53,47,0.16);
  --hover-bg: rgba(55,53,47,0.04);
  --hover-bg-strong: rgba(55,53,47,0.08);
  --shadow: none;
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 4px;
  --radius-lg: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--text); line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== 登录页 ====== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #FBFBFA;
}
.login-card {
  width: 360px; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 36px 32px;
  border: 1px solid var(--border);
}
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 20px; text-align: center; color: var(--text); }

/* ====== 主框架 ====== */
.app-layout { display: flex; min-height: 100vh; background: var(--bg); }
.app-sider {
  width: 220px; background: #FBFBFA; border-right: 1px solid var(--border);
  padding: 12px 0;
}
.app-sider .logo {
  font-size: 14px; font-weight: 700; color: var(--text);
  padding: 4px 16px 16px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.app-sider .menu-item {
  padding: 6px 12px; margin: 1px 8px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text);
  border-radius: var(--radius); transition: background 0.15s;
  border-left: none;
}
.app-sider .menu-item.active {
  background: var(--hover-bg-strong); color: var(--text); font-weight: 600;
}
.app-sider .menu-item:hover:not(.active) { background: var(--hover-bg); }

.app-main { flex: 1; padding: 32px 40px; overflow-x: hidden; background: var(--bg); }
.app-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; font-size: 28px; font-weight: 700; color: var(--text);
}
.app-header .user { font-size: 13px; color: var(--text-sec); font-weight: 400; }

/* ====== 通用卡片 (Notion: 零阴影 + 底部分割线) ====== */
.card {
  background: var(--card); border-radius: 0; box-shadow: none;
  margin-bottom: 32px; padding: 0 0 28px 0;
  border-bottom: 1px solid var(--border);
}
.card:last-child { border-bottom: none; }
.card-title {
  font-size: 17px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}

/* ====== 商机管理选项卡 ====== */
.opp-tab {
  padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-sec); border-bottom: 2px solid transparent; user-select: none;
  transition: color .15s, border-color .15s;
}
.opp-tab:hover { color: var(--text); background: var(--hover-bg); border-radius: var(--radius) var(--radius) 0 0; }
.opp-tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }

/* ====== KPI 卡片 (Notion: 扁平底色，无左边框) ====== */
.kpi-row { display:flex; gap:12px; flex-wrap:wrap; }
.kpi-card {
  flex:1; min-width:180px; border-radius: var(--radius-lg);
  padding: 20px 24px; text-align: left; border: none;
}
.kpi-card.blue   { background: rgba(35,131,226,0.06); }
.kpi-card.green  { background: rgba(15,123,78,0.06); }
.kpi-card.red    { background: rgba(224,62,45,0.06); }
.kpi-card.orange { background: rgba(217,115,13,0.06); }
.kpi-card .label { font-size: 12px; color: var(--text-sec); margin-bottom: 6px; font-weight: 500; }
.kpi-card .value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.kpi-card .sub   { font-size: 12px; color: var(--text-sec); margin-top: 4px; }

/* ====== 表格 (Notion: 极简) ====== */
.proj-table { width:100%; border-collapse:collapse; font-size: 14px; }
.proj-table th {
  background: #FBFBFA; color: var(--text-sec); font-weight: 500;
  font-size: 12px; padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border-strong);
}
.proj-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle; font-size: 14px;
}
.proj-table tr:hover { background: var(--hover-bg); }
.tag { display:inline-block; padding: 2px 8px; border-radius: var(--radius); font-size: 12px; font-weight: 500; }
.tag.done { background: rgba(15,123,78,0.1); color: var(--accent-green); }
.tag.doing { background: rgba(35,131,226,0.1); color: var(--primary); }
.tag.risk { background: rgba(224,62,45,0.1); color: var(--accent); }
.tag.wait { background: rgba(55,53,47,0.08); color: var(--text-sec); }
.tag.plan { background: rgba(217,115,13,0.1); color: var(--accent-orange); }

/* ====== 客户色柱 (Notion: 扁平) ====== */
.bar-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; font-size: 13px; }
.bar-row .label { width: 200px; flex-shrink:0; font-weight: 500; }
.bar-row .label .uin { color: var(--text-sec); font-size: 12px; font-weight: 400; }
.bar-track {
  flex:1; height: 24px; background: rgba(55,53,47,0.06); border-radius: var(--radius);
  overflow:hidden; display:flex; position: relative;
}
.bar-seg {
  height:100%; display:flex; align-items:center; justify-content:center;
  color:#fff; font-size: 12px; font-weight: 500; min-width: 0; overflow: hidden;
  letter-spacing: -0.2px;
}
.bar-seg.A { background: var(--primary); }
.bar-seg.B { background: rgba(35,131,226,0.45); color: #1E3A5F; }
.bar-seg.C { background: var(--accent-orange); }
.bar-row .total { width: 90px; text-align:right; font-weight: 600; flex-shrink:0; }

/* ====== ⓘ Tooltip 标记 ====== */
.calc-tip-icon { color: var(--text-ter); font-size: 14px; cursor: help; margin-left: 4px; vertical-align: middle; }
.calc-tip-popup { max-width: 380px; font-size: 13px; line-height: 1.7; }
.calc-tip-popup .formula { background: var(--hover-bg); border-left: 3px solid var(--primary); padding: 8px 12px; margin: 6px 0; font-family: "SF Mono", SFMono-Regular, Menlo, monospace; white-space: pre-wrap; border-radius: 0 var(--radius) var(--radius) 0; }
.calc-tip-popup .source { color: var(--text-sec); font-size: 12px; }
.calc-tip-popup h4 { font-size: 13px; margin: 6px 0 4px; color: var(--text); font-weight: 600; }

/* ====== Element Plus 覆写 (Notion 化) ====== */
.el-button--primary {
  --el-button-bg-color: var(--primary);
  --el-button-border-color: var(--primary);
  --el-button-hover-bg-color: var(--primary-hover);
  --el-button-hover-border-color: var(--primary-hover);
  border-radius: var(--radius); font-weight: 500;
}
.el-button {
  border-radius: var(--radius);
  font-weight: 500;
}
.el-input__wrapper {
  border-radius: var(--radius);
  box-shadow: none !important;
  border: 1px solid var(--border-strong);
}
.el-input__wrapper:hover { border-color: var(--text-ter); }
.el-input__wrapper.is-focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) !important; }
.el-select .el-input__wrapper { border-radius: var(--radius); }
.el-select-dropdown__item.selected { color: var(--primary); font-weight: 500; }
.el-dialog {
  border-radius: var(--radius-lg);
  --el-dialog-box-shadow: var(--shadow-lg);
}
.el-radio-button__inner { border-radius: var(--radius); }
.el-radio-group .el-radio-button:first-child .el-radio-button__inner { border-radius: var(--radius) 0 0 var(--radius); }
.el-radio-group .el-radio-button:last-child .el-radio-button__inner { border-radius: 0 var(--radius) var(--radius) 0; }
.el-tag { border-radius: var(--radius); font-weight: 500; }

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .app-sider { width: 100%; display: flex; overflow-x: auto; padding: 4px 0; }
  .app-sider .logo { display: none; }
  .app-sider .menu-item { white-space: nowrap; margin: 1px 4px; }
  .kpi-row { flex-direction: column; }
  .bar-row .label { width: 140px; }
}
