/* 广州锦熙化工网站样式 */
:root {
    --primary-color: #0066cc;
    --secondary-color: #003366;
    --accent-color: #ff6600;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;

    /* 新增变量 */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --font-family-sans: 'Noto Sans SC', sans-serif;
    --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --container-max-width: 1200px;
    --header-height: 76px;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    padding-top: 92px; /* 导航栏高度 */
}

/* 导航栏 */
.navbar {
    padding: 0.5rem 0;
    transition: var(--transition);
    min-height: 76px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-brand img {
    max-height: 56px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--primary-color);
    letter-spacing: 0.02em;
}

/* 移动端导航栏调整 */
@media (max-width: 768px) {
    .navbar-brand img {
        max-height: 48px;
    }

    .brand-text {
        font-size: 1.35rem;
    }
}

@media (max-width: 576px) {
    .navbar > .container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    .navbar-brand {
        display: contents;
    }

    .navbar-brand img {
        max-height: 32px;
        grid-column: 1;
        justify-self: start;
    }

    .brand-text {
        grid-column: 2;
        text-align: center;
        font-size: 1.15rem;
        font-weight: 800;
        white-space: nowrap;
    }

    .navbar > .container > .d-flex.d-lg-none {
        grid-column: 3;
        justify-self: end;
    }
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Hero区域 */
.hero-section {
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-content-wrapper {
    position: relative;
    min-height: 500px;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.hero-text-content {
    position: absolute;
    z-index: 2;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 35%;
    max-width: 450px;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.hero-section h1 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    font-size: 1.25rem;
    color: var(--gray-color);
    margin-bottom: 2rem;
}

/* 通用样式 */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.feature-icon {
    color: var(--primary-color);
}

/* 产品卡片 */
.product-card {
    overflow: hidden;
    border: 1px solid #e9ecef;
}

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

.product-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 2rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 2rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 页脚 */
footer {
    background-color: var(--secondary-color);
}

footer h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    color: white !important;
    text-decoration: underline !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }

    .hero-section {
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-content-wrapper {
        min-height: 350px;
    }

    .hero-image-container {
        height: 250px;
    }

    .hero-text-content {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        margin-top: -50px;
        padding: 1.25rem;
    }

    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }

    .hero-text-content .d-flex {
        gap: 0.75rem;
    }
}

/* 工具类 */
.object-fit-cover {
    object-fit: cover;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* ================================================== */
/* Hero Banner 轮播                                    */
/* ================================================== */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background-color: #000;
}

.hero-carousel .carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-carousel .carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-carousel .carousel-slide picture,
.hero-carousel .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-carousel .carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(0, 51, 102, 0.65) 0%,
        rgba(0, 51, 102, 0.35) 50%,
        rgba(0, 51, 102, 0.1) 100%);
    display: flex;
    align-items: center;
    z-index: 3;
}

.hero-carousel .carousel-content {
    max-width: 640px;
    padding: 0 4rem;
    color: #fff;
}

.hero-carousel .carousel-content h2 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-carousel .carousel-content p {
    font-size: 1.25rem;
    margin-bottom: 1.75rem;
    opacity: 0.95;
}

.hero-carousel .carousel-cta {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.875rem 2.25rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--primary-color);
    transition: var(--transition);
}

.hero-carousel .carousel-cta:hover,
.hero-carousel .carousel-cta:focus-visible {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}

.hero-carousel .carousel-indicators {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.625rem;
    z-index: 4;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: var(--transition);
}

.hero-carousel .carousel-indicators button.active {
    background-color: #fff;
    transform: scale(1.25);
}

.hero-carousel .carousel-indicators button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 1200px) {
    .hero-carousel { height: 500px; }
    .hero-carousel .carousel-content h2 { font-size: 2.5rem; }
    .hero-carousel .carousel-content p { font-size: 1.125rem; }
}

@media (max-width: 768px) {
    .hero-carousel { height: 400px; }
    .hero-carousel .carousel-content { padding: 0 2rem; }
    .hero-carousel .carousel-content h2 { font-size: 2rem; }
    .hero-carousel .carousel-content p { font-size: 1rem; }
    .hero-carousel .carousel-cta { padding: 0.625rem 1.75rem; font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .hero-carousel { height: 320px; }
    .hero-carousel .carousel-content h2 { font-size: 1.5rem; }
    .hero-carousel .carousel-content p { font-size: 0.9rem; margin-bottom: 1rem; }
}

/* ================================================== */
/* 跳过链接 (Skip to main content) - 可访问性           */
/* ================================================== */
.visually-hidden-focusable {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visually-hidden-focusable:focus,
.visually-hidden-focusable:focus-within {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    width: auto;
    height: auto;
    padding: 0.75rem 1.25rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 1100;
    box-shadow: var(--box-shadow);
}

/* ================================================== */
/* 表单 ARIA 错误状态                                  */
/* ================================================== */
.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"] {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

/* 加载优化 */
img {
    max-width: 100%;
    height: auto;
}

/* SEO优化 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 调整容器内边距 */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* 产品卡片单列显示 */
    .product-card {
        margin-bottom: 1.5rem;
    }

    /* 导航栏折叠样式优化 */
    .navbar-collapse {
        background-color: white;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        margin-top: 1rem;
        padding: 1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #f8f9fa;
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    /* Hero区域移动端优化 */
    .hero-section {
        padding: 3rem 0;
    }

    .hero-content-wrapper {
        min-height: 400px;
        flex-direction: column;
    }

    .hero-image-container {
        position: relative;
        height: 300px;
        width: 100%;
        overflow: hidden;
    }

    .hero-image {
        width: 166.67%; /* 显示图片右侧60% */
        margin-left: -66.67%; /* 将图片偏移，使右侧60%居中 */
        object-position: right center;
    }

    .hero-text-content {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin-top: -60px;
        padding: 1.5rem;
        background-color: rgba(255, 255, 255, 0.95);
        text-align: center;
    }

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

    .hero-section .lead {
        font-size: 1.1rem;
    }

    .hero-text-content .d-flex {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* 子类锚点目录 */
.product-anchors { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.product-anchors a {
  padding: 0.25rem 0.75rem;
  background: var(--bg-light, #f8f9fa);
  border-radius: var(--border-radius, 8px);
  text-decoration: none;
  font-size: 0.875rem;
  scroll-margin-top: 80px;
}

/* 产品卡片说明文字 2 行截断 */
.product-desc[data-truncate] {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc.expanded { -webkit-line-clamp: unset; }

/* 卡片悬停增强 */
.product-card img { transition: transform 0.3s ease; }
.product-card:hover img { transform: scale(1.05); }

/* 锚点跳转上方留出 fixed nav 空间 */
[id]:target { scroll-margin-top: 80px; }

/* 产品卡片图片按钮(包裹 <picture> 触发 Lightbox) */
.product-img-btn {
  display: block;
  width: 100%;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}
.product-img-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* 产品图 Lightbox 弹层 */
.product-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.product-lightbox.show { display: flex; }

.product-lightbox-picture,
.product-lightbox img {
  max-width: min(90vw, 800px);
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.product-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--dark-color);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.product-lightbox-close:hover { background: #fff; transform: scale(1.08); }
.product-lightbox-close:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .product-lightbox { padding: 0.75rem; }
  .product-lightbox-close { top: 0.5rem; right: 0.75rem; }
}

/* ============================================
   语言切换按钮 (Language Switch)
   ============================================ */
/* Desktop: 嵌在导航条末尾,左侧分隔线 */
.lang-switch {
  border-left: 1px solid #dee2e6;
  margin-left: 0.5rem;
  padding-left: 1rem !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.lang-switch:hover,
.lang-switch:focus {
  color: var(--primary-color) !important;
}
.lang-switch i {
  font-size: 0.85em;
}

/* Mobile: 独立按钮,贴在汉堡按钮左边,右侧分隔线 */
.lang-switch-mobile {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  margin-right: 0.35rem;
  padding-right: 0.5rem;
  border-right: 1px solid #dee2e6;
  color: #333;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  line-height: 1;
  border-radius: 0;
}
.lang-switch-mobile:hover,
.lang-switch-mobile:focus {
  color: var(--primary-color);
  text-decoration: none;
}
.lang-switch-mobile i {
  font-size: 0.8em;
}

/* 汉堡菜单去掉边框 */
.navbar-toggler {
  border: none;
  padding: 0.25rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* ============================================
   语言下拉菜单 (Language Dropdown)
   ============================================ */
/* Desktop dropdown 保持左侧分隔线 */
.lang-switch.dropdown-toggle {
  border-left: 1px solid #dee2e6;
  margin-left: 0.5rem;
  padding-left: 1rem !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.lang-switch.dropdown-toggle:hover,
.lang-switch.dropdown-toggle:focus {
  color: var(--primary-color) !important;
}
.lang-switch.dropdown-toggle::after {
  margin-left: 0.35rem;
  font-size: 0.7em;
}

/* Mobile dropdown 保持右侧分隔线 */
.lang-switch-mobile.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  margin-right: 0.35rem;
  padding-right: 0.5rem;
  border-right: 1px solid #dee2e6;
  color: #333;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  line-height: 1;
  border-radius: 0;
}
.lang-switch-mobile.dropdown-toggle:hover,
.lang-switch-mobile.dropdown-toggle:focus {
  color: var(--primary-color);
  text-decoration: none;
}
.lang-switch-mobile.dropdown-toggle::after {
  margin-left: 0.35rem;
  font-size: 0.7em;
}

/* 下拉菜单项:当前语言高亮 */
.dropdown-menu .dropdown-item.active {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
}
.dropdown-menu .dropdown-item.active:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* ============================================
   IP 检测 Banner (Language Detection Banner)
   ============================================ */
.lang-detect-banner {
  position: relative;
  z-index: 1080;
  margin-bottom: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 0.75rem 1rem;
}
.lang-detect-banner .btn {
  white-space: nowrap;
}