/* ============================================
   鳞光屿 - 用户认证（登录/注册/忘记密码）与个人中心样式
   ============================================ */

/* ---------- Auth 双栏卡片 ---------- */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 88px;
  min-height: 70vh;
}

.auth-card {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  width: 100%;
  max-width: 940px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.auth-side {
  position: relative;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 70%);
  color: var(--text-white);
  padding: 56px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-side::after {
  content: '';
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.auth-side::before {
  content: '';
  position: absolute;
  left: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(232, 168, 124, 0.18);
}

.auth-side-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
}

.auth-side-logo img {
  width: 38px;
  height: 38px;
}

.auth-side-body {
  position: relative;
  z-index: 1;
}

.auth-side-body h2 {
  color: var(--text-white);
  font-size: 30px;
  line-height: 1.4;
  margin-bottom: 14px;
}

.auth-side-body p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.8;
}

.auth-side-points {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}

.auth-side-point {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 12px;
}

.auth-side-point span {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.auth-form-side {
  padding: 48px 52px;
}

.auth-form-head {
  margin-bottom: 30px;
}

.auth-form-head h2 {
  font-size: 26px;
  margin-bottom: 8px;
}

.auth-form-head p {
  color: var(--text-medium);
  font-size: 14px;
}

.auth-field {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.auth-label .req {
  color: var(--coral);
  margin-left: 2px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-light);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-cream);
  font-size: 15px;
  color: var(--text-dark);
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--primary-light);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(122, 181, 166, 0.18);
}

.auth-input.invalid {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.12);
}

.auth-error {
  display: none;
  font-size: 12px;
  color: var(--coral);
  margin-top: 6px;
  line-height: 1.5;
}

.auth-error.show {
  display: block;
}

.auth-pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  border-radius: 50%;
  cursor: pointer;
}

.auth-pwd-toggle:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.auth-pwd-toggle svg,
.auth-pwd-toggle i {
  font-size: 18px;
  line-height: 1;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 22px;
  font-size: 13px;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-medium);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-link {
  color: var(--primary);
  font-weight: 500;
}

.auth-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.btn-auth {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--text-white);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(45, 106, 94, 0.25);
}

.btn-auth:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(45, 106, 94, 0.32);
}

.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-light);
  font-size: 12px;
  margin: 26px 0 20px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-socials {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.auth-social {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.auth-social:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
  transform: translateY(-3px);
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-medium);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* 注册页额外字段 */
.auth-field-code {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
}

.auth-field-code .auth-input {
  padding-left: 44px;
}

.auth-code-btn {
  height: 48px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary-light);
  color: var(--primary);
  background: var(--primary-bg);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

.auth-code-btn:hover {
  background: var(--primary);
  color: var(--text-white);
}

.auth-code-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-tip-note {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* 步骤指示器（忘记密码） */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
}

.auth-step .auth-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.auth-step.active {
  color: var(--primary);
}

.auth-step.active .auth-step-num {
  background: var(--primary);
  color: var(--text-white);
}

.auth-step-line {
  width: 34px;
  height: 1.5px;
  background: var(--border);
}

/* ---------- Toast ---------- */
.lgy-toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--primary);
  color: var(--text-white);
  padding: 13px 30px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  z-index: 99999;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  max-width: 86vw;
  text-align: center;
  pointer-events: none;
}

.lgy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---------- 用户中心 ---------- */
.user-hero {
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 75%);
  color: var(--text-white);
  padding: 46px 0 58px;
  margin-bottom: -40px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.user-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.user-info h1 {
  color: var(--text-white);
  font-size: 26px;
  margin-bottom: 6px;
}

.user-info .user-meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.user-stats {
  margin-left: auto;
  display: flex;
  gap: 34px;
  text-align: center;
}

.user-stat-num {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--text-white);
}

.user-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--text-white);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.26);
}

.btn-logout svg,
.btn-logout i {
  font-size: 15px;
}

/* 收藏网格：PC 5 列 / 手机 2 列 */
.fav-section {
  padding: 80px 0 96px;
}

.fav-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.fav-head h2 {
  font-size: 24px;
}

.fav-head .fav-count {
  font-size: 14px;
  color: var(--text-medium);
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
}

.fav-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: var(--transition-slow);
  position: relative;
  display: flex;
  flex-direction: column;
}

.fav-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.fav-card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-soft);
}

.fav-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.fav-card:hover .fav-card-img-wrap img {
  transform: scale(1.06);
}

.fav-card-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-medium);
  font-size: 16px;
  transition: var(--transition);
  z-index: 2;
}

.fav-card-remove:hover {
  background: var(--coral);
  color: var(--text-white);
  transform: rotate(90deg);
}

.fav-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.fav-card-cat {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.fav-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.fav-card-title:hover {
  color: var(--primary);
}

.fav-card-price {
  margin: 10px 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--coral);
}

.fav-card-price .fav-price-orig {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 6px;
}

.fav-card-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  border-radius: var(--radius-full);
  text-decoration: none;
  background: var(--primary);
  color: var(--text-white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: var(--transition);
}

.fav-card-btn:hover {
  background: var(--primary-dark);
}

.fav-card-btn:active {
  transform: scale(0.97);
}

.fav-empty {
  text-align: center;
  padding: 70px 20px;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border);
}

.fav-empty-icon {
  font-size: 52px;
  margin-bottom: 18px;
}

.fav-empty h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.fav-empty p {
  color: var(--text-medium);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---------- 定制弹窗 ---------- */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 30, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.active {
  opacity: 1;
  visibility: visible;
}

.custom-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 32px 34px;
  box-shadow: var(--shadow-lg);
  transform: translateY(24px);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal.active .custom-modal-card {
  transform: translateY(0);
}

.custom-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.custom-modal-head h3 {
  font-size: 19px;
}

.custom-modal-head .modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-medium);
  flex-shrink: 0;
}

.custom-modal-head .modal-close:hover {
  background: var(--coral);
  color: var(--text-white);
}

.custom-modal-product {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.custom-modal-product img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.custom-modal-product .cm-p-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.custom-modal-product .cm-p-price {
  font-size: 13px;
  color: var(--coral);
  font-weight: 700;
  margin-top: 2px;
}

.custom-field {
  margin-bottom: 16px;
}

.custom-field textarea,
.custom-field input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-cream);
  font-size: 14px;
  color: var(--text-dark);
  padding: 11px 14px;
  transition: var(--transition);
  resize: vertical;
}

.custom-field textarea {
  min-height: 84px;
}

.custom-field textarea:focus,
.custom-field input:focus {
  border-color: var(--primary-light);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(122, 181, 166, 0.18);
  outline: none;
}

.custom-field .custom-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}

.custom-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.custom-modal-actions .btn {
  flex: 1;
  padding: 12px 18px;
  font-size: 14px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .fav-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 460px;
  }
  .auth-side {
    display: none;
  }
  .auth-form-side {
    padding: 40px 30px;
  }
}

@media (max-width: 640px) {
  .fav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .fav-card-btn {
    height: 36px;
    font-size: 12px;
  }
  .user-profile {
    flex-direction: column;
    align-items: flex-start;
  }
  .user-stats {
    margin-left: 0;
    gap: 22px;
  }
  .auth-wrap {
    padding: 32px 16px 64px;
  }
  .auth-form-side {
    padding: 32px 22px;
  }
}
