/* ============================================
   会员中心（重做版）
   金色会员卡 + 权益网格 + 纵向等级列表
   ============================================ */

/* 关键：页面是 flex 容器，子项必须禁止收缩，否则内容被压扁。
   用 id 选择器 + !important 提升优先级，覆盖底层 .page 布局规则 */
#page-member {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

#page-member > * {
  flex-shrink: 0 !important;
}

/* 会员卡 */
.member-card {
  position: relative;
  margin: 14px 14px 0;
  padding: 22px 20px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, #5BB8FF, #2E8BFF);
  box-shadow: 0 12px 32px rgba(46, 139, 255, .28);
  overflow: hidden;
}

.member-card::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}

.member-card::before {
  content: '';
  position: absolute;
  right: 30px;
  bottom: -60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.member-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.member-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  border: 2px solid rgba(255, 255, 255, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-user-info {
  min-width: 0;
}

.member-nick {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-level-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  font-size: 12px;
  font-weight: 600;
}

.member-level-chip.active {
  background: rgba(255, 255, 255, .9);
  color: #2E8BFF;
}

.member-crown {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-crown .ico {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, .9);
}

/* 成长进度 */
.member-progress-wrap {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.member-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .92);
}

.member-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  overflow: hidden;
}

.member-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width .5s ease;
  min-width: 4px;
}

/* 分区标题 */
.member-section {
  padding: 0 14px;
  margin-top: 24px;
}

.member-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* 特权网格 */
.perk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #E3EDF9);
  box-shadow: 0 2px 8px rgba(46, 139, 255, .05);
}

.perk-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft, #E4F0FF);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perk-icon .ico {
  width: 18px;
  height: 18px;
  color: var(--primary, #2E8BFF);
}

.perk-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

/* 等级列表 */
.level-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--card, #fff);
  border: 1px solid var(--line, #E3EDF9);
  box-shadow: 0 2px 10px rgba(46, 139, 255, .05);
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .18s ease;
}

.level-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--lv-color, #4aa3ff);
}

.level-item.current {
  border-color: var(--lv-color, #4aa3ff);
  background: linear-gradient(135deg, var(--primary-soft, #E4F0FF), #fff);
  box-shadow: 0 6px 20px rgba(74, 163, 255, .16);
}

.level-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.level-item-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.level-item-info {
  min-width: 0;
}

.level-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.level-item-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.level-item-perks span {
  font-size: 11px;
  color: var(--text-sub, #6B809B);
  background: var(--bg-soft, #EAF3FF);
  padding: 2px 8px;
  border-radius: 6px;
}

.level-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.level-item-price {
  text-align: right;
  line-height: 1.2;
}

.level-item-price b {
  font-size: 17px;
  color: var(--gold, #FFC93C);
  font-weight: 800;
}

.level-item-price small {
  display: block;
  font-size: 11px;
  color: var(--text-sub, #6B809B);
}

.level-buy {
  border: none;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2E8BFF, #5BB8FF);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .18s ease;
}

.level-buy:active {
  transform: scale(.95);
}

.level-buy:disabled {
  background: var(--line, #E3EDF9);
  color: var(--text-sub, #6B809B);
  cursor: default;
}

/* 移动端底部导航遮挡防护 */
@media (max-width: 768px) {
  .page-member {
    padding-bottom: 84px;
  }
}

/* 桌面端：会员卡限宽居中，特权网格多列 */
@media (min-width: 900px) {
  .member-card,
  .member-section {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .member-card {
    margin-top: 20px;
  }

  .perk-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
