/* Theme and utility styles for 风电者 brand site */

:root {
    --color-primary: #00A86B;
    --color-secondary: #3DD598;
    --color-accent: #007940;
    --color-dark: #0A2463;
    --color-light: #E8F7EF;
}

/* Anchor scroll offset so sections are not hidden under fixed nav */
html {
    scroll-padding-top: 100px;
}

/* Base */
body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    /* gray-800 */
    background: #f9fafb;
    /* gray-50 */
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

a {
    text-decoration: none;
}

/* General utilities migrated from inline Tailwind utilities */
.content-auto {
    content-visibility: auto;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gradient-mask-b {
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.bg-gradient-green {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
}

.bg-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.border-gradient {
    border-image: linear-gradient(to right, var(--color-primary), var(--color-secondary)) 1;
}

.modal-backdrop {
    backdrop-filter: blur(4px);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* Hero product interactive hover/tilt effect */
.product-hero-wrap {
    perspective: 1200px;
    transform-style: preserve-3d;
    overflow: visible;
    isolation: isolate;
    position: relative;
    z-index: 15;
}

.product-hero {
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 600ms;
    will-change: transform;
}

.product-hero:hover {
    transform: rotate3d(1, -1, 0, 8deg) scale(1.02);
    box-shadow: none;
}

/* Soften default strong shadow inside hero only */
.product-hero .shadow-2xl {
    box-shadow: none !important;
}

.ring-decor {
    position: absolute;
    border-radius: 9999px;
    border-width: 2px;
    filter: blur(2px);
    pointer-events: none;
    transition: transform 500ms ease, opacity 400ms ease;
}

.ring-decor.primary {
    border-color: rgba(0, 168, 107, 0.35);
}

.ring-decor.secondary {
    border-color: rgba(61, 213, 152, 0.35);
}

.ring-decor.accent {
    border-color: rgba(0, 121, 64, 0.35);
}

/* Hover: nudge side rings more noticeably on desktop */
@media (min-width: 1024px) {
    .product-hero-wrap:hover .ring-decor.primary {
        transform: translate(-10px, -6px) scale(1.05);
    }

    .product-hero-wrap:hover .ring-decor.secondary {
        transform: translate(12px, 8px) scale(1.05);
    }
}

/* Back-to-top visibility helpers (paired with Tailwind utilities) */
.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Language selector custom arrow */
#language-selector select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Section heading underline using theme */
.section-underline::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    margin: 0.75rem auto 0;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
}

/* Simple fade-up for elements entering view (optional JS can add class) */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp .6s ease both;
}

/* Bubble particles (hero) */
@keyframes bubbleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: .6;
    }

    100% {
        transform: translateY(-40px) scale(1.15);
        opacity: 0;
    }
}

.bubble {
    position: absolute;
    border-radius: 9999px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .35));
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    animation: bubbleRise 2.6s ease-in infinite;
    pointer-events: none;
}

.bubble--sm {
    width: 8px;
    height: 8px;
    animation-duration: 2s;
}

.bubble--md {
    width: 12px;
    height: 12px;
    animation-duration: 2.8s;
}

.bubble--lg {
    width: 16px;
    height: 16px;
    animation-duration: 3.2s;
}

/* Badge link animation: sync with hero hover */
.product-hero-wrap:hover .hero-badge {
    transform: translateY(-4px) scale(1.03);
}

.product-hero-wrap:hover .hero-badge--cool {
    box-shadow: 0 10px 20px rgba(61, 213, 152, .25);
}

.product-hero-wrap:hover .hero-badge--warm {
    box-shadow: 0 10px 20px rgba(255, 124, 76, .25);
}

@media (hover: none),
(pointer: coarse) {
    .product-hero-wrap:hover .hero-badge {
        transform: none;
        box-shadow: none;
    }
}

/* 3D旋转木马徽章动画样式 */
.hero-carousel-row {
    position: absolute;
    width: 100%;
    height: 100px;
    perspective: 800px;
    perspective-origin: 50% 50%;
    pointer-events: none !important;
    z-index: 11;
    overflow: visible;
    max-width: 100%;
    left: 0;
    right: 0;
}

.hero-carousel-row-1 {
    top: -60px;
    left: 0;
    right: 0;
}

.hero-carousel-row-2 {
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
}

.hero-carousel-row-3 {
    bottom: -60px;
    left: 0;
    right: 0;
}

.hero-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    will-change: transform;
    pointer-events: none !important;
}

/* 3D旋转动画 - 从左往右 (绕Y轴顺时针) */
@keyframes carouselRotateLTR {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* 3D旋转动画 - 从右往左 (绕Y轴逆时针) */
@keyframes carouselRotateRTL {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(-360deg);
    }
}

.hero-carousel-track-ltr {
    animation: carouselRotateLTR 20s linear infinite;
}

.hero-carousel-track-rtl {
    animation: carouselRotateRTL 20s linear infinite;
}

/* 徽章卡片样式 - 放置在3D圆形轨道上 */
.hero-badge-carousel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-style: preserve-3d;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    min-width: 200px;
    max-width: 280px;
    min-height: 75px;
    height: auto;
    backface-visibility: visible;
    display: flex;
    align-items: center;
    user-select: none;
    opacity: 1;
    will-change: opacity, z-index;
}

.hero-badge-inner {
    width: 100%;
    height: auto;
}

.hero-badge-inner .flex {
    align-items: flex-start;
}

/* 动态z-index：正面标签在产品前面，背面标签在产品后面 */
.hero-carousel-track-ltr .hero-badge-carousel:nth-child(1) {
    z-index: 12;
    animation: zIndexLTR1 20s linear infinite;
}

.hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) {
    z-index: 5;
    animation: zIndexLTR2 20s linear infinite;
}

.hero-carousel-track-rtl .hero-badge-carousel:nth-child(1) {
    z-index: 12;
    animation: zIndexRTL1 20s linear infinite;
}

.hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) {
    z-index: 5;
    animation: zIndexRTL2 20s linear infinite;
}

/* z-index + opacity 动画 - LTR第1个标签（体现3D层次）*/
@keyframes zIndexLTR1 {
    0% { z-index: 12; opacity: 1; }
    23% { z-index: 12; opacity: 1; }
    25% { z-index: 12; opacity: 0.4; }
    27% { z-index: 5; opacity: 0.4; }
    73% { z-index: 5; opacity: 0.4; }
    75% { z-index: 5; opacity: 0.4; }
    77% { z-index: 12; opacity: 1; }
    100% { z-index: 12; opacity: 1; }
}

/* z-index + opacity 动画 - LTR第2个标签（体现3D层次）*/
@keyframes zIndexLTR2 {
    0% { z-index: 5; opacity: 0.4; }
    23% { z-index: 5; opacity: 0.4; }
    25% { z-index: 5; opacity: 0.4; }
    27% { z-index: 12; opacity: 1; }
    73% { z-index: 12; opacity: 1; }
    75% { z-index: 12; opacity: 0.4; }
    77% { z-index: 5; opacity: 0.4; }
    100% { z-index: 5; opacity: 0.4; }
}

/* z-index + opacity 动画 - RTL第1个标签（体现3D层次）*/
@keyframes zIndexRTL1 {
    0% { z-index: 12; opacity: 1; }
    23% { z-index: 12; opacity: 1; }
    25% { z-index: 12; opacity: 0.4; }
    27% { z-index: 5; opacity: 0.4; }
    73% { z-index: 5; opacity: 0.4; }
    75% { z-index: 5; opacity: 0.4; }
    77% { z-index: 12; opacity: 1; }
    100% { z-index: 12; opacity: 1; }
}

/* z-index + opacity 动画 - RTL第2个标签（体现3D层次）*/
@keyframes zIndexRTL2 {
    0% { z-index: 5; opacity: 0.4; }
    23% { z-index: 5; opacity: 0.4; }
    25% { z-index: 5; opacity: 0.4; }
    27% { z-index: 12; opacity: 1; }
    73% { z-index: 12; opacity: 1; }
    75% { z-index: 12; opacity: 0.4; }
    77% { z-index: 5; opacity: 0.4; }
    100% { z-index: 5; opacity: 0.4; }
}

/* 图标容器样式 */
.badge-icon-wrapper {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    margin-top: 0.125rem;
}

.badge-icon-wrapper i {
    color: white;
    font-size: 1.125rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.badge-icon-accent {
    background: var(--color-accent) !important;
}

.badge-icon-secondary {
    background: var(--color-secondary) !important;
}

.badge-icon-charging {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.badge-icon-endurance {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.badge-icon-scenes {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

/* 徽章内容样式 */
.badge-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge-title {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
    hyphens: auto;
}

.badge-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    margin: 0.125rem 0 0 0;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
    hyphens: auto;
}

/* 在圆形轨道上定位徽章 - 只有2个标签，180度间隔 */
.hero-carousel-track-ltr .hero-badge-carousel:nth-child(1) {
    transform: translateX(-50%) translateY(-50%) rotateY(0deg) translateZ(320px);
}

.hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) {
    transform: translateX(-50%) translateY(-50%) rotateY(180deg) translateZ(320px);
}

.hero-carousel-track-rtl .hero-badge-carousel:nth-child(1) {
    transform: translateX(-50%) translateY(-50%) rotateY(0deg) translateZ(320px);
}

.hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) {
    transform: translateX(-50%) translateY(-50%) rotateY(-180deg) translateZ(320px);
}

.hero-badge-carousel:hover {
    box-shadow: 0 25px 30px rgba(0, 0, 0, 0.25);
}

.hero-badge-carousel.hero-badge--cool:hover {
    box-shadow: 0 15px 25px rgba(61, 213, 152, .4);
}

.hero-badge-carousel.hero-badge--warm:hover {
    box-shadow: 0 15px 25px rgba(255, 124, 76, .4);
}

/* 内部内容保持正对观察者 - 关键！*/
.hero-badge-inner {
    transform-style: preserve-3d;
    backface-visibility: visible;
}

/* 确保图标和文字都正确显示 */
.hero-badge-inner i {
    display: inline-block;
}

/* 对于LTR轨道，内容需要反向旋转以保持正对观察者 - 2个标签版本 */
.hero-carousel-track-ltr .hero-badge-carousel:nth-child(1) .hero-badge-inner {
    transform: rotateY(0deg);
}

.hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) .hero-badge-inner {
    transform: rotateY(-180deg);
}

/* 对于RTL轨道 - 2个标签版本 */
.hero-carousel-track-rtl .hero-badge-carousel:nth-child(1) .hero-badge-inner {
    transform: rotateY(0deg);
}

.hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) .hero-badge-inner {
    transform: rotateY(180deg);
}

/* 彻底修正镜像翻转：直接在flex容器上应用scaleX */
.hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) .hero-badge-inner .flex {
    transform: scaleX(-1);
}

.hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) .hero-badge-inner .flex {
    transform: scaleX(-1);
}

/* 暂停动画在悬停时 */
.hero-carousel-row:hover .hero-carousel-track {
    animation-play-state: paused;
}

/* 为新的徽章样式添加悬停效果 */
.hero-badge-carousel.hero-badge--capacity:hover {
    box-shadow: 0 15px 25px rgba(0, 121, 64, .4);
}

.hero-badge-carousel.hero-badge--charging:hover {
    box-shadow: 0 15px 25px rgba(102, 126, 234, .4);
}

.hero-badge-carousel.hero-badge--endurance:hover {
    box-shadow: 0 15px 25px rgba(240, 147, 251, .4);
}

.hero-badge-carousel.hero-badge--scenes:hover {
    box-shadow: 0 15px 25px rgba(79, 172, 254, .4);
}

/* 移动端适配 - H5优化 */
@media (max-width: 767.98px) {
    .hero-carousel-row {
        height: auto;
        min-height: 70px;
        perspective: 500px;
    }
    
    .hero-carousel-row-1 {
        top: -50px;
    }
    
    .hero-carousel-row-2 {
        top: 50%;
        transform: translateY(-50%);
    }
    
    .hero-carousel-row-3 {
        bottom: -50px;
    }
    
    /* 移动端使用更小的旋转半径，更聚集 */
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(1) {
        transform: translateX(-50%) translateY(-50%) rotateY(0deg) translateZ(160px);
    }
    
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) {
        transform: translateX(-50%) translateY(-50%) rotateY(180deg) translateZ(160px);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(1) {
        transform: translateX(-50%) translateY(-50%) rotateY(0deg) translateZ(160px);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) {
        transform: translateX(-50%) translateY(-50%) rotateY(-180deg) translateZ(160px);
    }
    
    /* 移动端也需要修正镜像翻转 */
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) .hero-badge-inner {
        transform: rotateY(-180deg);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) .hero-badge-inner {
        transform: rotateY(180deg);
    }
    
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) .hero-badge-inner .flex {
        transform: scaleX(-1);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) .hero-badge-inner .flex {
        transform: scaleX(-1);
    }
    
    .hero-badge-carousel {
        min-width: 140px;
        max-width: 190px;
        min-height: 60px;
        height: auto;
        padding: 0.625rem 0.75rem;
        display: flex;
        align-items: center;
    }
    
    .hero-badge-inner {
        width: 100%;
        height: auto;
    }
    
    .hero-badge-inner .flex {
        align-items: flex-start;
    }
    
    .badge-icon-wrapper {
        width: 2rem;
        height: 2rem;
        flex-shrink: 0;
        margin-top: 0.125rem;
    }
    
    .badge-icon-wrapper i {
        font-size: 0.875rem;
    }
    
    .badge-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .badge-title {
        font-size: 0.8rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .badge-desc {
        font-size: 0.65rem;
        line-height: 1.35;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        display: block;
        white-space: normal;
        overflow: visible;
    }
    
    /* 加快移动端动画速度 */
    .hero-carousel-track-ltr {
        animation: carouselRotateLTR 12s linear infinite;
    }
    
    .hero-carousel-track-rtl {
        animation: carouselRotateRTL 12s linear infinite;
    }
    
    /* 移动端z-index + opacity 动画（12秒版本，体现3D层次）*/
    @keyframes zIndexLTR1Mobile {
        0% { z-index: 12; opacity: 1; }
        23% { z-index: 12; opacity: 1; }
        25% { z-index: 12; opacity: 0.4; }
        27% { z-index: 5; opacity: 0.4; }
        73% { z-index: 5; opacity: 0.4; }
        75% { z-index: 5; opacity: 0.4; }
        77% { z-index: 12; opacity: 1; }
        100% { z-index: 12; opacity: 1; }
    }
    
    @keyframes zIndexLTR2Mobile {
        0% { z-index: 5; opacity: 0.4; }
        23% { z-index: 5; opacity: 0.4; }
        25% { z-index: 5; opacity: 0.4; }
        27% { z-index: 12; opacity: 1; }
        73% { z-index: 12; opacity: 1; }
        75% { z-index: 12; opacity: 0.4; }
        77% { z-index: 5; opacity: 0.4; }
        100% { z-index: 5; opacity: 0.4; }
    }
    
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(1) {
        animation: zIndexLTR1Mobile 12s linear infinite;
    }
    
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) {
        animation: zIndexLTR2Mobile 12s linear infinite;
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(1) {
        animation: zIndexLTR1Mobile 12s linear infinite;
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) {
        animation: zIndexLTR2Mobile 12s linear infinite;
    }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    .hero-carousel-row {
        height: auto;
        min-height: 90px;
        perspective: 700px;
    }
    
    .hero-carousel-row-1 {
        top: -55px;
    }
    
    .hero-carousel-row-3 {
        bottom: -55px;
    }
    
    /* 在平板上使用适中的旋转半径 */
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(1) {
        transform: translateX(-50%) translateY(-50%) rotateY(0deg) translateZ(240px);
    }
    
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) {
        transform: translateX(-50%) translateY(-50%) rotateY(180deg) translateZ(240px);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(1) {
        transform: translateX(-50%) translateY(-50%) rotateY(0deg) translateZ(240px);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) {
        transform: translateX(-50%) translateY(-50%) rotateY(-180deg) translateZ(240px);
    }
    
    /* 平板端也需要修正镜像翻转 */
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) .hero-badge-inner {
        transform: rotateY(-180deg);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) .hero-badge-inner {
        transform: rotateY(180deg);
    }
    
    .hero-carousel-track-ltr .hero-badge-carousel:nth-child(2) .hero-badge-inner .flex {
        transform: scaleX(-1);
    }
    
    .hero-carousel-track-rtl .hero-badge-carousel:nth-child(2) .hero-badge-inner .flex {
        transform: scaleX(-1);
    }
    
    .hero-badge-carousel {
        min-width: 165px;
        max-width: 230px;
        min-height: 70px;
        height: auto;
        padding: 0.75rem 0.875rem;
        display: flex;
        align-items: center;
    }
    
    .hero-badge-inner {
        width: 100%;
        height: auto;
    }
    
    .hero-badge-inner .flex {
        align-items: flex-start;
    }
    
    .badge-icon-wrapper {
        width: 2.25rem;
        height: 2.25rem;
        flex-shrink: 0;
        margin-top: 0.125rem;
    }
    
    .badge-icon-wrapper i {
        font-size: 1rem;
    }
    
    .badge-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .badge-title {
        font-size: 0.875rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .badge-desc {
        font-size: 0.7rem;
        line-height: 1.35;
        display: block;
        white-space: normal;
        overflow: visible;
    }
}

/* Fallback brand utility classes (ensure working without Tailwind config) */
.bg-primary {
    background-color: var(--color-primary) !important;
}

.text-primary {
    color: var(--color-primary) !important;
}

.border-primary {
    border-color: var(--color-primary) !important;
}

.bg-secondary {
    background-color: var(--color-secondary) !important;
}

.text-secondary {
    color: var(--color-secondary) !important;
}

.bg-accent {
    background-color: var(--color-accent) !important;
}

.text-accent {
    color: var(--color-accent) !important;
}

.bg-dark {
    background-color: var(--color-dark) !important;
}

.text-dark {
    color: var(--color-dark) !important;
}

.bg-primary-10 {
    background-color: rgba(0, 168, 107, 0.10) !important;
}

.bg-secondary-10 {
    background-color: rgba(61, 213, 152, 0.10) !important;
}

/* Hero overlays using brand colors (replacing from-dark/via-dark/...) */
.bg-hero-overlay {
    background: linear-gradient(to bottom, var(--color-dark) 0%, rgba(10, 36, 99, 0.80) 60%, rgba(10, 36, 99, 0.90) 100%);
}

.bg-hero-glow {
    background: linear-gradient(to top right, rgba(0, 168, 107, 0.10), rgba(61, 213, 152, 0.10));
}

/* Extra fallback utilities commonly used in HTML */
.flex {
    display: flex !important;
}

.justify-between {
    justify-content: space-between !important;
}

.items-center {
    align-items: center !important;
}

.w-full {
    width: 100% !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.px-4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.px-5 {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

.space-x-8>*+* {
    margin-left: 2rem !important;
}

.bg-white {
    background-color: #ffffff !important;
}

.text-white {
    color: #ffffff !important;
}

.text-gray-900 {
    color: #111827 !important;
}

.text-gray-800 {
    color: #1f2937 !important;
}

.text-gray-600 {
    color: #4b5563 !important;
}

.text-gray-200 {
    color: #e5e7eb !important;
}

.bg-gray-50 {
    background-color: #f9fafb !important;
}

.border-gray-100 {
    border-color: #f3f4f6 !important;
}

.rounded-full {
    border-radius: 9999px !important;
}

.rounded-2xl {
    border-radius: 1rem !important;
}

.rounded-xl {
    border-radius: 0.75rem !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

.shadow-xl {
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.05) !important;
}

.shadow-2xl {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
}

.hidden {
    display: none !important;
}

.bg-box {
    background-color: #5beba3;
}

/* Sections spacing fallback */
#products,
#tech,
#story,
#sustain,
#partners,
#contact {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* Nav fallback */
#main-nav {
    color: #ffffff;
}

#main-nav .nav-link {
    color: #ffffff;
}

#main-nav .nav-link:hover {
    color: var(--color-secondary);
}

.nav-link--active {
    color: var(--color-secondary) !important;
}

/* Nav subtle glass bg (optional) */
.nav-glass {
    background: rgba(10, 36, 99, 0.4);
    backdrop-filter: saturate(120%) blur(8px);
}

.bg-dark-60 {
    background-color: rgba(10, 36, 99, 0.6);
}

/* Language selector styles */
.lang-select {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9999px;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 0.875rem;
}

.lang-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 168, 107, 0.4);
    border-color: var(--color-secondary);
}

.lang-select option {
    color: #111827;
}

.lang-select.lang-select--light {
    color: #374151;
    border-color: #d1d5db;
    background: #ffffff;
}

/* Hero layout fallback */
#home {
    min-height: 100vh;
    padding-top: 80px; /* 为固定导航栏预留空间 */
}

/* 确保按钮始终可点击 */
#home a[href="#products"],
#home a[id="open-custom-modal"],
#home a[id="open-agent-modal"] {
    position: relative;
    z-index: 30 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* 确保按钮容器也可交互 */
#home .md\:w-1\/2:first-child {
    position: relative;
    z-index: 25;
    pointer-events: auto;
}

/* 确保文字和按钮区域完全独立 */
#home .container > div:first-of-type {
    position: relative;
    z-index: 25;
    pointer-events: auto;
}

/* 确保在所有设备上都有足够的空间 */
@media (max-width: 1024px) {
    #home {
        padding-top: 100px;
    }
}

/* 移动端调整布局，避免被导航栏遮挡 */
@media (max-width: 767.98px) {
    #home {
        padding-top: 100px;
        /* 保持居中对齐，但通过padding-top避免遮挡 */
    }
    
}

#home .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 768px) {
    #home .container {
        flex-direction: row;
    }

    #home .container>div {
        width: 50%;
    }
}

/* Hero badges and image responsive layout */
@media (max-width: 767.98px) {

    /* stack hero content; give image breathing room */
    #home .product-hero-wrap {
        margin-top: 2rem;
        width: 100%;
        max-width: 400px; /* 限制最大宽度，避免过大 */
    }

    #home {
        padding-top: 120px; /* 移动端使用更大的padding */
    }
}

/* 针对更小的移动设备 */
@media (max-width: 480px) {
    #home {
        padding-top: 140px; /* 小屏幕设备需要更多空间 */
    }

    #home .product-hero img {
        max-width: 100%;
        height: auto;
        max-height: 300px; /* 限制最大高度，避免截断 */
        object-fit: contain; /* 保持比例 */
    }

    /* place floating badges relative to flow and avoid overflow */
    .hero-badge {
        position: static !important;
        transform: none !important;
        margin: 0.75rem 0;
    }

    .hero-badge .w-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
}

/* Disable heavy hover/tilt on touch devices to avoid jitter */
@media (hover: none),
(pointer: coarse) {
    .product-hero-wrap {
        perspective: none;
    }

    .product-hero {
        transform: none !important;
        transition: transform 200ms ease;
    }

    .product-hero:hover {
        transform: none !important;
    }
}

/* ---- Feature image 3D card ---- */
.feature-3d-wrap {
    perspective: 1200px;
    min-height: 400px;
}

.feature-3d-card {
    position: relative;
    height: 100%;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 400ms;
    box-shadow: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.feature-3d-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 20% 10%, rgba(255,255,255,.18), transparent 60%);
    pointer-events: none;
    mix-blend-mode: screen;
}

.feature-3d-card img {
    display: block;
    transform: translateZ(40px) scale(1.06);
    will-change: transform;
}

.feature-3d-card.is-resting {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
    box-shadow: none;
}

/* 移动端优化 - 确保图片完整显示 */
@media (max-width: 1023.98px) {
    .feature-3d-wrap {
        min-height: 350px;
        perspective: none;
    }
    
    .feature-3d-card {
        background: #ffffff;
    }
    
    .feature-3d-card img {
        transform: none !important;
        object-fit: contain !important;
        padding: 1rem;
    }
}

@media (hover: none), (pointer: coarse) {
    .feature-3d-wrap { 
        perspective: none;
    }
    .feature-3d-card { 
        transform: none !important;
        background: #ffffff;
    }
    .feature-3d-card img { 
        transform: none !important;
        object-fit: contain !important;
        padding: 1rem;
    }
}

/* 桌面端大屏优化 */
@media (min-width: 1024px) {
    .feature-3d-wrap {
        min-height: 500px;
    }
    
    .feature-3d-card img {
        object-fit: cover;
        object-position: center;
    }
}

/* Grid fallbacks for key sections */
/* Keep only minimal fallback for extremely old environments */
#products .grid {
    display: grid;
    gap: 2rem;
}

/* Remove aggressive section-wide grid overrides to avoid breaking nested grids.
   Let Tailwind utility classes (grid-cols-*, lg:grid-cols-*) control layout. */

/* Process components (lightweight, non-invasive) */
.process {
    position: relative;
}

.process .process-step {
    position: relative;
}

@media (min-width: 1024px) {

    .process.process--5::before,
    .process.process--4::before {
        content: '';
        position: absolute;
        left: 5%;
        right: 5%;
        top: 96px;
        height: 2px;
        background: linear-gradient(90deg, rgba(0, 0, 0, .06), rgba(0, 168, 107, .35), rgba(0, 0, 0, .06));
    }

    /* animated progress fill based on --progress */
    .process.process--5::after {
        content: '';
        position: absolute;
        left: 5%;
        top: 96px;
        height: 2px;
        width: var(--progress, 0%);
        max-width: 90%;
        background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
        box-shadow: 0 0 8px rgba(0, 168, 107, 0.25);
        transition: width .6s ease;
    }

    /* .process .process-step::after {
        content: '';
        position: absolute;
        top: 95px; left: 50%;
        width: 10px; height: 10px;
        transform: translateX(-50%);
        border-radius: 9999px; background: #e5e7eb;
        box-shadow: 0 0 0 3px #fff;
    } */
}

@media (max-width: 767.98px) {
    .process .grid {
        gap: 1.25rem;
    }

    .process .process-step {
        text-align: left;
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: .75rem;
        align-items: center;
    }

    .process .process-step>div:first-child {
        grid-row: span 2;
    }
}

/* Typography adjustments for process blocks (consistency) */
.process h3 {
    letter-spacing: 0.02em;
}

.process h4 {
    letter-spacing: 0.01em;
}

.process p {
    line-height: 1.65;
}

/* Process step states */
.process .process-step>div:first-child {
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease;
}

.process .process-step.is-active>div:first-child {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 168, 107, 0.28);
}

.process .process-step.is-complete>div:first-child {
    background-color: var(--color-secondary) !important;
    color: #ffffff !important;
}

.process .process-step.is-active h4 {
    color: var(--color-primary);
}

.process .process-step.is-complete h4 {
    color: var(--color-secondary);
}

/* Fix number color/weight inside customization steps (override text-primary on span) */
.process .process-step>div:first-child span {
    line-height: 1;
    font-weight: 700;
}

.process .process-step.is-active>div:first-child span,
.process .process-step.is-complete>div:first-child span {
    color: #ffffff !important;
}

#partners .grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    #partners .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

#contact .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    #contact .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Product card hover fallback */
#products .group img {
    transition: transform 0.5s ease;
}

#products .group .absolute {
    transition: opacity 0.3s ease;
    opacity: 0;
}

#products .group:hover .absolute {
    opacity: 1;
}

#products .group:hover img {
    transform: scale(1.1);
}

/* Simple bounce animation fallback */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(-5%);
    }

    50% {
        transform: translateY(0);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Responsive fallbacks for md: utilities used in nav/layout */
@media (min-width: 768px) {
    .md\:flex {
        display: flex !important;
    }

    .md\:hidden {
        display: none !important;
    }

    .md\:px-8 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    .md\:mb-0 {
        margin-bottom: 0 !important;
    }
}

/* Mobile drawer (right side, 50% width) */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 50vw;
    background: #ffffff;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    display: block;
}

.drawer.open {
    transform: translateX(0);
}

/* 确保移动端抽屉在移动设备上正确显示 */
@media (max-width: 767.98px) {
    .drawer {
        width: 80vw;
        max-width: 320px;
    }
    
    /* 确保移动端菜单按钮可见 */
    #menu-toggle {
        display: block !important;
    }
    
    /* 移动端菜单链接样式 */
    .mobile-nav-link {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f3f4f6;
        transition: color 0.2s ease;
    }
    
    .mobile-nav-link:hover {
        color: var(--color-primary) !important;
    }
    
    .mobile-nav-link:last-child {
        border-bottom: none;
    }
}

/* 确保移动端菜单在移动设备上正确隐藏和显示 */
@media (max-width: 767.98px) {
    #mobile-menu {
        display: block !important;
    }
    
    /* 确保移动端菜单按钮在移动端可见 */
    #menu-toggle {
        display: block !important;
    }
    
    /* 隐藏桌面端导航 */
    .hidden.md\\:flex {
        display: none !important;
    }
}

@media (min-width: 768px) {
    #mobile-menu {
        display: none !important;
    }
    
    #menu-toggle {
        display: none !important;
    }
}

/* Prevent background scroll when drawer is open (utility class) */
.drawer-open {
    overflow: hidden;
}

/* Drawer overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 50vw;
    background: rgba(0, 0, 0, 0.35);
    z-index: 900;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.drawer-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 移动端遮盖层调整 */
@media (max-width: 767.98px) {
    .drawer-overlay {
        width: 20vw;
    }
}

/* ---- i18n-safe typography utilities ---- */
/* Removed text truncation to ensure full content visibility across all languages */
/* All text now displays completely to prevent misinterpretation */

.ellipsis {
    /* Removed truncation - allow natural wrapping */
    overflow-wrap: break-word;
    word-break: break-word;
}

.line-clamp-1 {
    /* Removed line clamping - show full text */
    overflow-wrap: break-word;
    word-break: break-word;
}

.line-clamp-2 {
    /* Removed line clamping - show full text */
    overflow-wrap: break-word;
    word-break: break-word;
}

.line-clamp-3 {
    /* Removed line clamping - show full text */
    overflow-wrap: break-word;
    word-break: break-word;
}

.ow-anywhere {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ===== 产品轮播图样式 ===== */
.product-carousel {
    position: relative;
    height: 16rem; /* 固定高度 h-64 = 16rem */
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 轮播控制按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-btn i {
    color: var(--color-primary);
    font-size: 1rem;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.carousel-btn:hover i {
    color: var(--color-accent);
}

.product-card:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    pointer-events: none; /* 防止影响布局 */
}

.carousel-indicators .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto; /* 只有指示器本身可点击 */
}

.carousel-indicators .indicator.active {
    background: rgba(255, 255, 255, 1);
    width: 24px;
    border-radius: 4px;
}

.carousel-indicators .indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 产品标签筛选 */
.product-tab {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.product-tab:hover {
    background: var(--color-primary) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 168, 107, 0.25);
}

.product-tab.active {
    background: var(--color-primary) !important;
    color: white !important;
}

/* 产品卡片 */
.product-card {
    transition: transform 0.3s ease;
    background: transparent;
}

.product-card:hover {
    transform: translateY(-8px);
}

/* 产品卡片悬停文字阴影增强 */
.drop-shadow-lg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.7)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.6);
}

.drop-shadow-md {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7), 0 0 6px rgba(0, 0, 0, 0.5);
}

/* 隐藏滚动条的工具类 */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}