/* 接单派单系统 — 样式 */
:root {
  --bg: #f2f4f8;
  --card: #fff;
  --line: #e4e8ef;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --purple: #7c3aed;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* ===== 登录 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.login-card {
  background: #fff; border-radius: 14px; padding: 36px 34px; width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.login-card h1 { margin: 0 0 4px; font-size: 21px; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.login-card label { display:block; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; margin-bottom: 16px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-card button {
  width: 100%; padding: 11px; background: var(--primary); color: #fff; border: 0;
  border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 500;
}
.login-card button:hover { background: var(--primary-d); }
.login-err { background:#fef2f2; color:var(--red); padding:9px 12px; border-radius:6px; margin-bottom:16px; font-size:13px; }
.login-tip { margin-top:18px; font-size:12px; color:var(--muted); text-align:center; line-height:1.9; }
.login-card.wide { width: 430px; }
.login-card .req { color: var(--red); margin-left: 3px; }
/* 邮箱 + 验证码按钮一行 */
.login-card .code-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 16px; }
.login-card .code-row input { flex: 1; min-width: 0; margin-bottom: 0; }
.login-card .code-row .code-btn {
  flex: 0 0 auto; width: auto; padding: 10px 14px; font-size: 13px;
  white-space: nowrap; background: #fff; color: var(--primary); border: 1px solid var(--primary);
  border-radius: 6px; font-weight: 500;
}
.login-card .code-row .code-btn:hover:not(:disabled) { background: rgba(37,99,235,.06); }
.login-card .code-row .code-btn:disabled { background: #f3f4f6; color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.login-card .code-msg { font-size: 12px; margin: -8px 0 14px; min-height: 16px; }
/* ---- 注册页: 用户ID 高亮提示 + 注册成功结果 ---- */
.login-card .code-box {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 0 0 18px;
  border: 1px dashed #93c5fd; border-radius: 8px;
  background: linear-gradient(180deg, #eff6ff, #f8fafc);
}
.login-card .code-box .code-val {
  font-size: 20px; font-weight: 800; letter-spacing: 1px;
  color: var(--primary); font-family: ui-monospace, Menlo, Consolas, monospace;
  white-space: nowrap;
}
.login-card .code-box .code-hint {
  font-size: 12px; line-height: 1.6; color: #b45309;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 6px; padding: 6px 10px;
}
.login-card .code-box .code-hint b { color: #b91c1c; }
/* 注册成功后的整块结果面板 */
.login-card .reg-ok {
  text-align: center; padding: 26px 18px;
  border: 2px solid var(--green); border-radius: 12px;
  background: #f0fdf4; margin-bottom: 16px;
}
.login-card .reg-ok .reg-ok-title {
  font-size: 17px; font-weight: 700; color: var(--green); margin-bottom: 6px;
}
.login-card .reg-ok .reg-ok-code {
  font-size: 30px; font-weight: 800; letter-spacing: 2px; color: var(--primary);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  padding: 10px 0; margin: 8px 0; word-break: break-all;
}
.login-card .reg-ok .reg-ok-tip { font-size: 12px; color: #b45309; line-height: 1.7; }
.login-links {
  display:flex; justify-content:space-between; align-items:center;
  margin-top:12px; font-size:13px;
}
.login-links a { color: var(--primary); text-decoration: none; cursor: pointer; }
.login-links a:hover { text-decoration: underline; }
.reset-result {
  margin-top:14px; padding:12px; background: var(--ok-bg, #ecfdf5);
  border:1px solid #a7f3d0; border-radius:6px; font-size:13px; line-height:1.8;
}
.reset-code {
  margin-top:8px; padding:10px; background:#fff; border:1px dashed var(--primary);
  border-radius:6px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size:14px; word-break:break-all; text-align:center; letter-spacing:.5px;
}
.reset-tip { margin-top:6px; color: var(--muted); font-size:12px; }

/* ===== 业务配置 ===== */
.tabs { display:flex; flex-wrap:wrap; gap:6px; border-bottom:1px solid var(--line); padding-bottom:10px; margin-bottom:16px; }
.tabs .tab {
  padding:7px 14px; border:1px solid var(--line); background:#fff; border-radius:6px;
  font-size:13px; cursor:pointer; color:var(--muted);
}
.tabs .tab:hover { border-color: var(--primary); color: var(--primary); }
.tabs .tab.active { background: var(--primary); border-color: var(--primary); color:#fff; }
.cfg-group { border:1px solid var(--line); border-radius:8px; padding:16px 18px; }
.cfg-group-head { display:flex; align-items:center; gap:8px; margin-bottom:14px; padding-bottom:10px; border-bottom:1px dashed var(--line); }
.cfg-icon { font-size:18px; }
.cfg-row {
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:9px 0; border-bottom:1px solid #f3f4f6;
}
.cfg-row:last-child { border-bottom:0; }
.cfg-label { width:190px; font-size:13px; color:var(--text); flex-shrink:0; font-weight:500; }
.cfg-row .hint { flex:1; min-width:200px; }
/* 配置分组内的子段落(需求 11: 保证金扣费下方追加「结算扣费」段) */
.cfg-subsection { margin-top:6px; }
.cfg-subsection + .cfg-subsection { margin-top:18px; }
.cfg-subsection-title {
  font-size:13px; font-weight:600; color:var(--text); margin-bottom:2px;
  padding:8px 0 6px; border-top:1px solid var(--line);
  display:flex; align-items:center; gap:6px;
}
.cfg-subsection-title::before {
  content:''; width:3px; height:13px; border-radius:2px; background:var(--primary);
}
.cfg-actions { margin-top:16px; display:flex; align-items:center; gap:10px; }
.switch { display:inline-flex; align-items:center; gap:6px; font-size:13px; cursor:pointer; user-select:none; }
.switch input { width:auto !important; margin:0 !important; cursor:pointer; }

/* ===== 数据备份 ===== */
.bk-stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:12px; }
.bk-stat {
  border:1px solid var(--line); border-radius:8px; padding:12px 14px; background:#fff;
  border-left:3px solid var(--primary);
}
.bk-stat-k { font-size:12px; color:var(--muted); margin-bottom:4px; }
.bk-stat-v { font-size:18px; font-weight:700; line-height:1.3; word-break:break-all; }

/* ===== 角色与权限 ===== */
.role-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(400px, 1fr)); gap:14px; }
.role-card { border:1px solid var(--line); border-radius:8px; padding:14px; background:#fff; }
.role-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.role-head b { font-size:15px; }
.role-code {
  font-size:11px; background:#f3f4f6; color:var(--muted);
  padding:2px 6px; border-radius:4px; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.role-opts { display:flex; gap:16px; padding:8px 0; border-top:1px dashed var(--line); border-bottom:1px dashed var(--line); margin-bottom:10px; flex-wrap:wrap; }
.role-hint { font-size:12px; color:var(--muted); background:#f7f8fa; border-radius:5px; padding:6px 9px; margin-bottom:10px; line-height:1.6; }
.switch input:disabled { cursor:not-allowed; opacity:.45; }
.perm-box { max-height:320px; overflow-y:auto; }
.perm-mod { margin-bottom:12px; }
.perm-mod-name { font-size:12px; color:var(--muted); margin-bottom:6px; font-weight:600; }
.perm-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(130px, 1fr)); gap:4px 10px; }
.perm-item { display:flex; align-items:center; gap:5px; font-size:12.5px; cursor:pointer; }
.perm-item input { width:auto !important; margin:0 !important; }
.perm-item.perm-3 { display:grid; grid-template-columns:auto auto 1fr; gap:8px; align-items:center; }
.perm-item.perm-3 label { display:flex; align-items:center; gap:3px; font-size:11.5px; color:var(--muted); cursor:pointer; }
.perm-name { color:var(--text); }
.role-foot { margin-top:12px; padding-top:10px; border-top:1px dashed var(--line); display:flex; align-items:center; gap:10px; }
.role-msg { font-size:12px; color:var(--muted); }
.up-role { margin-bottom:8px; font-size:13px; }
.up-role code { font-size:11px; background:#f3f4f6; padding:2px 6px; border-radius:4px; margin-left:4px; }
.up-hint { font-size:12px; color:var(--muted); margin-bottom:10px; line-height:1.7; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #1e293b; color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo {
  padding: 18px 16px; font-size: 16px; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08); display:flex; align-items:center; gap:8px;
}
.logo .dot { width:8px; height:8px; border-radius:50%; background:#3b82f6; }
.nav { padding: 10px 0; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  color: #cbd5e1; font-size: 14px; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(59,130,246,.18); color: #fff; border-left-color: #3b82f6; }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.nav-group { padding: 14px 16px 6px; font-size: 11px; color: #64748b; letter-spacing: .5px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 16px; font-weight: 600; }
.topbar .right { display:flex; align-items:center; gap:14px; font-size:13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary);
  color: #fff; display:flex; align-items:center; justify-content:center;
  font-size: 13px; font-weight: 600;
}
/* 通知铃铛 */
.bell {
  position: relative; cursor: pointer; font-size: 17px; line-height: 1;
  padding: 4px; border-radius: 8px; user-select: none;
}
.bell:hover { background: #f1f5f9; }
.bell-badge {
  position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px;
  background: #dc2626; color: #fff; border-radius: 8px; font-size: 10px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
.nav-badge {
  margin-left: auto; background: #dc2626; color: #fff; border-radius: 9px;
  font-size: 11px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.content { padding: 20px 22px 40px; flex: 1; }

/* ===== 卡片 ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

/* ===== 统计卡 ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  border-left: 3px solid var(--primary);
}
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat.green { border-left-color: var(--green); }
.stat.orange { border-left-color: var(--orange); }
.stat.red { border-left-color: var(--red); }
.stat.purple { border-left-color: var(--purple); }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.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: #374151; font-weight: 500; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field textarea { resize: vertical; min-height: 76px; }
.field .hint { font-size: 12px; color: var(--muted); }
.section-title {
  grid-column: span 3; font-size: 13px; font-weight: 600; color: var(--primary);
  padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; padding-bottom: 2px;
}
.section-title:first-child { border-top: 0; margin-top: 0; }

/* ===== 按钮 ===== */
.btn {
  padding: 7px 15px; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { background: #f8fafc; font-weight: 600; color: #374151; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.clickable { cursor: pointer; }

/* ===== 徽标 ===== */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.tag.gray   { background:#f1f5f9; color:#64748b; }
.tag.blue   { background:#dbeafe; color:#1d4ed8; }
.tag.green  { background:#dcfce7; color:#15803d; }
.tag.orange { background:#ffedd5; color:#c2410c; }
.tag.red    { background:#fee2e2; color:#b91c1c; }
.tag.purple { background:#ede9fe; color:#6d28d9; }
.tag.urgent { background:#fee2e2; color:#b91c1c; font-weight:600; }

/* ===== 工具栏 ===== */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.toolbar input, .toolbar select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }
.toolbar .grow { flex: 1; }

/* ===== 分页 ===== */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line);
}
.pager .pages { display: flex; gap: 6px; }
.pager .pages button {
  min-width: 32px; padding: 5px 9px; border: 1px solid var(--line);
  background: #fff; border-radius: 5px; cursor: pointer; font-size: 13px;
}
.pager .pages button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pages button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 详情 ===== */
.desc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; }
.desc .item { font-size: 13px; }
.desc .item .k { color: var(--muted); margin-bottom: 3px; font-size: 12px; }
.desc .item .v { word-break: break-all; }
.desc .item.full { grid-column: span 3; }
.kv-box { background:#f8fafc; border-radius:6px; padding:12px 14px; font-size:13px; }
.kv-box .r { display:flex; justify-content:space-between; padding:4px 0; }
.kv-box .r .k { color:var(--muted); }
.kv-box .r .v { font-weight:500; text-align:right; }

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content:''; position:absolute; left:6px; top:6px; bottom:6px; width:2px; background:var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content:''; position:absolute; left:-20px; top:5px; width:10px; height:10px;
  border-radius:50%; background:var(--primary); border:2px solid #fff; box-shadow:0 0 0 2px var(--line);
}
.tl-item .t { font-size:13px; font-weight:600; }
.tl-item .m { font-size:12px; color:var(--muted); margin-top:2px; }
.tl-item .r { font-size:12px; color:var(--orange); margin-top:2px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 600; display:flex; justify-content:space-between; align-items:center; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display:flex; justify-content:flex-end; gap:10px; }

/* ===== 提示 ===== */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #1f2937; color: #fff; padding: 11px 16px; border-radius: 7px;
  font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px;
  animation: slideIn .2s ease;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
@keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:none; } }

.loading { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:60vh; gap:12px; color:var(--muted); }
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--line);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align:center; padding:44px 20px; color:var(--muted); font-size:13px; }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .4; }

/* ===== 抢单卡片 ===== */
.hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hall-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  padding: 15px; box-shadow: var(--shadow); transition: .15s; position: relative;
}
.hall-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.hall-card.urgent { border-color: #fca5a5; }
.hall-card .hc-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:9px; }
.hall-card .hc-no { font-size:12px; color:var(--muted); font-family: ui-monospace, monospace; }
.hall-card .hc-proj { font-size:15px; font-weight:600; margin-bottom:3px; }
.hall-card .hc-meta { font-size:12px; color:var(--muted); margin-bottom:11px; line-height:1.8; }
.hall-card .hc-fee { font-size:20px; font-weight:700; color:var(--orange); }
.hall-card .hc-foot { display:flex; justify-content:space-between; align-items:center; margin-top:12px; padding-top:11px; border-top:1px solid var(--line); }
.ribbon {
  position:absolute; top:11px; right:-1px; background:var(--red); color:#fff;
  font-size:11px; padding:2px 9px; border-radius:4px 0 0 4px; font-weight:600;
}
.guarantee { font-size:12px; color:var(--purple); }

@media (max-width: 900px) {
  .form-grid, .desc { grid-template-columns: 1fr; }
  .field.span2, .field.span3, .desc .item.full, .section-title { grid-column: span 1; }
  .sidebar { width: 62px; }
  .sidebar .nav a span:not(.ico), .logo span, .nav-group { display: none; }
}
