/* ================= 银联行动 · 后台管理 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #3b6df0;
  --primary-dark: #2f54eb;
  --primary-light: #eef3fe;
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --radius: 12px;
  --sidebar: #16213a;
  --sidebar-active: #24344f;
}

html, body { 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;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16213a 0%, #24344f 50%, #3b6df0 130%);
}
.login-card {
  width: 400px;
  background: var(--card);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
}
.login-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.login-sub {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 28px;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input[type="text"], .field input[type="password"],
.field input[type="number"], .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  background: #fff;
  color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: #fff; color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--primary); border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 主布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--sidebar);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  padding: 22px 20px 18px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #3b6df0, #22d3ee);
}
.sidebar-nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 7px;
  display: none;
}
.nav-item .badge.show { display: inline-block; }
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 13px; }
.content { padding: 24px; flex: 1; }

/* ---------- 卡片 / 统计 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.stat-card .label { color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .value.small { font-size: 18px; }
.stat-card .sub { color: var(--text-3); font-size: 12px; margin-top: 6px; }
.stat-card.accent { border-top: 3px solid var(--primary); }

.progress-wrap {
  height: 10px;
  background: #eef2f7;
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b6df0, #22d3ee);
  border-radius: 6px;
  transition: width .3s;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
}
.tbl td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: middle;
}
.tbl tr:hover td { background: #f8fafc; }
.tbl .empty { text-align: center; color: var(--text-3); padding: 40px 0; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-orange { background: var(--warning-bg); color: var(--warning); }
.tag-gray { background: #f1f5f9; color: var(--text-2); }

/* ---------- Tab / 筛选 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
}
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input[type="text"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 240px;
  outline: none;
}
.filter-bar input[type="text"]:focus { border-color: var(--primary); }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 13px;
}
.pager .btns { display: flex; gap: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: 50px 16px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.modal.wide { width: 860px; }
.modal-head {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  cursor: pointer;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  background: none;
  border: none;
}
.modal-foot {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 16px;
}
.info-item .k { color: var(--text-3); font-size: 12px; margin-bottom: 3px; }
.info-item .v { font-size: 14px; word-break: break-all; }
.info-item .v.copyable { cursor: pointer; }
.info-item .v.copyable:hover { color: var(--primary); }

.img-preview { text-align: center; margin: 10px 0; }
.img-preview img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.img-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-cols .img-label { text-align: center; color: var(--text-2); font-size: 12px; margin-bottom: 6px; }

.upload-box {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color .15s;
  font-size: 13px;
}
.upload-box:hover { border-color: var(--primary); color: var(--primary); }

.log-list { font-size: 13px; }
.log-list .log-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.log-item .t { color: var(--text-3); font-size: 12px; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.toast {
  padding: 11px 22px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .2);
  animation: toastIn .25s;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-note {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12.5px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.warning-note {
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12.5px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .info-grid { grid-template-columns: 1fr; }
}
