// 会员弹窗样式 — 新版黑金左右布局
@use '../variables' as *;

// 遮罩层
.member-dialog-overlay {
  position: fixed;
  inset: 0;
  background: $overlay-bg;
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.14rem;
}

// 弹窗主体 — 左右布局
.member-dialog {
  box-sizing: border-box;
  position: relative;
  display: flex;
  width: 6.49rem;
  height: 4rem;
  border-radius: 0.16rem;
  box-shadow: 0 0.025rem 0.05rem rgba(60, 38, 13, 0.22);
  border: 0.00625rem solid #D9B873;
  font-size: 0.14rem;

  // ==================== 左侧黑金权益栏 ====================
  &__left {
    position: relative;
    width: 2rem;
    height: 100%;
    background: linear-gradient(180deg, #0F001E 0%, #1A0B09 18.09%, #452206 66.19%, #2C1500 100%);
    padding: 0.24rem 0.20rem;
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 0.16rem 0 0 0.16rem;
  }

  // 装饰线条背景
  &__left-deco {
    position: absolute;
    width: 4.47rem;
    height: 2.39rem;
    left: -0.52rem;
    top: -0.75rem;
    background: radial-gradient(ellipse at center, rgba(255, 230, 175, 0.08) 0%, transparent 70%);
    pointer-events: none;
  }

  &__left-title {
    position: relative;
    font-weight: 600;
    font-size: 0.16rem;
    line-height: 0.21rem;
    color: #FFE9A6;
    margin: 0 0 0.06rem;
  }

  &__left-subtitle {
    position: relative;
    font-weight: 330;
    font-size: 0.12rem;
    line-height: 0.16rem;
    color: #F4E5CC;
    margin: 0 0 0.2rem;
  }

  // ==================== 左栏权益卡片 ====================
  &__benefits {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
  }

  &__benefit-card {
    box-sizing: border-box;
    width: 1.56rem;
    height: 0.6rem;
    border: 0.00625rem solid #9C6D2D;
    border-radius: 0.08rem;
    display: flex;
    align-items: center;
    padding: 0 0.12rem;
    gap: 0.12rem;
  }

  &__benefit-icon {
    width: 0.32rem;
    height: 0.32rem;
    background: #4C3517;
    border: 0.00625rem solid #D5A64A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    svg {
      width: 0.16rem;
      height: 0.16rem;
    }
  }

  &__benefit-info {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
  }

  &__benefit-name {
    font-weight: 450;
    font-size: 0.14rem;
    line-height: 0.19rem;
    color: #FFE6AF;
  }

  &__benefit-desc {
    font-weight: 330;
    font-size: 0.1rem;
    line-height: 0.13rem;
    color: #F4E5CC;
  }

  // ==================== 左右分割金边 ====================
  &__divider {
    width: 0.01rem;
    height: 100%;
    background: #D6B15B;
    flex-shrink: 0;
  }

  // ==================== 右侧内容区 ====================
  &__right {
    flex: 1;
    background: linear-gradient(179.38deg, #FCEDD8 0.54%, #FEFBF5 19.09%);
    display: flex;
    flex-direction: column;
    padding: 0.2rem 0.24rem;
    box-sizing: border-box;
    position: relative;
    border-radius: 0 0.16rem 0.16rem 0;
  }

  // ==================== 顶部标题行 ====================
  &__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
  }

  &__title {
    font-weight: 600;
    font-size: 0.18rem;
    line-height: 0.24rem;
    color: #1F160F;
    margin: 0;
  }

  &__header-actions {
    display: flex;
    align-items: center;
    gap: 0.16rem;
  }

  // 联系客服
  &__contact-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;

    &:hover .member-dialog__contact-qr {
      display: flex;
    }
  }

  &__contact {
    font-weight: 330;
    font-size: 0.12rem;
    line-height: 0.16rem;
    color: #2F343B;
    cursor: pointer;

    &:hover {
      color: #1F160F;
    }
  }

  &__contact-qr {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.1rem);
    left: 50%;
    transform: translateX(-50%);
    width: 0.96rem;
    height: 0.96rem;
    background: $bg-white;
    border-radius: 0.08rem;
    box-shadow: 0 0 0.08rem rgba(0, 0, 0, 0.08);
    padding: 0.06rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;

    img {
      width: 100%;
      height: 100%;
      border-radius: 0.04rem;
      object-fit: contain;
    }
  }

  &__contact-qr-arrow {
    position: absolute;
    bottom: -0.07rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.08rem solid transparent;
    border-right: 0.08rem solid transparent;
    border-top: 0.08rem solid $bg-white;
  }

  &__close {
    width: 0.24rem;
    height: 0.24rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.14rem;
    color: #2F343B;
    cursor: pointer;

    &:hover {
      color: #1F160F;
    }
  }

  // ==================== 套餐选择区域 ====================
  &__plans {
    display: flex;
    gap: 0.2rem;
    margin-bottom: 0.2rem;
  }

  &__plan-card {
    box-sizing: border-box;
    width: 1.2rem;
    height: 1.4rem;
    background: #FFFDF8;
    border: 1px solid #E7C991;
    border-radius: 0.08rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;

    &:hover {
      border-color: #B77D24;
    }

    // 选中态
    &--active {
      background: linear-gradient(180deg, #FFF4D8 0%, #FDF9F1 100%);
      border: 2px solid #B77D24;
      box-shadow: 0 0.04rem 0.08rem rgba(183, 125, 36, 0.2);
    }
  }

  // 推荐角标
  &__plan-badge {
    position: absolute;
    top: -0.12rem;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #C28A2F;
    border: 0.00625rem solid #F0D091;
    border-radius: 0.075rem;
    padding: 0.04rem 0.12rem;
    font-weight: 600;
    font-size: 0.12rem;
    line-height: 0.16rem;
    color: #FFFFFF;
  }

  &__plan-name {
    font-weight: 600;
    font-size: 0.14rem;
    line-height: 0.19rem;
    text-align: center;
    color: #1F160F;
  }

  &__plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
  }

  &__plan-price-symbol {
    font-weight: 600;
    font-size: 0.14rem;
    color: #1F160F;
  }

  &__plan-price-num {
    font-weight: 600;
    font-size: 0.28rem;
    line-height: 0.37rem;
    color: #1F160F;
  }

  &__plan-original {
    font-weight: 330;
    font-size: 0.12rem;
    line-height: 0.16rem;
    text-decoration: line-through;
    color: #7A7D82;
    margin-left: 0.04rem;
  }

  &__plan-tag {
    font-weight: 330;
    font-size: 0.12rem;
    line-height: 0.16rem;
    text-align: center;
    color: #3B2A1E;
  }

  // ==================== 支付方式选择（步骤一） ====================
  &__step-pay {
    flex: 1;
  }

  &__payment-section {
    margin-bottom: 0.16rem;
  }

  &__payment-label {
    font-weight: 450;
    font-size: 0.14rem;
    line-height: 0.19rem;
    color: #1F160F;
    display: block;
    margin-bottom: 0.08rem;
  }

  &__payment-methods {
    display: flex;
    gap: 0.24rem;
  }

  &__payment-item {
    box-sizing: border-box;
    width: 1.88rem;
    height: 0.58rem;
    background: #FFFDF8;
    border: 1px solid #E7C991;
    border-radius: 0.08rem;
    display: flex;
    align-items: center;
    padding: 0 0.2rem;
    gap: 0.12rem;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;

    svg {
      width: 0.32rem;
      height: 0.32rem;
      flex-shrink: 0;
    }

    // 选中态
    &--active {
      border-color: #B77D24;
    }
  }

  &__payment-text {
    font-weight: 600;
    font-size: 0.13rem;
    line-height: 0.17rem;
    color: #1F160F;
  }

  // 选中圆圈
  &__payment-radio {
    box-sizing: border-box;
    width: 0.14rem;
    height: 0.14rem;
    background: #FFFDF8;
    border: 1px solid #E7C991;
    border-radius: 50%;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;

    .member-dialog__payment-item--active & {
      border-color: #C28A2F;
    }
  }

  &__payment-radio-inner {
    width: 0.08rem;
    height: 0.08rem;
    background: #C28A2F;
    border-radius: 50%;
  }

  // ==================== 底部栏（步骤一/步骤二共用） ====================
  &__bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0.66rem;
    background: #FCF4E8;
    border-top: 1px solid #E9D4B1;
    border-radius: 0 0 0.16rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.24rem;
    box-sizing: border-box;

    &--qrcode {
      height: 1.7rem;
      padding: 0.2rem 0.24rem;
      gap: 0.24rem;
      justify-content: flex-start;
    }
  }

  &__footer-price {
    display: flex;
    align-items: baseline;
    gap: 0.04rem;
  }

  &__footer-price-label {
    font-weight: 330;
    font-size: 0.12rem;
    line-height: 0.16rem;
    color: #1F160F;
    margin-right: 0.08rem;
  }

  &__footer-price-symbol {
    font-weight: 600;
    font-size: 0.14rem;
    color: #1F160F;
  }

  &__footer-price-num {
    font-weight: 600;
    font-size: 0.24rem;
    line-height: 0.32rem;
    color: #1F160F;
  }

  // 购买会员按钮
  &__buy-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.08rem 0.24rem;
    height: 0.33rem;
    background: #C88E35;
    border: 1px solid #F0D091;
    box-shadow: 0 0.02rem 0.05rem rgba(154, 104, 32, 0.18);
    border-radius: 0.08rem;
    font-weight: 600;
    font-size: 0.13rem;
    line-height: 0.15rem;
    color: #FFFFFF;
    cursor: pointer;
    border: 1px solid #F0D091;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.9;
    }

    &:disabled {
      opacity: 0.5;
      cursor: default;
    }
  }

  // ==================== 扫码支付区域（底部栏内） ====================

  &__qrcode-box {

    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #B77D24;
    border-radius: 0.0rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    flex-shrink: 0;
  }

  &__qrcode-iframe {
    border: none;
    border-radius: 0.04rem;
  }
  .qrcode-zhifubao{
    transform: scale(0.52);
    width: 2.2rem !important;
    height: 2.2rem !important;
    padding-top: 0.1rem;
    padding-left: 0.1rem;
    box-sizing: border-box;
  }
  .qrcode-wechat{
    transform: scale(0.66);
    width: 1.6rem !important;
    height: 1.6rem !important;
    box-sizing: border-box;
  }

  &__qrcode-info {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
  }

  &__qrcode-price-row {
    display: flex;
    align-items: center;
    gap: 0.04rem;
  }

  &__qrcode-price-symbol {
    font-weight: 600;
    font-size: 0.18rem;
    color: #1F160F;
  }

  &__qrcode-price-num {
    font-size: 0.32rem;
    font-weight: 600;
    line-height: 0.37rem;
    color: #1F160F;
  }

  &__qrcode-tip {
    font-weight: 330;
    font-size: 0.14rem;
    line-height: 0.19rem;
    color: #1F160F;
    margin-left: 0.08rem;
    vertical-align: middle;
  }

  &__qrcode-agreement {
    font-weight: 330;
    font-size: 0.12rem;
    line-height: 0.16rem;
    color: #3B2A1E;
    margin: 0;

    a {
      color: #A86718;
      text-decoration: none;

      &:hover {
        color: #A86718;
      }
    }
  }

  // 我已支付成功按钮
  &__paid-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.08rem 0.24rem;
    height: 0.33rem;
    width: fit-content;
    background: #C88E35;
    border: 1px solid #F0D091;
    box-shadow: 0 0.02rem 0.05rem rgba(154, 104, 32, 0.18);
    border-radius: 0.08rem;
    font-weight: 600;
    font-size: 0.13rem;
    line-height: 0.15rem;
    color: #FFFFFF;
    cursor: pointer;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.9;
    }
  }
}
