@import url("/wp-content/themes/bigboom/css/rfj-red-swatches.css?v=1787855429");

#toast-container {
    position: fixed;
    z-index: 99999;
    width: 100%;
    pointer-events: none;
}

/* PC 端默认右上角 */
@media (min-width: 769px) {
    #toast-container {
        top: 20px;
        right: 20px;
        width: auto;
    }
}

/* 移动端底部居中 */
@media (max-width: 768px) {
    #toast-container {
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
}

.toast {
    display: inline-block;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 14px;
    margin: 6px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% {opacity:0; transform: translateY(20px);}
    10% {opacity:1; transform: translateY(0);}
    90% {opacity:1; transform: translateY(0);}
    100% {opacity:0; transform: translateY(-20px);}
}


/* ---------------- PC / 移动端基础样式 ---------------- */
#modern-comments { max-width: 800px; margin:0 auto; color:var(--rfj-text-primary); font-family: sans-serif; }

/* 评论卡片 */
.comment-card, .comment-reply-card { background:#fff; border-radius:8px; padding:12px 16px; margin-bottom:12px; transition: all 0.3s ease; }
.comment-card.pending, .comment-reply-card.pending { background:#f5f5f5; border-left:3px solid #ccc; color:var(--rfj-text-tertiary); font-style:italic; }
.comment-content { font-size:14px; line-height:1.6; margin-bottom:8px; word-break:break-word; }

/* 作者高亮 */
.author-reply { background:#f5f8fa; border-left:3px solid #1da1f2; padding:8px 12px; border-radius:6px; font-size:13px; color:var(--rfj-text-secondary); }

/* 评论操作 */
.comment-actions { display:flex; align-items:center; gap:12px; font-size:13px; }
.btn-like { border:none; background:transparent; cursor:pointer; color:var(--rfj-text-tertiary); display:inline-flex; align-items:center; gap:4px; position:relative; overflow:visible; }
.btn-like.liked { color:var(--rfj-red-e0245e); }
.btn-like.liked .rfj-svg-icon { animation:like-bounce 0.3s ease; }
@keyframes like-bounce {0%{transform:scale(1);}30%{transform:scale(1.4);}60%{transform:scale(0.9);}100%{transform:scale(1);}}

/* 点赞爆炸动画 */
.like-burst { position:absolute; top:50%; left:50%; width:6px; height:6px; background:var(--rfj-red-e0245e); border-radius:50%; opacity:0; pointer-events:none; animation:burst 0.6s ease forwards; }
@keyframes burst {0%{transform:scale(1) translate(-50%,-50%);opacity:1;}100%{transform:scale(5) translate(-50%,-50%);opacity:0;}}

/* 回复折叠 */
.expand-replies { background:none; border:none; cursor:pointer; color:var(--rfj-text-tertiary); font-weight:bold; padding:2px 0; }
.comment-reply-card { background:#f9f9f9; border-radius:6px; padding:8px 12px; margin-top:6px; font-size:13px; position:relative; opacity:0; transform:translateY(10px); transition:all 0.3s ease; }
.comment-reply-card::before { content:''; position:absolute; top:10px; left:-10px; width:8px; height:8px; background:#1da1f2; border-radius:50%; }
.replies-container { overflow:hidden; max-height:0; opacity:0; transition:max-height 0.3s ease, opacity 0.3s ease; }
.replies-container.open { max-height:1000px; opacity:1; }
.replies-container.open .comment-reply-card { opacity:1; transform:translateY(0); }

/* 评论表单（PC端） */
#comment-form { margin-top:20px; display:flex; flex-direction:column; gap:8px; }
#comment-form textarea { width:100%; min-height:60px; padding:8px 12px; border-radius:6px; border:1px solid #ccc; resize:vertical; font-size:14px; }
#comment-form button { align-self:flex-end; background:#999; color:#fff; border:none; padding:6px 16px; border-radius:6px; cursor:pointer; transition:background 0.2s ease; }
#comment-form button:hover { background:var(--rfj-red-b1191a); }
#comment-form textarea:not(:placeholder-shown) + button {background: var(--rfj-red-b1191a);}



/* 嵌入回复框 */
.reply-form { margin-top:8px; padding:8px; border:1px solid #e5e5e5; border-radius:8px; background:#fafafa; }
.reply-form .reply-content { width:100%; min-height:60px; resize:vertical; padding:6px 10px; border:1px solid #ddd; border-radius:6px; font-size:14px; line-height:1.4; outline:none; }
.reply-form .reply-content:focus { border-color:var(--rfj-red-legacy-brand); box-shadow:0 0 4px rgba(64,158,255,0.3); }
.reply-form .reply-actions { margin-top:6px; text-align:right; }
.reply-form .submit-reply { padding:4px 12px; font-size:13px; background:var(--rfj-red-legacy-brand); color:#fff; border:none; border-radius:4px; cursor:pointer; transition:background 0.2s; }
.reply-form .submit-reply:hover { background:var(--rfj-red-b01818); }

/* 增强主评论框焦点效果 */
#comment-content:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    outline: none;
    transform: translateY(-1px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 移动端底部回复框的焦点样式 */
#mobile-reply-form textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0);
    outline: none;
}

/* 回复框的焦点样式 */
.reply-form .reply-content:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0);
    outline: none;
}

/* 为所有输入框添加一致的过渡效果 */
#comment-content,
#mobile-reply-form textarea,
.reply-form .reply-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e1e1e1;
}

#comment-content:focus,
#mobile-reply-form textarea:focus,
.reply-form .reply-content:focus {
    border-width: 2px;
    border-color: #007bff;
}
/* 聚焦时的脉动效果 */
@keyframes input-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.comment-input-highlight {
    animation: comment-highlight 1.2s ease-out;
}

#mobile-reply-form {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

#mobile-reply-form.is-open {
    display: flex;
}

body.rfj-mobile-comment-open {
    overflow: hidden;
}

.mobile-reply-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.mobile-reply-sheet {
    position: relative;
    display: flex;
    width: 100%;
    max-height: min(86vh, 640px);
    max-height: min(86dvh, 640px);
    min-height: min(58vh, 420px);
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.22);
}

.mobile-reply-handle {
    width: 42px;
    height: 4px;
    margin: 10px auto 4px;
    border-radius: 999px;
    background: #d0d5dd;
}

.mobile-reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid #eef1f5;
}

.mobile-reply-header h3 {
    margin: 0;
    color: var(--rfj-text-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.mobile-reply-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: var(--rfj-text-secondary);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.mobile-reply-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 16px;
    overflow-y: auto;
}

#mobile-reply-form textarea {
    display: block;
    width: 100%;
    min-height: 190px;
    max-height: 38vh;
    max-height: 38dvh;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #f9fafb;
    color: var(--rfj-text-primary);
    font-size: 16px;
    line-height: 1.55;
    resize: none;
}

#mobile-reply-form textarea:focus {
    border-color: var(--rfj-red-legacy-brand);
    outline: none;
    box-shadow: 0 0 0 3px var(--rfj-red-legacy-brand-da442c);
}

.mobile-reply-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #eef1f5;
    background: #fff;
}

#mobile-reply-form .mobile-reply-cancel,
#mobile-reply-form #mobile-submit-reply {
    min-width: 84px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

#mobile-reply-form .mobile-reply-cancel {
    background: #f2f4f7;
    color: var(--rfj-text-secondary);
}

#mobile-reply-form #mobile-submit-reply {
    background: var(--rfj-red-legacy-brand);
    color: #fff;
}

#mobile-reply-form #mobile-submit-reply:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (min-width: 769px) {
    #mobile-reply-form {
        display: none !important;
    }
}

@supports (height: 100dvh) {
    .mobile-reply-sheet {
        max-height: min(86dvh, 640px);
    }
}

/* PC / 移动端切换 */
@media (max-width:768px){
    .reply-form { display:none; }
}
/* 加载更多按钮 */
#load-more-comments { display:block; margin:12px auto; padding:6px 16px; border:none; border-radius:6px; background:#f0f0f0; cursor:pointer; }
