:root {
  --bg: #f5f6f8; --card: #fff; --line: #e4e7ec; --txt: #1f2329;
  --muted: #8a919f; --blue: #2f6fed; --blue-bg: #eef4ff;
  --green: #16a34a; --green-bg: #eafaf0; --red: #dc2626; --red-bg: #fdecec;
  --amber: #b45309; --amber-bg: #fdf3e0; --orange: #ea580c; --orange-bg: #fff0e5;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--txt); font-size: 14px; }
#root { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
h1 { font-size: 18px; margin-bottom: 4px; }
h2 { font-size: 15px; margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 6px; }
.muted { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.f { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 130px; }
.f span { font-size: 12px; color: var(--muted); }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 16px; background: #fff; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn:hover { background: #f2f4f7; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #245bd0; }
.btn.danger { color: var(--red); border-color: #f3c1c1; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.urgent { background: var(--red-bg); color: var(--red); }
.tag.making { background: var(--blue-bg); color: var(--blue); }
.tag.wait { background: var(--amber-bg); color: var(--amber); }
.tag.done { background: var(--green-bg); color: var(--green); }
.tag.over { background: var(--red-bg); color: var(--red); }
.bar { height: 8px; background: #eceef2; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.bar i.full { background: var(--green); }
.order { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 10px; }
.order.hot { border-color: #f3b9b9; background: #fffafa; }
.order .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.order .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.order .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.load-warn { color: var(--amber); font-size: 12px; }
.load-bad { color: var(--red); font-size: 12px; }
.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 14px; position: sticky; top: 0; z-index: 5; }
.tabs button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--muted); }
.tabs button.on { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; display: none; z-index: 99; max-width: 90vw; }
@media (max-width: 600px) {
  #root { padding: 10px; }
  .f { min-width: 100%; }
  .order .acts .btn { flex: 1; text-align: center; }
}

/* 客户类型选择按钮 */
.ckpill{display:inline-flex;align-items:center;gap:8px;padding:10px 22px;border:2px solid #2b6cb0;border-radius:10px;font-weight:700;font-size:15px;color:#1a365d;background:#fff;cursor:pointer;white-space:nowrap;user-select:none;}
.ckpill.on{background:#2b6cb0;color:#fff;}
.ckpill input{display:none;}

/* 顶栏 logo */
.toplogo { height: 34px; vertical-align: middle; margin-right: 10px; }

.nc-opt:hover{background:#f0f4ff;}

/* ---------- 记事本浮窗 ---------- */
#memoBtn{white-space:nowrap;}
#memoBoard{position:fixed;top:64px;right:18px;width:410px;max-width:calc(100vw - 30px);height:600px;max-height:calc(100vh - 84px);background:#fff;border:1px solid #e3e6ee;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.18);z-index:900;display:none;flex-direction:column;overflow:hidden;resize:both;min-width:320px;min-height:180px;}
#memoBoard.open{display:flex;}
#memoBoard.min{height:46px;max-height:46px;flex:0 0 46px;overflow:hidden;resize:none;}
.memo-head{display:flex;align-items:center;gap:8px;padding:10px 12px;background:#2563eb;color:#fff;cursor:move;user-select:none;flex:0 0 auto;}
.memo-head b{flex:1;font-size:14px;}
.memo-head .memo-unread{background:#fbbf24;color:#7c2d12;font-size:11px;border-radius:9px;padding:1px 7px;font-weight:700;}
.memo-head button{background:rgba(255,255,255,.22);border:none;color:#fff;width:22px;height:22px;border-radius:5px;cursor:pointer;font-size:13px;line-height:1;padding:0;}
.memo-body{padding:12px;overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:8px;}
.memo-item{border:1px solid #eceff5;border-radius:8px;padding:8px 10px;background:#fafbfe;}
.memo-item.unread{border-left:3px solid #f59e0b;background:#fffbeb;}
.mi-top{display:flex;align-items:center;gap:6px;font-size:12px;color:#64748b;flex-wrap:wrap;}
.mi-title{font-weight:700;margin:4px 0 2px;font-size:13px;}
.mi-content{font-size:13px;line-height:1.5;white-space:pre-wrap;word-break:break-all;}
.mi-ops{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap;}
.mi-ops button{font-size:12px;padding:3px 10px;border-radius:6px;border:1px solid #dbe2ef;background:#fff;cursor:pointer;color:#334155;}
.mi-ops button.danger{color:#dc2626;border-color:#fecaca;}
.mi-ops button.primary{color:#fff;background:#2563eb;border-color:#2563eb;}
.mi-replies{margin-top:6px;background:#f1f5f9;border-radius:6px;padding:6px 8px;font-size:12px;color:#334155;}
.mi-replies div{margin-top:2px;}
.memo-tag{font-size:11px;border-radius:4px;padding:1px 6px;background:#e0e9ff;color:#1d4ed8;}
.memo-tag.sub{background:#dcfce7;color:#15803d;}
.memo-tag.r{background:#fef3c7;color:#92400e;}
.memo-pager{display:flex;align-items:center;justify-content:center;gap:10px;font-size:12px;color:#475569;}
.memo-pager button{border:1px solid #dbe2ef;background:#fff;border-radius:6px;padding:3px 10px;cursor:pointer;font-size:12px;}
.mcat{border:1px solid #e3e6ee;border-radius:8px;padding:8px;margin-top:6px;}
.mcat-row{display:flex;align-items:center;gap:6px;font-weight:700;font-size:13px;}
.mcat-row button{font-size:11px;padding:2px 7px;border-radius:5px;border:1px solid #dbe2ef;background:#fff;cursor:pointer;color:#475569;}
.msubs{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;align-items:center;}
.msub{background:#f1f5f9;border-radius:5px;padding:2px 8px;font-size:12px;display:inline-flex;align-items:center;gap:4px;}
.msub b{cursor:pointer;color:#94a3b8;font-weight:400;}
.msub-add{border:none;border-bottom:1px dashed #cbd5e1;font-size:12px;width:120px;padding:2px 4px;outline:none;background:transparent;}
