/* ─── PC 个人中心 · 重构版（清晰层次 + 去臃肿 + 头像 spinner 修复） ───
   设计令牌全部来自 style.css :root（--bg-card / --border-light / --text-primary /
   --text-secondary / --bg-hover / --shadow-* / --radius-* / --brand-*）。 */

.pf-page { max-width: 920px; margin: 0 auto; padding: .5rem 0 2rem; }

/* 卡片基底：统一白底 + 细描边 + 轻投影，靠留白与层级营造秩序感 */
.pf-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-xl, 20px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06));
    margin-bottom: 1.25rem;
    overflow: hidden;
}

/* ── 身份卡 ── */
.pf-identity { position: relative; }
.pf-identity-accent {
    height: 6px;
    background: linear-gradient(90deg, var(--brand-500, #6366f1), var(--brand-700, #4f46e5) 60%, #7c3aed);
}
.pf-identity-main {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.6rem 1.8rem 1.4rem;
    flex-wrap: wrap;
}

/* 头像 + 上传悬浮层 + spinner（spinner 默认隐藏，靠 .is-show 显隐，修复永转 bug） */
.pf-avatar-wrap {
    position: relative;
    width: 84px; height: 84px;
    flex: 0 0 auto;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
}
.pf-avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand-500, #6366f1), var(--brand-700, #4f46e5));
    border: 3px solid #fff;
    box-shadow: var(--shadow-brand, 0 4px 14px rgba(99,102,241,.3));
    overflow: hidden; user-select: none;
}
.pf-avatar-lg { width: 72px; height: 72px; font-size: 1.8rem; }
.pf-avatar-edit {
    position: absolute; inset: 0; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: rgba(15,23,42,.55); color: #fff; font-size: .7rem; font-weight: 600;
    opacity: 0; transition: opacity .2s ease;
}
.pf-avatar-edit svg { width: 20px; height: 20px; }
.pf-avatar-wrap:hover .pf-avatar-edit,
.pf-avatar-wrap:focus-visible .pf-avatar-edit { opacity: 1; }
.pf-avatar-wrap:focus-visible { box-shadow: 0 0 0 4px rgba(99,102,241,.35); }

/* 🔧 修复：默认 display:none，仅 .is-show 时显示，绝不被 [hidden] 覆盖 */
.pf-avatar-spinner {
    position: absolute; inset: 0; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    background: rgba(15,23,42,.55);
}
.pf-avatar-spinner.is-show { display: flex; }
.spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pf-spin .8s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* 身份信息 */
.pf-identity-info { min-width: 180px; flex: 1 1 200px; }
.pf-identity-line1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pf-name { font-size: 1.5rem; font-weight: 800; color: var(--text-primary, #1f2937); line-height: 1.2; }
.pf-vip-badge { display: inline-flex; }
.pf-edit-btn { margin-left: .2rem; }
.pf-identity-sub { margin-top: .4rem; font-size: .85rem; color: var(--text-secondary, #6b7280); }

.pf-identity-actions { margin-left: auto; }

/* 数据条：上分割线 + 三等分 + 竖向分隔，二级层次 */
.pf-identity-stats {
    display: flex;
    border-top: 1px solid var(--border-light, #e5e7eb);
    padding: .9rem 1.8rem;
}
.pf-stat { flex: 1; text-align: center; position: relative; }
.pf-stat + .pf-stat::before {
    content: ''; position: absolute; left: 0; top: 18%; height: 64%;
    width: 1px; background: var(--border-light, #e5e7eb);
}
.pf-stat-v { font-size: 1.25rem; font-weight: 800; color: var(--text-primary, #1f2937); }
.pf-stat-l { font-size: .74rem; color: var(--text-secondary, #6b7280); margin-top: 2px; }

/* ── 会员中心 Tab 卡 ── */
.pf-member-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.6rem .6rem; flex-wrap: wrap;
}
.pf-member-title { font-size: 1.1rem; font-weight: 800; margin: 0; color: var(--text-primary, #1f2937); }
.pf-tabs {
    display: flex; gap: .25rem;
    background: var(--bg-hover, #f9fafb);
    padding: .3rem; border-radius: var(--radius-full, 9999px);
}
.pf-tab {
    border: none; background: transparent;
    padding: .45rem .95rem; border-radius: var(--radius-full, 9999px);
    font-size: .85rem; font-weight: 600; color: var(--text-secondary, #6b7280);
    cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.pf-tab:hover { color: var(--brand-700, #4f46e5); }
.pf-tab.is-active { background: #fff; color: var(--brand-700, #4f46e5); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.1)); }

.pf-member-body { padding: .6rem 1.6rem 1.5rem; }
.pf-recharge-balance { font-size: .9rem; color: var(--text-secondary, #6b7280); margin-bottom: .85rem; }
.pf-recharge-balance b { color: var(--brand-700, #4f46e5); font-size: 1.05rem; margin: 0 .15rem; }
.pf-panel { display: none; }
.pf-panel.is-active { display: block; animation: pf-fade .22s ease; }
@keyframes pf-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 扁平化 member-status 嵌套卡，避免「卡片里的卡片」双边框视觉噪音 */
.pf-member .member-status {
    background: transparent; border: none; box-shadow: none;
    padding: 0; margin: 0;
}

/* （已移除快捷操作栏：积分中心并入会员中心「积分充值」Tab；会员中心/退出登录与卡片、导航栏重复已去掉） */

/* ── 资料设置弹窗 ── */
.pf-modal-mask {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(20,22,40,.5);
    display: none; align-items: flex-start; justify-content: center;
    padding: 8vh 1rem 1rem;
}
.pf-modal-mask.is-open { display: flex; }
.pf-modal {
    width: 100%; max-width: 440px;
    background: #fff; border-radius: var(--radius-xl, 20px);
    box-shadow: var(--shadow-xl, 0 20px 40px rgba(0,0,0,.2));
    display: flex; flex-direction: column; max-height: 84vh; overflow: hidden;
}
.pf-modal-head {
    position: sticky; top: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.3rem; border-bottom: 1px solid var(--border-light, #e5e7eb); background: #fff;
}
.pf-modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.pf-modal-x {
    border: none; background: transparent; font-size: 1.1rem; cursor: pointer;
    color: var(--text-secondary, #6b7280); width: 32px; height: 32px; border-radius: var(--radius-sm, 8px);
}
.pf-modal-x:hover { background: var(--bg-hover, #f9fafb); }
.pf-modal-body { padding: 1.2rem 1.3rem; overflow-y: auto; }
.pf-modal-avatar {
    display: flex; flex-direction: column; align-items: center; gap: .6rem;
    margin-bottom: 1.1rem;
}
.pf-avatar-box {
    position: relative; width: 72px; height: 72px;
    border-radius: 50%; cursor: pointer;
}
.pf-modal-foot {
    position: sticky; bottom: 0;
    display: flex; gap: .75rem; padding: 1rem 1.3rem;
    border-top: 1px solid var(--border-light, #e5e7eb); background: #fff;
}
.pf-modal-foot .btn { flex: 1; }

/* ── 响应式：小屏降级，保持可读与层次 ── */
@media (max-width: 720px) {
    .pf-identity-main { padding: 1.3rem 1.1rem; gap: 1rem; }
    .pf-avatar-wrap, .pf-avatar { width: 68px; height: 68px; }
    .pf-avatar { font-size: 1.7rem; }
    .pf-name { font-size: 1.3rem; }
    .pf-identity-stats { padding: .8rem 1.1rem; }
    .pf-stat-v { font-size: 1.1rem; }
    .pf-identity-actions { margin-left: 0; width: 100%; }
    .pf-identity-actions .btn { width: 100%; }
    .pf-member-head, .pf-member-body { padding-left: 1.1rem; padding-right: 1.1rem; }
    .pf-tabs { width: 100%; overflow-x: auto; }
}

/* ── 会员开通收银台弹窗（hero「升级会员」点击弹出，与移动端一致） ── */
.pf-vip-mask {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(15, 23, 42, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.pf-vip-picker {
    width: 100%; max-width: 420px;
    background: #fff; border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, .25));
    overflow: hidden; animation: pfVipIn .18s ease-out;
}
@keyframes pfVipIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.pf-vip-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, var(--brand-500, #6366f1), var(--brand-700, #4f46e5));
    color: #fff;
}
.pf-vip-title { font-weight: 800; font-size: 1.05rem; }
.pf-vip-x {
    border: none; background: rgba(255, 255, 255, .15); color: #fff;
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.pf-vip-x:hover { background: rgba(255, 255, 255, .28); }
.pf-vip-body { padding: 1.1rem 1.2rem .4rem; }
.pf-vip-sub { margin: 0 0 .9rem; color: var(--text-secondary, #64748b); font-size: .9rem; }
.pf-vip-tiers { display: flex; flex-direction: column; gap: .7rem; }
.pf-vip-tier {
    display: flex; align-items: center; gap: .8rem;
    padding: .85rem .9rem; border: 1.5px solid #e5e7eb; border-radius: 12px;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.pf-vip-tier:hover { border-color: var(--brand-400, #818cf8); }
.pf-vip-tier:has(input:checked) { border-color: var(--brand-600, #5b54e8); background: #eef2ff; }
.pf-vip-tier input { accent-color: var(--brand-600, #5b54e8); width: 18px; height: 18px; flex-shrink: 0; }
.pf-vip-tier-main { flex: 1; min-width: 0; }
.pf-vip-tier-name { font-weight: 700; }
.pf-vip-tier-name::after {
    content: '最受欢迎'; font-size: .7rem; font-weight: 600;
    background: #fef3c7; color: #b45309; padding: 1px 6px; border-radius: 6px; margin-left: .5rem;
}
.pf-vip-tier:not(.is-pop) .pf-vip-tier-name::after { content: none; }
.pf-vip-tier-desc { font-size: .8rem; color: var(--text-secondary, #64748b); }
.pf-vip-tier-price { font-weight: 800; color: var(--brand-700, #4f46e5); white-space: nowrap; }
.pf-vip-tier-price small { font-weight: 500; color: var(--text-secondary, #64748b); }
.pf-vip-agree {
    display: flex; align-items: flex-start; gap: .5rem; margin-top: 1rem;
    font-size: .85rem; color: var(--text-secondary, #64748b); line-height: 1.5;
}
.pf-vip-agree input { margin-top: 2px; accent-color: var(--brand-600, #5b54e8); flex-shrink: 0; }
.pf-vip-agree a { color: var(--brand-700, #4f46e5); }
.pf-vip-foot {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: 1rem 1.2rem; border-top: 1px solid #f1f5f9; margin-top: .8rem;
}
.pf-vip-amount { font-size: .9rem; color: var(--text-secondary, #64748b); }
.pf-vip-amount b { font-size: 1.25rem; color: #0f172a; margin-left: .2rem; }
.pf-vip-foot .btn { min-width: 120px; }
