/* ============================================
   Glassmorphism 美化层 —— 纯 CSS，不改任何 HTML
   作用于原版 Popeye 主题的现有结构
   ============================================ */

/* ---------- 全局基底（背景图 + 遮罩） ---------- */
body {
    background: #e8eef3;
    color: #2d3748;
    position: relative;
    min-height: 100vh;
}

/* 背景图片层（固定不滚动，用 transform 提升性能） */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('/bl-content/uploads/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* 用 transform 创建独立图层，避免重绘卡顿 */
    transform: translateZ(0);
    will-change: transform;
}

/* 浅色遮罩层（保证内容可读性，用 transform 提升性能） */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0.25) 40%,
        rgba(240, 246, 252, 0.45) 100%);
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
}

/* ---------- 小摆件装饰层 ---------- */
/* 左侧漂浮云朵 */
.decoration-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    transform: translateZ(0);
}

/* 云朵 1 - 左上 */
.decoration-layer .cloud-1 {
    position: absolute;
    top: 12%;
    left: 4%;
    width: 90px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    animation: cloudFloat 18s ease-in-out infinite;
    filter: blur(1px);
}

.decoration-layer .cloud-1::before,
.decoration-layer .cloud-1::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}

.decoration-layer .cloud-1::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 15px;
}

.decoration-layer .cloud-1::after {
    width: 30px;
    height: 30px;
    top: -12px;
    right: 12px;
}

/* 云朵 2 - 右侧中间 */
.decoration-layer .cloud-2 {
    position: absolute;
    top: 38%;
    right: 5%;
    width: 70px;
    height: 26px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 40px;
    animation: cloudFloat 22s ease-in-out infinite reverse;
    filter: blur(1.5px);
}

.decoration-layer .cloud-2::before,
.decoration-layer .cloud-2::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.decoration-layer .cloud-2::before {
    width: 32px;
    height: 32px;
    top: -16px;
    left: 12px;
}

.decoration-layer .cloud-2::after {
    width: 24px;
    height: 24px;
    top: -10px;
    right: 10px;
}

/* 云朵 3 - 左下 */
.decoration-layer .cloud-3 {
    position: absolute;
    bottom: 22%;
    left: 7%;
    width: 60px;
    height: 22px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 35px;
    animation: cloudFloat 25s ease-in-out infinite;
    filter: blur(2px);
    animation-delay: -8s;
}

/* 小太阳 - 右上 */
.decoration-layer .sun {
    position: absolute;
    top: 6%;
    right: 8%;
    width: 56px;
    height: 56px;
    background: radial-gradient(circle,
        rgba(255, 236, 180, 0.9) 0%,
        rgba(255, 210, 120, 0.6) 50%,
        transparent 70%);
    border-radius: 50%;
    animation: sunGlow 6s ease-in-out infinite;
}

/* 闪烁星星装饰 */
.decoration-layer .star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.decoration-layer .star:nth-child(4) { top: 18%; left: 12%; animation-delay: 0s; }
.decoration-layer .star:nth-child(5) { top: 30%; right: 10%; animation-delay: 1s; width: 3px; height: 3px; }
.decoration-layer .star:nth-child(6) { top: 55%; left: 6%; animation-delay: 2s; }
.decoration-layer .star:nth-child(7) { top: 70%; right: 8%; animation-delay: 0.5s; width: 3px; height: 3px; }
.decoration-layer .star:nth-child(8) { top: 15%; right: 22%; animation-delay: 1.5s; }
.decoration-layer .star:nth-child(9) { top: 45%; left: 15%; animation-delay: 2.5s; width: 3px; height: 3px; }
.decoration-layer .star:nth-child(10) { bottom: 30%; right: 15%; animation-delay: 0.8s; }

/* 纸飞机 - 从顶部外飞入，避免初始位置闪现 */
.decoration-layer .paper-plane {
    position: absolute;
    top: -60px;
    left: -80px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 30px solid rgba(90, 143, 212, 0.5);
    transform: rotate(45deg);
    animation: planeFly 35s linear infinite;
    opacity: 0;
    /* 延迟入场，等第一帧动画就位 */
    animation-delay: 1s;
}

/* 纸飞机尾迹 */
.decoration-layer .paper-plane::before {
    content: '';
    position: absolute;
    top: 28px;
    left: -25px;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(90, 143, 212, 0.3));
    transform: rotate(-45deg);
}

/* 热气球 - 右侧缓慢上升 */
.decoration-layer .balloon {
    position: absolute;
    bottom: -80px;
    right: 12%;
    width: 36px;
    height: 48px;
    background: linear-gradient(180deg, #ffb6c1 0%, #ff8fa3 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: balloonRise 20s ease-in-out infinite;
    opacity: 0.7;
}

.decoration-layer .balloon::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #8b5a2b;
    border-radius: 2px;
}

.decoration-layer .balloon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 12px;
    background: rgba(0, 0, 0, 0.2);
}

/* 山形剪影 - 左下角 */
.decoration-layer .mountain {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 120px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 100px solid rgba(100, 130, 160, 0.25);
    opacity: 0.6;
}

/* 山形剪影 2 - 右下角 */
.decoration-layer .mountain-2 {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 90px solid transparent;
    border-right: 110px solid transparent;
    border-bottom: 80px solid rgba(100, 130, 160, 0.2);
    opacity: 0.5;
}

/* ---------- 动画 ---------- */
@keyframes cloudFloat {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(15px) translateY(-5px); }
    50% { transform: translateX(5px) translateY(-10px); }
    75% { transform: translateX(-10px) translateY(-3px); }
}

@keyframes sunGlow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

@keyframes planeFly {
    0% {
        transform: translate(0, 0) rotate(45deg);
        opacity: 0;
    }
    3% {
        opacity: 0.7;
    }
    92% {
        opacity: 0.7;
    }
    100% {
        transform: translate(calc(100vw + 200px), calc(100vh + 100px)) rotate(60deg);
        opacity: 0;
    }
}

@keyframes balloonRise {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { transform: translateY(-110vh) rotate(5deg); opacity: 0; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .decoration-layer .cloud-1,
    .decoration-layer .cloud-2,
    .decoration-layer .cloud-3,
    .decoration-layer .sun,
    .decoration-layer .star,
    .decoration-layer .paper-plane,
    .decoration-layer .balloon {
        animation: none !important;
    }
}

/* ---------- 通用链接 ---------- */
a {
    color: #4a6fa5;
    transition: color .25s ease;
}

a:hover {
    color: #5a8fd4;
    text-decoration: none;
}

/* ---------- 顶部导航（浅色毛玻璃） ---------- */
nav.navbar {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(80, 110, 140, 0.12);
    padding: 14px 0;
}

nav.navbar .navbar-brand {
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #5a8fd4 0%, #9b7bc8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav.navbar .d-flex a {
    color: rgba(60, 80, 100, 0.75);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all .25s ease;
}

nav.navbar .d-flex a:hover {
    color: #2d3748;
    background: rgba(255, 255, 255, 0.6);
}

/* ---------- 页头（头像区） ---------- */
header {
    padding: 56px 0 40px !important;
    position: relative;
}

header .site-logo img.img-thumbnail {
    width: 140px;
    height: 140px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 8px 32px rgba(80, 110, 140, 0.2), 0 0 0 6px rgba(255, 255, 255, 0.25);
    padding: 4px;
    transition: transform .3s ease, box-shadow .3s ease;
}

header .site-logo img.img-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(80, 110, 140, 0.3), 0 0 24px rgba(255, 255, 255, 0.5);
}

header .site-description p {
    color: rgba(60, 80, 100, 0.75);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    max-width: 560px;
    margin: 14px auto 0;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6);
}

/* ---------- 搜索框（浅色毛玻璃胶囊） ---------- */
section form.d-flex.mb-4 {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(80, 110, 140, 0.15);
    transition: border-color .25s ease, box-shadow .25s ease;
}

section form.d-flex.mb-4:focus-within {
    border-color: rgba(90, 143, 212, 0.5);
    box-shadow: 0 8px 32px rgba(80, 110, 140, 0.15), 0 0 20px rgba(90, 143, 212, 0.15);
}

section form.d-flex.mb-4 input#search-input {
    background: transparent;
    border: none;
    color: #2d3748;
    padding: 10px 20px;
    font-size: 0.98rem;
}

section form.d-flex.mb-4 input#search-input::placeholder {
    color: rgba(100, 120, 140, 0.5);
}

section form.d-flex.mb-4 input#search-input:focus {
    background: transparent;
    color: #2d3748;
    box-shadow: none;
}

section form.d-flex.mb-4 .btn {
    border-radius: 40px;
    border: none;
    background: linear-gradient(135deg, #5a8fd4 0%, #9b7bc8 100%);
    color: #fff;
    font-weight: 600;
    padding: 8px 26px;
    transition: transform .2s ease, box-shadow .2s ease;
}

section form.d-flex.mb-4 .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(90, 143, 212, 0.35);
    color: #fff;
}

/* ---------- 文章卡片（毛玻璃） ---------- */
.list-group {
    background: transparent;
    gap: 18px;
    display: flex;
    flex-direction: column;
}

.list-group-item {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 16px;
    padding: 26px 28px !important;
    box-shadow: 0 4px 24px rgba(80, 110, 140, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: background .3s ease, border-color .3s ease, transform .3s ease, box-shadow .3s ease;
    position: relative;
    overflow: hidden;
}

/* 卡片顶部高光线 */
.list-group-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    opacity: 0;
    transition: opacity .3s ease;
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(90, 143, 212, 0.4) !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 36px rgba(80, 110, 140, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.list-group-item:hover::before {
    opacity: 1;
}

/* 卡片标题 */
.list-group-item h5 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.list-group-item h5,
.list-group-item > div > a {
    color: #2d3748;
}

.list-group-item > div > a:hover h5 {
    background: linear-gradient(135deg, #5a8fd4 0%, #9b7bc8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 日期 */
.list-group-item .color-blue {
    color: #5a8fd4 !important;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 描述文字 */
.list-group-item .form-text {
    color: rgba(70, 90, 110, 0.8);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ---------- 标签（胶囊徽章） ---------- */
.list-group-item .badge.bg-gray {
    background: rgba(255, 255, 255, 0.65) !important;
    color: rgba(70, 90, 110, 0.85) !important;
    border: 1px solid rgba(120, 150, 180, 0.25);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all .25s ease;
}

.list-group-item .badge.bg-gray:hover {
    background: linear-gradient(135deg, #5a8fd4 0%, #9b7bc8 100%) !important;
    color: #fff !important;
    border-color: transparent;
}

/* ---------- 分页 ---------- */
nav .pagination {
    gap: 8px;
}

nav .pagination .page-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    padding: 8px 18px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all .25s ease;
}

nav .pagination .page-link:hover {
    background: linear-gradient(135deg, #8ab4ff 0%, #c58bff 100%);
    color: #14171c;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(138, 180, 255, 0.3);
}

/* ---------- 页脚（浅色毛玻璃） ---------- */
footer.footer {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    margin-top: 64px !important;
}

footer .footer-links a.color-blue {
    color: rgba(70, 90, 110, 0.7) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all .25s ease;
}

footer .footer-links a.color-blue:hover {
    color: #2d3748 !important;
    background: rgba(255, 255, 255, 0.7);
}

footer p {
    color: rgba(100, 120, 140, 0.6);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* ---------- 代码块 ---------- */
pre, code {
    background: rgba(0, 0, 0, 0.4);
    color: #e6e6e6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- 选中文字 ---------- */
::selection {
    background: rgba(138, 180, 255, 0.35);
    color: #fff;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #181c21;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ---------- 入场动画 ---------- */
@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-group-item {
    animation: cardIn .45s ease both;
}

.list-group-item:nth-child(2) { animation-delay: .06s; }
.list-group-item:nth-child(3) { animation-delay: .12s; }
.list-group-item:nth-child(4) { animation-delay: .18s; }
.list-group-item:nth-child(5) { animation-delay: .24s; }
.list-group-item:nth-child(6) { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
    .list-group-item { animation: none; }
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
    header {
        padding: 40px 0 30px !important;
    }

    header .site-logo img.img-thumbnail {
        width: 110px;
        height: 110px;
    }

    .list-group-item {
        padding: 20px !important;
        border-radius: 14px;
    }

    .list-group-item h5 {
        font-size: 1.1rem;
    }
}
