/**
 * 个人中心 — 侧栏 + 概览；毛玻璃通过独立伪元素层实现，避免滚动闪白线
 */

/* 固定背景 + 毛玻璃滚动合成易出白线，个人中心页改为随内容滚动 */
body.page-profile {
  background-attachment: scroll;
  scroll-behavior: auto;
}

.pf-page {
  --pf-accent: #fdbbdb;
  --pf-accent-deep: #f0a8c4;
  --pf-accent-text: #a85878;
  --pf-muted: #888;
  --pf-text: #222;
  --pf-glass-tint: rgba(255, 255, 255, 0.34);
  --pf-glass-tint-strong: rgba(255, 255, 255, 0.42);
  --pf-glass-blur: 16px;
  --pf-glass-ring: rgba(253, 189, 219, 0.5);
  --pf-radius: 16px;
  --pf-sidebar-width: 220px;
  --pf-max-width: 1080px;
  --pf-transition: 0.2s ease;

  width: min(100% - 2rem, var(--pf-max-width));
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
  box-sizing: border-box;
}

.pf-shell {
  display: grid;
  grid-template-columns: var(--pf-sidebar-width) 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* —— 毛玻璃面板：blur 在 ::before，描边在 ::after，本体透明 —— */
.pf-sidebar,
.pf-hero,
.pf-stat-card,
.pf-section {
  position: relative;
  overflow: hidden;
  border: none;
  background: transparent;
  box-shadow: 0 8px 28px rgba(253, 189, 219, 0.12);
}

.pf-sidebar::before,
.pf-hero::before,
.pf-stat-card::before,
.pf-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--pf-glass-tint);
  backdrop-filter: blur(var(--pf-glass-blur)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--pf-glass-blur)) saturate(1.12);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  pointer-events: none;
}

.pf-sidebar::after,
.pf-hero::after,
.pf-stat-card::after,
.pf-section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--pf-glass-ring);
  pointer-events: none;
}

.pf-sidebar > *,
.pf-hero > *,
.pf-stat-card > *,
.pf-section > * {
  position: relative;
  z-index: 1;
}

.pf-hero::before {
  background: linear-gradient(135deg, rgba(253, 189, 219, 0.32), rgba(240, 168, 196, 0.16)),
    var(--pf-glass-tint);
}

.pf-stat-card::before {
  background: linear-gradient(135deg, rgba(253, 189, 219, 0.22), transparent), var(--pf-glass-tint);
}

.pf-section {
  scroll-margin-top: 1rem;
  box-shadow: 0 6px 24px rgba(253, 189, 219, 0.1);
}

.pf-hero {
  box-shadow: 0 10px 36px rgba(253, 189, 219, 0.14);
}

/* —— 侧栏 —— */
.pf-sidebar {
  position: sticky;
  top: 1rem;
  z-index: 2;
  padding: 0.75rem;
  border-radius: var(--pf-radius);
  contain: layout paint;
}

.pf-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pf-sidebar-group {
  margin: 0.85rem 0 0.35rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c97a96;
}

.pf-sidebar-group:first-child {
  margin-top: 0.2rem;
}

.pf-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  color: var(--pf-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--pf-transition), color var(--pf-transition);
}

.pf-sidebar-link:hover {
  background: rgba(253, 189, 219, 0.22);
  color: var(--pf-accent-text);
  text-decoration: none;
}

.pf-sidebar-link.is-active {
  background: rgba(253, 189, 219, 0.35);
  color: var(--pf-accent-text);
  border-color: rgba(240, 168, 196, 0.45);
  font-weight: 600;
}

.pf-sidebar-icon {
  width: 1.1rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.9;
}

.pf-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* —— 概览 Hero —— */
.pf-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--pf-radius);
}

.pf-hero-profile {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
}

.pf-avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(253, 189, 219, 0.35);
  background: rgba(255, 255, 255, 0.5);
}

.pf-hero-text {
  min-width: 0;
}

.pf-display-name {
  margin: 0 0 0.2rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--pf-text);
  line-height: 1.25;
  word-break: break-word;
}

.pf-handle {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  color: var(--pf-accent-text);
  font-weight: 500;
}

.pf-signature {
  margin: 0;
  font-size: 0.92rem;
  color: var(--pf-text);
  line-height: 1.5;
}

.pf-signature--empty {
  color: var(--pf-muted);
  font-style: italic;
}

.pf-hero-meta {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--pf-muted);
}

.pf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pf-accent-text);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(240, 168, 196, 0.65);
  background: linear-gradient(135deg, rgba(253, 189, 219, 0.55), rgba(240, 168, 196, 0.6));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: box-shadow var(--pf-transition), filter var(--pf-transition);
  box-shadow: 0 3px 12px rgba(253, 189, 219, 0.2);
}

.pf-btn:hover {
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(253, 189, 219, 0.28);
  color: var(--pf-accent-text);
  filter: brightness(1.03);
}

.pf-btn--ghost {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(253, 189, 219, 0.45);
}

/* —— 统计卡片 —— */
.pf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.85rem;
}

.pf-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 6.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--pf-radius);
  text-decoration: none;
  color: var(--pf-text);
  transition: box-shadow var(--pf-transition);
}

.pf-stat-card:hover {
  text-decoration: none;
  color: var(--pf-text);
  box-shadow: 0 12px 32px rgba(253, 189, 219, 0.2);
}

.pf-stat-card:hover::before {
  background: linear-gradient(135deg, rgba(253, 189, 219, 0.28), transparent), var(--pf-glass-tint-strong);
}

.pf-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pf-stat-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(253, 189, 219, 0.35);
  color: var(--pf-accent-text);
  border: 1px solid rgba(253, 189, 219, 0.4);
}

.pf-stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pf-accent-text);
  font-variant-numeric: tabular-nums;
}

.pf-stat-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.pf-stat-meta {
  font-size: 0.78rem;
  color: var(--pf-muted);
  margin-top: auto;
}

/* —— 动态区块（列表项不再单独 blur，避免滚动叠层闪线） —— */
.pf-section {
  padding: 1.25rem 1.35rem;
  border-radius: var(--pf-radius);
}

.pf-section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pf-accent-text);
}

.pf-section-title::after {
  content: '';
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-top: 0.45rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pf-accent-deep), rgba(253, 189, 219, 0.15));
}

.pf-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pf-activity-item {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(253, 189, 219, 0.1);
}

.pf-activity-item + .pf-activity-item {
  margin-top: 0.5rem;
}

.pf-activity-link {
  font-weight: 600;
  color: var(--pf-text);
  text-decoration: none;
}

.pf-activity-link:hover {
  color: var(--pf-accent-text);
  text-decoration: underline;
}

.pf-activity-content {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--pf-text);
}

.pf-activity-item .pf-activity-content:last-child,
.pf-activity-item .pf-activity-meta:last-child {
  margin-bottom: 0;
}

.pf-activity-meta {
  font-size: 0.8rem;
  color: var(--pf-muted);
}

.pf-activity-meta a {
  color: var(--pf-accent-text);
  font-weight: 500;
  text-decoration: none;
}

.pf-activity-meta a:hover {
  text-decoration: underline;
}

.pf-badge-anon {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin-right: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(253, 189, 219, 0.4);
  color: var(--pf-accent-text);
}

.pf-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--pf-muted);
}

.pf-empty a {
  color: var(--pf-accent-text);
  font-weight: 500;
}

/* —— 编辑页：表单卡片同样使用分层毛玻璃 —— */
body.page-profile .pf-main .anlian-form-card {
  position: relative;
  overflow: hidden;
  border: none;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 8px 28px rgba(253, 189, 219, 0.12);
}

body.page-profile .pf-main .anlian-form-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--pf-glass-tint);
  backdrop-filter: blur(var(--pf-glass-blur)) saturate(1.12);
  -webkit-backdrop-filter: blur(var(--pf-glass-blur)) saturate(1.12);
  transform: translateZ(0);
  pointer-events: none;
}

body.page-profile .pf-main .anlian-form-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--pf-glass-ring);
  pointer-events: none;
}

body.page-profile .pf-main .anlian-form-card > * {
  position: relative;
  z-index: 1;
}

.pf-edit-form .pf-edit-header {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pf-accent-text);
  text-align: center;
}

.pf-edit-footnote {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--pf-muted);
  text-align: center;
  border-top: 1px solid rgba(253, 189, 219, 0.28);
}

/* —— 编辑资料：头像置顶、点击上传 —— */
.pf-edit-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-bottom: 1.35rem;
}

.pf-edit-avatar .anlian-field-label {
  align-self: stretch;
  text-align: left;
}

.pf-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pf-avatar-picker {
  display: inline-flex;
  margin: 0.35rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pf-avatar-picker:focus-visible .pf-avatar-picker__frame {
  box-shadow: 0 0 0 3px rgba(253, 189, 219, 0.45);
}

.pf-avatar-picker__frame {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
  transition: transform var(--pf-transition);
}

.pf-avatar-picker:hover .pf-avatar-picker__frame,
.pf-avatar-picker:focus-visible .pf-avatar-picker__frame {
  transform: scale(1.03);
}

.pf-avatar-picker__frame .pf-avatar {
  width: 96px;
  height: 96px;
  border-width: 3px;
}

.pf-avatar-picker__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(168, 88, 120, 0.42);
  opacity: 0;
  transition: opacity var(--pf-transition);
  pointer-events: none;
}

.pf-avatar-picker:hover .pf-avatar-picker__overlay,
.pf-avatar-picker:focus-visible .pf-avatar-picker__overlay {
  opacity: 1;
}

.pf-avatar-picker__overlay-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

.pf-avatar-picker__tip {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--pf-muted);
  text-align: center;
}

.pf-edit-readonly {
  margin: 0 !important;
}

.pf-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.pf-form-actions__btn {
  flex: 1 1 8rem;
  min-height: 2.75rem;
  margin-top: 0 !important;
  box-sizing: border-box;
}

.pf-form-actions .anlian-btn-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  margin-top: 0 !important;
}

.pf-form-actions .pf-btn {
  min-height: 2.75rem;
  padding-top: 0;
  padding-bottom: 0;
}

.pf-main .anlian-form-card {
  margin: 0;
}

/* —— 响应式 —— */
@media (max-width: 900px) {
  .pf-shell {
    grid-template-columns: 1fr;
  }

  .pf-sidebar {
    position: static;
    contain: none;
  }

  .pf-sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .pf-sidebar-group {
    display: none;
  }

  .pf-sidebar-link {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 576px) {
  .pf-page {
    width: min(100% - 1rem, var(--pf-max-width));
    padding-top: 0.75rem;
  }

  .pf-hero {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pf-hero-profile {
    flex-direction: column;
  }

  .pf-hero-actions {
    justify-content: center;
  }

  .pf-stats {
    grid-template-columns: 1fr;
  }
}

/* 系统减少动效时关闭 hover 亮度变化 */
@media (prefers-reduced-motion: reduce) {
  .pf-btn:hover {
    filter: none;
  }
}
