/* 全局基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #faf9f7;
    /* 只留兜底色，不放图 */
    position: relative;
    z-index: 0;
}

/* 用伪元素做模糊背景层 */
body::before {
    content: '';
    position: fixed;
    /* 固定，滚动时背景不动 */
    inset: -20px;
    /* 向外扩，遮住模糊边缘 */
    z-index: -1;
    /* 垫到所有内容下面 */
    background-image: url(../Images/81.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(6px);
    /* ← 模糊只作用在背景层 */
    /* 可选：加个半透明遮罩，让文字更清晰 */
    /* 用 background-blend 或额外伪元素实现 */
}

/* 手机端：改 ::before 的背景图 */
@media (max-width: 768px) {
    body::before {
        background-image: url(../Images/80.jpg);
        /* 手机图 */
        /* 如果需要，模糊值也可以单独调 */
        filter: blur(3px);
    }
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    /* 和背景同层，叠在上面一点 */
    background: rgba(0, 0, 0, 0.55);
    /* 半透明浅色遮罩 */
    pointer-events: none;
    /* 不挡点击 */
}

.icon {
    width: 1.4em;
    height: 1.4em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}

/* ===== 加载动画核心样式 —— 带图片的进度条风格 ===== */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #363533;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.7s;
    pointer-events: auto;
}

.loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 加载内容容器 */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(70vw, 380px);
}

/* ===== 图片区域 ===== */
.loader-image-wrapper {
    width: 100px;
    height: 100px;
    margin-bottom: 1.8rem;
    border-radius: 50%;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    position: relative;
    animation: softFloat 3s ease-in-out infinite;
}

/* 图片本身 */
.loader-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* 加载时图片轻微浮动 */
@keyframes softFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* 图片环状装饰 (可选，增加设计感) */
.loader-image-wrapper::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(43, 43, 43, 0.1);
    pointer-events: none;
}

/* 如果图片无法加载，显示一个默认的图标占位 */
.loader-image-fallback {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #b0b0b0;
}

/* ===== 进度条区域 ===== */
.progress-container {
    width: 100%;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffc1c1;
    font-style: italic;

}

.progress-percent {
    font-size: 1.4rem;
    font-weight: 600;
    color: #b8d1c58c;
    font-style: italic;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.progress-track {
    width: 100%;
    height: 10px;
    background-color: #e6e4e0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #bbffe3, #4af5ae, #1bb475, #075837);
    border-radius: 20px;
    transition: width 0.25s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.25),
            transparent);
    animation: shimmer 1.8s ease-in-out infinite;
    transform: translateX(-100%);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    60%,
    100% {
        transform: translateX(100%);
    }
}

/* 底部装饰点 */
.loader-footer {
    display: flex;
    gap: 6px;
    margin-top: 0.8rem;
    justify-content: center;
}

.loader-footer span {
    width: 5px;
    height: 5px;
    background-color: #c0c0c0;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loader-footer span:nth-child(1) {
    animation-delay: 0s;
}

.loader-footer span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-footer span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.9);
        background-color: #c0c0c0;
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
        background-color: #2b2b2b;
    }
}

.loader-hint {
    font-size: 0.75rem;
    color: #b0b0b0;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
    text-align: center;
}

/* 响应式微调 */
@media (max-width: 480px) {
    .loader-container {
        width: min(80vw, 300px);
    }

    .loader-image-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 1.4rem;
    }

    .progress-label {
        font-size: 0.75rem;
    }

    .progress-percent {
        font-size: 1.1rem;
    }

    .progress-track {
        height: 8px;
    }

    .blog-content h1 {
        font-size: 2.2rem;
    }
}


/* 导航区 —— 自动从 HTML 按钮收集 */
/* ========== 桌面端：横排（保持原方案五） ========== */
.nav {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #ffffff33;
    justify-content: space-around;
    width: 100%;
    background: #ffffff08;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-sizing: border-box;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 120px;
    min-height: 54px;
    padding: 0.5rem;
    border: none;
    border-radius: 25px;
    background: #ffffff12;
    color: #ffffffcc;
    font-family: "speak1";
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        3px 3px 8px #00000055,
        -2px -2px 6px #ffffff18;
    transition: all 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.nav-btn:active {
    transform: scale(0.94);
}

@media (hover: hover) {
    .nav-btn:hover {
        color: #fff;
        transform: translateY(-1px);
    }
}

.nav-btn.active {
    background: #ffffff08;
    color: #c1fff0;
    box-shadow:
        inset 3px 3px 8px #00000066,
        inset -2px -2px 6px #ffffff14,
        0 0 0 1px #c1fff033;
}

/* ========== 手机端：竖排侧边导航 ========== */
@media (max-width: 640px) {

    /* ---- 悬浮开关按钮（默认显示）---- */
    .nav-toggle {
        display: flex;                 /* 手机上显示 */
        position: fixed;
        left: max(14px, env(safe-area-inset-left));
        bottom: max(20px, env(safe-area-inset-bottom));
        width: 52px;
        height: 52px;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: #ffffff14;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: #c1fff0;
        font-size: 1.4rem;
        cursor: pointer;
        box-shadow:
            3px 3px 10px #00000066,
            -2px -2px 6px #ffffff18,
            0 0 0 1px #c1fff033;
        z-index: 1100;
        transition: transform 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .nav-toggle:active { transform: scale(0.9); }

    /* 展开时图标旋转成"关闭" */
    .nav-toggle.open { transform: rotate(45deg); }

    /* ---- 竖排导航本体：默认收缩隐藏 ---- */
    .nav {
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.6rem;

        position: fixed;
        left: max(14px, env(safe-area-inset-left));
        bottom: calc(52px + max(20px, env(safe-area-inset-bottom)) + 12px);
        /* ↑ 正好在开关按钮正上方 12px */

        width: auto;
        padding: 0.7rem;
        border: none;
        border-radius: 18px;
        background: #ffffff10;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 4px 4px 24px #00000066;

        /* 收缩动画 */
        opacity: 0;
        visibility: hidden;
        transform: translateY(12px) scale(0.92);
        transform-origin: left bottom;  /* 从开关按钮处展开 */
        transition:
            opacity 0.22s ease,
            transform 0.22s ease,
            visibility 0.22s;
        z-index: 1050;

        max-height: 70vh;
        overflow-y: auto;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar { display: none; }

    /* 展开状态 */
    .nav.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    /* 竖排按钮：图标+文字横排小胶囊 */
    .nav-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 0.45rem 0.9rem;
        border-radius: 12px;
        font-size: 0.85rem;
    }

    .nav-btn svg,
    .nav-btn .icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
}

/* 桌面端隐藏开关按钮 */
@media (min-width: 641px) {
    .nav-toggle { display: none; }
}

/* 多页面 */
.page {
    display: none;
    animation: fadeSlide 0.35s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.page.active {
    display: block;
}