/* ========================================
   HIRSCHMANN轴承产品库 - 红色主题样式
   ======================================== */

:root {
    --red-primary: #c0392b;
    --red-dark: #96281b;
    --red-light: #e74c3c;
    --red-bg: #fdf2f2;
    --gray-dark: #333;
    --gray-mid: #666;
    --gray-light: #999;
    --gray-border: #e0e0e0;
    --white: #fff;
    --font-main: "微软雅黑", "Microsoft YaHei", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.8;
    color: var(--gray-dark);
    background-color: #f8f8f8;
}

a {
    color: var(--red-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--red-dark);
}

/* ---- 顶部导航 ---- */
.navbar {
    background: var(--white);
    color: var(--gray-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    border-bottom: 1px solid var(--gray-border);
}

.navbar .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.navbar .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar .logo-area:hover {
    color: var(--gray-dark);
}

.navbar .logo-area img {
    height: 60px;
    width: auto;
}

.navbar .logo-text {
    font-size: 16px;
    font-weight: bold;
    color: var(--gray-dark);
    letter-spacing: 0.5px;
}

.navbar .logo-area:hover .logo-text {
    color: var(--red-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    color: var(--gray-mid);
    font-size: 15px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.nav-links > li > a::after {
    content: '▼';
    font-size: 9px;
    margin-left: 2px;
    transition: transform 0.2s;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
    color: var(--red-primary);
    border-bottom-color: var(--red-primary);
}

.nav-links > li > a.active::after {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 8px 0;
    z-index: 200;
    margin-top: 2px;
}

.dropdown-menu.open {
    display: block;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: var(--gray-dark);
    font-size: 14px;
    border-bottom: none;
    transition: all 0.15s;
}

.dropdown-menu a:hover {
    background: var(--red-bg);
    color: var(--red-primary);
}

.dropdown-menu .series-name {
    font-weight: bold;
    color: var(--gray-dark);
}

.dropdown-menu a:hover .series-name {
    color: var(--red-primary);
}

.dropdown-menu .series-desc {
    font-size: 12px;
    color: var(--gray-light);
    margin-left: 8px;
}

.dropdown-menu .series-badge {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.dropdown-menu .series-badge.maintain {
    background: #fff3e0;
    color: #e67e22;
}

.dropdown-menu .series-badge.free {
    background: #e8f5e9;
    color: #27ae60;
}

.dropdown-menu .view-all-link {
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--red-primary);
    border-top: 1px solid var(--gray-border);
    font-weight: 500;
}

.dropdown-menu .view-all-link:hover {
    background: var(--red-primary);
    color: #fff;
}

/* 无下拉的直接链接（如首页） */
.nav-links > li.no-dropdown > a::after {
    display: none;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-dark);
    font-size: 24px;
    cursor: pointer;
}

/* ---- Banner ---- */
.banner {
    background: url('../images/banner-bg.jpg.png') center/cover no-repeat;
    /* 纯色渐变备用，不需要背景图时启用这行并注释掉上面这行 */
    /* background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-primary) 50%, var(--red-light) 100%); */
    color: var(--white);
    text-align: center;
    padding: 100px 20px;
    position: relative;
}

/* 背景图上的半透明遮罩 */
.banner::before {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(150,40,27,0.85) 0%, rgba(192,57,43,0.75) 50%, rgba(231,76,60,0.65) 100%);
    z-index: 0;
}

.banner .banner-content {
    position: relative;
    z-index: 1;
}

.banner .banner-logo {
    max-height: 70px;
    margin-bottom: 16px;
    display: inline-block;
}

.banner h1 {
    font-size: 32px;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.banner p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- 主体容器 ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- 系列分组标题 ---- */
.section-title {
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title > a,
.section-title > span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.section-title h2 {
    font-size: 20px;
    color: var(--red-primary);
    font-weight: bold;
}

.section-title a h2 {
    transition: color 0.2s;
}

.section-title a h2:hover {
    color: var(--red-dark);
}

.section-title .view-all {
    margin-left: auto;
    font-size: 13px;
    color: var(--gray-light);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.section-title .view-all:hover {
    color: var(--red-primary);
}

.section-title .badge {
    background: var(--red-primary);
    color: var(--white);
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
}

/* ---- 产品卡片网格 ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--red-primary);
}

.product-card h3 {
    font-size: 16px;
    color: var(--red-primary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.product-card p {
    font-size: 14px;
    color: var(--gray-mid);
    line-height: 1.7;
    flex: 1;
}

.product-card .tags {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-card .tag {
    background: var(--red-bg);
    color: var(--red-primary);
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
}

.product-card .read-more {
    margin-top: 14px;
    font-size: 13px;
    color: var(--red-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.product-card .read-more:hover {
    color: var(--red-dark);
}

/* 空系列占位卡片 */
.product-card.empty-card {
    border-style: dashed;
    background: #fafafa;
    cursor: default;
}

.product-card.empty-card:hover {
    box-shadow: none;
    transform: none;
    border-color: var(--gray-border);
}

.product-card.empty-card p {
    color: var(--gray-light);
    text-align: center;
    font-size: 14px;
}

/* 空系列提示（列表页） */
.empty-notice {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-light);
    font-size: 15px;
    border: 2px dashed var(--gray-border);
    border-radius: 8px;
    background: #fafafa;
}

/* ---- 新闻卡片网格 ---- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.news-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.news-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--red-primary);
}

.news-card .news-date {
    font-size: 12px;
    color: var(--gray-light);
    margin-bottom: 8px;
}

.news-card h3 {
    font-size: 16px;
    color: var(--red-primary);
    margin-bottom: 10px;
    line-height: 1.5;
    transition: color 0.2s;
}

.news-card:hover h3 {
    color: var(--red-dark);
}

.news-card p {
    font-size: 14px;
    color: var(--gray-mid);
    line-height: 1.7;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 分页 ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
    padding: 10px 0 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-mid);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.pagination a:hover {
    border-color: var(--red-primary);
    color: var(--red-primary);
}

.pagination .active {
    background: var(--red-primary);
    border-color: var(--red-primary);
    color: #fff;
    cursor: default;
}

.pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- 文章详情页 ---- */
.article {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-border);
}

.article-header h1 {
    font-size: 22px;
    color: var(--red-primary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 12px;
}

.article-meta {
    text-align: center;
    color: var(--gray-light);
    font-size: 13px;
}

.article-content p {
    margin: 14px 0;
    text-indent: 2em;
    font-size: 15px;
    color: var(--gray-dark);
}

.article-tags {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tags .label {
    font-size: 13px;
    color: var(--gray-light);
}

.article-tags .tag {
    background: var(--red-bg);
    color: var(--red-primary);
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
}

.article-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-border);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.article-nav a {
    color: var(--gray-mid);
}

.article-nav a:hover {
    color: var(--red-primary);
}

/* ---- 页脚 ---- */
.footer {
    background: #2c2c2c;
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

.footer .qr-section {
    margin-bottom: 16px;
}

.footer .qr-section p {
    font-size: 13px;
    margin-bottom: 8px;
}

.footer .qr-section img {
    display: inline-block;
    width: 100px;
    height: auto;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
}

.footer .contact-info {
    font-size: 13px;
    margin-bottom: 16px;
}

.footer .contact-info p {
    margin-bottom: 4px;
}

.footer .copyright {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 16px;
    line-height: 1.8;
}

.footer .friend-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.footer .friend-links span {
    margin-right: 4px;
}

.footer .friend-links a {
    color: rgba(255,255,255,0.5);
    margin: 0 8px;
    transition: color 0.2s;
}

.footer .friend-links a:hover {
    color: rgba(255,255,255,0.8);
}

/* ---- 面包屑 ---- */
.breadcrumb {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
    font-size: 13px;
    color: var(--gray-light);
}

.breadcrumb a {
    color: var(--gray-light);
}

.breadcrumb a:hover {
    color: var(--red-primary);
}

.breadcrumb span {
    margin: 0 6px;
}

/* ---- 侧边悬浮二维码 ---- */
.float-qr {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.float-qr-inner {
    background: #fff;
    border: 1px solid var(--gray-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 2px 12px rgba(0,0,0,0.1);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s;
    width: 150px;
}

.float-qr-inner:hover {
    box-shadow: 2px 2px 20px rgba(0,0,0,0.18);
}

.float-qr-inner img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 120px;
    margin: 0 auto;
    border-radius: 4px;
    object-fit: contain;
}

.float-qr-placeholder {
    display: block;
    width: 120px;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    line-height: 120px;
    font-size: 12px;
    color: #aaa;
    background: #fafafa;
}

.float-qr-text {
    font-size: 11px;
    color: var(--gray-dark, #333);
    margin-top: 8px;
    line-height: 1.5;
    white-space: nowrap;
}

/* 收起/展开按钮 */
.float-qr-toggle {
    width: 28px;
    height: 56px;
    background: var(--red-primary, #c41230);
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: -28px;
    transform: translateY(-50%);
    box-shadow: 2px 0 8px rgba(196,18,48,0.3);
    transition: background 0.2s;
}

.float-qr-toggle:hover {
    background: var(--red-dark, #a30f28);
}

/* 收起状态 */
.float-qr.collapsed {
    transform: translateY(-50%) translateX(-178px);
}

.float-qr.collapsed .float-qr-toggle {
    right: -56px;
}

@media (max-width: 768px) {
    .float-qr {
        display: none;
    }
}

/* ---- Tab 切换 ---- */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-border);
    margin-bottom: 10px;
}

.tab-btn {
    padding: 10px 28px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--gray-mid);
}

.tab-btn.active {
    color: var(--red-primary);
    border-bottom-color: var(--red-primary);
}

/* ---- 品牌介绍 ---- */
.brand-intro {
    background: #fff;
    border-bottom: 1px solid var(--gray-border);
    padding: 36px 0;
}

.brand-intro-body h2 {
    font-size: 22px;
    color: var(--red-primary);
    margin-bottom: 16px;
    font-weight: 700;
}

.brand-intro-body p {
    font-size: 14px;
    color: var(--gray-mid);
    line-height: 2;
    text-indent: 2em;
    margin-bottom: 10px;
}

.brand-intro-body p:last-of-type {
    margin-bottom: 0;
}

.brand-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-border);
}

.brand-highlight-item {
    text-align: center;
    padding: 16px 8px;
    background: var(--red-bg);
    border-radius: 8px;
}

.brand-highlight-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--red-primary);
    line-height: 1.3;
}

.brand-highlight-label {
    display: block;
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 4px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 0;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border-top: 1px solid var(--gray-border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links > li > a {
        padding: 14px 20px;
        border-bottom: 1px solid var(--gray-border);
        color: var(--gray-dark);
        font-size: 15px;
        justify-content: space-between;
    }

    .nav-links > li > a::after {
        font-size: 10px;
    }

    .nav-links > li > a:hover,
    .nav-links > li > a.active {
        background: var(--red-bg);
        color: var(--red-primary);
        border-bottom-color: var(--gray-border);
    }

    /* 移动端下拉菜单 */
    .dropdown-menu {
        position: static;
        transform: none;
        min-width: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin-top: 0;
        background: #f9f9f9;
    }

    .dropdown-menu.open {
        display: block;
        animation: none;
    }

    .dropdown-menu a {
        padding: 12px 36px;
        font-size: 14px;
        border-bottom: 1px solid #eee;
    }

    .dropdown-menu .series-desc {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .brand-highlights {
        grid-template-columns: repeat(2, 1fr);
    }

    .banner h1 {
        font-size: 24px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .article-nav {
        flex-direction: column;
        gap: 12px;
    }
}
