/* ============================================================
 * restyle_member.css  ·  C组（会员中心）
 * 会员中心视觉重构 —— member.html 无 body class。
 * 作用域限定方式（防止任何样式外溢）：
 *  - .wc-page 内部的所有组件：一律加 .wc-page 前缀；
 *  - 顶部导航 .nav-bar/.nav-title/.nav-back 与 .wc-page 平级
 *    （均为 body 直接子级），用 body:has(.wc-page) 限定为会员页专属；
 *  - 不依赖 body class。
 *
 * 覆盖来源：css/wechat.css（.wc-page / .plan-card / .member-hero /
 *   .benefit-table / .nav-bar 体系，线上主包文件） + member.html
 *   <head> 内联 <style>（.buy-btn.disabled-btn / .pay-tip /
 *   #redeemInput:focus） + #redeemBtn / #redeemInput 元素内联样式。
 *
 * 注意：
 *  - 套餐接口 / 微信支付 / 兑换码请求 / 家长门算术验证均为功能逻辑，
 *    本文件不碰；只做呈现。
 *  - 付费主按钮高 ≥56px、渐变饱满、:active 按压反馈。
 *  - 主色 ≤3：主橙 #FF8C42 / 暖金（会员）/ 中性暖灰；无红色否定态。
 *  - member.html 的 <meta name=viewport> 缺 viewport-fit=cover，
 *    CSS 无法补 meta 属性；本文件 env(safe-area-*) 规则在补齐后自动
 *    生效（未补齐时 env() 回退为 0，无副作用）。meta 建议见挂载说明。
 * ============================================================ */

/* ============ 0. 页面基底 + safe-area ============ */
.wc-page {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px
    calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  min-height: 100vh;
}
/* 顶部导航：会员页专属（body:has(.wc-page) 限定，不碰协议/回调页同名类） */
body:has(.wc-page) .nav-bar {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(135deg, #FF9A5C 0%, #FF8C42 50%, #F7731F 100%);
  box-shadow: 0 4px 16px rgba(247, 115, 31, 0.25);
}
body:has(.wc-page) .nav-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
body:has(.wc-page) .nav-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.2s ease;
}
body:has(.wc-page) .nav-back:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.35);
}

/* ============ 1. 会员状态卡 .member-hero ============ */
.wc-page .member-hero {
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.wc-page .member-hero.free {
  background: linear-gradient(135deg, #FFF3E6 0%, #FFE4CB 100%);
  border: 1px solid var(--primary-line);
}
.wc-page .member-hero.active {
  background: linear-gradient(135deg, #FFD874 0%, #F7A831 100%);
  border: 1px solid rgba(247, 168, 49, 0.4);
}
.wc-page .member-hero .mh-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
}
.wc-page .member-hero .mh-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-deep);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 8px;
}
.wc-page .member-hero.active .mh-label { color: #8A5A00; }
.wc-page .member-hero .mh-level {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-deep);
  line-height: 1.3;
}
.wc-page .member-hero.active .mh-level { color: #6B4400; }
.wc-page .member-hero .mh-expire {
  font-size: 14px;
  color: #8A5A30;
  margin-top: 6px;
  line-height: 1.6;
}
.wc-page .member-hero.active .mh-expire { color: #6B4E1A; }
.wc-page .member-hero .mh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  background: linear-gradient(135deg, #FF9A5C 0%, #F7731F 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  border-radius: 999px;
  padding: 12px 34px;
  min-height: 50px;
  box-shadow: 0 6px 16px rgba(247, 115, 31, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.wc-page .member-hero .mh-cta:active {
  transform: scale(0.96);
  box-shadow: 0 3px 10px rgba(247, 115, 31, 0.3);
}

/* ============ 2. 区块标题 ============ */
.wc-page .section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 22px 2px 12px;
}

/* ============ 3. 套餐卡片 .plan-card ============ */
.wc-page .plans-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wc-page .plan-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--line);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.wc-page .plan-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, #FFF8F0 0%, #FFFFFF 45%);
  box-shadow: var(--shadow-lg);
}
.wc-page .plan-card.featured::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FF9A5C, #F7731F);
  border-radius: var(--radius) var(--radius) 0 0;
}
.wc-page .plan-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: linear-gradient(135deg, #FF9A5C, #F7731F);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 14px;
  box-shadow: 0 3px 10px rgba(247, 115, 31, 0.35);
}
.wc-page .plan-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
}
.wc-page .plan-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-deep);
  margin-top: 3px;
}
.wc-page .plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 12px 0 12px;
  color: var(--primary-deep);
}
.wc-page .plan-price .currency { font-size: 18px; font-weight: 800; }
.wc-page .plan-price .amount { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.wc-page .plan-price .period { font-size: 14px; font-weight: 600; color: var(--text-light); margin-left: 2px; }
/* 权益清单：图标（青绿对勾）+ 文字 */
.wc-page .plan-features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.wc-page .plan-features li {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  padding-left: 28px;
}
.wc-page .plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--secondary-soft);
  color: var(--secondary-deep);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============ 4. 付费主按钮 .buy-btn（≥56px / 渐变饱满 / 按压反馈） ============ */
.wc-page .buy-btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF9A5C 0%, var(--primary) 45%, #F7731F 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(247, 115, 31, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.wc-page .buy-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(247, 115, 31, 0.3);
}
/* 未开通微信支付时的“即将开通”：温暖暖灰，不用死灰（覆盖内联 !important） */
.wc-page .buy-btn.disabled-btn {
  background: linear-gradient(135deg, #E7DCD2 0%, #D8CCC0 100%) !important;
  color: #7A6E62 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  box-shadow: none !important;
}
.wc-page .pay-tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  line-height: 1.6;
}

/* ============ 5. 套餐加载 / 失败温暖占位 ============ */
/* 套餐容器渲染前为空：温和加载占位（JS 渲染内容后自动消失） */
.wc-page .plans-wrap:empty::before {
  content: "套餐正在赶来路上…🍊";
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: var(--card);
  border: 1.5px dashed var(--primary-line);
  border-radius: var(--radius);
  padding: 36px 18px;
  line-height: 1.8;
}
/* 失败态约定：接口失败时由功能 JS 给 #planContainer 加 .plans-load-error
   并放入 .plans-retry-btn 重试按钮（按钮逻辑由 JS 绑定，样式在此备好，
   接口逻辑一行不碰）。视觉：暖橙温和占位 + 醒目重试按钮，无红色惊吓。 */
.wc-page .plans-wrap.plans-load-error {
  background: var(--card);
  border: 1.5px solid var(--primary-line);
  border-radius: var(--radius);
  padding: 34px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.wc-page .plans-wrap.plans-load-error::before {
  content: "🍊";
  display: block;
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}
.wc-page .plans-wrap.plans-load-error .plans-error-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.wc-page .plans-wrap.plans-load-error .plans-error-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 18px;
}
.wc-page .plans-wrap.plans-load-error .plans-retry-btn {
  min-height: 48px;
  padding: 0 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF9A5C, #F7731F);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(247, 115, 31, 0.32);
  transition: transform 0.12s ease;
}
.wc-page .plans-wrap.plans-load-error .plans-retry-btn:active { transform: scale(0.96); }

/* ============ 6. 兑换码卡 ============ */
.wc-page .wc-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 217, 184, 0.35);
  padding: 18px 16px;
}
.wc-page #redeemInput {
  border: 2px solid var(--line) !important;
  border-radius: 16px !important;
  background: #FFFCF8 !important;
  font-size: 15px !important;
  min-height: 50px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wc-page #redeemInput:focus {
  border-color: var(--primary) !important;   /* 覆盖内联 :focus 红边 #ff6b6b */
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.14) !important;
}
.wc-page #redeemBtn {
  /* 元素内联为红橙渐变 #ff6b6b→#ee5a24，内联样式必须 !important 覆盖 */
  background: linear-gradient(135deg, #FF9A5C 0%, #F7731F 100%) !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  min-height: 50px;
  padding: 12px 24px !important;
  box-shadow: 0 5px 14px rgba(247, 115, 31, 0.3) !important;
  transition: transform 0.12s ease !important;
}
.wc-page #redeemBtn:active { transform: scale(0.96); }
.wc-page #redeemBtn:disabled { opacity: 0.65; }
/* 兑换提示文案基础色（具体成功/失败色由 JS 设置；
   建议功能组把失败红 #ff4444/#ff6b6b 统一为暖橙 #E8631A） */
.wc-page #redeemMsg { font-size: 13px; line-height: 1.6; color: var(--text-light); }

/* ============ 7. 权益对比表 ============ */
.wc-page .benefit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.wc-page .benefit-table th,
.wc-page .benefit-table td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
.wc-page .benefit-table th {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  background: #FFF6EC;
}
.wc-page .benefit-table th:first-child,
.wc-page .benefit-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text);
}
.wc-page .benefit-table .col-vip {
  color: var(--primary-deep);
  font-weight: 800;
  background: #FFF8F0;
}
.wc-page .benefit-table .col-free { color: var(--text-light); font-weight: 600; }
/* 会员有权益：青绿对勾（鼓励色）；免费无权益：中性灰，不用红叉 */
.wc-page .benefit-table .check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--secondary-soft);
  color: var(--secondary-deep);
  font-weight: 800;
  font-size: 14px;
}
.wc-page .benefit-table .cross {
  color: #C3B8AC;
  font-weight: 700;
  font-size: 15px;
}

/* ============ 8. 底部说明 + 安全区 ============ */
.wc-page .member-footer {
  text-align: center;
  margin-top: 26px;
  padding: 0 8px calc(12px + env(safe-area-inset-bottom));
}
.wc-page .member-footer p {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.9;
}
