.layout-footer {
    position: relative;
    margin-top: auto;
    overflow-x: hidden;
    background-color: #2D2D2D;
    padding: 40px 0 20px;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    margin-bottom: 0;
    box-sizing: border-box; /* 确保 padding 和 border 不会增加总宽度 */
}

.footer-wrapper {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    width: 100%;
}

/*
  宽度、居中和响应式边距都由 .content-width-container 工具类处理。
*/
.footer-content-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-wrapper a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-wrapper a:hover {
    color: #FFFFFF;
}

.footer-main-section {
    padding-bottom: 30px;
    border-bottom: 1px solid #444;
}

.footer-branding {
    flex: 1;
    min-width: 250px;
}

.footer-logo img {
    max-height: 40px;
    margin-bottom: 35px;
    width: 185px;
    height: 29px;
}

.footer-links {
    flex: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 40px;
}

.footer-link-column {
    min-width: 150px;
}

.footer-column-title {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 16px;
    display: block;
    margin-bottom: 15px;
}

.footer-link-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link-column li {
    margin-bottom: 10px;
}

.footer-copyright-section {
    padding-top: 20px;
}

.copyright-grid {
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.legal-links {
    order: 1;
}

.copyright-text {
    font-size: 13px;
    order: 2;
}

.copyright-text::before {
    content: "|";
    color: rgba(255, 255, 255, 0.7);
    margin-right: 15px;
}

.copyright-text span {
    margin-right: 15px;
}
.copyright-text a {
    font-size: 13px;
}

.legal-links a,
.legal-links span {
    font-size: 13px;
    margin-left: 10px;
}

.footer-social-icons {
    display: flex;
    align-items: center;
    gap: 40px;       /* Space between WeChat and Shop icons */
}

/* Common styles for the grey circle buttons */
.social-btn {
    position: relative; /* Needed for positioning the popup */
    display: flex;      /* Use flex to center the icon image inside the circle */
    justify-content: center;
    align-items: center;
    width: 62px;
    height: 62px;
    background-color: rgb(168, 168, 168);
    border-radius: 50%;
    transition: background-color 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

/* Ensure the icon images fit nicely inside the circle */
.social-btn .btn-icon {
    /* width: 30px; */
    max-width: 60%;
    height: auto;
    border: none;
    margin: 0;
    display: block;
}

/* The Popup Container */
.footer-qrcode {
    display: none;
    position: absolute;

    /* Vertical Alignment*/
    top: 50%;
    transform: translateY(-50%);

    /* Horizontal Alignment*/
    left: auto;
    right: 100%;

    /* Spacing */
    margin-top: 0;
    margin-right: 15px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 999;
    width: 150px;
}

/* Small arrow pointing up to the icon */
.footer-qrcode::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: auto;
    right: -8px;
    /* Create the triangle pointing Right */
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #fff;
    border-right: none;
}

.footer-qrcode img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* Show popup on hover */
.wechat-btn:hover .footer-qrcode {
    display: block;
}

.wechat-btn:hover {
    background-color: #29C61B;
}

.shop-btn:hover {
    background-color: #F5A515;
}

@media (max-width: 1200px) {
    /*
       RealMCU < 992px 时：
       .footer-wechat, .footer-shop { width: 40px; height: 40px; }
       .footer-wechat img { width: 26px; height: 20px; }
       .footer-shop img { width: 22px; height: 22px; }
       gap: 15px
    */

    .footer-social-icons {
        gap: 15px;
    }

    .social-btn {
        width: 40px;
        height: 40px;
    }

    .social-btn .btn-icon {
        max-width: 65%; /* 调整图标在小圆圈内的比例 */
    }
}

@media (max-width: 768px) {
    .footer-content-grid {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        width: 100%;
        justify-content: flex-start;
        gap: 20px;
    }

    .footer-link-column {
        flex-basis: calc(50% - 15px);
        min-width: 120px;
    }

    .copyright-grid {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .copyright-text {
        order: 2;
    }

    .legal-links {
        order: 1;
    }

    .copyright-text::before {
        display: none;
    }

    .footer-branding {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 30px;
        width: 100%;
        margin-bottom: 20px;
    }

    .footer-logo img {
        margin-bottom: 0;
        width: 129px;
        height: 20px;
    }

    .footer-social-icons {
        gap: 12px;       /* Space between WeChat and Shop icons */
    }

    .social-btn {
        width: 36px;
        height: 36px;
    }

    .wechat-btn .btn-icon {
        width: 24px;
        height: 18px;
    }

    .shop-btn .btn-icon {
        width: 18px;
        height: 18px;
    }

    .footer-qrcode {
        display: none;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin-top: 15px;
        padding: 10px;
        background-color: #fff;
        border-radius: 4px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        z-index: 999;
        width: 150px;
    }

    /* Small arrow pointing up to the icon */
    .footer-qrcode::before {
        content: "";
        position: absolute;
        top: -8px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid #fff;
    }
}
