/* ================= 多商户订单支付管理系统 全局样式 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #f2f5fa;
  color: #2c3445;
  font-size: 14px;
  line-height: 1.6;
}
a { color: #2f6bff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  background: linear-gradient(120deg, #1e3a8a, #2f6bff);
  color: #fff;
  box-shadow: 0 2px 10px rgba(30, 58, 138, .25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { color: #fff; font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,.82);
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.topbar-right a { color: rgba(255,255,255,.85); }
.topbar-right .hi { color: rgba(255,255,255,.8); font-size: 13px; }
.btn-logout {
  border: 1px solid rgba(255,255,255,.45);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.btn-logout:hover { background: rgba(255,255,255,.15); text-decoration: none; }

.container { max-width: 1180px; margin: 24px auto 40px; padding: 0 20px; }
.footer { text-align: center; color: #9aa4b5; font-size: 12px; padding: 24px 0 30px; }

/* 闪存消息 */
.flash {
  padding: 11px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-size: 14px;
}
.flash-ok { background: #eafaf1; border-color: #9fdfb9; color: #157347; }
.flash-danger { background: #fdecec; border-color: #f3b4b4; color: #b42318; }
.flash-warn { background: #fff7e6; border-color: #f5d291; color: #a15c07; }
.flash-info { background: #eaf1ff; border-color: #a9c4ff; color: #1d4ed8; }

/* 卡片/面板 */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(31, 45, 80, .06);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #eef1f6; }
.card h3 { font-size: 14px; margin: 16px 0 10px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 520px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* 统计块 */
.stat {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(31, 45, 80, .06);
}
.stat .label { color: #8a94a7; font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; color: #1e293b; }
.stat .value.small { font-size: 20px; }
.stat .value.green { color: #157347; }
.stat .value.red { color: #b42318; }
.stat .value.blue { color: #1d4ed8; }
.stat .sub { color: #a2abbc; font-size: 12px; margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13.5px;
}
table.data th, table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef1f6;
  text-align: left;
  white-space: nowrap;
}
table.data th { background: #f8fafd; color: #5b6678; font-weight: 600; }
table.data tr:hover td { background: #fafcff; }
/* 自动轮询新出现的订单行：淡蓝高亮后渐隐 */
table.data tr.row-new td { animation: row-new-flash 2.6s ease-out; }
@keyframes row-new-flash {
  0%   { background: #dbeafe; }
  70%  { background: #eef4ff; }
  100% { background: transparent; }
}
table.data td.wrap, table.data th.wrap { white-space: normal; min-width: 120px; }
.num { font-variant-numeric: tabular-nums; }

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
}
.badge-ok { background: #e6f7ee; color: #157347; }
.badge-info { background: #e8f0ff; color: #1d4ed8; }
.badge-warn { background: #fff3df; color: #b45309; }
.badge-danger { background: #fdeaec; color: #b42318; }
.badge-muted { background: #eef1f6; color: #768198; }

/* 按钮/表单 */
.btn, button.btn {
  display: inline-block;
  border: none;
  background: #2f6bff;
  color: #fff;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}
.btn:hover { background: #1f58e0; text-decoration: none; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-gray { background: #64748b; }
.btn-gray:hover { background: #4f5d72; }
.btn-green { background: #18a058; }
.btn-green:hover { background: #13834a; }
.btn-red { background: #d92d20; }
.btn-red:hover { background: #b91c14; }
.btn-orange { background: #f59e0b; }
.btn-orange:hover { background: #d97706; }
.btn-outline {
  background: #fff;
  color: #2f6bff;
  border: 1px solid #b9ccff;
}
.btn-outline:hover { background: #f0f5ff; }
.btn + .btn { margin-left: 6px; }
.inline { display: inline; }

.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; color: #444e62; }
.form-row .hint { font-weight: 400; color: #9aa4b5; font-size: 12.5px; margin-left: 6px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d7deea;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #2c3445;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2f6bff;
  box-shadow: 0 0 0 3px rgba(47,107,255,.12);
}
textarea { min-height: 70px; resize: vertical; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline .form-row { margin-bottom: 0; }
.form-inline input, .form-inline select { width: auto; min-width: 130px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
  padding: 6px 14px;
  border-radius: 20px;
  background: #eef1f7;
  color: #59627a;
  font-size: 13px;
}
.tabs a:hover { text-decoration: none; background: #e2e8f3; }
.tabs a.active { background: #2f6bff; color: #fff; font-weight: 600; }
.tabs .count { opacity: .75; font-size: 12px; }

/* 分页 */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.pager a, .pager span {
  display: inline-block;
  min-width: 32px;
  padding: 5px 10px;
  text-align: center;
  border: 1px solid #dbe2ee;
  border-radius: 6px;
  background: #fff;
  color: #44506a;
}
.pager a:hover { background: #f0f5ff; text-decoration: none; }
.pager .current { background: #2f6bff; border-color: #2f6bff; color: #fff; }
.pager .info { border: none; background: none; color: #8a94a7; font-size: 12.5px; }

/* 登录页 */
.login-body {
  background: linear-gradient(135deg, #1e3a8a 0%, #2f6bff 60%, #4d8dff 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 35, 95, .35);
  width: 100%;
  max-width: 440px;
  padding: 36px 36px 30px;
  display: flex;
  flex-direction: column;
}
.login-title { font-size: 22px; text-align: center; margin-bottom: 8px; color: #1e293b; font-weight: 700; }
.login-header-link {
  margin-top: 4px;
  margin-bottom: 24px;
  text-align: center;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.8;
}
.login-header-link a {
  color: #2f6bff;
  margin: 0 4px;
}
.login-form-wrap {
  width: 100%;
}
.login-footer { margin-top: 18px; text-align: center; font-size: 13px; color: #8a94a7; }
.login-footer a { margin: 0 6px; }

/* 前台店铺 */
.shop-head {
  background: linear-gradient(120deg, #2547a8, #2f6bff);
  color: #fff;
  border-radius: 12px;
  padding: 26px 28px;
  margin-bottom: 20px;
}
.shop-head h1 { font-size: 22px; margin-bottom: 6px; }
.shop-head p { opacity: .85; font-size: 13px; }
.product-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.product-item {
  border: 2px solid #eef1f7;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  position: relative;
}
.product-item:hover { border-color: #a9c4ff; }
.product-item.sel { border-color: #2f6bff; background: #f5f9ff; }
.product-item input { position: absolute; right: 14px; top: 14px; width: auto; }
.product-item .p-name { font-weight: 700; font-size: 15px; padding-right: 24px; }
.product-item .p-desc { color: #8a94a7; font-size: 12.5px; margin: 6px 0 10px; min-height: 18px; }
.product-item .p-amount { color: #e23d2e; font-size: 22px; font-weight: 700; }
.product-item .p-amount small { font-size: 13px; }

/* 订单详情 */
.order-status-banner {
  border-radius: 10px;
  padding: 22px 24px;
  color: #fff;
  margin-bottom: 20px;
}
.order-status-banner.s-pending { background: linear-gradient(120deg, #64748b, #94a3b8); }
.order-status-banner.s-approved { background: linear-gradient(120deg, #2563eb, #4d8dff); }
.order-status-banner.s-paid_wait { background: linear-gradient(120deg, #d97706, #f59e0b); }
.order-status-banner.s-success { background: linear-gradient(120deg, #15803d, #22a05a); }
.order-status-banner.s-rejected, .order-status-banner.s-failed { background: linear-gradient(120deg, #b91c1c, #e0483d); }
.order-status-banner.s-expired { background: linear-gradient(120deg, #6b7280, #9ca3af); }
.order-status-banner .os-title { font-size: 20px; font-weight: 700; }
.order-status-banner .os-desc { opacity: .9; font-size: 13px; margin-top: 6px; }
.qr-box { text-align: center; padding: 10px 0; }
.qr-box img { max-width: 260px; width: 100%; border: 1px solid #eef1f6; border-radius: 10px; padding: 8px; background: #fff; }
.qr-box .qr-tip { margin-top: 10px; font-size: 13px; color: #64748b; }
.qr-box .pay-amount { font-size: 28px; color: #e23d2e; font-weight: 700; margin: 8px 0; }
.countdown { color: #b45309; font-weight: 600; }

.kv { width: 100%; font-size: 13.5px; }
.kv td { padding: 8px 6px; border-bottom: 1px dashed #eef1f6; vertical-align: top; }
.kv td:first-child { color: #8a94a7; width: 110px; white-space: nowrap; }

/* 时间线 */
.timeline { list-style: none; margin: 8px 0; padding-left: 6px; }
.timeline li {
  position: relative;
  padding: 0 0 18px 22px;
  border-left: 2px solid #e2e8f3;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
}
.timeline li.done::before { background: #22c55e; }

/* 二维码拖拽上传区 */
.qr-uploader { max-width: 480px; }
.qr-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
  padding: 30px 20px;
  min-height: 212px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
  transition: border-color .15s, background .15s, box-shadow .15s;
  outline: none;
}
.qr-dropzone:hover { border-color: #60a5fa; }
.qr-dropzone:focus-visible,
.qr-dropzone.is-active {
  border-color: #2563eb;
  border-style: solid;
  background: #f0f6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
}
.qr-dropzone.is-active .qrz-icon { background: #2563eb; color: #fff; }
.qr-dropzone.has-file { border-color: #93b4f5; background: #fff; min-height: 0; }
.qr-dropzone.qrz-dragover {
  border-color: #2563eb;
  border-style: solid;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}
.qr-dropzone .qrz-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #2563eb;
  font-size: 34px;
  font-weight: 300;
  line-height: 52px;
  transition: background .15s, color .15s;
}
.qr-dropzone .qrz-text { font-size: 14px; color: #334155; }
.qr-dropzone .qrz-text b { color: #2563eb; }
.qr-dropzone .qrz-text-or { margin-top: 4px; color: #64748b; font-size: 13px; }
.qr-dropzone .qrz-pick { margin: 14px 0 8px; }
.qr-dropzone .qrz-sub { margin-top: 4px; font-size: 12.5px; color: #94a3b8; }
.qr-dropzone .qrz-active-tip {
  display: none;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
}
.qr-dropzone.is-active .qrz-active-tip { display: block; }
.qr-dropzone .qrz-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: left;
}
.qr-dropzone .qrz-preview[hidden] { display: none; }
.qr-dropzone .qrz-preview img.qrz-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  flex: 0 0 auto;
}
.qr-dropzone .qrz-meta { min-width: 0; }
.qr-dropzone .qrz-name {
  font-size: 13px;
  color: #475569;
  word-break: break-all;
  margin-bottom: 10px;
  max-width: 240px;
}
.qr-dropzone .qrz-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-uploader .qrz-error {
  margin-top: 8px;
  font-size: 13px;
  color: #dc2626;
}
.timeline li.current::before { background: #2f6bff; box-shadow: 0 0 0 4px rgba(47,107,255,.18); }
.timeline li.fail::before { background: #ef4444; }
.timeline .t-title { font-weight: 600; font-size: 13.5px; }
.timeline .t-time { color: #9aa4b5; font-size: 12px; }
.timeline .t-detail { color: #64748b; font-size: 12.5px; }

.empty { text-align: center; color: #9aa4b5; padding: 40px 0; font-size: 13.5px; }
.detail-link { color: #2f6bff; }
.muted-text { color: #9aa4b5; }
.right-actions { text-align: right; }
.amount-strong { color: #e23d2e; font-weight: 700; }
.portal-grid .card { text-align: center; transition: transform .15s, box-shadow .15s; height: 100%; }
.portal-grid .card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(31,45,80,.1); }
.portal-grid .icon { font-size: 34px; margin-bottom: 10px; }
.portal-grid h2 { border: none; margin-bottom: 8px; padding: 0; }
.portal-grid p { color: #8a94a7; font-size: 13px; margin-bottom: 14px; }
.shop-entry { max-width: 520px; margin: 0 auto; }
