* { margin: 0; padding: 0; box-sizing: border-box; }

/* 保证 hidden 属性生效（避免被 display 覆盖） */
[hidden] { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f6f6f8;
    color: #333;
    min-height: 100vh;
}

/* ====== 顶部导航 ====== */
.p-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #ececf0;
}
.p-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}
.p-brand img { width: 26px; height: 26px; border-radius: 4px; }
.p-nav-actions { display: flex; align-items: center; gap: 16px; }
.p-link {
    color: #666;
    font-size: 14px;
    text-decoration: none;
}
.p-link:hover { color: #333; }
.p-btn {
    padding: 6px 14px;
    border: 1px solid #e2e2e6;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
}
.p-btn:hover { border-color: #c8c8d0; color: #333; }

/* ====== 布局 ====== */
.p-layout {
    display: flex;
    max-width: 1080px;
    margin: 0 auto;
    padding: 72px 20px 40px;
    gap: 20px;
}

/* ====== 左侧导航 ====== */
.p-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 10px;
    padding: 16px 12px;
    align-self: flex-start;
    position: sticky;
    top: 76px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.p-side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 16px;
    border-bottom: 1px solid #f0f0f4;
    margin-bottom: 12px;
}
.p-side-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}
.p-side-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p-menu { display: flex; flex-direction: column; gap: 2px; }
.p-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
}
.p-menu-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.p-menu-item:hover { background: #f5f5f8; color: #333; }
.p-menu-item.active {
    background: #eef1fa;
    color: #4a6cbd;
    font-weight: 500;
}

/* ====== 右侧主体 ====== */
.p-main {
    flex: 1;
    min-width: 0;
}
.p-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.p-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}
.p-edit-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    background: #4a6cbd;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: opacity .15s;
}
.p-edit-btn:hover { opacity: .85; }

/* 卡片 */
.p-card {
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* 头像区 */
.p-avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f4;
}
.p-avatar-wrap { flex-shrink: 0; }
.p-avatar {
    display: block;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}
.p-avatar-btn {
    display: block;
    margin: 8px auto 0;
    border: none;
    background: none;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
}
.p-avatar-btn:hover { color: #4a6cbd; }
.p-user-block { min-width: 0; }
.p-name { font-size: 18px; font-weight: 600; color: #333; }
.p-tip {
    min-height: 20px;
    font-size: 13px;
    color: #2f9e6e;
    margin-top: 4px;
}

/* 信息列表 */
.p-info-list { margin-top: 8px; }
.p-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f8;
}
.p-info-row:last-child { border-bottom: none; }
.p-label { color: #999; font-size: 13px; flex-shrink: 0; }
.p-value { color: #444; word-break: break-all; text-align: right; }
.p-value.qq-badge {
    padding: 2px 8px;
    border-radius: 4px;
    background: #f0f6ff;
    color: #4a6cbd;
    font-size: 12px;
}
.p-mini-btn {
    padding: 5px 12px;
    border: 1px solid #e2e2e6;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
}
.p-mini-btn:hover { border-color: #c8c8d0; color: #333; }

/* 空状态（收藏页预留） */
.p-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 20px;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 10px;
    color: #b0b0b8;
}
.p-empty svg { width: 48px; height: 48px; }
.p-empty p { font-size: 14px; }

/* 收藏音乐列表 */
.music-fav-list {
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 10px;
    padding: 4px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.music-fav-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 8px;
    transition: background .15s;
}
.music-fav-row:hover { background: #f7f7fa; }
.music-fav-cover {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}
.music-fav-main { flex: 1; min-width: 0; }
.music-fav-name {
    font-size: 14px; font-weight: 600; color: #222;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-fav-sub {
    font-size: 12px; color: #999; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-fav-tag {
    display: inline-block;
    font-size: 10px; line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: 1px;
}
.music-fav-dur { font-size: 12px; color: #aaa; flex-shrink: 0; }
.music-fav-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #666;
    transition: all .15s;
    cursor: pointer;
    flex-shrink: 0;
}
.music-fav-btn:hover { background: #f0f0f3; color: #ff2e63; }
.music-fav-btn svg { width: 16px; height: 16px; }

html[data-theme="dark"] .music-fav-list {
    background: #232329;
    border-color: #34343a;
}
html[data-theme="dark"] .music-fav-row:hover { background: #2a2a32; }
html[data-theme="dark"] .music-fav-name { color: #eee; }
html[data-theme="dark"] .music-fav-sub { color: #888; }
html[data-theme="dark"] .music-fav-dur { color: #666; }
html[data-theme="dark"] .music-fav-btn { color: #999; }
html[data-theme="dark"] .music-fav-btn:hover { background: #33333b; color: #ff5c7a; }

/* ====== 收藏图片画廊 ====== */
.img-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.img-tab {
    padding: 5px 16px;
    font-size: 13px;
    border: 1px solid #e5e5ea;
    border-radius: 999px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}
.img-tab:hover { color: #ff2e63; border-color: #ffd7e0; }
.img-tab.active {
    background: #ff2e63;
    border-color: #ff2e63;
    color: #fff;
}
.img-tab span { font-size: 12px; opacity: .8; }
.img-fav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.img-fav-grid.v {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.img-fav-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f3;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    transition: transform .15s;
}
.img-fav-grid.v .img-fav-card { aspect-ratio: 9 / 16; }
.img-fav-card:hover { transform: translateY(-2px); }
.img-fav-photo {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.img-fav-badge {
    position: absolute;
    top: 8px; left: 8px;
    font-size: 10px; line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 46, 99, 0.92);
    color: #fff;
}
.img-fav-actions {
    position: absolute;
    right: 8px; bottom: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity .15s;
}
.img-fav-card:hover .img-fav-actions,
.img-fav-card.is-default .img-fav-actions { opacity: 1; }
.img-fav-act {
    width: 28px; height: 28px;
    border: none; border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .15s;
}
.img-fav-act svg { width: 14px; height: 14px; }
.img-fav-act:hover { background: rgba(255, 46, 99, 0.85); }
.img-fav-card.is-default .img-fav-act[data-act="default"] {
    background: rgba(255, 46, 99, 0.9);
    color: #fff;
}
html[data-theme="dark"] .img-fav-card { background: #2a2a32; }
html[data-theme="dark"] .img-tab { background: #26262d; border-color: #3a3a44; color: #999; }
html[data-theme="dark"] .img-tab:hover { color: #ff5c7a; border-color: #5a3340; }
html[data-theme="dark"] .img-tab.active { background: #ff2e63; border-color: #ff2e63; color: #fff; }

/* ====== 账号设置 ====== */
.p-settings-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    padding: 4px 0 14px;
    border-bottom: 1px solid #f0f0f3;
    margin-bottom: 16px;
}
.p-avatar-row {
    display: flex;
    align-items: center;
    gap: 18px;
}
.p-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ececf0;
    background: #f5f5f7;
    flex-shrink: 0;
}
.p-avatar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.p-hint-text {
    font-size: 12px;
    color: #b0b0b8;
}
.bind-email-hint {
    padding: 2px 4px 0;
}
/* 危险操作按钮 */
.p-mini-btn.danger {
    color: #e74c3c;
    border-color: #f0c4bd;
}
.p-mini-btn.danger:hover {
    color: #fff;
    background: #e74c3c;
    border-color: #e74c3c;
}
.danger-btn {
    background: #e74c3c !important;
}
.danger-btn:hover { opacity: .85; }
html[data-theme="dark"] .p-mini-btn.danger {
    color: #ff7a6b;
    border-color: #5a3535;
}
html[data-theme="dark"] .p-mini-btn.danger:hover {
    color: #fff;
    background: #e74c3c;
}
/* 注销账号弹窗 */
.del-warn {
    font-size: 13px;
    line-height: 1.7;
    color: #e67e22;
    background: #fdf3e7;
    border: 1px solid #f5e0c8;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
}
.del-or {
    font-size: 12px;
    color: #aaa;
    flex-shrink: 0;
}
html[data-theme="dark"] .del-warn {
    color: #f0a45a;
    background: #2a2419;
    border-color: #4a3d28;
}

/* ====== 字体选择 ====== */
.p-font-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 6px;
}
.p-font-item {
    position: relative;
    padding: 14px 12px;
    border: 1px solid #e6e6ea;
    border-radius: 8px;
    background: #fafafc;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.p-font-item:hover { border-color: #c9c9d4; background: #f5f5f9; }
.p-font-item.active {
    border-color: #4a6cbd;
    background: #f0f4fd;
    box-shadow: 0 2px 8px rgba(74, 108, 189, 0.12);
}
.p-font-item-name {
    font-size: 14px;
    color: #333;
    display: block;
    margin-bottom: 4px;
}
.p-font-item-desc {
    font-size: 11px;
    color: #a0a0a8;
    display: block;
}
.p-font-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a6cbd;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    display: none;
}
.p-font-item.active .p-font-check { display: block; }
html[data-theme="dark"] .p-font-item {
    background: #26262e !important;
    border-color: #3a3a44 !important;
}
html[data-theme="dark"] .p-font-item:hover { border-color: #4a4a56 !important; }
html[data-theme="dark"] .p-font-item.active {
    background: rgba(74, 108, 189, 0.16) !important;
    border-color: #4a6cbd !important;
}
html[data-theme="dark"] .p-font-item-name { color: #d4d4d8 !important; }
html[data-theme="dark"] .p-font-item-desc { color: #6e6e78 !important; }

/* ====== 编辑资料模态框 ====== */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
}
.modal-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 10px;
    padding: 28px 28px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e2e6;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.form-input:focus { border-color: #4a6cbd; }
.form-hint { font-size: 12px; color: #b0b0b8; margin-top: 5px; }
.pwd-email-row { display: flex; gap: 8px; }
.pwd-email-row .form-input { flex: 1; }
.pwd-code-btn { white-space: nowrap; flex-shrink: 0; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

/* ====== 深色模式 ====== */
html[data-theme="dark"] body {
    background: #17171c !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .p-navbar,
html[data-theme="dark"] .p-sidebar,
html[data-theme="dark"] .p-card,
html[data-theme="dark"] .p-empty {
    background: #1e1e25 !important;
    border-color: #2c2c34 !important;
}
html[data-theme="dark"] .p-brand,
html[data-theme="dark"] .p-name,
html[data-theme="dark"] .p-side-name,
html[data-theme="dark"] .p-title,
html[data-theme="dark"] .p-value { color: #d4d4d8 !important; }
html[data-theme="dark"] .p-link { color: #8b8b95 !important; }
html[data-theme="dark"] .p-link:hover,
html[data-theme="dark"] .p-avatar-btn:hover { color: #d4d4d8 !important; }
html[data-theme="dark"] .p-btn,
html[data-theme="dark"] .p-mini-btn {
    background: #26262e !important;
    border-color: #3a3a44 !important;
    color: #c8c8d0 !important;
}
html[data-theme="dark"] .p-btn:hover,
html[data-theme="dark"] .p-mini-btn:hover { color: #fff !important; }
html[data-theme="dark"] .p-menu-item { color: #8b8b95 !important; }
html[data-theme="dark"] .p-menu-item:hover { background: #26262e !important; color: #d4d4d8 !important; }
html[data-theme="dark"] .p-menu-item.active {
    background: rgba(74, 108, 189, 0.22) !important;
    color: #8faeff !important;
}
html[data-theme="dark"] .p-avatar-row,
html[data-theme="dark"] .p-info-row { border-bottom-color: #2c2c34 !important; }
html[data-theme="dark"] .p-label { color: #6e6e78 !important; }
html[data-theme="dark"] .p-avatar-btn { color: #8b8b95 !important; }
html[data-theme="dark"] .p-value.qq-badge {
    background: rgba(74, 108, 189, 0.18) !important;
    color: #8faeff !important;
}
html[data-theme="dark"] .p-empty { color: #5c5c66 !important; }
html[data-theme="dark"] .p-edit-btn { background: #4a6cbd !important; }
html[data-theme="dark"] .modal-mask { background: rgba(0, 0, 0, 0.55) !important; }
html[data-theme="dark"] .modal-box {
    background: #1e1e25 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}
html[data-theme="dark"] .modal-title { color: #d4d4d8 !important; }
html[data-theme="dark"] .form-input {
    background: #26262e !important;
    border-color: #3a3a44 !important;
    color: #d4d4d8 !important;
}
html[data-theme="dark"] .form-label { color: #8b8b95 !important; }
html[data-theme="dark"] .form-hint { color: #5c5c66 !important; }
html[data-theme="dark"] .p-settings-title { color: #8b8b95 !important; border-color: #2a2a32 !important; }
html[data-theme="dark"] .p-hint-text { color: #5c5c66 !important; }
html[data-theme="dark"] .p-avatar-preview { border-color: #2a2a32 !important; background: #26262e !important; }

/* ====== 移动端 ====== */
@media (max-width: 768px) {
    .p-layout { padding: 72px 12px 32px; gap: 12px; }
    .p-sidebar { width: 64px; padding: 14px 8px; }
    .p-side-user { justify-content: center; padding: 6px 0 14px; }
    .p-side-name { display: none; }
    .p-menu-item { justify-content: center; padding: 12px 0; }
    .p-menu-item span { display: none; }
    .p-card { padding: 18px; }
}
