/* 会员中心 */

/* 主题变量桥接：复用 landing.css 的主题色，避免夜间模式下出现白卡片/浅色块 */
:root {
  --panel: var(--card, #fff);
  --bg-2: var(--card-soft, #f3f4f6);
  --line-2: var(--line, #eee);
  --shadow-sm: var(--shadow, 0 2px 10px rgba(0, 0, 0, .04));
  --field-bg: #fff;
  --field-line: #ddd;
  --ok: #059669;
  --err: #dc2626;
  --status-bg: linear-gradient(135deg, rgba(5,150,105,.10), rgba(16,185,129,.04));
  --status-line: rgba(5,150,105,.18);
  --buy-bg: rgba(5,150,105,.06);
  --buy-line: rgba(5,150,105,.45);
  --focus-ring: rgba(5,150,105,.12);
}
html[data-theme="dark"] {
  --field-bg: #2a2f36;
  --field-line: #3a4148;
  --ok: #34d399;
  --err: #f87171;
  --status-bg: linear-gradient(135deg, rgba(16,185,129,.18), rgba(5,150,105,.06));
  --status-line: rgba(16,185,129,.28);
  --buy-bg: rgba(52,211,153,.10);
  --buy-line: rgba(52,211,153,.45);
  --focus-ring: rgba(52,211,153,.16);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --field-bg: #2a2f36;
    --field-line: #3a4148;
    --ok: #34d399;
    --err: #f87171;
    --status-bg: linear-gradient(135deg, rgba(16,185,129,.18), rgba(5,150,105,.06));
    --status-line: rgba(16,185,129,.28);
    --buy-bg: rgba(52,211,153,.10);
    --buy-line: rgba(52,211,153,.45);
    --focus-ring: rgba(52,211,153,.16);
  }
}
.mb-topbar {
  position: sticky; top: 0; z-index: 20; height: 50px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--panel, #fff); border-bottom: 1px solid var(--line, #e8e8e8);
}
.dt-back { font-size: 30px; line-height: 1; color: var(--text, #333); text-decoration: none; width: 30px; }
.dt-topbar-title { flex: 1; font-weight: 700; font-size: 16px; color: var(--text, #333); }
.ft-btn { background: none; border: 0; font-size: 20px; color: var(--text-3, #999); padding: 6px; cursor: pointer; }

.mb-wrap { max-width: 460px; margin: 24px auto; padding: 0 16px 60px; }
.mb-card {
  background: var(--panel, #fff); border: 1px solid var(--line, #e8e8e8);
  border-radius: 16px; padding: 22px; box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,.04));
}
.mb-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mb-brand .mb-logo {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #059669, #10b981); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.mb-brand > div:nth-child(2) { display: flex; flex-direction: column; line-height: 1.4; }
.mb-brand b { font-size: 16px; }
.mb-brand span { font-size: 12px; color: var(--text-3, #999); }
.mb-logout { margin-left: auto; }

.mb-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line-2, #eee); margin-bottom: 18px; }
.mb-tab {
  flex: 1; padding: 10px 0; background: none; border: 0; border-bottom: 2px solid transparent;
  font-size: 14px; color: var(--text-2, #666); cursor: pointer;
}
.mb-tab.is-active { color: var(--ok); border-bottom-color: var(--ok); font-weight: 700; }

.mb-form { display: flex; flex-direction: column; gap: 13px; }
.mb-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2, #666); }
.mb-form .input, .mb-inline .input {
  border: 1px solid var(--field-line); border-radius: 10px; padding: 11px 12px;
  font-size: 16px; background: var(--field-bg); color: var(--text, #333); width: 100%; box-sizing: border-box;
}
.mb-form .btn, .mb-inline .btn { padding: 12px; border-radius: 10px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--ok); color: #fff; border: 0; }
.btn-outline { background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.btn-ghost { background: var(--bg-2, #f3f4f6); border: 0; color: var(--text-2, #666); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.mb-err { min-height: 18px; font-size: 12.5px; color: var(--err); }
.mb-q { font-size: 13px; color: var(--text-2, #666); background: var(--bg-2, #f6f7f9); padding: 10px 12px; border-radius: 8px; }

.mb-status {
  border-radius: 12px; padding: 16px; margin-bottom: 20px;
  background: var(--status-bg);
  border: 1px solid var(--status-line);
}
.mb-status .st-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mb-status .st-badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ok); color: #fff; }
.mb-status .st-badge.is-none { background: #9ca3af; }
.mb-status .st-exp { font-size: 20px; font-weight: 700; color: var(--text, #333); margin: 8px 0 2px; }
.mb-status .st-sub { font-size: 12px; color: var(--text-3, #999); }

.mb-block { border-top: 1px solid var(--line-2, #eee); padding-top: 18px; margin-top: 18px; }
.mb-block h3 { margin: 0 0 12px; font-size: 15px; }
/* 卡密激活：输入框 + 激活 + 购买会员，始终单行并排 */
.mb-inline { display: flex; gap: 8px; align-items: stretch; flex-wrap: nowrap; }
.mb-inline .input { flex: 1 1 auto; min-width: 0; }
.mb-inline .btn {
  flex: none; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; font-size: 14px; line-height: 1; border-radius: 10px;
}
/* 三者同高，视觉齐平 */
.mb-redeem .input, .mb-redeem .btn { min-height: 44px; }
.mb-redeem .input { padding: 0 12px; }
.mb-redeem .input:focus {
  outline: none; border-color: var(--ok);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
/* 购买会员：浅底描边，与实心「激活」区分主次 */
.buy-vip-btn {
  background: var(--buy-bg); color: var(--ok);
  border: 1px solid var(--buy-line); font-weight: 600;
  cursor: pointer;
}
.buy-vip-btn:active { background: var(--buy-line); }
.buy-vip-btn[hidden] { display: none; }
/* 窄屏（≤360）压缩按钮内边距，保证仍是一行 */
@media (max-width: 360px) {
  .mb-inline { gap: 6px; }
  .mb-inline .btn { padding: 0 10px; font-size: 13px; }
  .mb-redeem .input { padding: 0 10px; }
}
.mb-note { font-size: 12px; color: var(--text-3, #999); line-height: 1.5; margin: 10px 0 0; }

.mb-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.85); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; text-align: center;
}
.mb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
