/* ===== 博客页面基础布局：左右侧栏、中间内容区、返回按钮 ===== */
/* 这是引入了一些字体 */
@import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900&display=block');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    /* 当用户手动导航或者 CSSOM scrolling API 触发滚动操作时 */
    scroll-behavior: smooth;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    /* 背景放在最底层 — bg-day / bg-night 在 blog_common.css 中定义 */
}

/* 页面整体样式 */
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* 盒子样式 */
.box {
    position: absolute;
    width: 18.5vw;
    height: 76%;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    z-index: 3;
    box-sizing: border-box; /* 确保padding不会影响元素的大小 */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 让容器的所有子元素（图片和文本）默认左对齐 */
    background-size: cover; /* 让背景图片填充整个容器 */
    background-position: center; /* 背景图片居中显示 */
    overflow-y: scroll; /* 保持内容可滚动 */
}
.box::-webkit-scrollbar {
    display: none; /* 对Webkit内核浏览器有效（Chrome, Safari, Edge） */
}

.box .text1 {
    font-weight: bold;
    font-size: 1.125vw; /* 设置字体大小 */
    margin-left: 2%; /* 设置文本与左边框的距离为5px */
    text-align: left; /* 使文本左对齐 */
    color: #ff21c0; 
}
.box .text2 {
    font-weight: bold;
    font-size: 1vw; /* 设置字体大小 */
    margin-left: 2%; /* 设置文本与左边框的距离为5px */
    text-align: left; /* 使文本左对齐 */
    color: #21ebff; 
}

/* 左侧盒子 */
.box.left {
    left: 3.3%;
    top: 5%;
    padding: 1.2%; /* 设置组件与边框之间的距离 */
}
.box.left img {
    width: 95%;
    aspect-ratio: 1.7;
    border-radius: 10px;
    object-fit: cover;
    align-self: center;
    margin-bottom: 1.9%;
    opacity: 0.9;
    border: 3px solid rgba(33, 235, 255, 0.25);
    box-shadow:
        0 0 15px rgba(33, 235, 255, 0.1),
        inset 0 0 15px rgba(33, 235, 255, 0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.box.left img:hover {
    border-color: rgba(33, 235, 255, 0.6);
    box-shadow:
        0 0 25px rgba(33, 235, 255, 0.25),
        inset 0 0 20px rgba(33, 235, 255, 0.1);
}

/* 右侧盒子 */
.box.right {
    right: 3.3%;
    top: 5%;
    padding: 1%; /* 设置组件与边框之间的距离 */
}
.box.right img {
    width: 15%; /* 设置图片宽度为250px */
    height: 6.4%; /* 设置图片高度为150px */
    border-radius: 5px; /* 设置图片圆角 */
    object-fit:contain; /* 保证图片按比例填充区域 */
    margin-bottom: 1.9%; /* 给图片与文本之间留一点空间 */
    opacity: 0.8;           /* 设置图片透明度为50% */
}

/* 中间盒子 */
.box_center {
    position: absolute; /* 绝对定位 */
    left: 50%;          /* 左边距设置为 50% */
    top: 50%;           /* 上边距设置为 50% */
    width: 50%;       /* 宽度为 500px */
    height: 100vh;      /* 高度为视口的高度 */
    transform: translate(-50%, -50%); /* 通过平移使盒子居中 */
    background-color: #434343ba; /* 白色半透明背景 */
    border-radius: 1.9%;   
    overflow-y: scroll; /* 保持内容可滚动 */
    padding: 1.8%; /* 设置组件与边框之间的距离 */
    display: flex;
    flex-direction: column;
    z-index: 3;
    color: rgb(0, 0, 0);
}
.box_center::-webkit-scrollbar {
    display: none; /* 对Webkit内核浏览器有效（Chrome, Safari, Edge） */
}

.box_center img {
    width: 75%; /* 设置图片宽度为250px */
    aspect-ratio: 1.97; /* 设置图片的宽高比为 25:15，即 5:3 */    
    border-radius: 5px; /* 设置图片圆角 */
    object-fit: cover; /* 保证图片按比例填充区域 */
    align-self: center; /* 使图片水平居中 */
    margin-bottom: 1.9%; /* 给图片与文本之间留一点空间 */
}
.box_center h1 {
    font-size: 1.56vw; /* 设置字体大小 */
    text-align: left; /* 使文本左对齐 */
}
.box_center h2 {
    font-size: 1.25vw; /* 设置字体大小 */
    text-align: left; /* 使文本左对齐 */
}
/* 返回按钮 — 左侧框下方居中 */
.return-btn {
    position: absolute;
    left: 3.3%;
    width: 18.5vw;
    text-align: center;
    padding: 1.8vh 0;
    top: calc(5% + 76% + 1.2vh);
    text-decoration: none;
    font-size: 1.2vw;
    font-weight: 600;
    letter-spacing: 3px;
    overflow: hidden;
    transition: .5s;
    -webkit-box-reflect: below 1px linear-gradient(transparent, #0003);
    z-index: 3;
    cursor: pointer;
}
.return-btn:hover{
    background: #ff21c0;
    color: #111;
    border-color: #ff21c0;
    box-shadow: 0 0 2vw #ff21c0;
    transition-delay: .2s;
}
.return-btn:active {
    transform: scale(0.92);
    transition: transform 0.08s;
}
.return-btn::before{
    content:"";
    position: absolute;
    top:0;
    left:0;
    width: 0.6vh;
    height: 0.6vh;
    border-left: 2px solid #ff21c0;
    border-top: 2px solid #ff21c0;
    transition: .5s;
}
.return-btn::after{
    content:"";
    position: absolute;
    bottom:0;
    right:0;
    width: 0.6vh;
    height: 0.6vh;
    border-bottom: 2px solid #ff21c0;
    border-right: 2px solid #ff21c0;
    transition: .5s;
}
.return-btn:hover::before,
.return-btn:hover::after{
    width: 100%;
    height: 100%;
}
#btn{
    position: absolute;
    right: 3.3%;
    width: 18.5vw;
    text-align: center;
    top: calc(5% + 76% + 6vh);
    padding: 2vh 0;

    transition: 0.5s;
    z-index: 3;
}
theme-button {
    transform: scaleX(1) scaleY(1);  /* 默认大小为 1 */
    transition: transform 0.3s ease-in-out;  /* 平滑过渡 */
}
#particles {
    position: absolute;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* ===== 移动端适配 (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* 让页面可滚动，不再限制在 viewport 内 */
    body, html {
        overflow: auto !important;
        height: auto !important;
        min-height: 100vh;
    }

    /* box_center 改为正常文档流，不截断内容 */
    .box_center {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 96%;
        height: auto !important;
        min-height: calc(100vh - 2rem);
        margin: 0.5rem auto;
        overflow: visible;
        padding: 0.5rem;
    }

    /* 侧栏隐藏 — 返回按钮改为固定右下 */
    .box.left, .box.right { display: none; }
    .return-btn {
        position: fixed !important;
        left: 2vw !important;
        bottom: 2vw !important;
        top: auto !important;
        right: auto !important;
        width: auto !important;
        padding: 1.5vh 6vw;
        font-size: 3vw;
        letter-spacing: 1px;
        background: rgba(33,235,255,0.15);
        border: 1px solid rgba(33,235,255,0.3);
        z-index: 100;
    }
    .return-btn::before, .return-btn::after {
        display: none;
    }

    /* 返回按钮点击动画 */
    .return-btn:active {
        background: rgba(255,33,192,0.35) !important;
        transform: scale(0.92) !important;
        border-color: #ff21c0 !important;
        transition: transform 0.08s, background 0.08s !important;
    }

    /* 主题按钮: 固定右下 */
    #btn {
        position: fixed !important;
        left: auto !important;
        right: 3vw !important;
        bottom: 2vw !important;
        top: auto !important;
        padding: 1.5vh 3vw;
        z-index: 100;
    }
    theme-button {
        transform: scaleX(0.6) scaleY(0.6) !important;
    }

    /* 文章内容区域留出底部空间，避免被固定按钮遮挡 */
    .blog-article {
        padding-bottom: 14vw !important;
    }
}
