/* 会员中心 v10.0.22 — 纵向紧凑列表 · 单卡全流程 · 无横滑 */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

/* 解除 profile 视口锁定，整页自然滚动 */
body.page-membership.page-profile,
body.page-membership.page-profile main,
body.page-membership.page-profile .profile-page-wrap,
body.page-membership.page-profile .profile-page-inner,
body.page-membership.page-profile .profile-main,
body.page-membership.page-profile .profile-side {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: 0;
  flex: none !important;
}

.page-membership {
  --mem-text: #1a2234;
  --mem-muted: #4a5568;
  --mem-card: #f8fafc;
  font-family: 'Nunito', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] .page-membership {
  --mem-text: #eef2ff;
  --mem-muted: #b8c0d4;
  --mem-card: var(--card);
}
.page-membership .muted { color: var(--mem-muted) !important; }

.page-membership .membership-head { margin: 0 0 6px; }
.page-membership .membership-head .page-h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--mem-text);
}

.membership-pack-wrap { width: 100%; }
.membership-pack-card {
  padding: 14px 16px 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(59, 130, 246, .09), rgba(16, 185, 129, .05));
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
}
.membership-pack-form { margin: 0; }

/* 当前会员 — 单行紧凑 */
.membership-pack-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--mem-card);
  border: 1px solid var(--border);
  font-size: 12px;
}
.membership-pack-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--tier-color, #f59e0b);
  font-weight: 900;
}
.membership-pack-status-meta { font-weight: 700; color: var(--mem-muted); }
.membership-pack-status-quotas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
.membership-pack-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 9px 4px 5px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.membership-pack-quota-pill em {
  font-style: normal;
  color: var(--mem-muted);
  margin-right: 2px;
}

.membership-pack-intro { margin-bottom: 10px; }
.membership-pack-title {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--mem-text);
}
.membership-pack-desc {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

/* 套餐列表 — 纵向紧凑行 */
.mem-tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.mem-tier-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--mem-card);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  position: relative;
}
.mem-tier-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mem-tier-row:hover {
  border-color: color-mix(in srgb, var(--tier-color, var(--primary)) 40%, var(--border));
}
.mem-tier-row.selected {
  border-color: var(--tier-color, var(--primary));
  background: color-mix(in srgb, var(--tier-color, var(--primary)) 6%, var(--mem-card));
  box-shadow: 0 2px 12px color-mix(in srgb, var(--tier-color, var(--primary)) 18%, transparent);
}

.mem-tier-radio {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.mem-tier-row.selected .mem-tier-radio {
  border-color: var(--tier-color, var(--primary));
  background: var(--tier-color, var(--primary));
}
.mem-tier-row.selected .mem-tier-radio::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.mem-tier-ico-img,
.mem-tier-ico-fallback {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}
.mem-tier-ico-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}

.mem-tier-row-body { min-width: 0; }
.mem-tier-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 6px;
}
.mem-tier-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--mem-text);
}
.mem-tier-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  color: #fff;
}
.mem-tier-row-price {
  margin-left: auto;
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--tier-color, var(--primary));
  font-style: normal;
}
.mem-tier-row-price em { font-style: normal; }

.mem-tier-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.mem-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  color: var(--mem-text);
  line-height: 1.3;
  max-width: 100%;
}
.mem-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mem-chip-empty {
  color: var(--mem-muted);
  font-weight: 700;
  padding-left: 10px;
}

/* 模型引擎图标 */
.page-membership .mem-model-logo,
.page-membership .mem-chip-ico,
.page-membership .mem-quota-ico {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: var(--mem-card);
}
.page-membership .mem-model-logo-fallback {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: var(--mem-card);
}

/* 结算工具栏 — 底边对齐、统一控件高度 */
.membership-pack-checkout {
  padding: 14px 0 0;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
}
.membership-checkout-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.mem-checkout-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mem-checkout-period { flex: 0 0 118px; width: 118px; }
.mem-checkout-promo { flex: 0 0 130px; width: 130px; }
.mem-checkout-pay { flex: 1 1 240px; min-width: min(100%, 240px); }
.mem-checkout-action {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.membership-side-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--mem-muted);
  line-height: 1.2;
  min-height: 14px;
}

/* 统一控件高度 42px */
.page-membership .mem-checkout-control {
  height: 42px;
  min-height: 42px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  box-sizing: border-box;
  width: 100%;
}

.page-membership .membership-pack-pay {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  margin: 0 !important;
  width: 100%;
}
.page-membership .membership-pack-pay .pay-method {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  margin: 0;
  padding: 0 10px;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg2);
  box-sizing: border-box;
}
.page-membership .membership-pack-pay .pay-method.selected,
.page-membership .membership-pack-pay .pay-method:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--bg2));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}
.page-membership .membership-pack-pay .pay-icon,
.page-membership .membership-pack-pay .pay-icon-fallback {
  width: 26px;
  height: 26px;
  font-size: 12px;
  flex-shrink: 0;
}
.page-membership .membership-pack-pay .pay-label {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.page-membership .membership-pack-submit {
  height: 42px;
  min-height: 42px;
  min-width: 132px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 900;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.page-membership .pay-tip {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--mem-muted);
  font-weight: 600;
}
.page-membership .pay-tip a {
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.membership-pack-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
}

@media (min-width: 768px) {
  .membership-checkout-toolbar {
    flex-wrap: nowrap;
    align-items: flex-end;
  }
  .mem-checkout-pay { flex: 1 1 auto; max-width: none; }
}

@media (max-width: 767px) {
  .membership-pack-card { padding: 12px 12px 10px; }
  .membership-checkout-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .mem-checkout-period,
  .mem-checkout-promo,
  .mem-checkout-pay,
  .mem-checkout-action {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .page-membership .membership-pack-submit {
    width: 100%;
    min-width: 0;
  }
  .mem-tier-row-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .mem-tier-row-price { margin-left: 0; }
  .mem-chip-text { white-space: normal; }
}

@media (min-width: 1024px) {
  .membership-pack-status-quotas { width: auto; margin-left: auto; }
}
