/* 推广团队 — 三级团队 · 团队分红 · 政务蓝 */

.page-invites {
  background: var(--app-bg);
}

.page-invites .app-shell {
  background: var(--app-bg);
}

/* ── Hero ── */
.invites-hero {
  position: relative;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 20px;
  color: #fff;
  background: linear-gradient(165deg, #083d96 0%, var(--gov-blue) 55%, #004098 100%);
  overflow: hidden;
}

.invites-hero::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -1px;
  height: 16px;
  background: var(--app-bg);
  border-radius: 14px 14px 0 0;
  z-index: 1;
}

.invites-hero__top {
  display: grid;
  grid-template-columns: 40px 1fr 52px;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.invites-hero__top h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}

.invites-hero__top .back-button {
  color: #fff;
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
  opacity: 0.95;
}

.invites-hero__poster {
  justify-self: end;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: #ffe566;
  text-decoration: none;
  border: 1px solid rgba(255, 229, 102, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.invites-hero__desc {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  opacity: 0.88;
}

.invites-hero__stats {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
}

.invites-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.invites-stat__label {
  font-size: 12px;
  opacity: 0.9;
  letter-spacing: 0.04em;
}

.invites-stat__value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.invites-stat__unit {
  font-size: 13px;
  opacity: 0.85;
}

.invites-stat--accent .invites-stat__value {
  color: #ffe566;
}

.invites-stat-divider {
  width: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.22);
}

/* ── Main ── */
.invites-main {
  position: relative;
  z-index: 2;
  margin-top: -4px;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── 团队分红 ── */
.invites-commission {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.invites-commission__banner {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 112;
  height: auto;
  min-height: 100px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  line-height: 0;
  background: linear-gradient(135deg, #042e7a 0%, #0a52c8 50%, #0a6b4f 100%);
}

.invites-commission__banner svg {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.invites-commission__body {
  padding: 14px 14px 12px;
}

.invites-commission__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.invites-commission__title-wrap h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--blue-ink);
  letter-spacing: 0.02em;
}

.invites-commission__title-wrap p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.invites-commission__wallet {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gov-blue);
  text-decoration: none;
  white-space: nowrap;
}

.invites-commission__earn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.invites-commission__earn > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: linear-gradient(160deg, #f4f8ff 0%, #eef6f2 100%);
  border: 1px solid rgba(0, 82, 217, 0.08);
  border-radius: var(--radius-sm);
}

.invites-commission__earn span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.invites-commission__earn strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.invites-commission__earn strong b {
  font-weight: inherit;
}

.invites-commission__rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.invites-rate {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.invites-rate__illus {
  position: relative;
  width: 100%;
  aspect-ratio: 120 / 64;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

.invites-rate--l1 .invites-rate__illus {
  background: #0a52c8;
}

.invites-rate--l2 .invites-rate__illus {
  background: #0b6b4a;
}

.invites-rate--l3 .invites-rate__illus {
  background: #c46a18;
}

.invites-rate__illus svg {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.invites-rate__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px 10px;
  text-align: center;
}

.invites-rate__level {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.invites-rate__pct {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--gov-blue);
}

.invites-rate--l2 .invites-rate__pct {
  color: var(--gov-green);
}

.invites-rate--l3 .invites-rate__pct {
  color: var(--gov-orange);
}

.invites-rate__meta small {
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
}

.invites-commission__tip {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

/* ── List ── */
.invites-list-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.invites-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.invites-list-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-ink);
}

.invites-list-head small {
  color: var(--muted);
  font-size: 12px;
}

.invites-level-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.invites-level-tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: #f4f7fc;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  touch-action: manipulation;
}

.invites-level-tabs button span {
  line-height: 1.2;
}

.invites-level-tabs button em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--gov-blue);
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.invites-level-tabs button.is-active {
  color: var(--gov-blue);
  background: #eef4ff;
  border-color: rgba(0, 82, 217, 0.2);
  box-shadow: 0 1px 4px rgba(0, 82, 217, 0.08);
}

.invites-level-tabs button.is-active em {
  opacity: 1;
  color: var(--gov-blue);
}

.invites-level-tabs button[data-level-tab="2"] em {
  color: var(--gov-green);
}

.invites-level-tabs button[data-level-tab="3"] em {
  color: var(--gov-orange);
}

.invites-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.invites-list li {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.invites-list li:last-child {
  border-bottom: none;
}

.invite-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.invite-row-top strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-ink);
}

.invite-row-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.invite-row-badges .badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.invite-row-badges .badge--level {
  background: rgba(0, 82, 217, 0.08);
  color: var(--gov-blue);
}

.invite-row-badges .badge--verified {
  background: rgba(45, 157, 107, 0.12);
  color: var(--gov-green);
}

.invite-row-badges .badge--pending {
  background: rgba(230, 122, 46, 0.1);
  color: var(--gov-orange);
}

.invite-row-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.invites-empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 20px !important;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 360px) {
  .invites-level-tabs button {
    font-size: 12px;
  }

  .invites-rate__pct {
    font-size: 18px;
  }

  .invites-rate__meta small {
    font-size: 9px;
  }

  .invites-commission__earn strong {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .invites-commission {
    animation: invites-commission-in 0.45s ease both;
  }

  .invites-rate {
    animation: invites-rate-in 0.4s ease both;
  }

  .invites-rate--l1 {
    animation-delay: 0.05s;
  }

  .invites-rate--l2 {
    animation-delay: 0.12s;
  }

  .invites-rate--l3 {
    animation-delay: 0.19s;
  }
}

@keyframes invites-commission-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes invites-rate-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
