/* =========================
   forum.css
========================= */

/* =========================
   TOPBAR
========================= */

.topbar{
    height:88px;
    background:white;

    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:0 20px;

    position:sticky;
    top:0;

    z-index:100;

    border-bottom:1px solid #eee;
}

.logo-link,
.topbar-avatar-link{
    color:inherit;
    text-decoration:none;
}

.logo{
    width:52px;
    height:52px;

    border-radius:16px;
    background:#ff8b6a;
    color:white;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:32px;
    font-weight:bold;

    flex-shrink:0;
}

.site-logo{
    width:64px;
    height:64px;
    border-radius:18px;
    object-fit:cover;
    display:block;
    box-shadow:none;
}

.nav{
    display:flex;
    align-items:center;
    gap:36px;

    font-size:18px;
    font-weight:600;

    white-space:nowrap;
}

.nav a{
    cursor:pointer;
    transition:0.2s;
    color:#222;
    text-decoration:none;
}

.nav a:hover{
    opacity:0.7;
}

.nav .active{
    color:#16213E;
    font-weight:bold;
}

.user-avatar{
    width:52px;
    height:52px;
    border-radius:50%;
    background:#fff;
    object-fit:cover;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:28px;
}

/* =========================
   LAYOUT
========================= */

#forum-page{
    background:#ffffff;
}

.container{
    width:100%;
    max-width:760px;
    margin:0 auto;
    padding:22px 16px 28px;
    box-sizing:border-box;
}

#forum-page .app{
    background:#ffffff;
}

.hot-section{
    background:#fff8ed;
    border-radius:30px;
    padding:22px;
    margin-bottom:18px;
    overflow:hidden;
    box-sizing:border-box;
    border:1px solid rgba(22,33,62,.06);
    box-shadow:0 18px 42px rgba(22,33,62,.08);
}

.hot-header{
    display:flex;
    justify-content:space-between;
    margin-bottom:18px;
}

.hot-title{
    font-size:20px;
    font-weight:bold;
    color:#ff8b6a;
}

.forum-note{
    display:none;
}

.empty-comments{
    padding:24px 8px;
    text-align:center;
    color:#888;
}

.hot-list{
    display:flex;
    flex-direction:column;
    gap:14px;
    width:100%;
}

.hot-item{
    background:white;
    border-radius:22px;
    padding:18px 20px;
    width:auto;
    border:none;
    box-sizing:border-box;

    display:flex;
    justify-content:space-between;
    align-items:center;

    font-size:18px;
    font-weight:600;

    transition:0.2s;
    overflow:hidden;
    color:#1c2333;
}

.hot-item:hover{
    transform:translateY(-2px);
}

.hot-item.active{
    background:#ffefe4;
    color:#ff7a59;
    box-shadow:inset 0 0 0 2px rgba(255,122,89,.24);
}

.hot-item-empty{
    min-height:60px;
    color:#9aa1af;
    background:linear-gradient(180deg, rgba(22,33,62,.035), rgba(22,33,62,.02));
    border:1px dashed rgba(22,33,62,.08);
    pointer-events:none;
    transform:none !important;
}

.hot-item-empty span{
    display:block;
    border-radius:999px;
    background:transparent;
}

.hot-item-empty span:first-child{
    width:auto;
    height:auto;
}

.hot-item-empty span:last-child{
    width:auto;
    height:auto;
}

.hot-item span:first-child{
    min-width:0;
}

.hot-item span:last-child{
    flex-shrink:0;
    margin-left:16px;
}

.posts-list{
    display:flex;
    flex-direction:column;
    gap:28px;
    padding:10px 6px 18px;
}

.feed-section{
    background:transparent;
    border-radius:0;
    padding:0;
    box-sizing:border-box;
    box-shadow:none;
}

/* =========================
   POST CARD
========================= */

.post-card{
    background:#ffffff;
    border-radius:30px;
    padding:22px;

    animation:cardEnter .45s cubic-bezier(.22,1,.36,1);
    overflow:hidden;
    border:1px solid rgba(22,33,62,.1);
    transform:translateY(0);
    box-shadow:0 18px 38px rgba(22,33,62,.09);
}

.post-header{
    display:flex;
    gap:14px;
    margin-bottom:18px;
}

.post-user-info{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:flex-start;
    gap:4px 8px;
}

.post-username{
    font-size:15px;
    font-weight:700;
    line-height:1.2;
}

.post-avatar{
    width:64px;
    height:64px;

    border-radius:50%;
    background:#fff;
    color:inherit;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:28px;
    font-weight:bold;
    object-fit:cover;
    border:1px solid rgba(22,33,62,.08);
}

.post-time{
    color:#a7adba;
    font-size:14px;
    line-height:1.2;
    width:100%;
}

.post-user-info .badge {
    order: 0;
}

.post-user-info .post-username {
    order: 1;
}

.post-user-info .post-time {
    order: 2;
}

.post-content{
    font-size:18px;
    line-height:1.7;
    white-space:pre-wrap;
}

.post-image{
    display:block;
    width:min(100%, 280px);
    aspect-ratio:1 / 1;
    max-height:280px;
    object-fit:cover;
    background:transparent;
    border-radius:20px;
    margin-top:16px;
}

.post-stats{
    border-top:1px solid #eee;
    padding-top:14px;
    margin-top:18px;

    display:flex;
    gap:28px;
}

.stat-btn{
    display:flex;
    align-items:center;
    gap:10px;
    padding:4px 2px;

    color:#777;
    cursor:pointer;
    transition:0.2s;
}

.stat-btn:hover{
    transform:scale(1.04);
}

.stat-btn svg{
    width:22px;
    height:22px;
}

/* =========================
   COMMENT SYSTEM（升级版）
========================= */

.comment{
    display:flex;
    gap:10px;
    padding:12px;
    align-items:flex-start;
}

/* ⭐ 头像压层（你刚要的效果） */
.comment .avatar{
    width:52px;
    height:52px;
    border-radius:50%;
    object-fit:cover;

    border:2px solid #fff;
    position:relative;
    z-index:2;
}

.comment-main{
    flex:1;
    display:flex;
    flex-direction:column;
    gap:6px;

    margin-left:-6px;
}

.comment-content{
    font-size:14px;
    line-height:1.4;
    color:#222;
}

/* =========================
   RIGHT ACTIONS
========================= */

.comment-right{
    display:flex;
    align-items:center;
    gap:10px;
    margin-left:auto;
}

/* 统一按钮 */
.action-btn{
    background:none;
    border:none;
    cursor:pointer;

    display:flex;
    align-items:center;
    gap:4px;

    color:#888;
    transition:all .2s ease;
}

/* =========================
   LIKE SVG STATE
========================= */

.like-btn.active{
    color:#ff4d4f;
}

.like-btn svg{
    transition:transform .2s ease;
}

.like-btn svg.pop{
    transform:scale(1.12);
}

/* ripple */
.like-btn{
    position:relative;
}

.like-btn.ripple::after{
    content:"";
    position:absolute;
    inset:-6px;
    border-radius:50%;
    border:2px solid #ff4d4f;

    animation:ripple .5s ease-out;
    opacity:0;
}

@keyframes ripple{
    0%{transform:scale(0.6);opacity:0.8;}
    100%{transform:scale(1.8);opacity:0;}
}

/* =========================
   PC REPLY ONLY
========================= */

.reply-btn{
    display:none;
}

@media (min-width:768px){
    .reply-btn{
        display:block;
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width:768px){

    .topbar{
        height:74px;
        padding:0 14px;
    }

    .nav{
        gap:14px;
        font-size:15px;
    }

    .logo{
        width:44px;
        height:44px;
        font-size:24px;
        border-radius:14px;
    }

    .site-logo{
        width:48px;
        height:48px;
        border-radius:14px;
    }

    .user-avatar{
        width:44px;
        height:44px;
        font-size:22px;
    }

    .container{
        padding:14px;
    }

    .hot-section{
        padding:16px;
        border-radius:22px;
    }

    .post-card{
        padding:16px;
        border-radius:22px;
    }

    .post-avatar{
        width:52px;
        height:52px;
        font-size:22px;
    }

    .author-name{
        font-size:17px;
    }

    .post-content{
        font-size:16px;
    }
}

/* =========================
   ANIMATION
========================= */

@keyframes cardEnter{
    from{
        opacity:0;
        transform:translateY(20px) scale(.98);
    }
    to{
        opacity:1;
        transform:translateY(0) scale(1);
    }
}
