/* ...existing code... */
:root{
    --bg1: #ffe6ff;
    --bg2: #e6f7ff;
    --accent: #a27bff;
    --glass: rgba(255,255,255,0.18);
    --muted: #6b6b7a;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
    margin:0;
    font-family:"Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Microsoft Yahei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
    background: linear-gradient(135deg,var(--bg1),var(--bg2));
    color:#222;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    overflow-y:auto;
    /* ensure body is at least viewport height so fixed background stays behind content */
    min-height:100vh;
}

/* dreamy background shapes */
.sky{
    position:fixed;
    inset:0;
    /* send background shapes behind content to avoid accidental overlap */
    z-index:-1;
    pointer-events:none;
    overflow:hidden;
}
.cloud{
    position:absolute;
    width:220px;
    height:100px;
    background:linear-gradient(180deg,#fff9ff,#fff);
    border-radius:60px;
    filter:blur(8px);
    opacity:0.85;
    transform:translateY(0);
}
.cloud:before,.cloud:after{
    content:"";
    position:absolute;
    background:inherit;
    width:140px;height:80px;border-radius:50%;
}
.cloud:before{left:-40px;top:10px}
.cloud:after{right:-30px;top:5px}
.cloud.c1{top:10%;left:5%;animation:float 20s linear infinite}
.cloud.c2{top:22%;left:60%;width:300px;height:120px;animation:float 25s linear infinite reverse;opacity:0.9}
.cloud.c3{top:60%;left:20%;width:180px;height:90px;animation:float 18s linear infinite}

@keyframes float{
    0%{transform:translateY(0) translateX(0)}
    50%{transform:translateY(-12px) translateX(6px)}
    100%{transform:translateY(0) translateX(0)}
}

/* container */
.wrap{
    position:relative;
    z-index:1;
    max-width:1100px;
    margin:48px auto;
    padding:28px;
}

header{
    display:flex;
    gap:20px;
    align-items:center;
    /* allow header items to wrap on narrow screens so they don't overlap */
    flex-wrap:wrap;
}
.avatar{
    width:96px;height:96px;border-radius:18px;
    background:linear-gradient(135deg,#ffd6f7,#dfe9ff);
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 6px 18px rgba(0,0,0,0.08);
    flex-shrink:0;
    border: 2px solid rgba(255,255,255,0.6);
}
.avatar img{width:70%;height:70%;object-fit:cover;border-radius:12px}

.title{
    display:flex;
    flex-direction:column;
    /* ensure title can shrink inside a flex row without forcing overflow */
    min-width:0;
}
.title h1{
    margin:0;font-size:28px;letter-spacing:0.6px;
}
.title p{
    margin:4px 0 0;color:var(--muted);
    font-size:14px;
}

/* social buttons */
.socials{
    margin-left:auto;
    display:flex;
    gap:10px;
    align-items:center;
}
.btn{
    display:inline-flex;
    gap:8px;
    align-items:center;
    padding:8px 12px;
    border-radius:10px;
    background:var(--glass);
    backdrop-filter:blur(6px);
    color:#222;text-decoration:none;font-weight:600;
    box-shadow: 0 6px 14px rgba(160,130,255,0.08);
    transition:transform .18s ease, box-shadow .18s ease, background .18s;
    border:1px solid rgba(255,255,255,0.4);
}
.btn:hover{transform:translateY(-4px);box-shadow:0 12px 30px rgba(160,130,255,0.12)}
.icon{width:20px;height:20px;display:inline-block}

main{
    margin-top:28px;
    display:grid;
    /* keep a flexible main column and a constrained sidebar that won't force overlap
       minmax ensures the sidebar can shrink but won't disappear entirely */
    grid-template-columns: 1fr minmax(240px,320px);
    gap:22px;
    align-items:start;
    /* ensure rows can shrink properly when content is constrained */
    grid-auto-rows: minmax(0, auto);
}

/* posts list */
.posts{
    display:flex;
    flex-direction:column;
    gap:14px;
}
.card{
    background:linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45));
    border-radius:14px;
    padding:16px;
    box-shadow:0 10px 30px rgba(140,110,200,0.06);
    border:1px solid rgba(255,255,255,0.6);
    /* ensure cards stack with vertical spacing to avoid overlap */
    margin:0 0 14px 0;
}
.post-title{margin:0;font-size:18px}
.post-meta{margin-top:8px;color:var(--muted);font-size:13px}

/* sidebar */
aside .search{
    display:flex;
    gap:8px;
    margin-bottom:12px;
}
input[type="search"]{
    flex:1;padding:10px 12px;border-radius:10px;border:1px solid rgba(0,0,0,0.06);
    outline:none;background:rgba(255,255,255,0.75);
    font-size:14px;
}
.follow-card{
    display:flex;flex-direction:column;gap:10px;align-items:center;text-align:center;
    padding:18px;
    /* make sure follow-card takes full width of its column and doesn't float */
    width:100%;
}

footer{
    margin-top:36px;color:var(--muted);font-size:13px;text-align:center;
}

/* responsive */
@media (max-width:880px){
    main{grid-template-columns:1fr}
    .socials{margin-left:0}
}

/* 搜索高亮样式 */
mark{
    background:rgba(162,123,255,0.25);
    padding:0 3px;
    border-radius:3px;
}
/* prevent cards and post list from forcing overflow/overlap inside flex/grid children */
.posts, .card{min-width:0}
/* ...existing code... */