/* 个人中心、登录注册、管理后台补充样式 */

.nav-auth {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
}

/* 顶栏用户名文字样式已改为头像下拉，保留类名供兼容 */
.nav-user {
  display: none;
}

/* —— ipa.store 个人中心布局 —— */
.page-main--account {
  max-width: 1280px;
  padding-top: calc(var(--nav-h, 64px) + 20px);
}

.ipa-store-user-section {
  width: 100%;
}

.ipa-store-user-container {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.user-side-panel {
  position: sticky;
  top: calc(var(--nav-h, 64px) + 16px);
  padding: 20px 16px;
  border-radius: 16px;
  background: rgba(248, 248, 248, 0.55);
  border: 2px solid #fff;
  box-shadow: 0 12px 48px rgba(6, 10, 38, 0.12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.user-side-head {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
}

.user-side-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border: 3px solid #e9d5ff;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25);
}

.user-side-name {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e1b4b;
}

.user-side-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #ede9fe;
  color: #5b21b6;
}

.user-side-bio {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #6b7280;
}

.user-side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-side-link {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #505050;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.user-side-link:hover {
  color: #1167ff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.6);
}

.user-side-link.is-active {
  color: #1167ff;
  font-weight: 600;
  background: #fff;
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.8),
    inset -1px -1px 1px rgba(40, 49, 85, 0.12),
    1px 1px 3px rgba(40, 49, 85, 0.08);
}

.user-side-link-admin {
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 14px;
}

.user-side-logout {
  margin-top: 4px;
  color: #991b1b;
}

.user-side-logout:hover {
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.8);
}

.user-main-panel {
  min-width: 0;
}

.ipa-store-shadow-module.module-body {
  padding: 24px;
  border-radius: 16px;
  background: rgba(248, 248, 248, 0.55);
  border: 2px solid #fff;
  box-shadow: 0 12px 48px rgba(6, 10, 38, 0.12);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.module-body-title {
  margin: 0 0 20px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #272b34;
  text-align: center;
}

.user-form-table {
  display: grid;
  gap: 0;
}

.user-form-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px 20px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.92rem;
}

.user-form-row:last-child {
  border-bottom: none;
}

.user-form-row label,
.user-form-row .user-form-label {
  color: #6b7280;
  margin: 0;
}

.user-form-row .user-form-value {
  margin: 0;
  color: #1e1b4b;
  font-weight: 500;
  word-break: break-word;
}

.user-form-row input[type="text"],
.user-form-row input[type="email"],
.user-form-row input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  box-sizing: border-box;
  font-size: 0.92rem;
}

.user-form-actions {
  margin-top: 20px;
  text-align: center;
}

.user-form-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* 旧布局兼容（管理后台等仍可用 account-card） */
.account-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.account-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.account-sidebar a {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: #1e1b4b;
  background: #faf5ff;
  border: 1px solid #e9d5ff;
}

.account-sidebar a.active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  border-color: transparent;
}

.account-card {
  background: #fff;
  border: 1px solid #e9d5ff;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.account-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}

.info-grid dt {
  color: #6b7280;
  margin: 0;
}

.info-grid dd {
  margin: 0;
  font-weight: 500;
}

.alert-pending {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.auth-form {
  max-width: 400px;
  margin: 2rem auto;
}

.auth-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]) {
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  box-sizing: border-box;
}

/* 表单内开关/复选框：不继承文本框全宽样式 */
.auth-form .form-switch-list {
  margin-bottom: 1rem;
}

.auth-form .form-switch-card .form-switch-input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  accent-color: var(--primary, #8b5cf6);
  box-sizing: border-box;
}

/* 登录/注册表单内提示（客户端校验） */
.auth-form-hint {
  margin-bottom: 1rem;
}

.perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.perm-table th,
.perm-table td {
  border-bottom: 1px solid #f3e8ff;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.perm-yes {
  color: #059669;
}

.perm-no {
  color: #9ca3af;
}

.badge-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  background: #ede9fe;
  color: #5b21b6;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-disabled {
  background: #fee2e2;
  color: #991b1b;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

/* 表头：轻底 + 底部分隔线，避免与 account-card 背景脱节 */
.admin-table thead th {
  padding: 0.65rem 0.5rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.02em;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  border-top: none;
}

.admin-table tbody td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
  font-size: 0.9rem;
  color: var(--dark, #1e1b4b);
  background: transparent;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 768px) {
  .ipa-store-user-container {
    grid-template-columns: 1fr;
  }

  .user-side-panel {
    position: static;
  }

  .user-form-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .account-layout {
    grid-template-columns: 1fr;
  }
}

/* —— 会员中心 —— */
.membership-hint {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #6b7280;
}

.membership-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.membership-plan-card {
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.membership-plan-card--vip {
  border-color: #c4b5fd;
}

.membership-plan-card--svip {
  border-color: #f9a8d4;
  background: linear-gradient(180deg, #fff 0%, #fdf2f8 100%);
}

.membership-plan-card--enterprise {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #fff 0%, #eff6ff 100%);
}

.membership-plan-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: #7c3aed;
}

.membership-plan-name {
  margin: 0;
  font-size: 1.15rem;
  color: #1e1b4b;
}

.membership-plan-price {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #8b5cf6;
}

.membership-plan-duration {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.membership-plan-desc {
  margin: 0;
  flex: 1;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.5;
}

.membership-plan-btn {
  width: 100%;
  margin-top: 8px;
}

.membership-orders-table {
  font-size: 0.88rem;
}

.membership-summary .user-form-row {
  padding: 0.35rem 0;
}

/* 收银台 */
.membership-pay-box {
  max-width: 560px;
}

.membership-pay-summary p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.membership-pay-label {
  display: inline-block;
  min-width: 5rem;
  color: #6b7280;
}

.membership-pay-amount {
  font-size: 1.35rem;
  color: #7c3aed;
}

.membership-pay-methods-title {
  margin: 1.25rem 0 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
}

.membership-pay-method-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}

.membership-pay-method {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 118px;
  padding: 14px 14px 12px;
  border: 2px solid #ece8f8;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  user-select: none;
}

.membership-pay-method:hover:not(.membership-pay-method--disabled) {
  border-color: #c4b5fd;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
}

.membership-pay-method:has(.membership-pay-method-input:checked) {
  border-color: #8b5cf6;
  background: linear-gradient(180deg, #fff 0%, #f5f3ff 100%);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.membership-pay-method-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.membership-pay-method-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.membership-pay-method-icon img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.membership-pay-method--points .membership-pay-method-icon {
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
}

.membership-pay-method--alipay .membership-pay-method-icon {
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
}

.membership-pay-method--wechat .membership-pay-method-icon {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
}

.membership-pay-method-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  padding-right: 1.25rem;
}

.membership-pay-method-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
}

.membership-pay-method-desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.membership-pay-method-meta {
  font-size: 0.78rem;
  color: #8b5cf6;
  font-weight: 500;
  margin-top: 2px;
}

.membership-pay-method-warn {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #b45309;
  background: #fffbeb;
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.35;
}

.membership-pay-method-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.membership-pay-method-check::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s;
}

.membership-pay-method:has(.membership-pay-method-input:checked) .membership-pay-method-check {
  border-color: #8b5cf6;
  background: #8b5cf6;
}

.membership-pay-method:has(.membership-pay-method-input:checked) .membership-pay-method-check::after {
  transform: rotate(45deg) scale(1);
}

.membership-pay-submit {
  width: 100%;
  max-width: 280px;
}

.membership-pay-qrcode-wrap {
  margin-top: 1.25rem;
  text-align: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
}

.membership-pay-qrcode {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
}

.membership-pay-qrcode-tip,
.membership-pay-polling {
  color: #6b7280;
  font-size: 0.9rem;
}

.membership-hint--warn {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.membership-pay-method--disabled {
  opacity: 0.72;
  cursor: not-allowed;
  border-style: dashed;
  border-color: #e5e7eb;
  background: #f9fafb;
  box-shadow: none;
}

.membership-pay-method--disabled .membership-pay-method-icon {
  filter: grayscale(0.35);
  opacity: 0.85;
}

.membership-pay-method--disabled .membership-pay-method-name,
.membership-pay-method--disabled .membership-pay-method-desc {
  color: #9ca3af;
}

.membership-pay-method--disabled .membership-pay-method-meta {
  color: #9ca3af;
}

.membership-pay-method-note {
  display: block;
  font-size: 0.78rem;
  font-style: normal;
  color: #b45309;
  margin-top: 4px;
  font-weight: 400;
}

.membership-pay-unavailable {
  font-size: 0.82rem;
  color: #b45309;
}

.pay-ext-alert {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.9rem;
}

.pay-ext-alert--admin {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.pay-ext-alert-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.pay-ext-alert-list li {
  margin: 0.35rem 0;
}

.pay-ext-ok {
  color: #059669;
  font-weight: 600;
}

.pay-ext-bad {
  color: #dc2626;
  font-weight: 600;
}
