/* ========================================
   会员系统 - 前台样式
   ======================================== */

/* 登录/注册页 */
.auth-page {
  min-height: calc(100vh - 260px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--bg-card, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  padding: 44px 40px;
  width: 100%;
  max-width: 460px;
  border: 1px solid rgba(0,0,0,0.04);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-header h2 {
  font-size: 24px;
  color: var(--text-primary, #333);
  margin-bottom: 8px;
  font-weight: 600;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted, #888);
}

.auth-flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-flash-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.auth-flash-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.auth-form .form-group {
  margin-bottom: 18px;
}
.auth-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #555);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.auth-form label .required { color: #dc2626; margin-left: 2px; }
.auth-form label .optional { color: #999; font-weight: 400; }

/* 输入框图标容器 */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #c0c0c0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary, #333);
  background: var(--bg-card, #fff);
  transition: all 0.25s ease;
  box-sizing: border-box;
  line-height: 1.5;
}
.form-input.has-icon {
  padding-left: 40px;
}
.form-input::placeholder {
  color: #bfbfbf;
}
.form-input:hover {
  border-color: #999;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary, #8b1a1a);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.1);
}
.form-input.input-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
.form-input.input-success {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.08);
}

.form-hint {
  font-size: 12px;
  margin-top: 5px;
  min-height: 18px;
  line-height: 1.5;
}
.hint-checking { color: #999; font-style: italic; }
.hint-success { color: #16a34a; font-weight: 500; }
.hint-error { color: #dc2626; font-weight: 500; }

.form-row {
  display: flex;
  gap: 14px;
}
.form-row .form-group { flex: 1; }

.auth-btn {
  display: block;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.25s ease;
  border: none;
  letter-spacing: 4px;
}
.auth-btn-primary {
  background: #8b1a1a;
  color: #fff;
  width: 100%;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(139,26,26,0.25);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.auth-btn-primary:hover {
  background: #6b1414;
  box-shadow: 0 4px 14px rgba(139,26,26,0.35);
  transform: translateY(-1px);
}
.auth-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139,26,26,0.2);
}
.auth-btn-secondary {
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-secondary, #555);
}
.auth-btn-small {
  padding: 8px 20px;
  font-size: 13px;
  width: auto;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted, #888);
}
.auth-footer a {
  color: var(--primary, #8b1a1a);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* 个人中心 */
.profile-page {
  padding: 20px 0 40px;
}
.profile-container {
  display: flex;
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}
.profile-main { flex: 1; min-width: 0; }
.profile-sidebar { width: 340px; flex-shrink: 0; }

.profile-card {
  background: var(--bg-card, #fff);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.profile-card h3 {
  font-size: 16px;
  color: var(--text-primary, #333);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color, #eee);
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b1a1a, #c44040);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-info h2 {
  font-size: 18px;
  color: var(--text-primary, #333);
}

.profile-card.profile-card-avatar {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.profile-card.profile-card-avatar .profile-info {
  flex: 1;
}

.member-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.type-guest { background: #f0f0f0; color: #666; }
.type-regular { background: #e0f2fe; color: #0369a1; }
.type-monthly { background: #fef3c7; color: #92400e; }
.type-yearly { background: #fce7f3; color: #9d174d; }

.vip-expire {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-left: 8px;
}

.profile-stats {
  font-size: 13px;
  color: var(--text-muted, #888);
  line-height: 1.8;
}

/* 配额显示 */
.quota-grid { display: flex; flex-direction: column; gap: 16px; }
.quota-item {}
.quota-label {
  font-size: 13px;
  color: var(--text-secondary, #555);
  margin-bottom: 6px;
  font-weight: 500;
}
.quota-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary, #f0f0f0);
  border-radius: 4px;
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b1a1a, #c44040);
  border-radius: 4px;
  transition: width 0.3s;
}
.quota-text {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-top: 4px;
}
.quota-remaining { color: var(--primary, #8b1a1a); font-weight: 500; }

/* VIP升级卡片 */
.vip-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
}
.vip-card h3 { border-bottom-color: #fde68a; }
.vip-subtitle {
  font-size: 13px;
  color: #78716c;
  margin-bottom: 14px;
}
.vip-plans {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* VIP套餐行 - 纵向堆叠 */
.vip-plan-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.8);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s;
}
.vip-plan-row:hover { background: rgba(255,255,255,1); box-shadow: 0 1px 6px rgba(0,0,0,0.05); }
.vip-plan-row-hot {
  border: 1.5px solid #f59e0b;
  background: rgba(255,255,255,0.95);
}
.vip-plan-name {
  font-size: 15px;
  font-weight: 600;
  color: #92400e;
}
.vip-tag {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  font-weight: 600;
  margin-left: 4px;
}
.vip-plan-detail {
  font-size: 13px;
  color: #78716c;
}
.vip-plan-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vip-plan-price {
  font-size: 16px;
  font-weight: 700;
  color: #8b1a1a;
}
.vip-plan-per {
  font-size: 12px;
  font-weight: 400;
  color: #a8a29e;
}
.vip-buy-btn {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #8b1a1a;
  transition: all 0.2s;
  white-space: nowrap;
}
.vip-buy-btn:hover { background: #6b1414; }
.vip-buy-btn-hot {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}
.vip-buy-btn-hot:hover {
  background: linear-gradient(135deg, #d97706, #ea580c);
}
/* 订单记录卡片 */
.order-card {
  background: #fff;
}
/* 订单列表 */
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-secondary, #f9fafb);
  transition: background 0.2s;
}
.order-item:hover { background: var(--border-color, #f0f0f0); }
.order-info { flex: 1; min-width: 0; }
.order-type {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 4px;
}
.order-time {
  font-size: 12px;
  color: var(--text-muted, #999);
  word-break: break-all;
}
.order-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.order-amount { font-size: 15px; font-weight: 700; color: var(--text-primary, #333); }
.order-pay-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #8b1a1a;
  transition: background 0.2s;
}
.order-pay-btn:hover { background: #6b1414; }
.order-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted, #aaa);
  font-size: 13px;
}

.order-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  margin-left: 6px;
}
.order-status-paid { background: #dcfce7; color: #166534; }
.order-status-pending { background: #fef3c7; color: #92400e; }
.order-status-failed, .order-status-expired { background: #fee2e2; color: #991b1b; }
.order-status-refunded { background: #f3f4f6; color: #6b7280; }

/* 配额用尽页 */
.quota-card {
  text-align: center;
  max-width: 480px;
}
.quota-icon { font-size: 48px; margin-bottom: 16px; }
.quota-card h2 {
  font-size: 20px;
  color: var(--text-primary, #333);
  margin-bottom: 12px;
}
.quota-detail {
  font-size: 14px;
  color: var(--text-secondary, #555);
  line-height: 2;
  margin-bottom: 24px;
}
.quota-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.quota-tip {
  font-size: 12px;
  color: var(--text-muted, #888);
}

/* Header 用户区域 */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.9);
}
.header-user a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.header-user a:hover { color: #fff; }
.header-user .user-name {
  font-weight: 500;
  color: #fff;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-quota {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.header-quota strong {
  color: #fff;
}
.header-vip-badge {
  display: inline-block;
  padding: 1px 6px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}
.header-login-btn {
  padding: 4px 14px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 14px;
  color: #fff !important;
  font-size: 12px;
  transition: all 0.2s;
  background: transparent;
}
.header-login-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  color: #fff !important;
}
.header-register-btn {
  padding: 4px 14px;
  background: #fff;
  border-radius: 14px;
  color: #8b1a1a !important;
  font-size: 12px;
  transition: all 0.2s;
  border: none;
}
.header-register-btn:hover {
  background: var(--gold, #c8a44b);
  color: #fff !important;
}
.header-logout-btn {
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 2px 6px;
}
.header-logout-btn:hover { color: #fff; }

/* 响应式 */
@media (max-width: 768px) {
  .profile-container {
    flex-direction: column;
  }
  .profile-sidebar {
    width: 100%;
  }
  .auth-card {
    padding: 32px 22px;
    border-radius: 12px;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .header-user .header-quota {
    display: none;
  }
  .captcha-wrap {
    flex-direction: column;
  }
  .captcha-img {
    width: 120px;
    height: 40px;
  }
}

/* 验证码 */
.captcha-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.captcha-input-wrap {
  flex: 1;
}
.captcha-img {
  width: 120px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #c0c0c0;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.captcha-img:hover {
  border-color: #999;
}

/* 邮箱验证码发送按钮 */
.email-code-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  background: var(--primary, #8b1a1a);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
  z-index: 2;
}
.email-code-btn:hover:not(:disabled) {
  opacity: 0.85;
}
.email-code-btn:disabled {
  cursor: not-allowed;
}

/* 资料编辑表单 */
.profile-card .auth-form {
  margin-top: 12px;
}
