/* ============ 基础 ============ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f2f5fa; color: #24303f; font-size: 14px;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #101f31 0%, #17324f 55%, #1d4a76 100%);
}
.login-box {
  width: 340px; background: #fff; border-radius: 14px; padding: 30px 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28); text-align: center;
}
.login-logo {
  width: 52px; height: 52px; line-height: 52px; margin: 0 auto 12px;
  border-radius: 50%; background: linear-gradient(135deg, #2f8cff, #1a6fe0);
  color: #fff; font-size: 24px; font-weight: 700;
}
.login-box h2 { margin: 0; font-size: 20px; letter-spacing: 2px; }
.login-sub { margin: 6px 0 20px; font-size: 12px; color: #8b97a8; }
.login-box label { display: block; text-align: left; margin-bottom: 12px; font-size: 13px; color: #5d6b7c; }
.login-box input {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #dde4ee;
  border-radius: 8px; background: #fafbfd; outline: none;
}
.login-box input:focus { border-color: #2f8cff; background: #fff; }
#lgBtn {
  width: 100%; margin-top: 6px; padding: 11px 0; border: 0; border-radius: 8px;
  background: linear-gradient(90deg, #2f8cff, #1a6fe0); color: #fff; font-size: 15px;
  letter-spacing: 4px; cursor: pointer;
}
#lgBtn:hover { filter: brightness(1.05); }
.login-tip { margin-top: 14px; font-size: 12px; color: #9aa6b6; }

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 196px; flex: 0 0 196px; background: #121f2e; color: #b9c7d8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-logo {
  height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.07); color: #fff; font-size: 15px;
}
.side-logo span {
  width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 8px;
  background: linear-gradient(135deg, #2f8cff, #1a6fe0); font-weight: 700;
}
.side-logo b { font-weight: 600; letter-spacing: 1px; }
#menu { flex: 1; overflow-y: auto; padding: 8px 0; }
#menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px; cursor: pointer;
  font-size: 14px; color: #b9c7d8; border-left: 3px solid transparent;
}
#menu a i { font-style: normal; width: 18px; text-align: center; opacity: .85; font-size: 13px; }
#menu a:hover { background: rgba(255,255,255,.05); color: #fff; }
#menu a.on { background: #1f7fe8; color: #fff; border-left-color: #7fc0ff; }
.side-foot { padding: 12px 18px; font-size: 11px; color: #5b7189; border-top: 1px solid rgba(255,255,255,.06); }

.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; box-shadow: 0 1px 0 #e6ecf5; position: sticky; top: 0; z-index: 20;
}
.top-left { display: flex; align-items: center; gap: 14px; }
.ico { cursor: pointer; color: #7d8b9e; font-size: 16px; }
.ico:hover { color: #1f7fe8; }
.crumb { font-size: 13px; color: #8b97a8; }
.top-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #6d7c90; }
.top-domain { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid #dfe8f3; border-radius: 8px; background: #f7faff; }
.top-domain-label { color: #8796a8; font-size: 12px; }
.top-domain select { border: 0; background: transparent; color: #24303f; font-size: 13px; font-weight: 600; outline: none; max-width: 170px; cursor: pointer; }
.who b { color: #24303f; }
.logout { cursor: pointer; color: #2f8cff; }
.page { padding: 16px 20px 40px; }

/* ============ 卡片 / 通用 ============ */
.card {
  background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(24,52,90,.06);
  padding: 16px 18px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #24303f; }
.card h3 small { margin-left: 8px; font-weight: 400; font-size: 12px; color: #9aa6b6; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: #fff; border-radius: 10px; padding: 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 2px 10px rgba(24,52,90,.06);
}
.stat .ico-b {
  width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #eef5ff; color: #2f8cff; font-size: 18px;
}
.stat .txt b { display: block; font-size: 26px; line-height: 1.2; color: #24303f; }
.stat .txt span { font-size: 12px; color: #8b97a8; }
.stat.red .ico-b { background: #fff0f1; color: #f4555c; }
.stat.red .txt b { color: #e5454f; }
.stat.blue .ico-b { background: #eef5ff; color: #2f8cff; }
.stat.gray .ico-b { background: #f1f4f9; color: #7d8b9e; }

.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bar .grow { flex: 1; }
.btn {
  border: 0; border-radius: 7px; padding: 9px 16px; cursor: pointer; font-size: 13px;
  background: #2f8cff; color: #fff;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #f1f4f9; color: #46566a; }
.btn.danger { background: #f4555c; }
.btn.green { background: #1fa971; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input.f, select.f, textarea.f {
  padding: 8px 10px; border: 1px solid #dde4ee; border-radius: 7px; background: #fff; outline: none;
}
input.f:focus, select.f:focus, textarea.f:focus { border-color: #2f8cff; }
label.fld { display: block; margin-bottom: 12px; font-size: 13px; color: #5d6b7c; }
label.fld input, label.fld select, label.fld textarea {
  width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid #dde4ee;
  border-radius: 7px; outline: none; background: #fff;
}
label.fld input:focus, label.fld textarea:focus, label.fld select:focus { border-color: #2f8cff; }
label.fld em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: #9aa6b6; }

/* ============ 表格 ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
.tbl th { color: #7d8b9e; font-weight: 500; background: #fafbfe; }
.tbl tr:hover td { background: #fbfdff; }
.tbl img.thumb { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: #f1f4f9; }
.tbl td .thumb { display: inline-block; vertical-align: middle; margin-right: 8px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.tag.on { background: #e8f7f0; color: #1fa971; }
.tag.off { background: #f1f4f9; color: #8b97a8; }
.tag.red { background: #ffecee; color: #e5454f; }
.tag.blue { background: #eaf3ff; color: #2f8cff; }
.tag.orange { background: #fff3e4; color: #d9822b; }
.empty { padding: 40px 0; text-align: center; color: #9aa6b6; font-size: 13px; }

/* ============ 首页常用功能 ============ */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quick a { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; color: #24303f; }
.quick a i {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: #eaf3ff; color: #2f8cff; font-style: normal; font-size: 15px;
}
.quick a:nth-child(2n) i { background: #ffecee; color: #f4555c; }
.quick a:nth-child(3n) i { background: #e8f7f0; color: #1fa971; }

/* ============ 图表（纯 CSS 柱状）============ */
.chart { display: flex; align-items: flex-end; gap: 18px; height: 180px; padding: 10px 6px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .col b { font-size: 11px; color: #8b97a8; margin-bottom: 6px; }
.chart .col .barv { width: 60%; max-width: 34px; background: linear-gradient(180deg, #6fb4ff, #2f8cff); border-radius: 6px 6px 0 0; min-height: 2px; }
.chart .col em { margin-top: 8px; font-style: normal; font-size: 11px; color: #8b97a8; }

/* ============ 弹层 / 提示 ============ */
.modal { position: fixed; inset: 0; background: rgba(14,24,38,.45); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal-box { width: 460px; max-width: calc(100vw - 40px); max-height: 86vh; overflow: hidden; background: #fff; border-radius: 12px; display: flex; flex-direction: column; }
.modal-head { height: 50px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eff3f9; }
.modal-head b { font-size: 15px; }
.modal-head span { cursor: pointer; color: #9aa6b6; font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%) translateY(20px);
  background: rgba(18,31,46,.92); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 80;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.flex2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hint { font-size: 12px; color: #9aa6b6; line-height: 1.7; }
.qr-prev { width: 150px; height: 150px; border: 1px dashed #dde4ee; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #9aa6b6; cursor: pointer; overflow: hidden; }
.qr-prev img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: repeat(2, 1fr); }
}

/* 订单交易进度 */
.tag.green { background: #e8f7f0; color: #1fa971; }
.pflow { display: flex; gap: 4px; align-items: center; }
.pflow i { display: block; width: 16px; height: 5px; border-radius: 3px; background: #e3e8f0; }
.pflow i.on { background: #2f6df6; }
.pflow-t { margin-top: 5px; font-size: 11px; color: #7d8b9e; white-space: nowrap; }

/* 会员明细：宽弹层 */
.modal-box.mdl-wide{ width:980px; }
.modal-box.mdl-wide .tbl{ font-size:12.5px; }
.modal-box.mdl-wide .tbl th{ padding:8px 10px; }
.modal-box.mdl-wide .tbl td{ padding:8px 10px; }

.tbl.dense th, .tbl.dense td { padding: 9px 7px; font-size: 12px; }

.audit-sum{border:1px solid #e5ecf6;background:#f8fbff;border-radius:10px;padding:12px 14px;margin:0 0 14px}
.audit-sum-title{font-size:13px;font-weight:600;color:#30465f;margin-bottom:10px;display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.audit-sum-title span{font-weight:400;color:#7d8b9e;font-size:12px}
.audit-sum-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
.audit-sum-card{background:#fff;border:1px solid #e8eef6;border-radius:8px;padding:10px 12px}
.audit-sum-h{display:flex;align-items:center;gap:8px;padding-bottom:7px;margin-bottom:6px;border-bottom:1px dashed #edf1f7}
.audit-sum-h b{font-size:14px}
.audit-sum-r{display:flex;justify-content:space-between;font-size:12px;color:#6b7a8d;line-height:1.9}
.audit-sum-r b{color:#2c3e50;font-weight:600}
.audit-sum-r.total{border-top:1px solid #eef2f8;margin-top:5px;padding-top:5px}
.audit-sum-r.total b{color:#e5454f;font-size:14px}
.proof-thumb{cursor:zoom-in}
.proof-view{position:fixed;inset:0;background:rgba(8,15,24,.86);z-index:99999;display:flex;align-items:center;justify-content:center;padding:24px}
.proof-view img{max-width:92vw;max-height:86vh;object-fit:contain;border-radius:6px;background:#111;box-shadow:0 12px 50px rgba(0,0,0,.5)}
.proof-view .proof-close{position:absolute;top:18px;right:24px;width:38px;height:38px;border:0;border-radius:50%;background:#fff;color:#333;font-size:22px;cursor:pointer}

/* ============ d167 报表 / 数据列表美化 ============ */
.tbl th { background: #f5f8fd; color: #50647c; font-weight: 600; letter-spacing: .2px; }
.tbl tbody tr:nth-child(even) td { background: #fcfdff; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.money { color: #12845b; font-weight: 600; }
.rp-card { border: 1px solid #edf2f9; box-shadow: 0 4px 18px rgba(24,52,90,.07); }
.rp-card h3 { padding-left: 10px; border-left: 3px solid #2f8cff; line-height: 1.4; }
.rp-tbl { border-collapse: separate; border-spacing: 0; }
.rp-tbl th { background: linear-gradient(180deg, #f7faff, #eef5ff); border-bottom: 1px solid #dfe9f6; position: sticky; top: 0; z-index: 2; }
.rp-tbl td { border-bottom: 1px solid #eef3f9; }
.rp-tbl tbody tr:hover td { background: #f5faff; }

.tm-group { margin-top: 10px; border: 1px solid #e6edf7; border-radius: 10px; overflow: hidden; background: #fff; }
.tm-group summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; background: linear-gradient(90deg, #f7faff, #ffffff); border-bottom: 1px solid #edf2f9; }
.tm-group summary::-webkit-details-marker { display: none; }
.tm-group summary::before { content: '▸'; color: #2f8cff; font-size: 12px; transition: transform .15s; }
.tm-group[open] summary::before { transform: rotate(90deg); }
.tm-ref-name { font-size: 14px; font-weight: 700; color: #24303f; }
.tm-ref-meta { margin-left: auto; font-size: 12px; color: #7d8b9e; background: #f2f7ff; border: 1px solid #e2ecfb; border-radius: 999px; padding: 4px 10px; }
.tm-ref-meta b { color: #2f8cff; }
.tm-scroll { overflow-x: auto; }
.tm-table { min-width: 860px; }
.tm-table th { white-space: nowrap; }
.tm-rel { display: inline-block; min-width: 38px; text-align: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tm-rel.dir { background: #fff0f1; color: #e5454f; }
.tm-rel.und { background: #eef5ff; color: #2f8cff; }
.tm-person-row td { vertical-align: middle; }
.tm-sess { color: #5d6b7c; font-size: 12px; white-space: nowrap; }
.tm-total td { background: #f4f9ff !important; font-weight: 700; color: #24303f; border-top: 2px solid #dfeafa; }
@media (max-width: 760px) {
  .tm-ref-meta { display: none; }
  .rp-card { padding: 12px; }
}

/* ============ 抢购管理页：站点状态与操作区 ============ */
.rush-hero {
  display: flex; justify-content: space-between; align-items: stretch; gap: 20px; flex-wrap: wrap;
  padding: 18px 20px; margin-bottom: 14px; border-radius: 12px;
  background: linear-gradient(135deg, #0b3d32 0%, #0e5743 58%, #12745a 100%);
  box-shadow: 0 8px 24px rgba(13, 59, 49, .16); color: #fff;
}
.rush-hero-main { min-width: 260px; flex: 1 1 420px; }
.rush-kicker { font-size: 11px; letter-spacing: .08em; color: #9fe0cd; margin-bottom: 5px; }
.rush-site-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rush-site-name { font-size: 20px; font-weight: 700; line-height: 1.25; }
.rush-dot { width: 7px; height: 7px; border-radius: 50%; background: #65e8bb; box-shadow: 0 0 0 3px rgba(101, 232, 187, .16); }
.rush-dot.off { background: #a7b6bf; box-shadow: 0 0 0 3px rgba(167, 182, 191, .12); }
.rush-site-state { font-size: 12px; color: #d5efe7; }
.rush-site-hint { margin-top: 7px; font-size: 12px; color: #b8d8cf; line-height: 1.5; }
.rush-hero-stats { display: flex; align-items: stretch; justify-content: flex-end; gap: 10px; flex-wrap: wrap; flex: 0 1 auto; }
.rush-hero-stat {
  min-width: 150px; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px; background: rgba(255, 255, 255, .075);
}
.rush-hero-stat > span { display: block; color: #b7d9cf; font-size: 11px; margin-bottom: 4px; }
.rush-hero-stat > b { display: block; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.35; }
.rush-hero-stat > b.ok { color: #83f2c5; }
.rush-hero-stat > b.muted { color: #d7e5df; }
.rush-hero-link {
  display: inline-block; margin-top: 5px; color: #a9f0d6; font-size: 11px;
  text-decoration: none; cursor: pointer;
}
.rush-hero-link:hover { color: #fff; text-decoration: underline; }
.rush-hero-manage { align-self: center; padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; margin-top: 0; white-space: nowrap; }
.rush-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rush-card-head h3 { margin: 0; }
.rush-head-note { font-size: 12px; color: #9aa6b6; line-height: 1.5; }
.rush-quick .rush-actions-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rush-quick-hint { font-size: 12px; color: #9aa6b6; margin-left: 2px; }
.btn.ghost.danger-text { background: #fff3f1; color: #d54a54; }
.btn.ghost.danger-text:hover { background: #ffe9e6; }
.rush-settings .rush-card-head { align-items: center; margin-bottom: 14px; }
.rush-form-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.05fr);
  gap: 12px; align-items: stretch;
}
.rush-field { display: flex; flex-direction: column; justify-content: flex-start; margin: 0; }
.rush-field > span { margin-bottom: 6px; color: #5d6b7c; font-size: 13px; }
.rush-field input {
  width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #dde4ee;
  border-radius: 7px; outline: none; background: #fff; color: #24303f; font-size: 13px;
}
.rush-field input:focus { border-color: #2f8cff; box-shadow: 0 0 0 3px rgba(47,140,255,.08); }
.rush-field em { display: block; margin-top: 5px; color: #9aa6b6; font-style: normal; font-size: 11px; line-height: 1.4; }
.rush-session-box {
  display: flex; flex-direction: column; min-height: 88px; padding: 10px 12px;
  border: 1px solid #e4edf7; border-radius: 9px; background: #f8fbff;
}
.rush-session-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #5d6b7c; margin-bottom: 8px; }
.rush-session-box .btn { align-self: flex-start; padding: 6px 13px; font-size: 12px; }
.rush-session-meta { margin-top: 8px; color: #8b97a8; font-size: 11px; line-height: 1.5; }
.rush-display-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 13px; padding: 11px 13px; border: 1px dashed #dfe8f3; border-radius: 8px; background: #fbfdff;
}
.rush-display-copy b { display: block; font-size: 13px; color: #24303f; }
.rush-display-copy span { display: block; margin-top: 3px; font-size: 11px; color: #8b97a8; }
.rush-seg { display: flex; gap: 6px; align-items: center; }
.rush-seg .btn { padding: 6px 16px; border-radius: 7px; font-size: 12px; }
.rush-help { margin-top: 10px; border-top: 1px solid #f0f3f8; padding-top: 9px; }
.rush-help summary { cursor: pointer; color: #6d7c90; font-size: 12px; }
.rush-help > div { margin-top: 8px; color: #7d8b9e; font-size: 12px; line-height: 1.65; }
.rush-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rush-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px;
  border-radius: 999px; background: #f3f7fd; color: #6d7c90; font-size: 11px;
}
.rush-chip b { color: #2f5fd9; font-size: 13px; }
.rush-table-wrap { overflow-x: auto; padding-bottom: 2px; }
.rush-table { min-width: 860px; }
.rush-table th { white-space: nowrap; }
.rush-table td { padding-top: 10px; padding-bottom: 10px; }
.rush-prod { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.rush-prod-thumb { flex: 0 0 auto; line-height: 0; }
.rush-prod-thumb .thumb { margin-right: 0; }
.rush-prod-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rush-prod-id b { color: #52647a; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 185px; }
.rush-prod-id span { color: #24303f; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 185px; }
.rush-actions { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.rush-actions .btn { white-space: nowrap; }
.rush-assigned .rush-card-head { margin-bottom: 8px; }
@media (max-width: 1280px) {
  .rush-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rush-hero-stats { justify-content: flex-start; }
}
@media (max-width: 820px) {
  .rush-form-grid { grid-template-columns: 1fr; }
  .rush-hero { padding: 15px 16px; }
  .rush-hero-stats { width: 100%; }
  .rush-hero-stat { flex: 1 1 150px; }
  .rush-display-row { align-items: flex-start; flex-direction: column; }
  .rush-settings .rush-card-head { align-items: flex-start; }
}

.top-domain select:disabled { color: #24303f; opacity: 1; cursor: default; }
