/* 客服导单台 · 深蓝企业风 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1e3a5f;
  --primary-dark: #16293f;
  --accent: #2f6fd0;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #232a33;
  --muted: #7a8699;
  --border: #e3e8ef;
  --ok: #1f9d55;
  --warn: #d97706;
  --err: #d63030;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ── 登录页 ── */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% 18%, rgba(47, 111, 208, .38), transparent 45%),
    radial-gradient(circle at 85% 82%, rgba(20, 40, 70, .45), transparent 50%),
    linear-gradient(160deg, var(--primary-dark), var(--primary) 55%, #274a75);
  padding: 16px;
}
.login-card {
  background: var(--card);
  border-radius: 18px;
  padding: 40px 34px 32px;
  width: 100%; max-width: 380px;
  box-shadow: 0 18px 50px rgba(10, 25, 47, .4);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  border-radius: 16px; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(47, 111, 208, .42);
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-logo.has-img { background: #fff; box-shadow: none; }  /* 透明 logo 垫白底 + 去投影（渐变/阴影会从透明像素透出来） */
.login-brand h1 { font-size: 21px; font-weight: 600; }
.login-brand p { color: var(--muted); margin-top: 5px; font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { position: relative; }
.login-field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.login-field input {
  width: 100%; padding: 12px 14px 12px 40px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 15px;
  background: #fbfcfe; color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field input::placeholder { color: #aab4c4; }
.login-field input:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 208, .15);
}
.login-field input#password { padding-right: 42px; }
/* 密码明文切换小眼睛：淡淡的不抢视觉，hover 才加深 */
.login-eye {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: #c3ccd9;
  transition: color .15s;
}
.login-eye:hover { color: var(--muted); }
.login-eye svg { width: 17px; height: 17px; }
.login-eye .eye-off { display: none; }
.login-eye.is-on .eye-open { display: none; }
.login-eye.is-on .eye-off { display: block; }
.login-error { color: var(--err); font-size: 13px; min-height: 20px; margin: 2px 0; }
.login-error:not(:empty) {
  background: #fde8e8; padding: 8px 12px; border-radius: 8px; line-height: 1.4;
}
.login-submit {
  margin-top: 4px;
  padding: 12px 16px; font-size: 15px; font-weight: 600;
  border-radius: 10px; letter-spacing: 2px;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47, 111, 208, .35);
}
.pwd-back {
  display: block; text-align: center; margin-top: 14px;
  color: var(--muted); font-size: 13px; text-decoration: none;
}
.pwd-back:hover { color: var(--accent); }

/* ── 顶栏 / Tab ── */
.topbar {
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 52px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { font-size: 16px; font-weight: 600; }
.topbar-brand span { font-weight: 400; font-size: 12px; opacity: .7; margin-left: 6px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tabs {
  background: var(--card);
  display: flex; gap: 4px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  position: sticky; top: 52px; z-index: 9;
}
.tab {
  border: none; background: none; cursor: pointer;
  padding: 12px 16px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }

/* ── 布局 / 卡片 ── */
.container { max-width: 860px; margin: 0 auto; padding: 16px 12px 60px; }
.panel { display: none; }
.panel.active { display: block; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  margin-bottom: 16px;
}
.card h2 { font-size: 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin-bottom: 0; }

/* ── 表单 ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid label { font-size: 13px; color: var(--muted); display: block; }
.form-grid label.span2 { grid-column: span 2; }
.form-grid input, .form-grid select {
  width: 100%; margin-top: 6px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff;
}
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-actions { grid-column: span 2; display: flex; align-items: center; gap: 12px; }
.hint { color: var(--muted); font-size: 12px; }
.inline-check { font-size: 13px; color: var(--muted); margin-right: 8px; }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.span2, .form-actions { grid-column: span 1; }
}

/* ── 按钮 ── */
.btn {
  border: 1px solid var(--border);
  background: #fff; color: var(--text);
  border-radius: 8px; padding: 8px 16px;
  font-size: 14px; cursor: pointer;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; color: inherit; }
.topbar .btn-ghost { color: #fff; opacity: .85; }
.btn-danger { color: var(--err); border-color: var(--err); background: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* ── 结果区 ── */
.result {
  margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 14px;
}
.result .amount { font-size: 28px; font-weight: 700; color: var(--primary); }
.result .amount small { font-size: 13px; color: var(--muted); font-weight: 400; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin-top: 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { word-break: break-all; }
.items-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.items-table th, .items-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.items-table th { color: var(--muted); font-weight: 500; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-ok { background: #e3f5ea; color: var(--ok); }
.badge-warn { background: #fdf1e0; color: var(--warn); }
.badge-err { background: #fde8e8; color: var(--err); }
.badge-muted { background: #eef1f5; color: var(--muted); }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; }
.table td.num { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* ── 弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 25, 40, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; width: 100%; max-width: 720px;
  max-height: 88vh; border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
}
@media (min-width: 640px) {
  .modal-mask { align-items: center; padding: 24px; }
  .modal { border-radius: 14px; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; word-break: break-all; }
.modal-body { padding: 14px 16px; overflow-y: auto; }
.modal-foot {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}
.node-chain { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.node-chain .node {
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  background: #eef1f5; color: var(--muted);
}
.node-chain .node.success { background: #e3f5ea; color: var(--ok); }
.node-chain .node.exception, .node-chain .node.failed { background: #fde8e8; color: var(--err); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(30, 40, 55, .92); color: #fff;
  padding: 10px 20px; border-radius: 8px; font-size: 14px;
  z-index: 100; max-width: 86vw; text-align: center;
}
