/* ──────────────────────────────────────────────────────────────
   login.css — 星命小馆登录/注册页专用样式
   ────────────────────────────────────────────────────────────── */

/* 补充 styles.css 可能未定义的变量 */
:root {
  --card-bg:    rgba(255,255,255,0.05);
  --border:     rgba(255,255,255,0.10);
  --text:       #f0e8d8;
  --text-dim:   rgba(220,210,195,0.72);
  --teal:       #7ecac3;
  --gold:       #d9a441;
  --gold-glow:  rgba(217,164,65,0.25);
  --error:      #e07070;
}

body {
  background: radial-gradient(ellipse at 20% 15%, rgba(217,164,65,0.12) 0%, transparent 50%),
              #0e1a26 !important;
  min-height: 100vh;
}

/* ── 外壳 ── */
.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1.6rem;
}

/* ── 品牌 ── */
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-brand, 'Noto Serif SC', serif);
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.login-brand .brand-mark {
  font-size: 1.1rem;
  opacity: 0.85;
}
.login-brand:hover { opacity: 0.82; }

/* ── 卡片 ── */
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2rem 1.6rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

/* ── 选项卡（登录 / 注册） ── */
.login-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.4rem;
  gap: 0.25rem;
}
.login-tab {
  flex: 1;
  padding: 0.55rem 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 0.97rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}
.login-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.login-tab:not(.active):hover { color: var(--text); }

/* ── 注册提示 ── */
.login-hint {
  font-size: 0.83rem;
  color: var(--text-dim);
  margin: -0.6rem 0 1.2rem;
  line-height: 1.5;
}

/* ── 表单 ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.auth-form label {
  font-size: 0.83rem;
  color: var(--text-dim);
  margin-bottom: -0.2rem;
}

/* 输入框包装（支持前缀/后缀图标） */
.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.input-prefix {
  padding: 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  line-height: 44px;
  background: rgba(255,255,255,0.03);
}

.input-wrap input {
  flex: 1;
  background: none;
  border: none;
  padding: 0 0.85rem;
  height: 44px;
  color: var(--text);
  font-size: 16px;          /* 防 iOS 自动缩放 */
  outline: none;
}
.input-wrap input::placeholder { color: rgba(200,190,175,0.4); }

/* 显示/隐藏密码按钮 */
.toggle-pwd {
  background: none;
  border: none;
  padding: 0 0.75rem;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 44px;
  transition: color 0.2s;
}
.toggle-pwd:hover { color: var(--gold); }

/* ── 错误提示 ── */
.auth-error {
  font-size: 0.83rem;
  color: var(--error);
  background: rgba(224,112,112,0.1);
  border: 1px solid rgba(224,112,112,0.2);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  margin: 0.2rem 0;
  animation: fadeIn 0.2s ease;
}

/* ── 提交按钮 ── */
.auth-submit {
  margin-top: 0.8rem;
  width: 100%;
  padding: 0.82rem;
  font-size: 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.auth-submit.loading .btn-label::after {
  content: '…';
  animation: dots 1s steps(3, end) infinite;
}

/* ── 底部说明 ── */
.auth-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 1.2rem;
  line-height: 1.6;
  opacity: 0.7;
}

/* ── 已登录卡片 ── */
.logged-in-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.4rem 2rem;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.logged-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gold);
  background: var(--gold-glow);
  margin-bottom: 0.2rem;
}

.logged-phone {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.logged-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.back-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem;
  border-radius: 12px;
  font-size: 0.95rem;
  text-decoration: none;
  margin-top: 0.4rem;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.83rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.logout-btn:hover { color: var(--error); }

/* ── 订阅状态 ── */
.sub-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.sub-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.sub-badge.sub-active {
  background: rgba(217,164,65,0.18);
  color: var(--gold);
  border: 1px solid rgba(217,164,65,0.35);
}
.sub-badge.sub-none {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.sub-expires {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── 修改密码 ── */
.toggle-chpwd-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.83rem;
  padding: 6px 16px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, color 0.2s;
}
.toggle-chpwd-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.chpwd-form-wrap {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.chpwd-form { gap: 0.5rem; }
.chpwd-form .auth-submit { margin-top: 0.4rem; }

.auth-success {
  font-size: 0.83rem;
  color: #70c090;
  background: rgba(112,192,144,0.1);
  border: 1px solid rgba(112,192,144,0.2);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  text-align: center;
}

/* ── 动画 ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}

/* ── 支付卡片 ── */
.payment-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem 1.8rem 1.4rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.payment-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.payment-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--gold-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--gold);
  flex-shrink: 0;
}

.payment-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text);
}

.payment-price {
  font-size: 1.5rem; font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
}
.payment-price span {
  font-size: 0.85rem; font-weight: 400;
  color: var(--text-dim);
}

.payment-features {
  list-style: none; padding: 0; margin: 0;
  width: 100%;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.payment-features li {
  font-size: 0.85rem; color: var(--text-dim);
  padding-left: 0.2rem;
}
.payment-features li::first-letter { color: var(--teal); }

/* 二维码区 */
.qr-area {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.6rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  width: 100%;
}

.qr-loading {
  font-size: 0.85rem; color: var(--text-dim);
  padding: 1rem 0;
}

.qr-img {
  width: 180px; height: 180px;
  border-radius: 8px;
  background: #fff;
}

.qr-hint {
  font-size: 0.82rem; color: var(--text-dim);
}

.qr-polling {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--text-dim);
}

.qr-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.pay-mobile-link {
  font-size: 0.85rem; color: var(--teal);
  text-decoration: underline; text-underline-offset: 3px;
}

.pay-success {
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  padding: 0.5rem 0;
}

.pay-success-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(112,192,144,0.18);
  border: 1.5px solid #70c090;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #70c090;
}

.pay-success-text {
  font-size: 0.95rem; color: var(--text); font-weight: 600;
}

.payment-footer {
  width: 100%; text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.skip-link {
  background: none; border: none;
  font-size: 0.8rem; color: var(--text-dim);
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.skip-link:hover { color: var(--text); }

.renew-btn {
  width: 100%;
  border-radius: 10px;
  font-size: 0.92rem;
  padding: 0.7rem;
}

/* ── 移动端 ── */
@media (max-width: 440px) {
  .login-card,
  .logged-in-card,
  .payment-card { border-radius: 12px; padding: 1.4rem 1.1rem; }
  .qr-img { width: 155px; height: 155px; }
}
