/* header.css */
/* index.html overview.html config-main.html config-device.html getcommand.html */

.head-container {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: left;
}

.head-container a {
    font-size: 16px;
    font-weight: 500;
    color: white;
    text-decoration: none;
    margin-right: 20px;
    transition: all 0.3s ease;
}

.head-container a:active {
    color: #2e2d3b;
}

/* 图标图片 */
.icon-image {
    height: 25px;
    /* 图标的高度适应容器 */
    width: auto;
    /* 图标的宽度自动调整，保持比例 */
    vertical-align: middle;
    /* 垂直居中 */
    margin-top: -12px;
    margin-bottom: -10px;
    cursor: pointer;
    transition: filter 0.3s ease;
    filter: brightness(0) invert(1);
}

.icon-image:active {
    filter: brightness(1) invert(0);
    /* 变成白色 */
}

@media (max-width: 768px) {
    .head-container-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        overflow: hidden;
    }

    .head-container {
        display: flex;
        flex-direction: row;
        position: relative;
        top: 5%;
        overflow-x: auto;
        /* 添加横向滚动效果 */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* 隐藏滚动条 */
        scroll-behavior: smooth;
        /* 平滑滚动效果 */
        overscroll-behavior-x: contain;
        /* 添加横向滚动的 OverScroll 效果 */
        width: 100%;
        -ms-overflow-style: none;
    }

    .head-container::-webkit-scrollbar {
        display: none;
    }

    .head-container a {
        margin: 0;
        margin-right: 25px;
        font-size: 14px;
        flex: 0 0 auto;
        /* 确保每个 h2 和 a 元素不会缩小 */
        min-width: fit-content;
        /* 使内容自适应宽度 */
    }

    .head-container a:last-child {
        margin-right: 0;
        flex-grow: 1;
        white-space: nowrap;
    }

    /* 左侧模糊提示 */
    .blur-left {
        position: absolute;
        left: 0;
        top: 0;
        width: 80px;
        height: 100%;
        background: linear-gradient(to right, rgba(164, 233, 166, 1), rgba(255, 255, 255, 0));
        pointer-events: none;
        /* 防止影响滚动 */
        opacity: 0;
        /* 默认透明 */
        transition: opacity 0.3s ease;
        /* 淡入淡出效果 */
        z-index: 10;
        /* 确保在内容之上 */
    }

    /* 右侧模糊提示 */
    .blur-right {
        position: absolute;
        right: 0;
        top: 0;
        width: 80px;
        height: 100%;
        background: linear-gradient(to left, rgba(164, 233, 166, 1), rgba(255, 255, 255, 0));
        pointer-events: none;
        opacity: 0;
        /* 默认透明 */
        transition: opacity 0.3s ease;
        /* 淡入淡出效果 */
        z-index: 10;
        /* 确保在内容之上 */
    }
}

body.dark-mode .head-container {
    box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
}

body.dark-mode .head-container a {
    color: #2e2d3b;
}

body.dark-mode .head-container a:active {
    color: #f4f4f9;
}

body.dark-mode .icon-image {
    filter: brightness(1) invert(0);
}

body.dark-mode .icon-image:active {
    filter: brightness(0) invert(1);
}

body.dark-mode .blur-left {
    background: linear-gradient(to right, #218838, #ffffff00);
}

body.dark-mode .blur-right {
    background: linear-gradient(to left, #218838, #ffffff00);
}

@media (hover: hover) {
    .head-container a:hover {
        color: #2e2d3b;
    }

    .icon-image:hover {
        filter: brightness(1) invert(0);
        /* 变成白色 */
    }

    body.dark-mode .head-container a:hover {
        color: #f4f4f9;
    }

    body.dark-mode .icon-image:hover {
        filter: brightness(0) invert(1);
    }
}