/* 高池交易处理中心 —— 浅色商务后台 */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e4e8ee;
  --ink: #2b3444;
  --ink-2: #6b7686;
  --ink-3: #98a2b3;
  --blue: #1f5eff;
  --blue-dark: #174bc4;
  --green: #0a9e6b;
  --orange: #d97a08;
  --red: #d64541;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 13px;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- 登录（左右分屏企业风） ---------- */
.login-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; background: #fff;
}
.login-left {
  flex: 1.25; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #101d36 0%, #16294f 45%, #1c3a70 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 0 8%;
}
.login-deco { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-left > * { position: relative; z-index: 1; }
.login-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 56px; }
.login-brand strong { font-size: 17px; display: block; letter-spacing: .02em; }
.login-brand small { font-size: 10px; color: #7f93b8; letter-spacing: .22em; }
.login-slogan { font-size: 30px; font-weight: 600; letter-spacing: .04em; margin-bottom: 14px; }
.login-sub { color: #93a7cc; font-size: 14px; letter-spacing: .12em; margin-bottom: 52px; }
.login-window {
  width: 380px; max-width: 100%; border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.97); box-shadow: 0 24px 60px rgba(4,12,30,.45);
}
.lw-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  background: #eef1f6; border-bottom: 1px solid #e2e7ef;
}
.lw-bar i { width: 9px; height: 9px; border-radius: 50%; background: #d4dae4; }
.lw-bar i:first-child { background: #f2907e; }
.lw-bar span { margin-left: 8px; font-size: 11px; color: #6b7686; }
.lw-body { padding: 14px 16px 16px; }
.lw-kpis { display: flex; gap: 10px; margin-bottom: 12px; }
.lw-kpis b {
  flex: 1; background: #f6f8fb; border-radius: 7px; padding: 8px 10px;
  font-size: 14px; color: #1f5eff; font-variant-numeric: tabular-nums;
}
.lw-kpis b:nth-child(2) { color: #0a9e6b; }
.lw-kpis b:nth-child(3) { color: #d97a08; }
.lw-chart { display: flex; align-items: flex-end; gap: 8px; height: 92px; margin-bottom: 12px; }
.lw-chart i { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #4d84ff, #1f5eff); }
.lw-chart i:nth-child(2n) { background: linear-gradient(180deg, #35c99e, #0a9e6b); }
.lw-rows { display: flex; justify-content: space-between; font-size: 11px; color: #6b7686; }
.login-copy { margin-top: 56px; font-size: 11px; color: #5d7097; letter-spacing: .06em; }

.login-right { flex: 1; display: flex; align-items: center; justify-content: center; background: #fbfcfe; }
.login-box { width: 360px; padding: 0 12px; }
.login-box h1 { font-size: 24px; color: #1c2635; }
.login-hint { color: var(--ink-3); font-size: 13px; margin: 8px 0 34px; }
.login-form label { display: block; margin: 16px 0 7px; color: var(--ink-2); font-size: 12.5px; }
.login-form input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 14px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,94,255,.1); }
.login-err {
  margin-top: 12px; padding: 8px 12px; border-radius: 8px; font-size: 12px;
  background: #fdf0ef; color: var(--red); border: 1px solid #f5d3d2;
}
.login-tip { margin-top: 20px; text-align: center; color: var(--ink-3); font-size: 11px; }

@media (max-width: 920px) {
  .login-left { display: none; }
}

/* ---------- 布局 ---------- */
.logo-dot {
  width: 34px; height: 34px; border-radius: 9px; background: var(--blue);
  display: inline-flex; flex: none; position: relative;
}
.logo-dot::after {
  content: ''; position: absolute; left: 10px; top: 8px; width: 12px; height: 18px;
  border: 3px solid #fff; border-top: 0; border-radius: 0 0 4px 4px;
}
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 212px; flex: none; background: #1c2635; color: #c6cfdc;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 16px; }
.brand .logo-dot { width: 30px; height: 30px; }
.brand strong { color: #fff; font-size: 14px; display: block; }
.brand small { font-size: 10px; color: #7b8aa0; letter-spacing: .1em; }
.nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 2px; flex: 1; }
.nav-item {
  text-align: left; padding: 10px 14px; border: 0; border-radius: 8px;
  background: none; color: #aeb9ca; font-size: 13.5px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--blue); color: #fff; }
.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sync-line { display: flex; align-items: center; gap: 7px; font-size: 11px; margin-bottom: 8px; color: #8fa0b5; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #7b8aa0; }
.sync-dot.on { background: #2ecc8f; }
.sync-dot.err { background: #ff7b72; }
.user-line { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.user-name { font-size: 12px; color: #dfe6ef; }
.user-name::before { content: '● '; color: var(--green); font-size: 9px; }

.main { flex: 1; min-width: 0; padding: 22px 26px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.topbar h2 { font-size: 19px; }
.page-sub { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- 通用控件 ---------- */
.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; font-size: 13px;
  background: var(--blue); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--blue-dark); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: #f2f5f9; color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b93a37; }
.btn-success { background: var(--green); }
.btn-success:hover { background: #08855a; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; margin-top: 20px; height: 40px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px;
  font-size: 13px; outline: none; background: #fff;
}
.input:focus { border-color: var(--blue); }
.select { width: 130px; }
.chk { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 12.5px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.card.no-pad { padding: 0; overflow: hidden; }
.card h3 { font-size: 14px; margin-bottom: 14px; }
.view { animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi .k-label { color: var(--ink-3); font-size: 12px; }
.kpi .k-value { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-value.warn { color: var(--red); }
.kpi .k-value.ok { color: var(--green); }
.kpi .k-value.blue { color: var(--blue); }
.kpi .k-unit { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 2px; }

.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.grid-2 .card { margin-bottom: 16px; }
.chart { height: 260px; }

/* ---------- 动态流 ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: 12px; padding: 9px 2px; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; align-items: baseline;
}
.feed-item:last-child { border-bottom: 0; }
.feed-time { color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.feed-who { color: var(--blue); flex: none; }
.feed-act { color: var(--ink); }
.feed-detail { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 状态标签 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 8px; padding: 7px 14px; font-size: 13px;
}
.tab .n { color: var(--ink-3); font-size: 11px; margin-left: 4px; }
.tab.active { border-color: var(--blue); color: var(--blue); background: #eef3ff; }
.tab.active .n { color: var(--blue); }
.tab.t-abn.active { border-color: var(--red); color: var(--red); background: #fdf1f0; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; white-space: nowrap;
}
.badge.b-pending   { background: #fdf6e7; color: #a4700a; }
.badge.b-reviewed  { background: #eef3ff; color: var(--blue); }
.badge.b-to_ship   { background: #f0f7ff; color: #1273cf; }
.badge.b-shipped   { background: #ebf8f1; color: var(--green); }
.badge.b-delivered { background: #f0f1f3; color: var(--ink-2); }
.badge.b-abn { background: #fdf0ef; color: var(--red); }
.badge.b-as  { background: #f3ecfd; color: #7a3fd1; }
.badge.b-open  { background: #fdf6e7; color: #a4700a; }
.badge.b-done  { background: #ebf8f1; color: var(--green); }

/* ---------- 表格 ---------- */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar .input { min-width: 220px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500;
  padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td {
  padding: 11px 14px; border-bottom: 1px solid #eef1f5; font-size: 12.5px; vertical-align: middle;
}
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: #f7faff; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .sn { font-family: Consolas, monospace; color: var(--blue); }
.tbl .muted { color: var(--ink-3); }
.cell-2 { line-height: 1.45; }
.cell-2 small { color: var(--ink-3); display: block; max-width: 260px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tbl-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; color: var(--ink-3); font-size: 12px;
}
.pager { display: flex; align-items: center; gap: 12px; }

/* ---------- 抽屉 ---------- */
.drawer-mask, .modal-mask {
  position: fixed; inset: 0; background: rgba(20,30,45,.35); z-index: 60;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 92vw; z-index: 61;
  background: #fff; box-shadow: -8px 0 30px rgba(20,30,45,.15);
  display: flex; flex-direction: column; animation: slidein .2s ease;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 15px; font-family: Consolas, monospace; color: var(--blue); }
.drawer-body { padding: 20px 22px 40px; overflow-y: auto; flex: 1; }
.d-sec { margin-bottom: 22px; }
.d-sec > h4 {
  font-size: 13px; color: var(--ink-3); margin-bottom: 10px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.d-sec > h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.kv .row { display: flex; gap: 8px; font-size: 12.5px; }
.kv .k { color: var(--ink-3); flex: none; width: 74px; }
.kv .v { color: var(--ink); word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.item-actions { display: flex; flex-direction: column; gap: 8px; }
.remark-item { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.remark-item:last-child { border-bottom: 0; }
.remark-item .meta { color: var(--ink-3); font-size: 11px; margin-top: 3px; }
.mini-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; outline: none; resize: vertical; font-family: inherit;
}
.mini-input:focus { border-color: var(--blue); }

/* ---------- 弹窗 ---------- */
.modal-mask { display: flex; align-items: center; justify-content: center; z-index: 70; }
.modal {
  width: 420px; max-width: 92vw; background: #fff; border-radius: 12px; padding: 22px 24px;
  box-shadow: 0 14px 50px rgba(20,30,45,.25);
}
.modal h3 { font-size: 15px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.form-row .input, .form-row select, .form-row textarea { width: 100%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: #26313f; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(20,30,45,.3);
}
.toast.err { background: var(--red); }

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* 趋势窗口切换（近7日 / 近30日） */
.trend-switch { display: inline-flex; gap: 0; margin-left: auto; }
.ts-btn { border: 1px solid #d8dee8; background: #fff; color: #6b7686; font-size: 12px;
  padding: 3px 12px; cursor: pointer; }
.ts-btn:first-child { border-radius: 4px 0 0 4px; }
.ts-btn:last-child { border-radius: 0 4px 4px 0; border-left: none; }
.ts-btn.is-active { background: #1f5eff; border-color: #1f5eff; color: #fff; }
