/* style.css */

/*
Theme Name:uonev2.0
Theme URI: https://yourwebsite.com
Author: Your Name
Author URI: https://yourwebsite.com
Description: A custom theme for UONE automatic equipment.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: uone
*/

/* === Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* === Header === */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo img {
    height: 40px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #ff9a00;
}

/* === Hero Section === */
.hero {
    background-image: url('<?php echo get_template_directory_uri(); ?>/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #ff9a00;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #e68a00;
}

.btn-secondary {
    background-color: transparent;
    color: #333;
    border: 1px solid #333;
}

.btn-secondary:hover {
    background-color: #333;
    color: white;
}

/* === Product Categories === */
.product-categories {
    padding: 5rem 0;
    background-color: #fff;
}

.product-categories .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.category-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-body {
    padding: 1rem;
    text-align: center;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

/* === Featured Products === */
.featured-products {
    padding: 5rem 0;
    background-color: #f8f9fa;
}

.featured-products .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-card .card-body {
    padding: 1rem;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

/* === About Us === */
.about-section {
    padding: 5rem 0;
    background-color: #fff;
}

.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: #666;
}

.about-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* === Services === */
.services-section {
    padding: 5rem 0;
    background-color: #f8f9fa;
}

.services-section .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-item {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
}

.service-item h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.service-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* === Partners === */
.partners-section {
    padding: 5rem 0;
    background-color: #fff;
}

.partners-section .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

.partners-logos {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.partners-logos img {
    width: 120px;
    height: 60px;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.partners-logos img:hover {
    opacity: 1;
}

/* === Contact Form === */
.contact-form-section {
    padding: 5rem 0;
    background-color: #f8f9fa;
}

.contact-form-section .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: #333;
}

.contact-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* === Footer === */
footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #ff9a00;
}

.footer-column p, .footer-column ul {
    margin-bottom: 1rem;
    color: #ccc;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #ff9a00;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #ff9a00;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* === Floating Button === */
.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .hero {
        height: 60vh;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .about-content {
        flex-direction: column;
    }

    .about-text {
        order: 2;
    }

    .about-image {
        order: 1;
        margin-bottom: 2rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

/* 页面整体容器 */
.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 通用区域标题样式 */
.section-title {
    font-size: 1.5rem;
    color: #333;
    margin: 2rem 0 1rem 1rem; /* 与内容区左右对齐 */
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    text-align: center; /* 居中标题 */
}

/* 分类网格布局 */
.product-categories-grid {
    margin: 2rem auto;
    padding: 0 1rem;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.category-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center; /* 居中卡片内容 */
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.category-header {
    padding: 1rem;
    text-align: center;
}

.category-title {
    margin: 0.5rem 0 0;
    font-size: 1.1rem;
}

.category-title a {
    text-decoration: none;
    color: inherit;
}

.category-content {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #666;
    text-align: left; /* 描述左对齐 */
}

/* 产品网格布局 */
.products-grid {
    margin: 2rem auto;
    padding: 0 1rem;
}

.products-grid .section-title {
    text-align: center; /* 产品列表标题也居中 */
}

.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.product-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.entry-header {
    padding: 1rem;
}

.entry-title {
    margin: 0.5rem 0 0;
    font-size: 1.2rem;
}

.entry-title a {
    text-decoration: none;
    color: inherit;
}

.entry-content {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #666;
}
/* 为 taxonomy 归档页面添加基础样式 */
.taxonomy-description {
    margin: 1rem 0;
    padding: 0 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* 通用区域标题样式 */
.section-title {
    font-size: 1.5rem;
    color: #333;
    margin: 2rem 0 1rem 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
    text-align: center;
}

/* 页面标题样式 */
.page-header {
    margin: 1rem 0;
    padding: 0 1rem;
    text-align: center;
}

.page-title {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

/* 分类网格布局 */
.product-categories-grid {
    margin: 2rem auto;
    padding: 0 1rem;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.category-card {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.category-header {
    padding: 1rem;
    text-align: center;
}

.category-title {
    margin: 0.5rem 0 0;
    font-size: 1.1rem;
}

.category-title a {
    text-decoration: none;
    color: inherit;
}

.category-content {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #666;
    text-align: left;
}

/* 产品网格布局 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 1rem;
}

.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.product-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.entry-header {
    padding: 1rem;
}

.entry-title {
    margin: 0.5rem 0 0;
    font-size: 1.2rem;
}

.entry-title a {
    text-decoration: none;
    color: inherit;
}

.entry-content {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* 分类卡片布局优化 */
.category-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-thumbnail-wrapper {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.category-thumbnail {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.no-thumbnail-placeholder {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.category-description {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-item {
        padding: 12px;
    }
    
    .category-thumbnail-wrapper {
        height: 120px;
    }
}

/* 分类卡片布局优化 */
.category-item {
    flex: 1;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-thumbnail-wrapper {
    width: 100%;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.category-thumbnail {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.no-thumbnail-placeholder {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.category-description {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 横向布局：每行4个 */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.category-item {
    flex: 1 1 calc(25% - 16px);
    min-width: calc(25% - 16px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-item {
        flex: 1 1 calc(50% - 16px);
        min-width: calc(50% - 16px);
    }
}

@media (max-width: 480px) {
    .category-item {
        flex: 1 1 calc(100% - 16px);
        min-width: calc(100% - 16px);
    }
}

/* === 全新产品网格布局 === */

/* 应用网格布局到容器 */
.my-unique-product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important; /* 确保不受最大宽度限制 */
}

/* 定义每个网格项（即产品卡片）的样式 */
.my-unique-product-grid .product-card {
    display: flex !important;
    flex-direction: column;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
    width: 100% !important; /* 强制填满网格项 */
    min-width: 0; /* 允许内容收缩 */
}

/* 卡片悬停效果 */
.my-unique-product-grid .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 确保卡片内图片和文字正常显示 */
.my-unique-product-grid .product-card .product-thumbnail {
    max-width: 100%;
    height: 120px;
    object-fit: cover;
    margin-bottom: 12px;
    display: block;
}

.my-unique-product-grid .product-card .entry-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    flex-grow: 1;
    word-break: break-word; /* 强制长单词换行 */
    overflow-wrap: break-word; /* 同上 */
}

.my-unique-product-grid .product-card .entry-content {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .my-unique-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .my-unique-product-grid {
        grid-template-columns: 1fr !important;
    }
}
.pagination-container {
    margin: 20px 0;
    text-align: center;
}
.pagination-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pagination-container li {
    display: inline-block;
    margin: 0 5px;
}
.pagination-container a,
.pagination-container span {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}
.pagination-container a:hover,
.pagination-container .current {
    background-color: #007cba;
    color: white;
}

/* --- Mobile Menu Enhancement for Header Nav --- */

/* 针对移动端的样式 */
@media screen and (max-width: 768px) {

    /* 1. 隐藏默认的导航菜单 - 优化样式 */
    .mobile-nav {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important; /* 初始位置在屏幕外 - 强制 */
        width: 280px !important;
        height: 100vh !important;
        background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%) !important; /* 柔和渐变背景 */
        z-index: 1000 !important;
        /* 平滑的滑入滑出效果 */
        transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important; 
        overflow-y: auto !important;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15) !important;
        padding: 20px !important;
    }

    /* 2. 当菜单激活时的显示状态 */
    .mobile-nav.active {
        right: 0 !important; /* 移动到屏幕内 - 强制 */
    }

    /* 3. 菜单列表样式优化 */
    .mobile-nav ul {
        list-style-type: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav li {
        border-bottom: 1px solid #ddd; /* 分割线 */
    }

    .mobile-nav li:last-child {
        border-bottom: none; /* 最后一项无分割线 */
    }

    .mobile-nav a {
        display: block;
        padding: 15px 10px; /* 增加点击热区 */
        color: #333 !important;
        text-decoration: none;
        font-size: 16px;
        transition: background-color 0.2s ease, color 0.2s ease; /* 悬停动画 */
    }

    .mobile-nav a:hover {
        background-color: #e0e7ff; /* 悬停背景色 */
        color: #0073aa !important; /* 悬停文字颜色 */
    }

    /* 4. 创建一个遮罩层，用于点击收起菜单 - 优化过渡 */
    .menu-overlay {
        display: none; /* 默认隐藏 */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        /* 遮罩层的淡入淡出效果 */
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .menu-overlay.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    /* 5. 汉堡菜单按钮样式 - 放在右边，添加动画 */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 10px;
        color: #333;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1001;
        text-decoration: none;
        line-height: 1;
        /* 添加一个微妙的背景，使其在复杂背景下更清晰 */
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 4px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        color: #0073aa;
        background-color: white;
        transform: scale(1.05); /* 悬停放大效果 */
    }
}

/* 桌面端保持不变 */
@media screen and (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
    .mobile-nav {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow-y: visible !important;
        right: auto !important;
        transition: none !important;
    }
    .mobile-nav ul {
        display: flex; /* 假设桌面端是flex布局 */
    }
    .mobile-nav li {
        border-bottom: none; /* 桌面端无分割线 */
    }
    .mobile-nav a {
        padding: 10px 15px; /* 桌面端默认内边距 */
    }
}

/* --- 移动端新闻列表与相关文章单列布局优化 --- */
@media screen and (max-width: 768px) {
    /* 通用规则：匹配常见的新闻卡片类名 */
    .post-item,
    .related-post,
    .news-card,
    .article-card,
    .item {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 通用规则：匹配常见的网格容器类名 */
    .posts-grid,
    .related-posts-grid,
    .news-list,
    .articles-container,
    .grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.5rem !important; /* 设置合适的行间距 */
    }

    /* 优化新闻标题的换行 */
    .post-item h2, 
    .post-item .entry-title,
    .related-post h3,
    .related-post .title,
    .news-card h2,
    .article-card h3 {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important; /* 允许单词内部换行，以优化英文长词 */
    }
}
/* --- 移动端“相关文章”列表单列布局优化 --- */
@media screen and (max-width: 768px) {
    /* 强制相关文章网格为单列 */
    .related-news-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.5rem !important;
    }

    /* 确保每个卡片宽度为100% */
    .related-news-card {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}
/* --- 移动端“上一篇/下一篇”导航优化 - 第二版 --- */
@media screen and (max-width: 768px) {
    /* 将导航改为垂直堆叠 */
    .nav-navigation {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* 优化导航链接的样式 */
    .nav-navigation a {
        display: block !important;
        padding: 0.75rem 1rem !important; /* 增加内边距 */
        text-decoration: none !important;
        color: #0073aa !important;
        border-radius: 4px !important;
        transition: all 0.2s ease !important;
        white-space: normal !important; /* 允许换行 */
        overflow-wrap: break-word !important; /* 在边界内换行 */
        word-wrap: break-word !important; /* 兼容性 */
        hyphens: auto !important; /* 允许单词内部换行 */
        max-width: 100% !important; /* 确保宽度不被父容器限制 */
    }

    .nav-navigation a:hover {
        background-color: #e0e7ff !important;
        color: #00568c !important;
    }
}

/* --- 移动端新闻列表页单列布局优化 - 精确版 --- */
@media screen and (max-width: 768px) {
    /* 强制新闻网格为单列 */
    .news-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.5rem !important;
    }

    /* 确保每个新闻卡片宽度为100% */
    .news-card {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}
/* --- 移动端产品详情页 Tab 标签栏优化 - 增强版 --- */
@media screen and (max-width: 768px) {
    /* 保持Tab导航为水平排列，但增加间距和高度 */
    .tab-navigation {
        display: flex !important;
        flex-direction: row !important; /* 保持水平排列 */
        border-bottom: 1px solid #ddd !important; /* 底部分割线 */
        margin-bottom: 1rem !important; /* 与下方内容留出间距 */
    }

    /* 优化单个Tab按钮的样式 */
    .tab-button {
        flex: 1 !important;
        text-align: center !important;
        padding: 12px 0 !important; /* 增加上下padding，增大点击热区 */
        cursor: pointer !important;
        border: 1px solid transparent !important;
        border-bottom: none !important; /* 除了最后一个 */
        background-color: #f9f9f9 !important; /* 统一背景色 */
        margin-bottom: -1px !important; /* 让边框重叠 */
        font-size: 0.95rem !important; /* 适当调整字体大小 */
        transition: all 0.2s ease !important;
        min-height: 40px !important; /* 确保有足够的高度 */
    }

    .tab-button.active { /* 选中状态的样式 */
        background-color: white !important; /* 选中的标签背景为白色 */
        border-color: #ddd !important;
        font-weight: bold !important;
        color: #0073aa !important;
        border-bottom: 2px solid #0073aa !important; /* 添加底部粗线作为视觉强调 */
    }

    .tab-button:last-child { /* 最后一个标签需要底边框 */
        border-bottom: 1px solid #ddd !important;
    }
}
/* --- 移动端 Tab 内容区域优化 --- */
@media screen and (max-width: 768px) {
    .tab-content {
        padding: 1rem !important; /* 增加内边距 */
        line-height: 1.6 !important; /* 增加行高，提升可读性 */
    }

    .tab-content h2,
    .tab-content h3 {
        font-size: 1.2rem !important; /* 调整标题大小 */
        margin-bottom: 0.75rem !important;
    }

    .tab-content p {
        margin-bottom: 1rem !important;
        font-size: 0.95rem !important; /* 调整段落文字大小 */
    }
}


/* --- 移动端产品详情页 Tab 标签栏 - 实现整体左对齐并优化间距（最终版）--- */
@media screen and (max-width: 768px) {
    /* 确保Tab导航容器无左右内边距，实现整体左对齐 */
    .tab-navigation {
        padding-left: 0 !important; /* 移除左边内边距 */
        padding-right: 0 !important; /* 移除右边内边距 */
        margin-bottom: 1rem !important;
        display: flex !important;
        flex-direction: row !important;
        border-bottom: 1px solid #ddd !important;
        /* 使用flex-start确保整体左对齐 */
        justify-content: flex-start !important;
    }

    /* 使用内间距（padding）来控制按钮之间的距离 */
    .tab-button {
        /* 增加左右内边距，形成内间距 */
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        /* 移除左右外边距，避免重复计算 */
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* 确保第一个和最后一个按钮的边距不会被重复计算 */
    .tab-button:first-child {
        margin-left: 0 !important;
    }

    .tab-button:last-child {
        margin-right: 0 !important;
    }
}

/* --- 移动端产品详情页 - 相册与信息栏改为上下结构 (基于您的实际类名) --- */
@media screen and (max-width: 768px) {
    /* 将产品内容区域设置为垂直Flex布局 */
    .product-content {
        display: flex !important;
        flex-direction: column !important; /* 关键：改为垂直堆叠 */
        gap: 1.5rem !important; /* 设置组件之间的间距 */
    }

    /* 确保主图保持正常 */
    .main-product-image {
        width: 100% !important;
        height: auto !important;
        border-radius: 4px !important;
    }

    /* 调整缩略图的排列方式，使其水平居中 */
    .inline-thumbnail-gallery {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important; /* 水平居中 */
        gap: 0.5rem !important; /* 缩略图之间的间距 */
        margin-top: 1rem !important;
    }

    /* 调整单个缩略图的样式 */
    .thumbnail-item {
        width: 60px !important; /* 固定宽度，确保大小一致 */
        height: 60px !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }

    .thumbnail-item.active {
        border-color: #0073aa !important;
        transform: scale(1.05); /* 悬停/选中时轻微放大 */
    }

    /* 优化信息栏的样式，使其在全宽下更好看 */
    .product-info {
        padding: 1rem !important; /* 给信息栏增加内边距 */
        background-color: white !important;
        border-radius: 4px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }

    /* 确保信息栏内的文本不会被截断 */
    .product-info p,
    .product-info ul,
    .product-info li {
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
}
/* --- Tags 列表页 - 直接定位 post-grid 容器 (最终版) --- */

/* 桌面端：创建网格布局 */
@media screen and (min-width: 769px) {
    /* 直接定位到 .post-grid 容器 */
    .post-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; /* 自适应网格 */
        gap: 1.5rem !important;
        padding: 0 !important;
        margin-bottom: 2rem !important;
    }

    /* 应用新闻卡片的整体样式 */
    .post-grid article,
    .post-grid .post-card {
        background-color: white !important;
        border-radius: 4px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
        overflow: hidden !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    /* 新闻卡片内的图片样式 */
    .post-grid article img,
    .post-grid .post-card img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
        border-radius: 4px 4px 0 0 !important;
    }

    /* 新闻卡片内的内容区域 */
    .post-grid article .entry-content,
    .post-grid .post-card .entry-content {
        padding: 1rem !important;
        flex-grow: 1;
    }

    /* 新闻卡片内的标题样式 */
    .post-grid article h2,
    .post-grid .post-card h2 {
        font-size: 1.1rem !important;
        margin: 0 0 0.5rem 0 !important;
        color: #0073aa !important;
        line-height: 1.4 !important;
    }

    .post-grid article h2 a,
    .post-grid .post-card h2 a {
        color: inherit !important;
        text-decoration: none !important;
    }

    .post-grid article h2 a:hover,
    .post-grid .post-card h2 a:hover {
        color: #00568c !important;
    }

    /* 新闻卡片内的元信息（日期等） */
    .post-grid article .entry-meta,
    .post-grid .post-card .entry-meta {
        font-size: 0.8rem !important;
        color: #666 !important;
        margin-bottom: 0.5rem !important;
    }

    /* 新闻卡片内的摘要/描述 */
    .post-grid article .entry-summary,
    .post-grid .post-card .entry-summary,
    .post-grid article p,
    .post-grid .post-card p {
        margin: 0 !important;
        line-height: 1.5 !important;
        color: #333 !important;
    }
}

/* 移动端：保持单列，但优化间距和样式 */
@media screen and (max-width: 768px) {
    .post-grid {
        padding: 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .post-grid article,
    .post-grid .post-card {
        background-color: white !important;
        border-radius: 4px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
        margin-bottom: 1rem !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .post-grid article img,
    .post-grid .post-card img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
        border-radius: 4px 4px 0 0 !important;
    }

    .post-grid article .entry-content,
    .post-grid .post-card .entry-content {
        padding: 1rem !important;
    }

    .post-grid article h2,
    .post-grid .post-card h2 {
        font-size: 1rem !important;
        margin: 0 0 0.5rem 0 !important;
        color: #0073aa !important;
        line-height: 1.4 !important;
    }

    .post-grid article h2 a,
    .post-grid .post-card h2 a {
        color: inherit !important;
        text-decoration: none !important;
    }

    .post-grid article .entry-meta,
    .post-grid .post-card .entry-meta {
        font-size: 0.75rem !important;
        color: #666 !important;
        margin-bottom: 0.5rem !important;
    }

    .post-grid article .entry-summary,
    .post-grid .post-card .entry-summary,
    .post-grid article p,
    .post-grid .post-card p {
        margin: 0 !important;
        line-height: 1.5 !important;
        color: #333 !important;
    }
}

/* --- Homepage Styles --- */

/* General Homepage Sections */
.homepage-hero,
.homepage-product-categories,
.homepage-products-showcase,
.homepage-industry-news,
.homepage-services-guarantees,
.homepage-contact-us {
    padding: 60px 0;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: #0073aa;
    margin: 10px auto 0;
}

/* --- Custom Carousel Styles --- */
.custom-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-text {
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 20px;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* 允许点击穿透到按钮 */
}

.carousel-btn {
    pointer-events: auto; /* 激活按钮自身的点击 */
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    margin: 0 20px;
}

.carousel-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.indicator-dot.active {
    background-color: white;
}

/* --- End of Custom Carousel Styles --- */

/* Categories Grid (2行 x 4列) */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4列 */
    gap: 20px; /* 间距 */
}

.category-item {
    text-align: center;
    transition: transform 0.3s ease;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    width: 250px; /* 设置卡片宽度 */
    height: 188px; /* 设置卡片高度，形成 250x188 的长方形 */
    margin: 0 auto; /* 居中卡片 */
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.image-container {
    width: 100%; /* 图片容器宽度占满卡片 */
    height: 120px; /* 图片容器高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3px; /* 减小内边距 */
    background-color: #f8f9fa;
    flex-shrink: 0; /* 防止flex项收缩 */
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 确保图片完整显示并居中 */
    display: block;
}

.category-name {
    font-size: 1rem;
    color: #333;
    padding: 3px; /* 减小底部空间 */
    margin: 0;
    flex-grow: 1;
    line-height: 1.2; /* 减小行高 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Products Grid (2行 x 3列) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列 */
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* 保持高度自适应 */
    min-width: 0; /* 修复flex子项宽度问题 */
    min-width: 250px; /* 确保卡片最小宽度为250px，保证图片能正常显示 */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* --- 核心修改：将 product-thumb 本身设为固定尺寸容器，并重置其父级 a 标签的样式 --- */
.product-card a { /* 重置包裹图片的 a 标签 */
    display: block;
    margin: 0;
    padding: 0;
}

.product-thumb {
    width: 250px; /* 固定宽度 */
    height: 250px; /* 固定高度 */
    object-fit: contain; /* 确保图片完整显示并居中 */
    display: block; /* 设为块级元素 */
    margin: 0 auto; /* 在容器内水平居中 */
    flex-shrink: 0; /* 关键：防止在flex容器中被压缩 */
    background-color: #f8f9fa; /* 可选：为无图时的空白区域设置背景色 */
}

/* --- End of 核心修改 --- */


.product-title {
    font-size: 1.2rem;
    margin: 15px;
    color: #0073aa;
    text-align: center;
    flex-shrink: 0; /* 防止标题被压缩 */
}

.product-title a {
    text-decoration: none;
    color: inherit;
}

/* --- Multiline Clamp Utility Class for Excerpts (核心：限制为3行) --- */
.multiline-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制为3行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5; /* 控制行高，影响整体高度 */
    margin: 0 15px 15px; /* 为摘要添加左右和底部边距 */
    flex-shrink: 0; /* 防止摘要被压缩 */
}
/* --- End of Multiline Clamp --- */


/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.news-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.news-thumb {
    width: 100%;
    height: 225px; /* 调整为225px，配合300px宽，实现图片高宽比3:4 */
    object-fit: cover;
    display: block;
}

.news-title {
    font-size: 1.1rem;
    margin: 15px;
    color: #333;
    flex-grow: 1;
}

.news-title a {
    text-decoration: none;
    color: inherit;
}

/* .news-excerpt 已通过 multiline-clamp 类统一处理 */

.news-meta {
    padding: 0 15px 15px;
    font-size: 0.9rem;
    color: #888;
}

/* Services & Guarantees */
.services-content {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    line-height: 1.6;
}

/* Contact Us */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info h3,
.contact-form h3 {
    margin-top: 0;
    color: #333;
}

.contact-info p {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 992px) {
    .categories-grid { 
        grid-template-columns: repeat(2, 1fr); 
        justify-content: center; /* 平板居中 */
    } 
    .products-grid { grid-template-columns: repeat(2, 1fr); } /* 平板：2列 */
    .news-grid { grid-template-columns: repeat(2, 1fr); } /* 平板：2列 */
}

@media (max-width: 768px) {
    .custom-carousel { height: 300px; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1rem; }
    .categories-grid { 
        grid-template-columns: 1fr; 
        justify-content: center; /* 手机居中 */
    } 
    .products-grid { grid-template-columns: 1fr; } /* 手机：1列 */
    .news-grid { grid-template-columns: 1fr; } /* 手机：1列 */
}

@media (max-width: 480px) {
    .section-title { font-size: 1.6rem; }
}

/* --- 全局底部重塑 --- */
.ubest-footer {
    background-color: #222222; /* 稍微浅一点的深灰，比纯黑更有质感 */
    color: #aaaaaa;
    padding: 70px 0 0;
    font-size: 14px;
    line-height: 1.6;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr 1fr; /* 调整列宽比例 */
    gap: 50px;
    padding-bottom: 50px;
}

/* 标题优化：摒弃黄色，改用白色+蓝色边框 */
.footer-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-title::after {
    content: '';
    display: block;
    width: 35px;
    height: 3px;
    background: #0056b3; /* 匹配你按钮的蓝色 */
    margin-top: 10px;
}

/* 联系信息列表 */
.footer-contact-info {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.footer-contact-info li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.footer-contact-info i {
    color: #0056b3; /* 图标用蓝色点缀 */
    width: 20px;
    margin-right: 10px;
    font-size: 14px;
}

/* 快速链接 hover 效果 */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #aaaaaa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
    padding-left: 8px; /* 侧滑效果 */
}

/* 咨询按钮：与全站 View Details 按钮风格统一 */
.footer-cta-btn {
    display: inline-block;
    background: #0056b3;
    color: #fff !important;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    transition: 0.3s;
    border: none;
}

.footer-cta-btn:hover {
    background: #004494;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 社交图标 */
.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.footer-social a {
    width: 38px;
    height: 38px;
    background: #333;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: 0.3s;
}

.footer-social a:hover {
    background: #0056b3;
    transform: translateY(-3px);
}

/* 版权条 */
.footer-bottom {
    background: #1a1a1a;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #333;
    color: #666;
}

/* 响应式：手机端变单列 */
@media (max-width: 991px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}
