/* 邀请中心 · LZW 红金主题（与 withdrawal / recharge 一致） */

.ih-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(env(safe-area-inset-bottom) + 88px);
  background: var(--app-bg, #f5f0eb);
}

/* ── 顶部红金 Hero ── */
.ih-hero {
  position: relative;
  overflow: hidden;
  padding-bottom: 28px;
  color: #fff;
  background:
    radial-gradient(ellipse 55% 70% at 92% 8%, rgba(212, 160, 23, 0.32), transparent 55%),
    radial-gradient(ellipse 40% 50% at 0% 100%, rgba(200, 16, 46, 0.35), transparent 50%),
    linear-gradient(155deg, #7a1020 0%, #8b1a2a 52%, #8b1528 100%);
}
.ih-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  pointer-events: none;
}
.ih-hero-glow {
  position: absolute;
  top: -50px;
  right: -30px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 215, 110, 0.35) 0%, transparent 70%);
  pointer-events: none;
  animation: ih-glow-pulse 4s ease-in-out infinite;
}
.ih-hero-icon {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: 24px;
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: rgba(245, 215, 110, 0.1);
  pointer-events: none;
  font-family: var(--app-display, serif);
}
@keyframes ih-glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.ih-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
}
.ih-nav .back {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ih-nav .back:active { opacity: 0.85; }
.ih-nav .meta { flex: 1; min-width: 0; }
.ih-nav .meta .k {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(232, 176, 106, 0.9);
  font-weight: 600;
}
.ih-nav .meta .t {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--app-display, serif);
  line-height: 1.2;
  color: #fff;
}

/* 用户信息 */
.ih-hero-user {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 20px 0;
}
.ih-hero-user .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5d76e 0%, #e8b06a 55%, #d4a017 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #7a1020;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 215, 110, 0.35);
}
.ih-hero-user .who { flex: 1; min-width: 0; }
.ih-hero-user .who .name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ih-hero-user .who .sub {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* 主统计 */
.ih-hero-main {
  position: relative;
  z-index: 1;
  padding: 16px 20px 0;
}
.ih-hero-main .lab {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
}
.ih-hero-main .val {
  margin-top: 4px;
  font-size: 44px;
  font-weight: 800;
  font-family: var(--app-display, serif);
  line-height: 1;
  color: #f5d76e;
}
.ih-hero-main .val small {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 2px;
}
.ih-hero-main .ih-hero-hint,
.ih-hero-main .hint {
  margin: 8px 0 0;
  padding: 6px 10px;
  max-width: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* 三格统计 */
.ih-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 14px 16px 0;
}
.ih-stat {
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ih-stat .v {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--app-display, serif);
  color: #fff;
  line-height: 1.1;
}
.ih-stat .v.highlight { color: #f5d76e; }
.ih-stat .k {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}
.ih-stats-note {
  position: relative;
  z-index: 1;
  margin: 10px 16px 2px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.48);
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* ── 主体内容区 ── */
.ih-body {
  position: relative;
  z-index: 2;
  margin-top: -14px;
  padding: 0 16px 12px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #f8f2f3 0%, var(--app-bg, #f5f0eb) 120px);
  box-shadow: 0 -10px 30px rgba(122, 16, 32, 0.1);
}
.ih-body::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  margin: 10px auto 12px;
  border-radius: 2px;
  background: rgba(122, 16, 32, 0.12);
}

/* 通用卡片 */
.ih-card {
  margin-bottom: 12px;
  padding: 16px 14px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--app-line, #eadfe1);
  box-shadow: var(--app-shadow-sm, 0 1px 6px rgba(0, 0, 0, 0.05));
}
.ih-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.ih-section-title {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--app-display, serif);
  color: var(--app-ink, #7a1020);
}
.ih-section-hint {
  font-size: 12px;
  color: var(--app-muted, #9a8a8e);
}

/* ── 邀请分享 ── */
.ih-share-qr {
  text-align: center;
  margin-bottom: 14px;
}
.ih-share-qr-box {
  width: 196px;
  height: 196px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9e8 0%, #fff5e0 100%);
  border: 1.5px solid rgba(245, 215, 110, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 4px 16px rgba(245, 215, 110, 0.12);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.ih-share-qr-box > :not(:first-child) {
  display: none !important;
}
.ih-share-qr-box img,
.ih-share-qr-box canvas,
.ih-share-qr-box table,
.ih-share-qr-box .ih-share-qr-img {
  display: block;
  width: 156px !important;
  height: 156px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 auto;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}
.ih-share-qr-box table {
  border-collapse: collapse;
  table-layout: fixed;
}
.ih-share-qr-box table td {
  padding: 0 !important;
}
.ih-share-qr-tip {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--app-muted, #9a8a8e);
}

.ih-share-link,
.ih-share-code {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8f4f5;
  border: 1px solid var(--app-line, #eadfe1);
}
.ih-share-link .lab,
.ih-share-code .lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--app-muted, #9a8a8e);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.ih-share-link .val {
  font-size: 12px;
  line-height: 1.55;
  color: var(--app-primary, #c8102e);
  word-break: break-all;
  font-weight: 500;
}
.ih-share-code .val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--app-display, serif);
  letter-spacing: 0.1em;
  color: #b8860b;
}
.ih-share .copy {
  margin-top: 10px;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--app-primary, #c8102e) 0%, var(--app-primary-2, #e33845) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--app-display, serif);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.28);
  -webkit-tap-highlight-color: transparent;
}
.ih-share .copy.ghost {
  background: #fff;
  color: var(--app-primary, #c8102e);
  border: 1.5px solid rgba(200, 16, 46, 0.35);
  box-shadow: none;
}
.ih-share .copy:active { opacity: 0.92; transform: scale(0.99); }

/* ── 邀请海报 ── */
.ih-poster-wrap .ih-poster-inner {
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 8px 28px rgba(122, 16, 32, 0.18),
    inset 0 0 0 1px rgba(245, 215, 110, 0.35);
  border: 2px solid rgba(245, 215, 110, 0.45);
  background: linear-gradient(155deg, #7a1020 0%, #8b1a2a 100%);
}
.ih-poster-inner canvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}
.ih-poster-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--app-muted, #9a8a8e);
}
.ih-poster-save {
  display: block;
  width: 100%;
  margin-top: 12px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--app-primary, #c8102e) 0%, var(--app-primary-2, #e33845) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--app-display, serif);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.28);
  -webkit-tap-highlight-color: transparent;
}
.ih-poster-save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ih-poster-save:active:not(:disabled) { opacity: 0.92; transform: scale(0.99); }

/* ── 官方推广图 ── */
.ih-sec-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(200, 16, 46, 0.08);
  color: var(--app-primary, #c8102e);
}
.ih-sec-link {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--app-primary, #c8102e);
  text-decoration: none;
}
.ih-zhitui-card .ih-zhitui-body p,
.ih-team-card .ih-zhitui-body p {
  margin: 0;
  font-size: 13px;
  color: var(--app-sub, #666);
  line-height: 1.55;
}
.ih-zhitui-btn {
  margin-top: 12px;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #c8102e, #8b1a2a);
}
.ih-zhitui-btn:active { opacity: 0.92; }
.ih-promo-list { padding: 0; }
.ih-promo-item {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8f4f5;
  border: 1px solid var(--app-line, #eadfe1);
}
.ih-promo-item:last-child { margin-bottom: 0; }
.ih-promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ih-promo-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--app-ink, #7a1020);
}
.ih-promo-head .badge {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(245, 215, 110, 0.25);
  color: #8a6d00;
}
.ih-promo-frame {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--app-line, #eadfe1);
}
.ih-promo-frame img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.ih-promo-empty {
  padding: 28px 16px;
  text-align: center;
  border-radius: 14px;
  background: #f8f4f5;
  border: 1px dashed var(--app-line, #eadfe1);
}
.ih-promo-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--app-muted, #9a8a8e);
}
.ih-promo-empty strong {
  color: var(--app-primary, #c8102e);
  font-weight: 700;
}

/* ── 下级消费返佣 ── */
.ih-fx .hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ih-fx .ih-section-title {
  font-family: inherit;
  font-size: 15px;
}
.ih-fx .hd .t {
  font-size: 14px;
  font-weight: 700;
  color: var(--app-sub, #666);
  line-height: 1.45;
}
.ih-fx .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ih-fx .grid .cell {
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9e8 0%, #fff5e0 100%);
  border: 1px solid rgba(245, 215, 110, 0.4);
}
.ih-fx .grid .cell .g {
  font-size: 12px;
  font-weight: 500;
  color: var(--app-muted, #888);
}
.ih-fx .grid .cell .p {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--app-primary-dark, #8b1a2a);
}
.ih-fx .desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--app-sub, #666);
}
.ih-fx .desc strong {
  font-weight: 700;
  color: var(--app-primary-dark, #8b1a2a);
}

/* ── 推广阶梯奖励 ── */
.ih-menu {
  border-radius: 14px;
  background: #f8f4f5;
  border: 1px solid var(--app-line, #eadfe1);
  overflow: hidden;
}
.ih-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.ih-menu a + a {
  border-top: 1px solid var(--app-line, #eadfe1);
}
.ih-menu a:active { background: rgba(200, 16, 46, 0.04); }
.ih-menu .ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--app-line, #eadfe1);
}
.ih-menu .ico.gold {
  background: linear-gradient(135deg, #fff9e8 0%, #fff5e0 100%);
  border-color: rgba(245, 215, 110, 0.45);
}
.ih-menu .ico svg {
  width: 20px;
  height: 20px;
  stroke: #b8860b;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ih-menu .txt { flex: 1; min-width: 0; }
.ih-menu .txt .t {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--app-display, serif);
  color: var(--app-ink, #7a1020);
}
.ih-menu .txt .d {
  margin-top: 2px;
  font-size: 11px;
  color: var(--app-muted, #9a8a8e);
}
.ih-menu .arr {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--app-muted, #9a8a8e);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
}
.ih-menu .arr.ready {
  color: #fff;
  background: linear-gradient(135deg, var(--app-primary, #c8102e) 0%, var(--app-primary-2, #e33845) 100%);
}
.ih-menu .arr.done {
  color: var(--app-muted, #9a8a8e);
  background: rgba(0, 0, 0, 0.04);
}

/* 提示 */
.ih-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--app-line, #eadfe1);
  border-left: 3px solid var(--app-primary, #c8102e);
  font-size: 13px;
  line-height: 1.65;
  color: var(--app-sub, #5c4a4e);
}
.ih-tip-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: rgba(200, 16, 46, 0.1);
  color: var(--app-primary, #c8102e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}
.ih-tip strong {
  color: var(--app-primary, #c8102e);
  font-weight: 700;
}

/* ── 底部 Dock ── */
.ih-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--app-line, #eadfe1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  gap: 10px;
}
.ih-dock button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--app-display, serif);
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.ih-dock .main {
  flex: 2;
  background: linear-gradient(135deg, var(--app-primary, #c8102e) 0%, var(--app-primary-2, #e33845) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(200, 16, 46, 0.35);
}
.ih-dock .main:active { transform: scale(0.98); }
.ih-dock .sub {
  flex: 1;
  background: #fff;
  color: var(--app-primary, #c8102e);
  border: 1.5px solid rgba(200, 16, 46, 0.35);
  font-size: 14px;
}
.ih-dock .sub:active { background: #f8f4f5; }

/* ── 图片预览 ── */
.ih-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ih-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
