/* ===== 盐华运营管理系统 · 工作台主题 ===== */
:root {
  --main: #1f6e63;
  --main-d: #17574e;
  --main-l: #e8f2f0;
  --gold: #e8963a;
  --gold-l: #fdf3e7;
  --bg: #f3f5f7;
  --card: #ffffff;
  --line: #e5e9ec;
  --txt: #22313b;
  --gray: #7a8a94;
  --red: #d64545;
  --red-l: #fdecec;
  --green: #3c9d63;
  --green-l: #e9f7ef;
  --amber: #e8963a;
  --amber-l: #fdf3e7;
  --purple: #7b5ea7;
  --purple-l: #f1ecf8;
  --blue: #3d7bb3;
  --blue-l: #eaf2fa;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 45, 55, .06), 0 4px 14px rgba(20, 45, 55, .05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--txt); font-size: 15px; line-height: 1.55; }

/* ---------- 布局 ---------- */
.ws { display: flex; min-height: 100vh; }
.side { width: 224px; background: linear-gradient(180deg, #1b5c52, #164a42);
  color: #d9e8e5; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  transition: transform .22s ease; }
.logo { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.09); }
.logo-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--gold); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex: none; }
.logo b { display: block; font-size: 15px; color: #fff; letter-spacing: .5px; }
.logo small { display: block; font-size: 11px; color: #9fc0ba; margin-top: 1px; }
.menu { flex: 1; overflow-y: auto; padding: 10px 8px; }
.menu::-webkit-scrollbar { width: 0; }
.m-item { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px;
  cursor: pointer; color: #c4d9d5; font-size: 14.5px; margin-bottom: 2px; user-select: none; }
.m-item .ic { width: 20px; text-align: center; font-size: 15px; flex: none; }
.m-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.m-item.on { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.m-item.parent .arr { margin-left: auto; font-size: 11px; transition: transform .2s; color: #8fb4ad; }
.m-item.parent.open .arr { transform: rotate(90deg); }
.m-sub { overflow: hidden; max-height: 0; transition: max-height .22s ease; }
.m-sub.open { max-height: 320px; }
.m-sub .m-item { padding: 8px 12px 8px 41px; font-size: 13.5px; }
.m-sub .m-item.on { background: var(--gold); color: #fff; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.me { padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.08); margin-bottom: 8px; }
.me .nm { color: #fff; font-size: 14px; font-weight: 600; }
.me .pos { font-size: 11.5px; color: #9fc0ba; }
.side-foot .btn { width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #d9e8e5; }
.side-foot .btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.main { flex: 1; margin-left: 224px; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 54px; }
.burger { display: none; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--txt); padding: 6px 8px; }
.crumb { font-size: 15.5px; font-weight: 600; }
.crumb .sub-crumb { color: var(--gray); font-weight: 400; font-size: 13px; margin-left: 6px; }
.top-act { margin-left: auto; display: flex; gap: 8px; align-items: center; }
#app { padding: 18px; max-width: 1180px; width: 100%; margin: 0 auto; }
.side-mask { display: none; position: fixed; inset: 0; background: rgba(15,30,35,.45); z-index: 35; }

/* ---------- 卡片与网格 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h3 .cnt { margin-left: auto; font-size: 12.5px; color: var(--gray); font-weight: 400; }
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 17px;
  position: relative; overflow: hidden; cursor: pointer; }
.kpi .n { font-size: 30px; font-weight: 700; line-height: 1.15; }
.kpi .l { font-size: 12.5px; color: var(--gray); margin-top: 3px; }
.kpi.red .n { color: var(--red); }
.kpi.green .n { color: var(--green); }
.kpi.amber .n { color: var(--amber); }
.kpi.gold { background: linear-gradient(135deg, #e8963a, #d97f22); }
.kpi.gold .n, .kpi.gold .l { color: #fff; }
.kpi .dot { position: absolute; right: -14px; top: -14px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--main-l); opacity: .5; }

/* ---------- 员工卡片 ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.staff-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.staff-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,45,55,.1); }
.staff-card .nm { font-weight: 700; font-size: 15px; }
.staff-card .pos { font-size: 12px; color: var(--gray); margin: 2px 0 10px; }
.staff-card .nums { display: flex; gap: 14px; }
.staff-card .nums div { flex: 1; }
.staff-card .nums .n { font-size: 21px; font-weight: 700; color: var(--main); }
.staff-card .nums .n.red { color: var(--red); }
.staff-card .nums .l { font-size: 11.5px; color: var(--gray); }
.staff-card.warn { border-left: 3px solid var(--red); }

/* ---------- 列表行 ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px;
  box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; }
.row:hover { background: #fafcfc; }
.row.od { border-left: 3px solid var(--red); }
.row.hot { border-left: 3px solid var(--purple); }
.row .grow { flex: 1; min-width: 0; }
.row .nm { font-weight: 600; font-size: 15px; }
.row .meta { font-size: 12px; color: var(--gray); margin-top: 2px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.row .r-side { text-align: right; flex: none; }
.row .r-side .big { font-weight: 700; color: var(--main); }
.row .r-side .sm { font-size: 11.5px; color: var(--gray); }
.row .chev { color: #b8c4ca; flex: none; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 1.5px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  line-height: 1.6; vertical-align: 1px; }
.b-red { background: var(--red-l); color: var(--red); }
.b-green { background: var(--green-l); color: var(--green); }
.b-amber { background: var(--amber-l); color: #c5761e; }
.b-purple { background: var(--purple-l); color: var(--purple); }
.b-blue { background: var(--blue-l); color: var(--blue); }
.b-gray { background: #eef1f3; color: var(--gray); }
.b-gold { background: var(--gold-l); color: #c5761e; }

/* ---------- 表单 ---------- */
label { display: block; font-size: 13px; color: #55656f; margin: 12px 0 4px; font-weight: 600; }
label:first-child { margin-top: 0; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #d6dde1; border-radius: 8px;
  font-size: 14.5px; font-family: inherit; background: #fff; color: var(--txt); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--main); box-shadow: 0 0 0 3px rgba(31,110,99,.12); }
textarea { resize: vertical; min-height: 72px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.f2 .fld label { margin-top: 8px; }
.f3 .fld label { margin-top: 8px; }
.sec { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px 18px; margin-bottom: 14px; }
.sec > h3 { margin: 0 0 4px; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.sec > h3 .no { width: 24px; height: 24px; border-radius: 7px; background: var(--main); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.sec > .hint { font-size: 12.5px; color: var(--gray); margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--main);
  color: #fff; border: 0; border-radius: 9px; padding: 10px 18px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--main-d); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: #eef2f4; color: #3d525e; }
.btn.ghost:hover { background: #e2e8eb; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #d97f22; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #bd3535; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 26px; font-size: 16px; }

/* ---------- 开关 ---------- */
.sw { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; background: #c9d2d7; border-radius: 22px; transition: .18s; }
.sw i:before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw input:checked + i { background: var(--main); }
.sw input:checked + i:before { left: 21px; }

/* ---------- 时间线（跟进记录） ---------- */
.tl { position: relative; padding-left: 22px; }
.tl:before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: #dfe7e5; border-radius: 2px; }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item:before { content: ''; position: absolute; left: -20px; top: 7px; width: 11px; height: 11px;
  border-radius: 50%; background: #fff; border: 3px solid var(--main); }
.tl-item.cold:before { border-color: #a9b8bf; }
.tl-item.hot:before { border-color: var(--red); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.tl-head .date { font-weight: 700; font-size: 13.5px; }
.tl-body { background: #f8fafb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px;
  font-size: 13.5px; }
.tl-body .ct { white-space: pre-wrap; word-break: break-word; }
.tl-foot { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; align-items: center; }
.tl-foot .next { font-size: 12px; color: var(--gray); margin-left: auto; }
.tl-edit { font-size: 12px; color: var(--main); cursor: pointer; background: none; border: 0; padding: 0; font-family: inherit; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15,30,35,.45); z-index: 90; display: none; }
.mask.on { display: block; }
.sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 94%; max-width: 520px;
  max-height: 86vh; overflow-y: auto; background: #fff; border-radius: 14px; z-index: 95; display: none;
  padding: 18px 20px; box-shadow: 0 16px 50px rgba(10,25,30,.3); }
.sheet.on { display: block; }
.sheet.wide { max-width: 760px; }
.sheet h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; }
.sheet .x { margin-left: auto; cursor: pointer; color: var(--gray); font-size: 20px; padding: 0 4px; }

/* ---------- 评估/报价 ---------- */
.judge { background: var(--purple-l); border: 1px solid #ddd0ee; color: #5b4585; border-radius: 9px;
  padding: 9px 12px; font-size: 13.5px; margin: 8px 0; }
.judge b { color: var(--purple); }
.price-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); padding: 12px 16px; margin: 14px -18px -16px; }
.price-bar table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.price-bar td { padding: 3.5px 0; }
.price-bar td.r { text-align: right; font-variant-numeric: tabular-nums; }
.price-bar tr.tot td { border-top: 1.5px solid var(--line); padding-top: 7px; font-weight: 700; font-size: 15px; }
.price-bar tr.tot td.r { color: var(--main); font-size: 17px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.opt { border: 1px solid #d6dde1; border-radius: 8px; padding: 5px 11px; font-size: 13px; cursor: pointer;
  background: #fff; user-select: none; }
.opt.on { background: var(--main-l); border-color: var(--main); color: var(--main); font-weight: 600; }
.q-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.q-item { flex: 1 1 44%; min-width: 150px; font-size: 13.5px; padding: 4px 0; }
.q-item select { width: auto; min-width: 64px; padding: 4px 6px; font-size: 13px; display: inline-block; margin-left: 6px; }

/* ---------- 其他 ---------- */
.empty { text-align: center; color: var(--gray); padding: 40px 10px; font-size: 13.5px; }
.hint { font-size: 12.5px; color: var(--gray); }
.warnbox { background: var(--amber-l); border: 1px solid #f2ddb8; color: #a06a1e; border-radius: 9px;
  padding: 9px 12px; font-size: 13px; margin: 8px 0; }
.search { position: relative; }
.search input { padding-left: 34px; }
.search:before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: .6; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; color: var(--gray); font-weight: 600; font-size: 12.5px; padding: 7px 8px;
  border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 8px; border-bottom: 1px solid #f0f3f5; }
table.tbl td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.tot td { font-weight: 700; border-top: 1.5px solid var(--line); }

/* ---------- 响应式（手机） ---------- */
@media (max-width: 860px) {
  .side { transform: translateX(-100%); box-shadow: none; }
  .side.open { transform: translateX(0); box-shadow: 8px 0 30px rgba(10,25,30,.35); }
  .side-mask.on { display: block; }
  .main { margin-left: 0; }
  .burger { display: block; }
  #app { padding: 12px; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  .f2, .f3 { grid-template-columns: 1fr; }
  .row .r-side { display: none; }
}
