@import url('theme-colors.css');

/* 品牌渐变顶栏 / 按钮 */
.lv-brand-bar {
    background: var(--lv-gradient) !important;
}

.lv-brand-bar__slogan {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .lv-brand-bar__slogan {
        font-size: 0.8125rem;
        letter-spacing: 0.05em;
    }
}

@media (max-width: 479px) {
    .lv-brand-bar__slogan {
        font-size: 0.625rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: center;
    }
}

.lv-btn-gradient {
    background: var(--lv-gradient);
    color: #fff;
    transition: opacity 0.2s, transform 0.2s;
}

.lv-btn-gradient:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.lv-section-soft {
    background: var(--lv-gradient-soft);
}

/* 导航 Logo 横版整图 */
header a img.site-logo-wide,
header a img.site-logo,
header a img[src*="logo-full"],
header a img[src*="logo.png"] {
    height: 2.75rem;
    width: auto;
    max-width: min(340px, 72vw);
    object-fit: contain;
    object-position: left center;
    display: block;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    header a img.site-logo-wide,
    header a img.site-logo,
    header a img[src*="logo-full"] {
        height: 3rem;
        max-width: 340px;
    }
}

/* 仅图标（favicon 等场景备用） */
header a img.site-logo-icon {
    height: 2.25rem;
    width: 2.25rem;
    max-width: none;
    object-fit: contain;
}

/* Tailwind CSS配置和通用样式 */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* 确保导航栏显示一致 */
header,
header.site-main-header {
    position: fixed !important;
    top: 48px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background-color: white !important;
    overflow: visible !important;
}

/* 主内容区域适配头部高度 */
.main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 通用工具类 */
@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    
    .card-hover {
        transition: all 0.3s ease;
    }
    
    .card-hover:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(var(--lv-primary-rgb), 0.12);
    }
    
    .nav-active {
        color: var(--lv-primary) !important;
        font-weight: 500;
    }
    
    .scrollbar-hide {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }
    
    .text-shadow {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* 动画效果 */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-float-delay-1 {
    animation: float 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.animate-float-delay-2 {
    animation: float 3s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 轮播图样式（高度由页面 .hero-carousel-wrap 控制） */
.carousel-slide {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide:first-child {
    opacity: 1 !important;
}

.carousel-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    transform: scale(1.2);
}

/* 新闻卡片悬停效果 */
.news-card-hover {
    transition: all 0.3s ease;
}

.news-card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--lv-primary-rgb), 0.15);
}

.news-card-hover:hover .news-card-icon {
    transform: scale(1.1);
}

.news-card-icon {
    transition: transform 0.3s ease;
}

/* 头部样式 */
.header-top-bar {
    background: linear-gradient(135deg, var(--lv-primary) 0%, var(--lv-secondary) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-trigger:hover .dropdown-menu,
.dropdown-trigger:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 侧边栏样式 */
.sidebar-float {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
    .sidebar-float {
        display: block !important;
    }
}

.sidebar-main {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    overflow: hidden;
}

.contact-item {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.contact-item:hover {
    background: linear-gradient(135deg, var(--lv-primary) 0%, var(--lv-secondary) 100%);
    transform: translateY(-2px);
}

/* 右侧悬浮详情框 */
.sidebar-detail-box {
    width: 16rem;
}
.sidebar-detail-box.sidebar-detail-box--consult {
    width: 16rem;
    padding: 1rem 1.125rem;
}

.contact-item .icon {
    transition: all 0.3s ease;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-item:hover .icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.contact-item .icon i {
    color: var(--lv-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.contact-item:hover .icon i {
    color: white;
}

.contact-item .label {
    color: #374151;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
}

.contact-item:hover .label {
    color: white;
}

.detail-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.detail-box.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 底部样式 */
.footer-main {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .footer-content {
        padding: 0 2rem;
    }
}

.footer-section h3,
.footer-section h4 {
    color: #f9fafb;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section .company-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.footer-section .company-logo i {
    color: var(--lv-primary);
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.footer-section .company-logo h3 {
    color: #f9fafb;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.footer-section p,
.footer-section li {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

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

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

.footer-section a:hover {
    color: var(--lv-primary);
}

.footer-section .contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.footer-section .contact-item i {
    color: var(--lv-primary);
    margin-right: 0.5rem;
    width: 16px;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--lv-primary) 0%, var(--lv-secondary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-nav .nav-desktop {
        display: none !important;
    }
    
    .header-nav .nav-mobile {
        display: flex !important;
    }
    
    .sidebar-float {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .header-nav .nav-desktop {
        display: flex !important;
    }
    
    .header-nav .nav-mobile {
        display: none !important;
    }
}

.mobile-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu a {
    color: #374151;
    text-decoration: none;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu a:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--lv-primary);
}

/* 首页特殊样式 */
.page-index .header-top-bar .online-trial {
    display: flex !important;
}

.page-index .header-nav .dropdown-menu {
    display: block !important;
}

/* 滚动条样式 */
html {
    scroll-behavior: smooth;
}

/* 主内容区域 */
.main-content {
    padding-top: 0;
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 0;
    }
}

/* 成功案例客户卡片（参考官方案例墙样式） */
.case-client-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.case-client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 135, 90, 0.12);
}

.case-client-card__header {
    min-height: 7rem;
}

.case-client-card__leaf {
    position: absolute;
    width: 3.5rem;
    height: 3.5rem;
    top: 0.5rem;
    background: radial-gradient(circle at 30% 30%, #52c87a 0%, #00875a 70%);
    opacity: 0.35;
    border-radius: 0 80% 0 80%;
    pointer-events: none;
}

.case-client-card__leaf--l {
    left: 0.75rem;
    transform: rotate(-25deg);
}

.case-client-card__leaf--r {
    right: 0.75rem;
    transform: rotate(25deg) scaleX(-1);
}

.case-client-card__logo {
    position: relative;
    z-index: 1;
}

/* ========== 移动端体验优化 ========== */
:root {
    --site-header-offset: 7.25rem;
}

@media (min-width: 768px) {
    :root {
        --site-header-offset: 7.5rem;
    }
}

main.site-main {
    padding-top: var(--site-header-offset);
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 1023px) {
    body {
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* 首页 Hero 轮播（移动端降低高度，桌面端保留视口比例） */
.hero-carousel-wrap {
    min-height: min(420px, 72vh);
    height: clamp(380px, 68vh, 540px);
}

@media (min-width: 768px) {
    .hero-carousel-wrap {
        min-height: 540px;
        height: clamp(540px, 78vh, 720px);
    }
}

@media (min-width: 1024px) {
    .hero-carousel-wrap {
        min-height: 620px;
        height: clamp(620px, 82vh, 760px);
    }
}

.hero-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (min-width: 1024px) {
    .hero-bg {
        background-attachment: fixed;
    }
}

@media (max-width: 767px) {
    .carousel-dot {
        width: 2.75rem !important;
        height: 2.75rem !important;
        min-width: 44px;
        min-height: 44px;
    }

    .carousel-nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

.cases-filter-btn {
    min-height: 44px;
    padding-left: 1.125rem;
    padding-right: 1.125rem;
}

#backToTop {
    z-index: 45;
}

@media (max-width: 1023px) {
    #backToTop {
        bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 移动端底部快捷联系栏 */
.mobile-contact-bar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-contact-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 3.5rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-contact-bar__item:active,
.mobile-contact-bar__item:hover {
    background-color: rgba(23, 132, 232, 0.06);
}

.mobile-contact-bar__item i {
    font-size: 1.125rem;
}

.mobile-contact-bar__item span {
    font-size: 0.6875rem;
    line-height: 1.2;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.125rem;
}

@media (min-width: 380px) {
    .mobile-contact-bar__item span {
        font-size: 0.75rem;
    }
}

button.mobile-contact-bar__item {
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.mobile-contact-bar__item.is-active {
    color: var(--lv-primary);
    background-color: rgba(23, 132, 232, 0.08);
}

.mobile-contact-bar__item.is-active span {
    font-weight: 600;
}

/* 微信弹层 */
.mobile-wechat-overlay {
    -webkit-tap-highlight-color: transparent;
}

.mobile-wechat-overlay:not(.hidden) {
    display: flex;
}

.mobile-wechat-panel {
    position: relative;
    animation: mobileWechatIn 0.25s ease-out;
}

@keyframes mobileWechatIn {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobileMenu.mobile-menu a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

#mobileMenu.mobile-menu a.hidden,
.mobile-menu a.hidden,
.mobile-menu .nav-item-hidden {
    display: none !important;
}

.footer-section .break-words,
footer .break-words {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 在线留言浮动按钮（移动端） */
.online-consult-fab {
    left: 1rem;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--lv-primary), var(--lv-secondary));
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(23, 132, 232, 0.35);
    font-size: 0.625rem;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.online-consult-fab i {
    font-size: 1.125rem;
}

.online-consult-panel:not(.hidden) {
    display: flex;
}

.form-success-modal:not(.hidden) {
    display: flex;
}

.form-hp-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .online-consult-fab {
        display: none !important;
    }
}

/* 详情页 / 列表页移动端体验 */
@media (max-width: 767px) {
    main.site-main > section:first-child:not(#home) {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    main.site-main section.bg-neutral .text-sm.text-gray-500 {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.125rem;
    }

    main.site-main section.bg-neutral .text-sm.text-gray-500::-webkit-scrollbar {
        display: none;
    }

    main.site-main > section:first-child:not(#home) h1 {
        font-size: clamp(1.625rem, 6.5vw, 2.25rem) !important;
        line-height: 1.25 !important;
    }

    #detail-specs table,
    .detail-table-wrap {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #detail-sidebar .grid.grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    #detail-sidebar-actions a,
    #detail-sidebar-actions button {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .form-input,
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    textarea,
    select {
        font-size: 16px;
    }

    .cases-filter-btn {
        flex: 1 1 auto;
        min-width: calc(33% - 0.5rem);
    }
}