:root {
  --bg: #f3f6fb;
  --ink: #0b1220;
  --muted: #5b6b82;
  --card: #ffffff;
  --line: #d5e1f0;
  --accent: #2563eb;
  --accent2: #0284c7;
  --ok: #0f766e;
  --warn: #b45309;
  --bad: #be123c;
  --offline: #94a3b8;
  --side: #071422;
  --shadow: 0 16px 40px rgba(8, 20, 40, .10);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink); }
#app { min-height: 100%; }
a { color: var(--accent2); }
button, input, select, textarea { font-family: inherit; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  background: #061018;
}
.login-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 64px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #e8f1ff;
  background:
    radial-gradient(900px 480px at 0% 100%, rgba(37, 99, 235, .45) 0%, transparent 58%),
    radial-gradient(700px 360px at 90% 0%, rgba(56, 189, 248, .22) 0%, transparent 50%),
    #061018;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 211, 252, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, .08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 18%, transparent 74%);
  pointer-events: none;
}
.login-kicker {
  position: relative;
  font-size: 13px;
  letter-spacing: .28em;
  color: #7dd3fc;
  margin: 0 0 28px;
}
.login-slogan {
  position: relative;
  margin: 0;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: .04em;
  max-width: 16em;
}
.login-curve {
  position: relative;
  width: min(100%, 520px);
  height: auto;
  margin: 36px 0 28px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, .45));
}
.login-product {
  position: relative;
  margin: 0;
  color: #93c5fd;
  font-size: 14px;
  letter-spacing: .08em;
}
.login-panel {
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 40px 28px;
}
.login-card {
  width: min(100%, 400px);
  background: var(--card);
  padding: 36px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .lead { color: var(--muted); margin: 0 0 22px; font-size: 13px; line-height: 1.6; }
.login-card .row { margin-bottom: 12px; }
.login-card input { width: 100%; min-width: 0; }
.login-card button.ok {
  width: 100%; margin-top: 6px; padding: 11px 14px; border-radius: 10px;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
}

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { min-height: 42vh; padding: 40px 24px 28px; }
  .login-slogan { max-width: none; font-size: 24px; }
}

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--side);
  color: #f6f0e6;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.side .brand { font-weight: 700; font-size: 16px; margin-bottom: 4px; line-height: 1.35; }
.side .sub { color: #cbbda8; font-size: 12px; margin-bottom: 18px; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 11px;
  letter-spacing: .16em;
  color: #a89880;
  padding: 6px 12px 4px;
}
.side button.nav {
  width: 100%; text-align: left; background: transparent; border: 0;
  color: #f6f0e6; padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 4px;
}
.side button.nav:hover { background: rgba(255,255,255,.06); }
.side button.nav.active { background: var(--accent); }
.side .side-foot { margin-top: auto; padding-top: 16px; }
.main { padding: 22px 28px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: nowrap; }
.runbar {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1;
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-size: 13px;
}
.runbar span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runbar strong { font-size: 14px; }
.runbar.idle { color: var(--muted); }
.runbar.wait { border-color: #f3d7a6; background: #fff8ee; }
.runbar.run { border-color: #b7d7cb; background: #f3faf6; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--offline); flex: none; }
.runbar.run .run-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(47,111,94,.16); }
.runbar.wait .run-dot { background: var(--warn); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.pills { display: flex; gap: 8px; flex-wrap: nowrap; flex: none; }
.pill {
  background: var(--card); border: 1px solid var(--line); padding: 6px 10px;
  font-size: 12px; border-radius: 999px; cursor: pointer;
}
.pill:hover { border-color: var(--accent); }
.pill.on { border-color: var(--ok); color: var(--ok); }
.pill.off { color: var(--offline); cursor: default; }

h2 { margin: 0 0 6px; font-size: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head .hint { margin: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); padding: 16px 18px;
  margin-bottom: 14px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 0; }
.toolbar .search { min-width: 240px; flex: 1; }
.toolbar select { min-width: 140px; }
.toolbar .count { color: var(--muted); font-size: 12px; margin-left: auto; }
.pick { width: 36px; text-align: center; }
.pick input { width: 16px; height: 16px; margin: 0; }
label { font-size: 13px; color: var(--muted); }
input, select, textarea {
  padding: 8px 10px; border: 1px solid var(--line); background: #fff;
  font-size: 14px; border-radius: 8px; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37,99,235,.28); border-color: var(--accent); }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="search"] { min-width: 200px; }
button, .btn {
  background: var(--ink); color: #fff; border: 0; padding: 8px 14px;
  cursor: pointer; font-size: 13px; border-radius: 8px;
}
button:hover { filter: brightness(1.06); }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover { background: #e8f0fb; }
button.ok { background: var(--accent2); }
button.warn { background: var(--accent); }
button.bad { background: var(--bad); }
button.sm { padding: 6px 10px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 168px 1fr; gap: 10px 16px; align-items: start; margin-bottom: 14px; }
.form-grid label { padding-top: 8px; }
.form-grid textarea { width: 100%; min-height: 92px; padding: 8px 10px; }
.form-grid .pair { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-grid .pair input[type="number"] { min-width: 110px; }

.order-block { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.order-block:last-child { margin-bottom: 0; }
.order-head {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; background: #f7f1e6; font-size: 12px; color: var(--muted);
}
.order-head strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.goods-table td, .cust-table td { vertical-align: top; }
.goods-table .good-name, .cust-table .good-name { font-weight: 650; line-height: 1.45; }
.goods-table .good-sub, .cust-table .good-sub { color: var(--muted); font-size: 12px; line-height: 1.5; }
.goods-table .good-code, .cust-table .good-code { color: var(--ok); font-size: 12px; line-height: 1.5; }
.goods-table .good-price, .cust-table .good-price { color: var(--accent); font-weight: 650; white-space: nowrap; }
.goods-table .tag { margin-top: 6px; }
.cust-table input.mini { width: 88px; min-width: 88px; }
.price-edit { display: flex; gap: 6px; align-items: center; }
.cust-add { margin-top: 10px; }
.modal-head .tag { margin-right: auto; }
.order-head .order-edit { margin-left: auto; }
.change-log { margin-top: 14px; }
.change-log p { margin: 4px 0; line-height: 1.5; }
.order-block td[rowspan] { background: #fffcf7; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #faf6ef; }
.empty { text-align: center; color: var(--muted); padding: 28px 8px !important; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: #eee7da; }
.tag.ok { background: #dceee7; color: var(--ok); }
.tag.off { background: #ece8e1; color: var(--offline); }
.tag.warn { background: #fde7c7; color: var(--warn); }
.tag.bad { background: #fde2e8; color: var(--bad); }
.pause-note { display: block; margin-top: 4px; max-width: 148px; color: var(--bad); font-size: 12px; line-height: 1.35; }
select.risk-pick { min-width: 96px; }
select.risk-pick.ok { color: var(--ok); }
select.risk-pick.bad { color: var(--bad); background: #fde2e8; border-color: #e7b7c2; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 8px 0 16px; }
.board-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; box-shadow: var(--shadow); }
.board-card span { display: block; color: var(--muted); font-size: 12px; }
.board-card strong { display: block; margin-top: 6px; font-size: 26px; font-variant-numeric: tabular-nums; }
.board-card em { display: block; margin-top: 4px; color: var(--muted); font-style: normal; font-size: 12px; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 8px 0 16px; }
.board-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px; box-shadow: var(--shadow); }
.board-card span { display: block; color: var(--muted); font-size: 12px; }
.board-card strong { display: block; margin-top: 6px; font-size: 26px; font-variant-numeric: tabular-nums; }
.board-card em { display: block; margin-top: 4px; color: var(--muted); font-style: normal; font-size: 12px; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pc-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.phone-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phone-name .name-edit {
  box-sizing: border-box; flex: 1 1 140px; width: 160px; min-width: 120px; max-width: 240px;
  height: 28px; margin: 0; padding: 0 6px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; line-height: 28px;
}
.phone-name .name-edit:hover { border-color: var(--line); background: #fff; }
.phone-name .name-edit:focus { border-color: var(--accent); background: #fff; outline: 2px solid rgba(37,99,235,.18); }
.phone-name .name-edit.unnamed { color: var(--accent); }
.type-pick { position: relative; display: inline-flex; align-items: center; }
.type-pick select { padding-left: 32px; min-width: 124px; }
.type-pick select.type-plain { padding-left: 10px; }
.app-mark { position: absolute; left: 7px; width: 18px; height: 18px; display: grid; place-items: center; pointer-events: none; }
.app-mark img { width: 18px; height: 18px; object-fit: contain; display: block; border-radius: 4px; }
.logbox {
  height: 460px; overflow: auto; background: #071422; color: #dbeafe;
  padding: 14px; font-family: Consolas, "Sarasa Mono", monospace; font-size: 12px;
  line-height: 1.55; border-radius: 10px;
}
.modal-mask { position: fixed; inset: 0; background: rgba(6, 16, 32, .66); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-shot { background: var(--card); border: 1px solid var(--line); padding: 14px 16px 16px; max-width: min(92vw, 520px); max-height: 94vh; overflow: auto; border-radius: 14px; box-shadow: 0 24px 60px rgba(7, 20, 34, .35); }
.modal-detail { max-width: min(92vw, 720px); width: 720px; }
.modal-cust { max-width: min(96vw, 980px); width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-head strong { font-size: 15px; }
.shot-img { display: block; margin: 0 auto; max-width: 100%; max-height: 80vh; height: auto; background: #111; }
.unnamed { color: var(--accent); font-weight: 600; }
.boot-splash { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 5; }
.boot-dot { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: boot-spin .8s linear infinite; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-row button {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.stat-row button strong { margin-left: 4px; font-variant-numeric: tabular-nums; }
.stat-row button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.file-btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center;
  background: var(--accent2); color: #fff; border-radius: 8px; padding: 8px 14px;
  font-size: 13px; cursor: pointer;
}
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pager-size, .pages { display: flex; align-items: center; gap: 6px; }
.pager select { min-width: 72px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ver { color: var(--muted); font-size: 12px; line-height: 1.55; }
.ver strong { color: var(--ink); font-weight: 600; }
.quota { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.quota input { min-width: 72px; width: 80px; }

.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  pointer-events: none;
  width: min(560px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(28, 25, 20, .22);
  animation: toast-in .18s ease;
}
.toast.ok { background: #1f6f56; color: #fff; }
.toast.err { background: #9f1239; color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── 「账单图」按钮：鼠标指上去浮出大图，点一下复制（亮哥 2026-09-29 合并） ── */
.img-hover {
  position: fixed; z-index: 9999; width: 440px; max-width: calc(100vw - 24px);
  max-height: 82vh;                       /* 图再长也不撑爆屏幕，body 里滚着看 */
  display: flex; flex-direction: column;
  background: var(--card, #fffcf7); border: 1px solid var(--line, #e6dccb);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
  overflow: hidden; pointer-events: auto;
}
.img-hover .ih-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid var(--line, #e6dccb);
  background: var(--bg, #f4efe6); font-size: 12px;
}
.img-hover .ih-head strong { font-size: 12.5px; }
.img-hover .ih-tip { color: var(--muted, #6b6458); font-size: 11px; white-space: nowrap; }
.img-hover .ih-body { flex: 1 1 auto; min-height: 0; overflow: auto; background: #fff; }
.img-hover img { display: block; width: 100%; height: auto; }   /* 按原比例铺满宽度，长图在 body 里滚 */
.img-hover .ih-pack { border-top: 1px solid var(--line, #e6dccb); }
.img-hover .ih-pack:first-child { border-top: 0; }
.img-hover .ih-cap { padding: 6px 10px; font-size: 12px; font-weight: 650; color: var(--ink, #2b2b2b); background: var(--bg, #f4efe6); }
.img-hover .ih-ph { padding: 22px 12px; text-align: center; color: var(--muted, #6b6458); font-size: 12px; }
.flow-hover { width: 300px; max-height: none; }
.flow-body { padding: 8px 12px 12px; }
.flow-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line, #e6dccb); font-size: 13px; }
.flow-row:first-child { border-top: 0; }
.flow-k { color: var(--muted, #6b6458); flex: none; }
.flow-v { text-align: right; }
.pay-tag { cursor: pointer; border: 0; font: inherit; }
