/* profile.css — 资料页、朋友圈、群资料 */
.profile-screen { background: var(--profile-bg); }
.profile-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 2;
}
.profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 16px 18px;
}
.profile-hero .avatar-lg { width: 72px; height: 72px; font-size: 28px; pointer-events: none; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-meta { color: var(--sub); font-size: 13px; margin-top: 6px; }
.profile-menu { border-top: 1px solid var(--profile-line); }
/* 资料菜单：无副标题时标题垂直居中；图标/文字统一白色 */
.profile-screen .profile-menu .row {
    min-height: 52px;
    padding: 14px 16px;
    align-items: center;
}
.profile-screen .profile-menu .row .d { display: none; }
.profile-screen .profile-menu .row .t {
    color: var(--text);
    line-height: 1.25;
    margin: 0;
}
.group-members-panel {
    padding: 18px 12px 8px;
    border-bottom: 1px solid var(--line);
}
.group-members-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 10px;
}
.group-member-cell {
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.group-member-av,
.group-member-cell .avatar,
.group-member-cell .avatar-fallback {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
}
.group-member-name {
    width: 100%;
    font-size: 12px;
    color: var(--sub);
    text-align: center;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-row-val {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sub);
    font-size: 13px;
    margin-right: 4px;
}
.profile-screen .profile-menu .row.danger .t { color: var(--red); }
.dialog .field { margin: 12px 0 4px; }
.dialog .field input,
.dialog .field textarea {
    width: 100%;
    box-sizing: border-box;
}
.profile-screen .profile-menu .ico {
    color: var(--text);
}
.profile-screen .profile-menu .chev {
    color: var(--profile-chev);
}

/* ===== 个人资料页（左滑进入） ===== */
.nav-stage > .profile-list-underlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    transform: translateX(100%);
    will-change: transform;
}
.nav-stage > .profile-screen-underlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    transform: translateX(-100%);
    will-change: transform;
}
.nav-stage > .list-screen {
    z-index: 1;
    will-change: transform;
}
.nav-stage > .me-profile-screen {
    z-index: 1;
    will-change: transform;
}
.me-profile-screen {
    background: var(--profile-bg);
    position: relative;
    overflow: hidden;
}
.me-profile-cover-hit {
    position: relative;
    width: 100%;
    height: 220px;
    z-index: 2;
    padding: 0;
    display: block;
    border: none;
    background: none;
    cursor: pointer;
}
.me-profile-cover-hit-preview {
    cursor: default;
}
.me-profile-cover-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 6;
    background: linear-gradient(180deg, rgba(0, 0, 0, .42), transparent);
    color: #fff;
}
.me-profile-cover-nav .nav-text-btn { color: #fff; }
.me-profile-cover-nav .nav-text-btn.ok { color: var(--accent); font-weight: 600; }
[data-theme="light"] .me-profile-cover-nav {
    background: linear-gradient(180deg, rgba(255, 255, 255, .72), transparent);
    color: var(--text);
}
[data-theme="light"] .me-profile-cover-nav .nav-text-btn { color: var(--text); }
[data-theme="light"] .me-profile-cover-nav .nav-text-btn.ok { color: var(--accent); }
.me-profile-cover-gestures {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: grab;
    touch-action: none;
}
.me-profile-cover-gestures:active { cursor: grabbing; }
.me-profile-previewing .moments-junction,
.me-profile-previewing .moments-body {
    pointer-events: none;
    opacity: .35;
}
.me-profile-cover {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.me-profile-cover-inner {
    width: 100%;
    height: 100%;
    will-change: transform;
    overflow: hidden;
    position: relative;
}
.me-profile-cover-fallback {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 90% 80% at 50% 0%, var(--accent-soft), transparent 70%),
        linear-gradient(160deg, var(--accent) 0%, var(--bg2) 100%);
}
.me-profile-cover-img {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    pointer-events: none;
    max-width: none;
}
.me-profile-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}
.me-profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 16px 14px;
    margin-top: 0;
}
.me-profile-hero-av {
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
    line-height: 0;
    border: 3px solid var(--profile-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.me-profile-hero-av .avatar-lg {
    width: 72px;
    height: 72px;
    font-size: 28px;
}
.me-profile-hero-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    padding: 6px 0 0;
}
.me-profile-hero-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    color: var(--text);
    opacity: .82;
}
.me-profile-hero-back svg {
    width: 22px;
    height: 22px;
    transform: scaleX(-1);
}
.me-profile-hero-back:active {
    opacity: .55;
}
.me-profile-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    padding: 0;
    color: var(--text);
}
.me-profile-name-input {
    width: 100%;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: var(--input);
    color: var(--text);
    outline: none;
}
.me-profile-hero .list-status {
    margin-top: 6px;
    font-size: 12px;
}
.me-profile-section {
    border-top: 1px solid var(--profile-line);
    padding: 0 0 8px;
}
.me-profile-sec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border-top: 1px solid var(--profile-line);
    border-bottom: 1px solid var(--profile-line);
    text-align: left;
}
.me-profile-sec-chev {
    color: var(--sub);
    font-size: 18px;
    line-height: 1;
}
.me-profile-sec-hd {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.me-profile-sec-hd-static {
    padding: 14px 16px 8px;
    color: var(--sub);
}
.me-profile-scroll-pad { height: calc(56px + env(safe-area-inset-bottom, 0px)); }
.me-profile-bar {
    position: absolute;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    background: none;
    border: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.me-profile-bar.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}
.me-profile-bar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    color: var(--icon);
    padding: 0;
    background: none;
    border: none;
}
.me-profile-bar-btn svg { width: 21px; height: 21px; }
.me-profile-bar-btn:active { color: var(--accent); opacity: .85; }

.friend-list { padding-bottom: 4px; }
.friend-letter {
    padding: 6px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sub);
    background: var(--bg2);
}
.friend-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.friend-row .avatar,
.friend-row .avatar-fallback {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
}
.friend-name {
    font-size: 16px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 好友资料页底部操作 */
.friend-profile-screen .profile-body {
    display: flex;
    flex-direction: column;
}
.friend-profile-screen .profile-menu { flex-shrink: 0; }
.profile-actions {
    margin-top: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profile-act-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    background: var(--input);
    color: var(--text);
    border: 1px solid var(--line);
}
.profile-act-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.profile-act-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
[data-theme="light"] .profile-act-btn.primary { color: #fff; }
.profile-act-btn:active { opacity: .85; }

/* 朋友圈子页（用户） */
.user-moments-screen {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.moments-scroll {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.user-moments-screen .moments-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.moments-top {
    position: relative;
}
.moments-cover-wrap {
    position: relative;
    height: 220px;
}
.moments-cover-hit {
    display: block;
    width: 100%;
    height: 220px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    overflow: visible;
}
.moments-cover-wrap .me-profile-cover-hit {
    height: 100%;
}
.moments-cover-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 6px 0;
    background: none;
    border: none;
    color: #fff;
    pointer-events: none;
}
.moments-cover-nav .nav-back,
.moments-cover-nav .moments-camera-btn {
    pointer-events: auto;
    color: #fff;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5));
}
.moments-junction {
    position: relative;
    height: 36px;
    margin-top: -36px;
    padding-right: 48px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    z-index: 4;
    pointer-events: none;
}
.moments-junction-av {
    position: relative;
    pointer-events: auto;
    padding: 0;
    border-radius: 50%;
    line-height: 0;
    border: 1.5px solid var(--card-blue);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
    margin-bottom: -36px;
    overflow: visible;
}
.moments-junction-av .avatar-lg {
    width: 72px;
    height: 72px;
    font-size: 28px;
}
.moments-av-stars {
    position: absolute;
    /* 可见星心在 40px 盒内偏上（重心约 20,18）。right/bottom -11px 时，重心落在 1.5px 圆环上 */
    right: -11px;
    bottom: -11px;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 2;
}
.moments-av-star {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232b57c6' stroke='%232b57c6' stroke-width='1' stroke-linejoin='round' d='M12 7C12 8.6 9.4 11 8 11C9.4 11 12 13.4 12 15C12 13.4 14.6 11 16 11C14.6 11 12 8.6 12 7Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    animation:
        moments-star-float-a 3.4s ease-in-out infinite,
        moments-star-twinkle-a 2.6s ease-in-out infinite;
}
.moments-av-star-sm {
    position: absolute;
    right: -19px;
    bottom: 8px;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 3;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232b57c6' stroke='%232b57c6' stroke-width='1' stroke-linejoin='round' d='M12 7C12 8.6 9.4 11 8 11C9.4 11 12 13.4 12 15C12 13.4 14.6 11 16 11C14.6 11 12 8.6 12 7Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    animation:
        moments-star-float-b 4.6s ease-in-out infinite,
        moments-star-twinkle-b 3.5s ease-in-out infinite;
    animation-delay: -0.6s, -1.1s;
}
@keyframes moments-star-float-a {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes moments-star-float-b {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
@keyframes moments-star-twinkle-a {
    0%, 100% { filter: brightness(0.76) saturate(0.92); }
    42% { filter: brightness(0.9) saturate(1.02); }
    68% { filter: brightness(0.82) saturate(0.96); }
}
@keyframes moments-star-twinkle-b {
    0%, 100% { filter: brightness(1) saturate(1) hue-rotate(0deg); }
    28% { filter: brightness(1.22) saturate(1.08) hue-rotate(0deg); }
    52% { filter: brightness(0.94) saturate(0.96) hue-rotate(0deg); }
    74% { filter: brightness(1.1) saturate(1.04) hue-rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
    .moments-av-star,
    .moments-av-star-sm {
        animation: none;
    }
}
.moments-body {
    min-height: calc(100dvh - 200px);
    padding-top: 44px;
}
.moments-empty {
    margin: 28px 16px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--sub);
    font-size: 14px;
    line-height: 1.6;
}
.moments-empty::before,
.moments-empty::after {
    content: "";
    width: 2em;
    height: 1px;
    background: currentColor;
    flex: none;
}
.moments-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 16px 28px;
}
.moments-post {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* 好友朋友圈子页 */
.moments-screen { background: var(--profile-bg); }
.moments-feed { min-height: 100%; }
.moments-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--profile-line);
}
.moments-head .avatar,
.moments-head .avatar-fallback {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
}
.moments-head-name {
    font-size: 16px;
    font-weight: 600;
}

[data-theme="light"] .moments-av-star,
[data-theme="light"] .moments-av-star-sm {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23A8956B' stroke='%23A8956B' stroke-width='1' stroke-linejoin='round' d='M12 7C12 8.6 9.4 11 8 11C9.4 11 12 13.4 12 15C12 13.4 14.6 11 16 11C14.6 11 12 8.6 12 7Z'/%3E%3C/svg%3E");
}
