/* ============================================================
   紫川珠宝 - 全站公共头部样式（header.css）
   从 index.html 抽取，所有页面统一引用
   选择器统一加 .header 前缀以提高特异性，确保覆盖各页面原有样式
   引入位置：<head> 末尾（在页面 <style> 之后），确保后加载覆盖
   ============================================================ */

/* === 跳过链接（无障碍必备）=== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #8d0da9;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1001;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

/* === 导航栏 === */
header.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    padding: 0 5% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    transition: none !important;
}
.header .header-left {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 32px;
    flex: 1;
    padding-bottom: 4px;
}
.header .header-right {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    flex: 1;
    padding-bottom: 4px;
}
.header .header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    align-self: center;
}
.header .logo-container {
    display: flex;
    align-items: center;
}
.header .logo-img {
    height: 84px;
    display: block;
}
.header .main-nav {
    display: flex;
    list-style: none;
    gap: 32px;
}
.header .nav-link {
    text-decoration: none !important;
    color: #3d3d3d !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    display: inline-block !important;
    line-height: 24px !important;
    letter-spacing: 1px !important;
    /* 重置各页面可能残留的属性 */
    position: static !important;
    min-height: auto !important;
    padding-bottom: 0 !important;
    transition: none !important;
    text-shadow: none !important;
}
.header .nav-link.active {
    color: #8d0da9 !important;
    font-weight: 600 !important;
}
/* 重置各页面可能存在的下划线伪元素 */
.header .nav-link::after,
.header .nav-link::before,
.header .nav-link:hover::after,
.header .nav-link:hover::before,
.header .nav-link.active::after,
.header .nav-link.active::before {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
    background: transparent !important;
}

/* === 汉堡菜单样式 === */
.header .hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}
.header .hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
}

/* === 响应式：768px === */
@media (max-width: 768px) {
    header.header {
        padding: 12px 5% !important;
    }
    .header .header-left {
        gap: 16px !important;
        padding-bottom: 4px !important;
    }
    .header .header-right {
        gap: 16px !important;
        padding-bottom: 4px !important;
    }
    .header .main-nav {
        gap: 16px !important;
    }
    .header .nav-link {
        font-size: 15px !important;
    }
}

/* === 响应式：480px === */
@media (max-width: 480px) {
    header.header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 3px 5% !important;
        background: #ffffff !important;
        box-shadow: none !important;
        position: fixed !important;
        z-index: 1000 !important;
    }

    .header .hamburger {
        display: flex !important;
        position: relative !important;
        order: 1 !important;
        width: 30px !important;
        height: 22px !important;
        z-index: 1001 !important;
    }

    .header .hamburger span {
        height: 3px !important;
        border-radius: 2px !important;
    }

    .header .header-center {
        order: 2 !important;
    }

    .header .header-left,
    .header .header-right {
        order: 3 !important;
    }

    .header .header-left,
    .header .header-right {
        position: fixed !important;
        left: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        padding: 16px 0 !important;
        z-index: 999 !important;
        display: none !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        border-top: 1px solid #f0f0f0 !important;
    }

    /* header-left 紧贴导航栏下方 */
    .header .header-left.active {
        display: flex !important;
        top: 86px !important;
    }

    /* header-right 紧跟 header-left 之后 */
    /* header-left 高度 ≈ 4项×34px + 3gap×8px + 32px padding ≈ 198px */
    .header .header-right.active {
        display: flex !important;
        top: 284px !important;
    }

    .header .main-nav {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .header .logo-container {
        display: flex !important;
        align-items: center !important;
        margin-top: 0 !important;
    }

    .header .logo-img {
        height: 80px !important;
        display: block !important;
        opacity: 1 !important;
    }

    .header .nav-link {
        font-size: 15px !important;
        text-align: center !important;
        padding: 12px 0 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
        color: #000000 !important;
        font-weight: 400 !important;
        text-decoration: none !important;
        font-family: "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif !important;
        width: 100% !important;
    }

    .header .nav-link:hover,
    .header .nav-link.active {
        color: #8d0da9 !important;
    }
}

/* ============================================================
   统一内容区与导航栏的间距（与首页一致：96px）
   修复各栏目页面文字与导航栏重叠问题
   修复栏目背景色与大图之间的白色缝隙
   ============================================================ */
.main-image-section {
    margin-top: 96px !important;
}
.main-content {
    margin-top: 96px !important;
}
/* 用伪元素让 hero-section 的背景图向上延伸，消除导航栏下方白色缝隙 */
.hero-section {
    position: relative !important;
}
.hero-section::before {
    content: '' !important;
    position: absolute !important;
    top: -96px !important;
    left: 0 !important;
    right: 0 !important;
    height: 96px !important;
    background-image: inherit !important;
    background-size: inherit !important;
    background-position: inherit !important;
    background-repeat: inherit !important;
    z-index: 0 !important;
}
/* 确保 overlay/content 在伪元素之上 */
.hero-section .hero-overlay,
.hero-section .hero-content {
    position: relative !important;
    z-index: 1 !important;
}
.product-detail {
    padding-top: 96px !important;
}
.news-detail {
    padding-top: 100px !important;
}
