/* ════════════════════════════════════════════════════════
   个人中心 · Profile Center (重设计 v2)
   结构：Hero(头像+等级+积分条) / 社区统计 / 我的社区tabs / 账号设置
   配色沿用站点变量（蓝 #4f8cff 主色，暗色底）
   ════════════════════════════════════════════════════════ */

body {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

.pc-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 14px 12px 56px;
  animation: pcFadeUp 0.4s ease;
}

@keyframes pcFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════ 1. Hero Card ════ */
.pc-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pc-hero-banner {
  height: 72px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #16233f 0%, #0f1a2e 55%, #182448 100%);
}

.pc-banner-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 25% 70%, rgba(79,140,255,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 75% 30%, rgba(76,175,136,0.12) 0%, transparent 50%);
  animation: pcBannerShift 8s ease-in-out infinite alternate;
}

@keyframes pcBannerShift {
  0%   { transform: translateX(-4px) scale(1.02); }
  100% { transform: translateX(4px) scale(1); }
}

.pc-hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.pc-hero-body {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 18px 16px;
  margin-top: -28px;
  position: relative;
  z-index: 1;
}

/* ── Avatar ── */
.pc-avatar-wrap {
  position: relative;
  cursor: pointer;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pc-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card);
  background: var(--bg);
  transition: border-color 0.25s, filter 0.25s;
}

.pc-avatar-wrap:hover .pc-avatar {
  border-color: var(--accent);
  filter: brightness(0.7);
}

.pc-avatar-overlay {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s, background 0.25s;
  pointer-events: none;
}

.pc-avatar-overlay i {
  font-size: 1.2rem;
  color: #fff;
}

.pc-avatar-wrap:hover .pc-avatar-overlay {
  opacity: 1;
  background: rgba(0,0,0,0.35);
}

/* ── Hero Info ── */
.pc-hero-info {
  flex: 1;
  min-width: 0;
  padding-top: 32px;
}

.pc-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pc-nickname {
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* ── Level Badge ── */
.pc-lv {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 19px;
  padding: 0 8px;
  background: rgba(79,140,255,0.10);
  border: 1px solid rgba(79,140,255,0.28);
  border-radius: 10px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.pc-lv i { font-size: 0.7rem; }

/* ── Sub line (标签 · @用户名 · 天数) ── */
.pc-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-sub em {
  font-style: normal;
  color: var(--text);
  opacity: 0.85;
}

.pc-sub .dot {
  margin: 0 6px;
  opacity: 0.45;
}

.pc-custom-titles {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.pc-custom-titles .custom-title {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 7px;
  line-height: 1.4;
  white-space: nowrap;
}

/* ── Points Strip ── */
.pc-points {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 18px 14px;
  padding: 10px 14px;
  background: rgba(79,140,255,0.05);
  border: 1px solid rgba(79,140,255,0.10);
  border-radius: 9px;
}

.pc-pts-num {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.pc-pts-num b {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.pc-pts-num span {
  font-size: 0.62rem;
  color: var(--muted);
}

.pc-pts-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.pc-pts-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.pc-pts-next {
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
}

.pc-pts-streak {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #ff8c42;
  white-space: nowrap;
}

.pc-pts-streak i { font-size: 0.78rem; }

/* ════ 2. Stats Grid ════ */
.pc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.pc-st {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  transition: border-color 0.2s;
}

.pc-st:hover { border-color: rgba(79,140,255,0.3); }

.pc-st b {
  display: block;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pc-st span {
  font-size: 0.6rem;
  color: var(--muted);
}

.pc-st:nth-child(1) b { color: var(--accent); }
.pc-st:nth-child(2) b { color: var(--red); }
.pc-st:nth-child(3) b { color: var(--green); }
.pc-st:nth-child(4) b { color: var(--yellow); }

/* ════ 3. Section ════ */
.pc-section {
  margin-bottom: 10px;
}

.pc-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.pc-section-title i {
  font-size: 0.9rem;
  color: var(--accent);
  opacity: 0.85;
}

/* ── Tabs ── */
.pc-tabs {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 8px;
}

.pc-tab {
  flex: 1;
  padding: 6px 0;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s;
}

.pc-tab:hover { color: var(--text); }

.pc-tab.on {
  background: rgba(79,140,255,0.10);
  color: var(--accent);
  font-weight: 600;
}

/* ── Feed ── */
.pc-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.pc-post:hover { border-color: rgba(79,140,255,0.25); }

.pc-post-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.pc-post-author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pc-post-ava {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(79,140,255,0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pc-post-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-post-board {
  font-size: 0.6rem;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(79,140,255,0.10);
  color: var(--accent);
  white-space: nowrap;
}

.pc-post-time {
  font-size: 0.62rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

.pc-post-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.4;
}

.pc-post-text {
  font-size: 0.78rem;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-post-foot {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.pc-pf {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--muted);
}

.pc-pf i { font-size: 0.82rem; }
.pc-pf.hot { color: var(--red); }
.pc-pf.sav { color: var(--yellow); }

/* ── Comment card ── */
.pc-cmt {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
}

.pc-cmt-ref {
  font-size: 0.66rem;
  color: var(--muted);
  margin-bottom: 5px;
  padding-left: 8px;
  border-left: 2px solid rgba(79,140,255,0.3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-cmt-body {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.65;
}

.pc-cmt-time {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 5px;
}

/* ── Empty / loading ── */
.pc-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.pc-empty i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

.pc-spin { animation: pcSpin 1s linear infinite; }

@keyframes pcSpin {
  to { transform: rotate(360deg); }
}

/* ════ 4. Card + List Items ════ */
.pc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.pc-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.pc-list-item:last-child { border-bottom: none; }

.pc-list-item:hover { background: rgba(79,140,255,0.04); }

.pc-list-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(79,140,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-list-icon i {
  font-size: 0.82rem;
  color: var(--accent);
}

.pc-list-icon.pc-ic-orange { background: rgba(255,140,66,0.10); }
.pc-list-icon.pc-ic-orange i { color: #ff8c42; }
.pc-list-icon.pc-ic-green { background: rgba(76,175,136,0.10); }
.pc-list-icon.pc-ic-green i { color: var(--green); }
.pc-list-icon.pc-ic-yellow { background: rgba(240,196,74,0.10); }
.pc-list-icon.pc-ic-yellow i { color: var(--yellow); }

.pc-list-content {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.pc-list-label {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text);
}

.pc-list-sub {
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 1px;
  opacity: 0.8;
}

.pc-list-arrow {
  font-size: 0.95rem;
  color: var(--muted);
  opacity: 0.4;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.pc-list-item:hover .pc-list-arrow {
  transform: translateX(3px);
  opacity: 0.8;
}

/* ════ 5. Logout ════ */
.pc-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.pc-logout i { font-size: 1rem; }

.pc-logout:hover {
  color: var(--red);
  background: rgba(240,74,110,0.06);
}

/* ════ Modals ════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: pcFadeIn 0.15s ease;
}

@keyframes pcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 90%;
  max-width: 360px;
  animation: pcModalIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

@keyframes pcModalIn {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.modal .field { margin-bottom: 14px; }

.modal .field label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal .field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal .field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.12);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-btn {
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}

.modal-btn.primary {
  background: var(--accent);
  color: #fff;
}

.modal-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,140,255,0.25);
}

.modal-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.modal-btn.ghost:hover {
  border-color: var(--muted);
  background: rgba(255,255,255,0.02);
}

/* ════ Crop Modal ════ */
.crop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  animation: pcFadeIn 0.15s ease;
}

.crop-title {
  color: #fff;
  font-size: 0.92rem;
  margin-bottom: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.crop-container {
  position: relative;
  display: inline-block;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  border-radius: 8px;
  overflow: hidden;
}

.crop-container img {
  display: block;
  max-width: 80vw;
  max-height: 56vh;
  border-radius: 8px;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  cursor: move;
  z-index: 10;
  border-radius: 50%;
}

.crop-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.25);
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
  z-index: 11;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.crop-handle.n  { top: -6px; left: 50%; margin-left: -6px; cursor: n-resize; }
.crop-handle.s  { bottom: -6px; left: 50%; margin-left: -6px; cursor: s-resize; }
.crop-handle.w  { top: 50%; margin-top: -6px; left: -6px; cursor: w-resize; }
.crop-handle.e  { top: 50%; margin-top: -6px; right: -6px; cursor: e-resize; }

.crop-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
}

.crop-btn {
  padding: 10px 30px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}

.crop-btn.confirm {
  background: var(--accent);
  color: #fff;
}

.crop-btn.confirm:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,140,255,0.3);
}

.crop-btn.cancel {
  background: rgba(255,255,255,0.08);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.15);
}

.crop-btn.cancel:hover { background: rgba(255,255,255,0.14); }

.crop-hint {
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  margin-top: 12px;
  letter-spacing: 0.02em;
}

/* ════ Toast ════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.84rem;
  z-index: 3000;
  animation: pcSlideIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

@keyframes pcSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ════ Responsive ════ */
@media (max-width: 480px) {
  .pc-container { padding: 10px 10px 48px; }
  .pc-hero-banner { height: 64px; }
  .pc-hero-body { gap: 12px; padding: 0 14px 14px; }
  .pc-avatar-wrap, .pc-avatar { width: 56px; height: 56px; }
  .pc-nickname { font-size: 1.08rem; }
  .pc-points { margin: 0 14px 12px; gap: 10px; }
  .pc-pts-next { display: none; }
  .pc-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .pc-st { padding: 8px 4px; }
  .pc-st b { font-size: 0.98rem; }
}
