/**
 * 雅致青绿 - 问题修复样式 v2
 * 修复：移动端评论区、进度环、滚动、流云
 */

/* ===== 1. 修复移动端评论区不显示 ===== */
@media (max-width: 1024px) {
    .mobile-layout .comments-section,
    .mobile-main .comments-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .mobile-layout .comments-section {
        margin-top: 40px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 16px !important;
    }
}

/* ===== 2. 修复回到顶部按钮进度环 - 完全重写 ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(107, 144, 128, 0.15);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: visible;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    margin-top: -3px;    /* 向上微调 1px（可选） */
    margin-left: -2px;   /* 向左微调 1px（可选） */
    transform: rotate(-90deg);
    pointer-events: none;
}

.back-to-top circle {
    fill: none;
    stroke-width: 3;
}

.back-to-top .progress-ring-bg {
    stroke: rgba(107, 144, 128, 0.1);
}

.back-to-top .progress-ring {
    stroke: var(--accent-color);
    stroke-linecap: round;
    stroke-dasharray: 141;
    stroke-dashoffset: 141;
    transition: stroke-dashoffset 0.3s ease;
}

.back-to-top i {
    font-size: 1.2rem;
    color: var(--accent-color);
    z-index: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 100px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .back-to-top svg {
        width: 44px;
        height: 44px;
    }
    
    .back-to-top i {
        font-size: 1rem;
    }
}

/* ===== 3. 修复滚动到底部的顿挫感 ===== */
html {
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
}

body,
main,
.mobile-main {
    overscroll-behavior-y: contain;
}

.reached-top,
.reached-bottom {
    animation: none !important;
}

/* ===== 4. 增强动态流云效果 ===== */
.elegant-clouds-bg {
    opacity: 0.12 !important;
    z-index: 0;
}

.cloud-layer {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.9) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 40%, rgba(255, 255, 255, 0.7) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, 0.8) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 80%, rgba(255, 255, 255, 0.6) 0%, transparent 40%);
    filter: blur(40px);
}

.cloud-layer:nth-child(2) {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .elegant-clouds-bg {
        opacity: 0.08 !important;
    }
}

/* ===== 5. 确保移动端正常显示 ===== */
@media (max-width: 1024px) {
    .mobile-layout {
        display: block !important;
    }
    
    .desktop-layout {
        display: none !important;
    }
    
    .mobile-post-card {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-simple-pagination {
        display: block !important;
    }
}

/* ===== 6. 修复评论区 ===== */
.comments-section {
    max-height: none !important;
    overflow: visible !important;
}

@media (max-width: 1024px) {
    .comments-section {
        display: block !important;
        opacity: 1 !important;
    }
}

/* ===== 7. 优化滚动性能 ===== */
.mobile-main {
    -webkit-overflow-scrolling: touch;
}
