.main-content {
    width: 1200px;
    display: flex;
    gap: 30px;
    margin: 100px auto 10px;
    align-items: flex-start;
}

/* 左侧分类列表 */
.category-list {
    flex: 1 1 25%;
    border: 1px solid #ddd;
    box-sizing: border-box;
    background-color: #f9f9f9;
    border-top-left-radius: 20px;
    overflow: hidden;
}

.category-list h3 {
    font-size: 1.2rem;
    background: #192857;
    padding: 15px;
    border-top-left-radius: 20px;
    color: #fff;
    text-align: center;
    margin: 0;
}

.category-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list ul li {
    position: relative;
    border-bottom: 1px solid #bbb;
    transition: background-color 0.3s;
}

.category-list ul li a {
    display: block;
    width: 100%;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
}

/* 箭头只给一级菜单 */
.category-list ul li::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    width: 8px;
    height: 8px;
    border-top: 2px solid #999;
    border-right: 2px solid #999;
    transform: translateY(-50%) rotate(45deg);
    transition: 0.3s;
    z-index: 1;
    pointer-events: none;
}

/* hover + 选中样式统一 */
.category-list ul li:hover,
.category-list ul li.active {
    background-color: #1c243e;
}
.category-list ul li:hover>a,
.category-list ul li.active>a {
    color: #fff;
}
.category-list ul li:hover::after,
.category-list ul li.active::after {
    border-color: #fff;
}

/* ===================== 二级菜单 ===================== */
.category-list ul ul {
    display: none;
    background: #f9f9f9;
}
.category-list ul li.active ul {
    display: block !important;
}
.category-list ul ul li a {
    padding-left: 30px !important;
    font-size: 14px;
}
.category-list ul ul li::after {
    display: none !important;
}

/* 二级菜单 hover 和选中高亮 */
.category-list ul ul li:hover {
    background-color: #f9f9f9;
}
.category-list ul ul li.active {
    background-color: #f9f9f9;
}
.category-list ul ul li.active a {
   color: #192857;
   font-weight: 600;
}
.category-list ul ul li a:hover {
    color: #192857;
    font-weight: 600;
}
 
/* 右侧产品列表 */
.product-list {
    flex: 3 1 75%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 0px;
}

.product-item-p {
    border: 1px solid #ddd;
    padding: 10px;
    box-sizing: border-box;
    background: #fff;
    transition: box-shadow 0.3s;
    margin: 0 0 25px;
}

.product-item-p:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-item-p img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
    object-fit: contain;
}

.product-info {
    font-size: 0.9rem;
    color: #333;
}

.product-name {
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
}

.product-category {
    font-size: 0.85rem;
    color: #777;
    text-align: center;
}

/* ===================== 分页 ===================== */
.btn-li{
    width: 1200px;
    margin: auto;
    margin-bottom: 100px;
    display: flex;
    justify-content: end;
}

.btn-li ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 5px;
}

.btn-li ul li {
    display: inline-block;
    margin-left: 0;
}

.btn-li ul li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    color: #666;
    text-decoration: none;
    font-family: '微软雅黑';
    z-index: 1;
    position: relative;
    padding: 0 !important;
    text-align: center;
}

.btn-li ul li a::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #192857;
    border-radius: 10px;
    z-index: -1;
    transform: scale(0);
    transition: 0.5s;
}

.btn-li ul li a:hover{
    color: #fff;
}

.btn-li ul li a:hover::before {
    transform: scale(1,1);
}


.product-a{
    font-size: 20px;
    font-weight: 550;
    text-decoration: none;
    color: inherit;
}
.product-a-s{
    font-size: 16px;
    text-decoration: none;
    color: inherit;
}

/* ==============================================
   箭头展开收起动画
============================================== */
.category-list ul li:has(ul)::after {
    content: "";
    position: absolute;
    top: 18px !important;
    right: 15px;
    width: 8px;
    height: 8px;
    border-top: 2px solid #999;
    border-right: 2px solid #999;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    z-index: 2;
    pointer-events: none;
}
  
.category-list ul li:has(ul).active::after,
.category-list ul li:has(ul):has(ul[style*="block"])::after {
    transform: rotate(135deg) !important;
}
  
.category-list ul ul li::after {
    display: none !important;
}

/* ===================== 移动端 ===================== */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        margin: 45px auto 45px;
        width: 100% !important;
    }
    .category-list {
        width: 90%;
        margin: auto;
    }
    .product-list {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
    .product-item-p{
        width: 90%;
        margin: auto;
    }

    .btn-li{
        width: 90%;
        margin: 20px auto;
        justify-content: center;
    }

    .btn-li ul li a {
        width: 40px;
        padding: 0 !important;
        text-align: center;
    }
    
}
/* 电脑端隐藏手机端，手机端隐藏电脑端 */
@media (min-width: 769px) {
  .btn-li .mobile-only { display: none !important; }
}
@media (max-width: 768px) {
  .btn-li .pc-only { display: none !important; }
}

/* 高亮样式 */
.btn-li ul li a.current {
  background: #192857;
  color: #fff !important;
  border-color: #192857;
}
@media (max-width: 480px) {
    .product-list {
        grid-template-columns: 1fr;
    }
}

@media screen and (min-width:769px) and (max-width:1024px){
    .main-content {
        width: 900px;
    }
    .btn-li{
        width: 900px;
    }
    .nav-bar {
        padding: 0 0;
        text-align: center;
    }
}