/* ==========================================================================
   rebate-v1.css · 店站「推广返利」增量样式
   接：storefront 顶栏 (.nav / .nl / .nbtn) + member-console 壳
        (admin-v1 .console-layout / .sidebar / .workspace / .panel / .stat-card)
   复用：--acc #0d9488 · --acc-bg · --acc-h · console --navy/--paper/--line
   勿引入新品牌色；勿改 R3「代理团队」页样式。
   ========================================================================== */

/* ---------- 顶栏入口（登录态） ---------- */
/* 挂在 storefront .nav-r 里，紧挨「个人中心」；勿抢 .nbtn「联系客服」 */
.nav-rebate,
a.nav-rebate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--acc, #0d9488);
  font-size: 14px;
  font-weight: 650;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--acc-bg, #e6f7f5);
  border: 1px solid rgba(13, 148, 136, 0.22);
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-rebate:hover {
  background: #d5f3ef;
  border-color: rgba(13, 148, 136, 0.4);
  color: var(--acc-h, #0f766e);
  text-decoration: none;
}
.nav-rebate__badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  background: var(--acc, #0d9488);
}
/* 手机顶栏短链：只露图标 +「返利」 */
.nav-rebate--compact .nav-rebate__full { display: none; }
.nav-rebate--compact .nav-rebate__short { display: inline; }
.nav-rebate__short { display: none; }
.nav-rebate__ico {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---------- 侧栏：推广返利 vs 代理团队 ---------- */
.sidebar nav button.rebate-nav,
.sidebar nav .rebate-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar nav button.rebate-nav.selected,
.sidebar nav .rebate-nav.selected {
  background: #ffffff14;
  color: #fff;
  border-color: #ffffff18;
  box-shadow: inset 3px 0 #41cbb9;
}
.rebate-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  flex: none;
}
.rebate-pill--retail {
  background: rgba(65, 203, 185, 0.22);
  color: #7eebd9;
  border: 1px solid rgba(65, 203, 185, 0.35);
}
/* 代理团队保持 dim；小 pill「代理」降低权重，与普通用户区分 */
.sidebar nav button.dim .rebate-pill--agent,
.sidebar nav .dim .rebate-pill--agent {
  background: rgba(255, 255, 255, 0.06);
  color: #8daebd;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar nav button.dim {
  color: #8daebd;
  font-size: 12.5px;
  opacity: 0.85;
}

/* ---------- 主区壳 ---------- */
.rebate-view { min-width: 0; }
.rebate-view .workspace-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rebate-view .workspace-head .rebate-pill--retail {
  background: var(--acc-bg, #e6f7f5);
  color: var(--acc-h, #0f766e);
  border: 1px solid rgba(13, 148, 136, 0.25);
  height: 22px;
  padding: 0 9px;
  font-size: 11px;
}

/* A · 说明条 */
.rebate-info {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #eef8f6;
  border: 1px solid #cfe8e3;
  color: #356a64;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 18px;
}
.rebate-info__ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--acc-bg, #e6f7f5);
  color: var(--acc, #0d9488);
  display: grid;
  place-items: center;
  border: 1px solid rgba(13, 148, 136, 0.18);
}
.rebate-info__ico svg { width: 18px; height: 18px; }
.rebate-info p { margin: 0; }
.rebate-info strong { color: #0f5c55; font-weight: 700; }
.rebate-info .fine { margin-top: 6px; color: #5a8580; font-size: 12px; }

/* B · 推广工具 + C · 余额 两列 */
.rebate-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.rebate-panel {
  background: #fff;
  border: 1px solid var(--line, #dce6ec);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 3px 12px #153b5108;
  min-width: 0;
}
.rebate-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.rebate-panel__head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.02em;
}
.rebate-panel__hint {
  font-size: 12px;
  color: var(--muted, #637987);
}

/* 复制行 */
.rebate-copy-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
}
.rebate-copy-row__label {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted, #637987);
}
.rebate-copy-row__box {
  min-width: 0;
  font-family: ui-monospace, Consolas, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: #f5f9fb;
  border: 1px solid #d8e4ea;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink, #193447);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rebate-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #dce6ec);
  background: #fff;
  color: var(--ink, #193447);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}
.rebate-copy-btn:hover { background: #eef6f7; }

/* 二维码区 */
.rebate-qr-block {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e2eef2;
  flex-wrap: wrap;
}
.rebate-qr {
  width: 148px;
  height: 148px;
  border-radius: 14px;
  border: 1px solid #d5e6e3;
  background: #fff;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 2px 8px #0a243808;
  flex: none;
}
.rebate-qr__label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 650;
  color: var(--acc-h, #0f766e);
  background: var(--acc-bg, #e6f7f5);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.rebate-qr-meta {
  flex: 1;
  min-width: 160px;
}
.rebate-qr-meta p {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted, #637987);
  line-height: 1.55;
}
.rebate-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  background: var(--acc, #0d9488);
  color: #fff;
  font-weight: 650;
  font-size: 13.5px;
}
.rebate-primary:hover { background: var(--acc-h, #0f766e); }
.rebate-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line, #dce6ec);
  background: #fff;
  color: var(--ink, #193447);
  font-weight: 650;
  font-size: 13.5px;
}
.rebate-secondary:hover { background: #eef6f7; }

/* C · 余额 */
.rebate-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.rebate-stat {
  background: #fff;
  border: 1px solid var(--line, #dce6ec);
  border-radius: 16px;
  padding: 16px 18px;
}
.rebate-stat .label {
  font-size: 12px;
  color: var(--muted, #637987);
  margin-bottom: 6px;
}
.rebate-stat .value {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
/* 可用余额：teal 渐变突出 */
.rebate-stat--available {
  background: linear-gradient(135deg, #0d9488, #07585a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.28);
}
.rebate-stat--available .label { color: #c4e4df; }
.rebate-stat--available .value { color: #fff; }
.rebate-stat--available .sub {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}
.rebate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.rebate-actions .rebate-primary { flex: 1; min-width: 120px; }
.rebate-actions .rebate-secondary { flex: 1; min-width: 120px; }
.rebate-payout-note {
  font-size: 12px;
  color: var(--muted, #637987);
  line-height: 1.55;
  margin: 0;
}

/* 明细表 */
.rebate-tables { display: grid; gap: 16px; }
.rebate-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line, #dce6ec);
}
.rebate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.rebate-table th {
  background: #f7fafc;
  color: var(--muted, #637987);
  font-size: 11px;
  letter-spacing: .02em;
  font-weight: 650;
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 1px solid #e8eef2;
}
.rebate-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8eef2;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.rebate-table tr:last-child td { border-bottom: 0; }
.rebate-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
}
.rebate-status--available {
  background: var(--acc-bg, #e6f7f5);
  color: var(--acc-h, #0f766e);
}
.rebate-status--pending {
  background: #fff8e8;
  color: #8a5a00;
}
.rebate-status--sent {
  background: #e9f7ee;
  color: #1f8a3b;
}
.rebate-status--requested {
  background: #eef4f8;
  color: #456c7c;
}
.rebate-status--void,
.rebate-status--failed {
  background: #fdeeec;
  color: #c4271c;
}

/* 提现表单（展开态示意） */
.rebate-payout-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2eef2;
  display: grid;
  gap: 12px;
}
.rebate-payout-form label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
}
.rebate-payout-form input,
.rebate-payout-form select {
  width: 100%;
  border: 1px solid #c9d8e0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.rebate-payout-form .warn-line {
  font-size: 12px;
  color: #8a5a00;
  background: #fff8e8;
  border: 1px solid #f2dba6;
  border-radius: 10px;
  padding: 10px 12px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .rebate-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav-rebate { padding: 6px 10px; }
  .nav-rebate__full { display: none; }
  .nav-rebate__short { display: inline; }
  .rebate-copy-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .rebate-copy-row__label { font-size: 11.5px; }
  .rebate-qr-block { flex-direction: column; align-items: center; text-align: center; }
  .rebate-qr-meta { width: 100%; }
  .rebate-qr-meta .rebate-primary { width: 100%; }
  .rebate-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rebate-stat .value { font-size: 22px; }
  .rebate-panel { padding: 18px 16px; border-radius: 15px; }
  .rebate-info { padding: 12px 14px; }
}

.rebate-qr img{display:block;width:176px;height:176px;padding:8px;background:#fff;border:1px solid #dce6ec;border-radius:10px}.rebate-qr__label{display:block;margin-top:8px;text-align:center;color:#637987;font-size:12px}

/* moved from inline <style> in index.html (blocked by CSP) */
.rebate-credit-toggle{display:flex;align-items:center;gap:8px;margin:12px 0;padding:10px 12px;border:1px solid #b8e4dc;border-radius:10px;background:#effbf8;color:#285c59;font-size:13px}.rebate-credit-toggle input{accent-color:#0d9488}
/* 2026-11-02 军师：真二维码图片 176px 放不进 148px 的旧方框，改成自适应，标签放到码下面不压码 */
.rebate-qr{width:auto!important;height:auto!important;display:flex!important;flex-direction:column;align-items:center;padding:10px;gap:6px}
.rebate-qr img{width:168px!important;height:168px!important;padding:6px!important;border:0!important}
.rebate-qr__label{position:static!important;transform:none!important;margin:0!important}
