/* ======================================
   订阅面板 UI（2026-08-24 订阅制重构）
   参考：变色龙加速器套餐页（四档卡片 + 设备数步进器 + 总计 + 去结算）
   免费每周 20 次(游客)/验证后 50 次 + 订阅无限调参
   ====================================== */

/* 遮罩层 */
.recharge-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.recharge-overlay.active {
  display: flex;
  opacity: 1;
}

/* 卡片容器 */
.recharge-panel {
  position: relative;
  width: 90%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface-1, #161b22);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 8px;
  padding: 15px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

/* 2026-08-25 审查员 P0-2：PC 断点加宽 720px，四档 2×2 放大，无内滚 */
@media (min-width: 769px) {
  .recharge-panel {
    max-width: 720px;
    max-height: 90vh;
  }
}

/* 支付区吸底（P0-1：付款动作永远在视野内） */
.recharge-paybar {
  position: sticky;
  bottom: -15px;
  margin: 14px -16px -15px;
  padding: 12px 16px 15px;
  background: linear-gradient(180deg, rgba(22,27,34,0.9) 0%, var(--surface-1, #161b22) 30%);
  border-top: 1px solid var(--border-default, #30363d);
}

.recharge-overlay.active .recharge-panel {
  transform: scale(1);
}

/* 关闭按钮 */
.recharge-panel__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #8b949e);
  transition: all 0.2s ease;
}

.recharge-panel__close:hover {
  background: var(--surface-2, #1c2128);
  color: var(--text-primary, #e6edf3);
}

.recharge-panel__close:active {
  transform: scale(0.9);
}

/* 标题 */
.recharge-panel__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #e6edf3);
  margin: 0 0 4px 0;
  line-height: 1.4;
}

/* 副标题 */
.recharge-panel__subtitle {
  font-size: 13px;
  color: var(--text-muted, #8b949e);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

/* 顶部额度条 */
.recharge-panel__quota {
  margin-bottom: 12px;
}

.recharge-quota-badge {
  display: inline-block;
  background: var(--surface-2, #1c2128);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-muted, #8b949e);
}

.recharge-quota-badge b {
  color: var(--accent, #0ea5e9);
  font-size: 14px;
}

.recharge-quota-badge--member {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #22c55e;
  font-weight: 600;
}

/* 2026-09-04 免费下载次数行（游客态/独立展示行） */
.recharge-dl-line {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted, #8b949e);
}

.recharge-dl-line b {
  color: var(--accent, #0ea5e9);
}

/* 会员态「当前订阅至 …」行（P0-①：语义闭环） */
.recharge-current-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary, #8b949e);
}
.recharge-current-sub b { color: var(--text-primary, #e6edf3); }

/* 四档订阅卡片 2 列网格 */
.recharge-panel__options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.recharge-panel__loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted, #8b949e);
  font-size: 13px;
}

/* 订阅档位卡片 */
.recharge-plan {
  position: relative;
  background: var(--surface-2, #1c2128);
  border: 2px solid var(--border-default, #30363d);
  border-radius: 10px;
  padding: 12px 10px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.recharge-plan:hover {
  background: var(--surface-3, #2d333b);
  border-color: #3d444d;
}

.recharge-plan:active {
  transform: translateY(0) scale(0.98);
}

.recharge-plan.selected {
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--accent, #0ea5e9);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* 推荐角标 */
.recharge-plan__badge {
  position: absolute;
  top: -8px;
  right: 8px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* 价格 */
.recharge-plan__price {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary, #e6edf3);
  line-height: 1;
}

.recharge-plan__price-unit {
  font-size: 14px;
  font-weight: 400;
  margin-right: 1px;
}

/* 档名 + 时长 */
.recharge-plan__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.recharge-plan__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
}

.recharge-plan__period {
  font-size: 12px;
  color: var(--text-muted, #8b949e);
}

/* 设备数起 */
.recharge-plan__devices {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
}

.recharge-plan__devices-num {
  color: var(--accent, #0ea5e9);
  font-weight: 700;
  font-size: 13px;
}

/* 日均 + 当前设备价 */
.recharge-plan__daily {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
}

.recharge-plan__total {
  color: var(--text-primary, #a5b3c4);
}

/* 权益列表 */
.recharge-plan__benefits {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.recharge-plan__benefit {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
  line-height: 1.4;
}

.recharge-plan.selected .recharge-plan__benefit {
  color: var(--text-primary, #e6edf3);
}

/* 设备数步进器 */
.recharge-devices {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2, #1c2128);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.recharge-devices__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recharge-devices__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
}

.recharge-devices__hint {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
}

.recharge-devices__stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recharge-devices__btn {
  width: 34px;
  height: 34px;
  background: var(--surface-3, #2d333b);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 6px;
  color: var(--text-primary, #e6edf3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.recharge-devices__btn:hover {
  border-color: var(--accent, #0ea5e9);
  color: var(--accent, #0ea5e9);
}

.recharge-devices__btn:active {
  transform: scale(0.92);
}

.recharge-devices__num {
  min-width: 36px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent, #0ea5e9);
  font-variant-numeric: tabular-nums;
}

/* 总计 */
.recharge-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 12px;
}

.recharge-total__label {
  font-size: 13px;
  color: var(--text-muted, #8b949e);
}

.recharge-total__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent, #0ea5e9);
  font-variant-numeric: tabular-nums;
}

/* 支付方式选择（2026-08-24：微信/支付宝，默认手机非微信=支付宝） */
.recharge-pay-methods {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.recharge-pay-method {
  flex: 1;
  height: 38px;
  background: var(--surface-2, #1c2128);
  border: 1px solid var(--border-default, #30363d);
  border-radius: 8px;
  color: var(--text-secondary, #8b949e);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.recharge-pay-method:hover {
  border-color: var(--accent, #0ea5e9);
  color: var(--text-primary, #e6edf3);
}

.recharge-pay-method.active {
  border-color: var(--accent, #0ea5e9);
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent, #0ea5e9);
}

/* 去结算按钮 */
.recharge-panel__submit {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.recharge-panel__submit:hover {
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  filter: brightness(1.08);
}

.recharge-panel__submit:active {
  transform: scale(0.98);
}

.recharge-panel__submit:disabled {
  background: var(--surface-3, #2d333b);
  color: var(--text-muted, #8b949e);
  cursor: not-allowed;
  opacity: 0.6;
}

/* 免费提示 */
.recharge-panel__tip {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 4px;
  padding: 6px 10px;
  text-align: center;
  font-size: 11px;
  color: #4a8a5f;
  line-height: 1.5;
  margin-bottom: 10px;
}

.recharge-panel__tip b {
  color: #22c55e;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .recharge-panel {
    width: 95%;
    max-width: none;
  }

  .recharge-panel__options {
    gap: 8px;
  }

  .recharge-plan {
    padding: 10px 8px 8px;
  }

  .recharge-plan__price {
    font-size: 22px;
  }

  .recharge-devices__btn {
    width: 40px;
    height: 40px;
  }
}

/* 小屏单列布局 */
@media (max-width: 400px) {
  .recharge-panel__options {
    grid-template-columns: 1fr;
  }

  .recharge-plan {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 12px;
  }

  .recharge-plan__badge {
    top: -8px;
    right: 8px;
  }
}

/* 无障碍支持 */
.recharge-panel:focus-within {
  outline: 2px solid var(--accent, #0ea5e9);
  outline-offset: 2px;
}

/* 2026-08-25 审查员 P1：逾期警示胶囊（今日已用完） */
.recharge-quota-badge--warn {
  background: rgba(210, 153, 34, 0.14);
  border-color: rgba(210, 153, 34, 0.5);
  color: #d29922;
  font-weight: 600;
}

/* 未选中卡可见描边（勿与 disabled 灰底混淆） */
.recharge-plan {
  border-color: #3d444d;
}

/* 手机单列卡：价格独占一行纵向（P1：价格视觉主导） */
@media (max-width: 768px) {
  .recharge-plan {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 12px;
  }
  .recharge-plan__price {
    font-size: 26px;
    line-height: 1.1;
  }
  .recharge-plan__meta {
    order: 0;
  }
}
