/* Profile Page M3 Style */

.profile {
  padding: 0 20px 90px;
}

/* AppBar / Title Bar */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 10px;
}

.profile-header__title {
  font-size: 24px;
  font-weight: 900;
  color: var(--md-text);
}

/* User Card */
.profile-user-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  margin-bottom: 16px;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 3px solid var(--md-brand-soft);
  box-shadow: var(--md-elev-1);
  object-fit: cover;
  transition: transform var(--md-dur-2) var(--md-ease);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

.profile-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--md-surface);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-status-dot.in-store { background-color: #2ED573; }
.profile-status-dot.out-store { background-color: var(--md-text-3); }

.profile-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-user-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--md-text);
}

.profile-user-uid {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--brand-1);
  letter-spacing: 0.5px;
}

/* 权益摘要（简洁图标 + 数字） */
.profile-benefits-strip {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-benefit-pill {
  --pillColor: var(--brand-1);
  --pillBg: color-mix(in srgb, var(--pillColor) 12%, var(--md-surface));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pillColor) 28%, var(--md-outline));
  background: var(--pillBg);
  color: var(--pillColor);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--md-elev-1);
  cursor: pointer;
  transition: transform var(--md-dur-2) var(--md-ease), box-shadow var(--md-dur-2) var(--md-ease), filter var(--md-dur-2) var(--md-ease);
  animation: profileBenefitEnter 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.profile-benefit-pill i {
  font-size: 13px;
  opacity: 0.92;
}

.profile-benefit-pill strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.profile-benefit-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--md-elev-2);
  filter: saturate(1.04);
}

.profile-benefit-pill.is-emphasis {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--pillColor) 30%, transparent);
  border-color: color-mix(in srgb, var(--pillColor) 48%, var(--md-outline));
}

.benefit-popover {
  position: fixed;
  z-index: 2100;
  max-width: min(280px, calc(100vw - 24px));
  background: rgba(16, 18, 22, 0.92);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: benefitPopoverIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(4px);
}

.benefit-popover__title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  margin-bottom: 3px;
  color: #fff;
}

.benefit-popover__text {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

@keyframes benefitPopoverIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-benefit-pill--daypass {
  --pillColor: color-mix(in srgb, #2ED573 78%, var(--md-surface));
}

.profile-benefit-pill--enter {
  --pillColor: color-mix(in srgb, #1677FF 78%, var(--md-surface));
}

.profile-benefit-pill--overnight {
  --pillColor: color-mix(in srgb, #6C5CE7 80%, var(--md-surface));
}

.profile-benefit-pill--fortune-play {
  --pillColor: color-mix(in srgb, #1677FF 78%, var(--md-surface));
}

.profile-benefit-pill--fortune-night {
  --pillColor: color-mix(in srgb, #6C5CE7 80%, var(--md-surface));
}

@keyframes profileBenefitEnter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* KPI / Info Modules */
.profile-kpi-card {
  padding: 24px 16px;
  margin-bottom: 16px;
}

.profile-fortune-entry {
  width: 100%;
  margin: 0 0 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform var(--md-dur-2) var(--md-ease), box-shadow var(--md-dur-2) var(--md-ease), filter var(--md-dur-2) var(--md-ease);
}

.profile-fortune-entry:hover {
  transform: translateY(-1px);
  box-shadow: var(--md-elev-2);
  filter: saturate(1.04);
}

.profile-fortune-entry__icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.16), rgba(255, 159, 67, 0.18));
  font-size: 26px;
  font-family: 'Noto Color Emoji', 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.profile-fortune-entry__main {
  flex: 1;
  min-width: 0;
}

.profile-fortune-entry__title {
  font-size: 16px;
  font-weight: 900;
  color: var(--md-text);
}

.profile-fortune-entry__arrow {
  color: var(--md-text-3);
  font-size: 14px;
}

.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 0;
}

.profile-kpi-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--md-text);
  line-height: 1;
}

.profile-kpi-value--brand {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-kpi-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--md-text-3);
  font-size: 12px;
  font-weight: 700;
}

.profile-kpi-help {
  font-size: 14px;
  cursor: pointer;
  transition: color var(--md-dur-1);
}

.profile-kpi-help:hover { color: var(--brand-1); }

.profile-kpi-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.profile-kpi-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--md-outline);
  background: transparent;
  color: var(--md-text-2);
  cursor: pointer;
  transition: all var(--md-dur-1);
}

.profile-kpi-btn--primary {
  border-color: color-mix(in srgb, var(--brand-1) 30%, transparent);
  color: var(--brand-1);
}

.profile-kpi-btn--secondary {
  border-color: color-mix(in srgb, #6C5CE7 30%, transparent);
  color: #6C5CE7;
}

.profile-kpi-btn:hover {
  background: var(--md-brand-soft);
  transform: translateY(-1px);
}

/* Tiles Grid */
.profile-tiles-card {
  padding: 8px;
  margin-bottom: 20px;
}

.profile-tiles-grid {
  display: grid;
  gap: 8px;
}

.profile-tiles-grid--2 { grid-template-columns: repeat(2, 1fr); }
.profile-tiles-grid--4 { grid-template-columns: repeat(4, 1fr); }

.profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border-radius: var(--md-r-md);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--md-text);
  transition: all var(--md-dur-2) var(--md-ease);
  cursor: pointer;
}

.profile-tile:hover {
  background: var(--md-brand-soft);
  border-color: color-mix(in srgb, var(--brand-1) 15%, transparent);
  transform: translateY(-2px);
}

.profile-tile:active {
  transform: translateY(0) scale(0.96);
}

.profile-tile-icon {
  font-size: 28px;
  margin-bottom: 8px;
  transition: transform var(--md-dur-2);
}

.profile-tile:hover .profile-tile-icon {
  transform: scale(1.1);
}

.profile-tile-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-text-2);
}

/* Skeleton */
.profile-skeleton-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--md-outline);
  animation: m3-pulse 1.5s infinite;
}

.profile-skeleton-line {
  height: 14px;
  background: var(--md-outline);
  border-radius: 4px;
  animation: m3-pulse 1.5s infinite;
}

@keyframes m3-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@media (min-width: 768px) {
  .profile {
    max-width: 520px;
    margin: 0 auto;
  }
}
