:root {
    --color-primary: #007bff;
    --color-text: #555;
    --color-background: #ffffff;
    --color-shadow: rgba(0, 0, 0, 0.05);
    
    /* 布局变量微调 */
    --nav-padding: 10px 15px;
    --link-line-height: 20px; 
    --nav-gap-h: 25px;
    --nav-gap-v: 10px;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f7f7; /* 极浅灰色背景 */
    color: #333;
}
header {
    background: white; /* 顶部栏使用白色，突出内容 */
    color: #B72022; /* 品牌色 */
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); /* 柔和阴影，增加层次感 */
    position: sticky; /* 顶部吸附 */
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}
header h1 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    margin-right: 15px;
}

header .site-logo {
    height: 50px;
    margin: 0 16px;
    display: block;
    object-fit: contain;
}

#category-nav-container {
    position: sticky;
    top: 50px; 
    padding: var(--nav-padding);
    background-color: var(--color-background);
    /* 优化阴影：更轻薄，仅有底部边缘感 */
    box-shadow: 0 1px 4px var(--color-shadow);
    z-index: 90;
    
    display: flex;
    align-items: flex-start; 
}

/* 链接容器：限制为两行高度的关键 */
#category-links {
    flex-grow: 1; 
    display: flex;
    flex-wrap: wrap;
    gap: var(--nav-gap-v) var(--nav-gap-h); 
    
    /* 高度计算保持不变 */
    /* height: calc(2 * var(--link-line-height) + var(--nav-gap-v));  */
    height: 25px;
    overflow-y: hidden; 
    
    max-height: none !important; 
    padding-right: 0; 
    
    /* 增加动画：让容器内元素的布局变化更平滑 */
    transition: all 0.3s ease; 
}

/* ======================================= */
/* 2. 链接元素样式 (核心美化)             */
/* ======================================= */
.category-link {
    text-decoration: none;
    color: var(--color-text);
    font-size: 14.5px; /* 稍微减小字体，增加精致感 */
    font-weight: 500; /* 默认使用中等字重，更清晰 */
    padding: 3px 0; 
    line-height: var(--link-line-height); 
    position: relative; 
    white-space: nowrap;
    
    /* 链接文字过渡，使悬停平滑 */
    transition: color 0.2s ease;
    
    flex-shrink: 0; 
}

/* 悬停状态 (Hover)：添加动态反馈 */
.category-link:hover {
    color: var(--color-primary); 
}

/* 激活状态 (Active) */
.category-link.active {
    color: var(--color-primary);
    font-weight: 600; 
}

/* 激活状态的底部分割线 (指示器) - 增强动态感 */
.category-link.active::after,
.category-link:hover::after {
    content: '';
    position: absolute;
    left: 50%; /* 从中心开始 */
    bottom: -4px; 
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px;
    
    /* 悬停时的默认状态 */
    width: 0; 
    transform: translateX(-50%);
    
    /* 动画过渡：宽度和颜色同时平滑变化 */
    transition: width 0.3s cubic-bezier(0.2, 0.8, 0.4, 1), background-color 0.3s;
}

/* 悬停时指示器从中心展开 */
.category-link:hover::after {
    width: 100%; /* 悬停时展开至全宽 */
}

/* 激活项始终保持完全展开 */
.category-link.active::after {
    width: 100%;
}

main {
    padding: 0 10px; /* 侧边留白 */
    max-width: 1200px;
    margin: 0 auto;
}

/*
 * --------------------------------
 * 产品分类 Section 样式
 * --------------------------------
 */
.product-category {
    margin: 25px 0; /* 增加分类间距 */
    padding: 0;
    padding-top: 80px;
    margin-top: -80px;
}
.product-category h2 {
    /* color: #1a4f8d; */
    border-left: 5px solid #B72022; /* 侧边高亮线 */
    padding-left: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 600;
}

/*
 * --------------------------------
 * 产品卡片 (Product Card) 优化
 * --------------------------------
 */
.product-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;

    border: none; /* 移除生硬边框 */
    background-color: white;
    border-radius: 12px; /* 柔和圆角 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07); /* 精致柔和的阴影 */
    overflow: hidden;

    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer; /* 保持指针样式，暗示可点击 */
}
.product-card:active {
    transform: scale(0.99); /* 触摸反馈 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    /* background-color: #eef2f5; */
    background-color: #fcfcfc;
    /* 仅顶部圆角，与卡片圆角保持一致 */
    border-radius: 12px 12px 0 0;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 确保图片完整显示 */
}

.product-info {
    padding: 15px;
    background-color: #fcfcfc;
}
.product-info h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
    font-weight: 700;
}
.product-info p {
    margin-top: 5px;
    color: #888; /* 描述/型号使用柔和的灰色 */
    font-size: 0.9em;
    line-height: 1.4;
}

/* --- 突出主推产品样式 --- */
.main-product {
    /* border: 1px solid #cceeff; */
    background-color: #f7fcff; /* 极浅的品牌色背景 */
    /* box-shadow: 0 8px 20px rgba(0, 150, 255, 0.15); */
}

/* --- 子产品列表布局微调 --- */
.sub-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 10px;
}

/* --- 备案号样式优化 --- */
.site-footer {
    background-color: #f8f8f8; /* 浅灰色背景，与 body 呼应 */
    padding: 20px 15px 30px;  /* 增加底部留白，适合手机滑动 */
    text-align: center;
    border-top: 1px solid #eee;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.copyright {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

.beian-info {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* 手机端自动换行 */
    gap: 8px;
}

.beian-info a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 鼠标悬停变红，呼应 BOVE 主色 */
.beian-info a:hover {
    color: #A00000;
}

.divider {
    color: #ddd;
}

.gongan-link img {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* 针对移动端的微调 */
@media (max-width: 480px) {
    .ms-item {
        padding: 12px 15px;
    }
    .ms-title-cn {
        font-size: 17px;
    }
    .ms-content {
        font-size: 14px;
    }
    .beian-info {
        flex-direction: column; /* 手机端垂直排列更整齐 */
        gap: 5px;
    }
    .divider {
        display: none; /* 手机端隐藏竖线 */
    }
}

/*
 * --------------------------------
 * 媒体查询：适配平板和桌面
 * --------------------------------
 */
@media (min-width: 600px) {
    main {
        padding: 0 20px;
    }

    /* 桌面端：子产品排成两列 */
    .sub-list {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 桌面端：主推产品改为左右布局 */
    .main-product {
        flex-direction: row;
    }
    .main-product .product-image {
        width: 35%; /* 图片占左侧 */
        height: auto;
        border-radius: 12px 0 0 12px; /* 仅左侧圆角 */
    }
    .main-product .product-info {
        width: 65%; /* 信息占右侧 */
    }
}