/* Footer
================================================== */
/* 定义CSS变量 - 参照导航栏设计 */
:root {
    --footer-bg: #0d0d0d;
    --footer-text: #999;
    --footer-text-light: #aaa;
    --primary-color: #ffb600;
    --primary-dark: #e6a400;
    /* 修改：使用与导航栏相同的变量 */
    --content-max-width: 1800px;
    --footer-border: rgba(255, 255, 255, 0.1);
}

/*- Footer common */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    position: relative;
    /* 使用相对单位而非固定像素 */
    min-height: auto;
}

.footer-main {
    /* 修改：减少黑色背景区域高度 */
    padding: clamp(30px, 4vw, 60px) 0 clamp(20px, 3vw, 40px);
    border-bottom: 1px solid var(--footer-border);
}

.footer .widget-title {
    font-size: clamp(14px, 1vw, 16px);
    font-weight: 700;
    position: relative;
    margin: 0 0 clamp(20px, 2vw, 30px);
    padding-left: clamp(10px, 0.8vw, 15px);
    text-transform: uppercase;
    color: #fff;
    border-left: 3px solid var(--primary-color);
}

/* Footer about us */
.footer-about {
    margin-bottom: clamp(20px, 3vw, 40px);
    /* 修改：增加简介列宽度，让每行显示更多字数 */
    flex: 0 0 clamp(280px, 28vw, 380px);
    max-width: clamp(280px, 28vw, 380px);
    padding-right: clamp(5px, 1vw, 10px);
}

.footer-logo {
    margin-bottom: clamp(15px, 1.5vw, 20px);
    max-height: clamp(40px, 4vw, 60px);
    width: auto;
}

.footer-about p {
    line-height: 1.8;
    color: var(--footer-text-light);
    font-size: clamp(12px, 0.9vw, 14px);
    margin-bottom: clamp(15px, 1.5vw, 20px);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* 修改：确保简介文本充分利用宽度 */
    max-width: 100%;
    width: 100%;
}

/* 在线留言按钮 */
.feedback-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    font-size: clamp(11px, 0.8vw, 13px);
    font-weight: 500;
    padding: clamp(4px, 0.5vw, 6px) clamp(10px, 1vw, 15px);
    border-radius: 0px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    width: auto;
    min-width: clamp(80px, 8vw, 100px);
}

.feedback-btn:hover {
    background-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 182, 0, 0.3);
}

/* 导航分类列样式 */
.footer-category-col {
    margin-bottom: clamp(20px, 3vw, 40px);
    /* 修改：进一步缩小分类列宽度和间距 */
    flex: 0 0 clamp(100px, 9vw, 130px);
    max-width: clamp(100px, 9vw, 130px);
    padding: 0 clamp(2px, 0.2vw, 4px);
}

.footer-category-title {
    font-size: clamp(13px, 0.9vw, 15px);
    font-weight: 700;
    color: #fff;
    margin-bottom: clamp(12px, 1.2vw, 18px);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 修改：限制分类标题最多显示9个中文字符 */
    max-width: 9em;
    width: 100%;
    display: block;
}

.footer-category-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-category-links li {
    margin-bottom: clamp(7px, 0.6vw, 10px);
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

.footer-category-links li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(4px, 0.4vw, 6px);
    height: clamp(4px, 0.4vw, 6px);
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-category-links li:hover:before {
    opacity: 1;
}

.footer-category-links li a {
    color: var(--footer-text-light);
    font-size: clamp(11px, 0.8vw, 13px);
    padding-left: clamp(3px, 0.4vw, 5px);
    transition: all 0.3s ease;
    display: block;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 修改：限制分类链接最多显示9个中文字符 */
    max-width: 9em;
    width: 100%;
}

.footer-category-links li a:hover {
    color: var(--primary-color);
    padding-left: clamp(8px, 1vw, 12px);
    text-decoration: none;
}

/* 联系方式列 */
.footer-contact-col {
    /* 修改：缩小联系方式列宽度 */
    flex: 0 0 clamp(130px, 13vw, 170px);
    max-width: clamp(130px, 13vw, 170px);
    padding: 0 clamp(2px, 0.2vw, 4px);
    margin-top: 0;
    position: relative; /* 为微信二维码弹窗定位 */
}

.contact-info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 clamp(12px, 1.5vw, 20px) 0;
}

.contact-info-list li {
    margin-bottom: clamp(8px, 0.8vw, 12px);
    display: flex;
    align-items: flex-start;
    color: var(--footer-text-light);
    font-size: clamp(11px, 0.8vw, 13px);
    line-height: 1.6;
    position: relative;
    padding-left: 0;
}

.contact-info-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(4px, 0.4vw, 6px);
    height: clamp(4px, 0.4vw, 6px);
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-info-list li:hover:before {
    opacity: 1;
}

.contact-info-list li i {
    color: var(--primary-color);
    font-size: clamp(11px, 0.8vw, 13px);
    margin-right: clamp(4px, 0.5vw, 6px);
    margin-top: 2px;
    min-width: clamp(14px, 1.2vw, 18px);
    text-align: center;
    flex-shrink: 0;
}

.contact-info-text {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    padding-left: clamp(3px, 0.4vw, 5px);
    transition: all 0.3s ease;
    /* 修改：确保联系方式文本充分利用空间 */
    max-width: 100%;
    width: 100%;
}

.contact-info-list li:hover .contact-info-text {
    padding-left: clamp(8px, 1vw, 12px);
}

.contact-info-text a {
    color: var(--footer-text-light);
    transition: color 0.3s ease;
    /* 修改：确保联系方式链接不换行，超出显示省略号 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.contact-info-text a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* 修改：微信图标区域 - 靠左显示，悬停时二维码显示在右侧 */
.wechat-icon-container {
    text-align: left; /* 靠左显示 */
    padding-top: clamp(8px, 1.2vw, 12px);
    border-top: 1px solid var(--footer-border);
    margin-top: clamp(8px, 1.2vw, 12px);
    position: relative;
    display: inline-block; /* 使容器宽度自适应内容 */
}

.wechat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 2.5vw, 40px);
    height: clamp(32px, 2.5vw, 40px);
    background-color: var(--primary-color);
    color: #111;
    border-radius: 50%;
    font-size: clamp(16px, 1.5vw, 20px);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    margin-bottom: clamp(4px, 0.6vw, 6px);
}

.wechat-icon:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: scale(1.1);
}

.wechat-icon-text {
    color: var(--footer-text-light);
    font-size: clamp(10px, 0.7vw, 12px);
    margin: 0;
    display: block;
    line-height: 1.3;
    text-align: left; /* 文本左对齐 */
}

.wechat-icon-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 修改：微信二维码弹窗 - 显示在右侧，尺寸缩小 */
.wechat-qrcode-popup {
    position: absolute;
    top: 0; /* 与图标顶部对齐 */
    left: 100%; /* 显示在图标右侧 */
    margin-left: 12px; /* 与图标保持一定距离 */
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    padding: clamp(4px, 0.5vw, 6px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    /* 缩小二维码尺寸 */
    width: clamp(80px, 7vw, 100px);
    height: auto;
    pointer-events: none;
}

/* 二维码弹窗三角形箭头 - 调整到左侧 */
.wechat-qrcode-popup::before {
    content: '';
    position: absolute;
    top: 20px; /* 与图标中心对齐 */
    left: -8px; /* 显示在弹窗左侧 */
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: var(--primary-color); /* 箭头指向右侧 */
}

/* 二维码图片容器 */
.wechat-qrcode-popup-img {
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.wechat-qrcode-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* 悬停时显示二维码 */
.wechat-icon-container:hover .wechat-qrcode-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* 版权信息 - 修改：缩短高度，调整布局 */
.copyright {
    background: var(--primary-color);
    color: #111;
    /* 修改：缩短上下内边距 */
    padding: clamp(8px, 1vw, 12px) 0;
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: clamp(10px, 0.8vw, 12px);
}

/* 修改：合并版权信息和ICP备案 */
.copyright-info {
    text-align: center;
    margin-bottom: clamp(3px, 0.4vw, 5px);
    /* 修改：添加flex布局，使内容在一行显示 */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(5px, 0.8vw, 10px);
}

/* 修改：添加分隔符样式 */
.copyright-separator {
    margin: 0 clamp(2px, 0.3vw, 5px);
    color: #111;
    opacity: 0.7;
}

.copyright-info a {
    color: #111;
    transition: color 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.copyright-info a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-menu {
    text-align: center;
    /* 修改：调整上方边距 */
    margin-top: clamp(5px, 0.8vw, 10px);
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(8px, 1vw, 15px);
}

.footer-menu ul li {
    display: inline-block;
    line-height: 1;
}

.footer-menu ul li a {
    color: #111;
    padding: 0;
    font-size: clamp(10px, 0.8vw, 12px);
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer-menu ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 主容器行样式 - 完全参照导航栏设计 */
.footer-main .container {
    /* 修改：与导航栏对齐，使用相同的内边距和最大宽度 */
    max-width: var(--content-max-width);
    margin: 0 auto;
    /* 与导航栏完全一致的内边距 */
    padding: 0 clamp(20px, 8vw, 150px);
    width: 100%;
}

.footer-main .row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    /* 修改：进一步减少列间距，为简介腾出更多空间 */
    gap: clamp(3px, 0.5vw, 8px);
    margin: 0;
    padding-bottom: 0;
    overflow-x: visible;
}

.footer-main .row > div {
    flex: 0 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* 响应式设计 - 参照导航栏的媒体查询 */
@media (min-width: 1600px) {
    .footer-main .container {
        max-width: var(--content-max-width);
    }
}

@media (max-width: 1400px) {
    .footer-about {
        flex: 0 0 clamp(240px, 24vw, 320px);
        max-width: clamp(240px, 24vw, 320px);
    }
    .footer-category-col {
        flex: 0 0 clamp(90px, 8vw, 115px);
        max-width: clamp(90px, 8vw, 115px);
    }
    .footer-contact-col {
        flex: 0 0 clamp(115px, 11vw, 145px);
        max-width: clamp(115px, 11vw, 145px);
    }
}

@media (max-width: 1200px) {
    .footer-main .row {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: clamp(12px, 1.5vw, 20px);
    }
    
    .footer-about {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
        padding-right: 0;
    }
    
    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }
    
    .feedback-btn {
        margin: 0 auto;
        display: block;
        max-width: 140px;
    }
    
    .footer-category-col,
    .footer-contact-col {
        flex: 0 0 calc(50% - clamp(12px, 1.5vw, 20px) / 2);
        max-width: calc(50% - clamp(12px, 1.5vw, 20px) / 2);
    }
}

@media (max-width: 992px) {
    .footer-main {
        /* 进一步减少移动端的黑色背景高度 */
        padding: clamp(25px, 3.5vw, 40px) 0 clamp(15px, 2.5vw, 30px);
    }
    
    .footer-main .container {
        /* 移动端也减小内边距，与导航栏保持一致 */
        padding: 0 clamp(20px, 8vw, 150px);
    }
    
    .footer-about p {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .footer-main .container {
        /* 与导航栏的移动端内边距保持一致 */
        padding: 0 clamp(20px, 8vw, 150px);
    }
    
    .footer-category-col,
    .footer-contact-col {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }
    
    .footer-category-title,
    .footer-about p,
    .contact-info-list li {
        text-align: center;
    }
    
    .footer-category-title {
        max-width: none; /* 移动端取消字符限制 */
    }
    
    .footer-category-links li a {
        max-width: none; /* 移动端取消字符限制 */
    }
    
    .contact-info-list li {
        justify-content: center;
    }
    
    /* 修改：移动端微信图标区域居中显示 */
    .wechat-icon-container {
        text-align: center;
        display: block;
    }
    
    .wechat-icon-text {
        text-align: center;
    }
    
    /* 修改：移动端调整二维码弹窗位置，显示在图标上方 */
    .wechat-qrcode-popup {
        top: auto;
        bottom: 100%; /* 显示在图标上方 */
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        margin-left: 0;
    }
    
    .wechat-qrcode-popup::before {
        top: 100%; /* 箭头调整到弹窗底部 */
        left: 50%;
        transform: translateX(-50%);
        border: 8px solid transparent;
        border-top-color: var(--primary-color); /* 箭头指向下方 */
    }
    
    /* 在小屏幕上将版权信息和ICP备案垂直排列 */
    .copyright-info {
        flex-direction: column;
        gap: clamp(3px, 0.5vw, 5px);
    }
    
    .copyright-separator {
        display: none;
    }
}

@media (max-width: 576px) {
    .footer-main .container {
        /* 与导航栏的超小屏幕内边距保持一致 */
        padding: 0 clamp(20px, 8vw, 150px);
    }
    
    .footer-main {
        /* 移动端进一步减少高度 */
        padding: clamp(20px, 3vw, 30px) 0 clamp(10px, 2vw, 20px);
    }
    
    .copyright {
        /* 进一步缩短移动端的上下内边距 */
        padding: 8px 0;
    }
    
    .footer-menu ul {
        gap: 8px;
    }
}

/* 确保所有内容不超出页脚宽度 */
.footer-main .container {
    overflow-x: hidden;
}

/* 返回顶部按钮 */
#back-to-top {
    right: clamp(20px, 3vw, 40px);
    top: auto;
    z-index: 10;
    display: none;
}

#back-to-top .btn:focus {
    outline: 0;
    box-shadow: none;
}

#back-to-top.position-fixed {
    bottom: clamp(15px, 2vw, 20px);
}

#back-to-top .btn.btn-primary {
    width: clamp(30px, 3vw, 36px);
    height: clamp(30px, 3vw, 36px);
    line-height: clamp(30px, 3vw, 36px);
    background: rgba(0, 0, 0, 0.9);
    border-radius: 3px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(14px, 1vw, 16px);
    padding: 0;
}