/* ============================================================
   个人中心页面 - profile.css
   原创设计：用户头卡 + 分组设置列表
   与moban3的独立卡片堆叠布局完全不同
   ============================================================ */

/* ====== 用户信息卡片 ====== */
.pf-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 30px;
    background: linear-gradient(135deg, #7C6CF0, #6C5CE7);
    border-radius: var(--radius-lg);
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    animation: fadeUp .3s var(--ease-out) both;
}

.pf-hero::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}

.pf-hero::before {
    content: '';
    position: absolute;
    right: 50px;
    top: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    pointer-events: none;
}

.pf-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.3);
}

.pf-avatar svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pf-user-info {
    flex: 1;
    min-width: 0;
}

.pf-email {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-uid {
    font-size: 12px;
    color: rgba(255,255,255,.7);
}

.pf-balance-box {
    text-align: right;
    flex-shrink: 0;
}

.pf-balance-val {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.pf-balance-unit {
    font-size: 13px;
    color: rgba(255,255,255,.7);
    margin-left: 4px;
}

.pf-balance-label {
    font-size: 11px;
    color: rgba(255,255,255,.6);
    margin-top: 2px;
}

/* ====== 设置区块 ====== */
.pf-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--divider);
    margin-bottom: 16px;
    overflow: hidden;
    animation: fadeUp .3s var(--ease-out) .05s both;
}

.pf-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
}

.pf-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pf-section-icon svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pf-section-icon.icon-pwd {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
}

.pf-section-icon.icon-notify {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
}

.pf-section-icon.icon-reset {
    background: linear-gradient(135deg, #F87171, #EF4444);
}

.pf-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.pf-section-body {
    padding: 18px 20px;
}

/* ====== 表单 ====== */
.pf-form-row {
    margin-bottom: 14px;
}

.pf-form-row:last-child {
    margin-bottom: 0;
}

.pf-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.pf-form-input {
    width: 100%;
    max-width: 420px;
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-alt);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.pf-form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,92,231,.1);
}

.pf-form-input.is-invalid {
    border-color: #EF4444;
    background: rgba(239,68,68,.03);
}

.pf-form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.pf-form-input::placeholder {
    color: var(--text-muted);
}

.pf-form-error {
    font-size: 12px;
    color: #EF4444;
    margin-top: 4px;
    animation: fadeUp .2s var(--ease-out) both;
}

.pf-form-success {
    font-size: 13px;
    color: #10B981;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(16,185,129,.08);
    border-radius: var(--radius-sm);
    animation: fadeUp .2s var(--ease-out) both;
}

/* ====== 按钮 ====== */
.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 22px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
    margin-top: 16px;
}

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

.pf-btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.pf-btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.pf-btn-danger {
    background: rgba(239,68,68,.1);
    color: #EF4444;
}

.pf-btn-danger:hover {
    background: rgba(239,68,68,.18);
}

.pf-btn-danger:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ====== 通知开关行 ====== */
.pf-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--divider);
}

.pf-switch-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pf-switch-row:first-child {
    padding-top: 0;
}

.pf-switch-label {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.pf-switch-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 开关组件 */
.pf-toggle {
    position: relative;
    width: 46px;
    height: 26px;
    background: rgba(120,120,128,.2);
    border-radius: 13px;
    cursor: pointer;
    transition: background .25s;
    flex-shrink: 0;
}

.pf-toggle.active {
    background: var(--accent);
}

.pf-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    transition: left .25s var(--ease-out);
}

.pf-toggle.active::after {
    left: 23px;
}

/* ====== 警告提示 ====== */
.pf-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(245,158,11,.06);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.pf-warning-icon {
    width: 18px;
    height: 18px;
    stroke: #F59E0B;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    margin-top: 1px;
}

.pf-warning-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ====== 确认弹窗 ====== */
.pf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    animation: fadeIn .15s;
}

.pf-confirm {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    max-width: calc(100% - 32px);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    z-index: 9001;
    animation: scaleIn .2s var(--ease-out) both;
}

.pf-confirm-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 22px 22px 8px;
}

.pf-confirm-msg {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 0 22px 20px;
    line-height: 1.6;
}

.pf-confirm-actions {
    display: flex;
    border-top: 1px solid var(--divider);
}

.pf-confirm-btn {
    flex: 1;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    transition: background .15s;
}

.pf-confirm-btn:first-child {
    border-right: 1px solid var(--divider);
    border-bottom-left-radius: var(--radius-lg);
    color: var(--text-secondary);
}

.pf-confirm-btn:first-child:hover {
    background: var(--surface-alt);
}

.pf-confirm-btn:last-child {
    border-bottom-right-radius: var(--radius-lg);
    color: #EF4444;
}

.pf-confirm-btn:last-child:hover {
    background: rgba(239,68,68,.05);
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .pf-hero {
        flex-wrap: wrap;
        padding: 20px;
        gap: 14px;
    }

    .pf-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .pf-balance-box {
        width: 100%;
        text-align: left;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,.15);
    }

    .pf-balance-val {
        font-size: 24px;
    }

    .pf-section-body {
        padding: 16px;
    }

    .pf-form-input {
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .pf-hero {
        padding: 16px;
    }

    .pf-balance-val {
        font-size: 22px;
    }

    .pf-email {
        font-size: 14px;
    }
}
