/* ==========================================================================
   LotusTale 样式表 - 现代高端品牌主题
   ========================================================================== */

/* 设计令牌与变量 */
:root {
    --brand-teal: #35bec2;
    --brand-teal-dark: #29a3a7;
    --brand-teal-light: #5cd0d3;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #999999;
    --border-color: #eaeaea;
    --bg-white: #ffffff;
    --bg-light: #f9f9f9;
    --sidebar-width: 45px;
    --header-height: 80px;
    --font-primary: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-primary);
    background-color: var(--bg-white);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 左侧固定蒂芙尼蓝导航栏 */
.left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--brand-teal);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.header-logo-mobile,
.search-toggle-mobile,
.header-submenu-row {
    display: none;
}

.header-main-row {
    display: contents;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    outline: none;
    padding: 0;
    z-index: 1005;
}

.menu-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--bg-white);
    transition: var(--transition-smooth);
    border-radius: 1px;
}

/* 汉堡按钮变形为 'X' */
.menu-toggle.open .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.open .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 覆盖在横幅上的透明 Logo 触发器 */
.logo-click-trigger {
    position: fixed;
    top: 20px;
    left: 80px;
    width: 180px;
    height: 50px;
    z-index: 990;
    cursor: pointer;
    background: transparent;
    display: block;
}

/* 导航遮罩层 */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 995;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 导航侧边抽屉 */
.nav-drawer {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    bottom: 0;
    width: 440px;
    /* 窄菜单宽度 */
    background-color: var(--bg-white);
    z-index: 998;
    transform: translateX(-100%);
    transition: var(--transition-smooth);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.08);
}

.nav-drawer.open {
    transform: translateX(0);
}

.drawer-menu-pane {
    width: 100%;
    height: 100%;
    padding: 90px 30px 40px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-teal) transparent;
}

.drawer-menu-pane::-webkit-scrollbar {
    width: 4px;
}

.drawer-menu-pane::-webkit-scrollbar-thumb {
    background-color: var(--brand-teal);
}

/* 菜单区域 */
.menu-section {
    margin-bottom: 25px;
    width: 100%;
}

.menu-section-header {
    border-top: 1.5px solid var(--brand-teal);
    border-bottom: 1.5px solid var(--brand-teal);
    padding: 8px 0;
    margin-bottom: 15px;
    width: 100%;
}

.section-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
}

.menu-section-content {
    display: flex;
    width: 100%;
    position: relative;
}

.menu-links {
    list-style: none;
    width: 190px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

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

.menu-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition-fast);
    display: inline-block;
    line-height: 1.4;
}

.menu-links a:hover,
.menu-links a.active-hover {
    color: var(--brand-teal);
    transform: translateX(4px);
}

/* 底部页脚 Logo 与横幅 */
.drawer-menu-footer {
    margin-top: auto;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.menu-logo {
    width: 350px;
    height: auto;
    display: block;
}

.menu-banner-text {
    background-color: var(--brand-teal);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    padding: 10px 20px;
    width: 350px;
    display: block;
}

.menu-submenu-pane {
    flex-grow: 1;
    position: relative;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-self: flex-start;
}

.menu-submenu-pane.active {
    opacity: 1;
    visibility: visible;
}

.submenu-divider {
    display: none;
}

.submenu-list {
    list-style: none;
    padding: 0;
    padding-left: 20px;
    margin: 0;
    border-left: 1px solid var(--border-color);
    flex-grow: 1;
}

.submenu-list li {
    margin-bottom: 10px;
}

.submenu-list li:last-child {
    margin-bottom: 0;
}

.submenu-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition-fast);
    display: inline-block;
    line-height: 1.4;
}

.submenu-list a:hover {
    color: var(--brand-teal);
    transform: translateX(4px);
}

/* 主内容区域 */
.main-content {
    margin-left: var(--sidebar-width);
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* 各个内容区域 */
.content-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.6s;
    z-index: 1;
}

.content-section.active {
    opacity: 1;
    visibility: visible;
    z-index: 5;
}

/* 首页横向轮播 */
#home-section {
    background-color: #f0f0f0;
}

.horizontal-scroll-container {
    display: flex;
    width: 400%;
    /* 4 个幻灯片 */
    height: 100%;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-slide {
    width: 25%;
    /* 容器的 1/4 */
    height: 100%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.slide-content-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw;
    /* 100 * 9 / 16 */
    min-height: 100vh;
    min-width: 177.78vh;
    /* 100 * 16 / 9 */
}

.slide-content-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 首页滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    right: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-primary);
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
}

.indicator-text {
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 2px;
    font-weight: 500;
    margin-bottom: 8px;
    writing-mode: vertical-lr;
}

.indicator-arrow {
    width: 1px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.indicator-arrow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15px;
    background-color: var(--brand-teal);
    animation: indicatorScroll 2s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes indicatorScroll {
    0% {
        transform: translateY(-100%);
    }

    80% {
        transform: translateY(300%);
    }

    100% {
        transform: translateY(300%);
    }
}

/* 内页（水平轮播图集） */
.inner-page-section {
    overflow: hidden;
    background-color: var(--bg-white);
}

.section-gallery {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    padding-top: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-gallery img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
    display: block;
    border: none;
    margin: 0;
    padding: 0;
}

/* 轮播图左右控制按钮 */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    opacity: 0;
    pointer-events: none;
}

/* 当鼠标悬浮在页面区域上时显示按钮 */
.inner-page-section:hover .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.45);
    border-color: var(--brand-teal);
    transform: translateY(-50%) scale(1.08);
}

.carousel-arrow.prev {
    left: 40px;
}

.carousel-arrow.next {
    right: 40px;
}

.carousel-arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.carousel-arrow:hover svg {
    stroke: var(--brand-teal);
}

/* 分页指示器（圆点） */
.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.carousel-dot:hover {
    background: rgba(0, 0, 0, 0.4);
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--brand-teal);
    border-color: var(--brand-teal);
}

/* 首页 16.jpg 上的 Learn More 透明点击按钮 (扩大点击范围且完全隐藏高亮) */
.home-learn-more-btn {
    position: absolute;
    bottom: 8%;
    right: 5%;
    width: 20%;
    height: 12%;
    background: transparent;
    cursor: pointer;
    z-index: 20;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.home-learn-more-btn:focus,
.home-learn-more-btn:active {
    outline: none;
    background: transparent;
    box-shadow: none;
}

/* 首页 17.jpg, 18.jpg 和 19.jpg 上的 Learn More 透明点击按钮 (针对子页面跳转，及完全隐藏高亮) */
.home-solutions-btn,
.home-advanced-btn,
.home-science-btn {
    position: absolute;
    bottom: 33%;
    left: 11%;
    width: 20%;
    height: 10%;
    background: transparent;
    cursor: pointer;
    z-index: 20;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.home-solutions-btn:focus,
.home-solutions-btn:active,
.home-advanced-btn:focus,
.home-advanced-btn:active,
.home-science-btn:focus,
.home-science-btn:active {
    outline: none;
    background: transparent;
    box-shadow: none;
}

/* 首页评论轮播 */
.comment-carousel {
    position: absolute;
    left: 8%;
    bottom: 13%;
    width: 32.5%;
    aspect-ratio: 2591 / 1485;
    /* 刚好同时展示三条的比例 */
    overflow: hidden;
    z-index: 15;
    pointer-events: none;
    /* 让它不阻挡底层鼠标滚动 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.comment-carousel.h5-only {
    display: none !important;
}

.comment-track {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    /* 增加评论之间的间距 */
    padding-bottom: 12px;
    /* 垫底间距，确保无缝循环动画完美对齐 */
    animation: marqueeUp 16s linear infinite;
    /* 无缝向上滚动动画 */
}

.comment-item {
    width: 100%;
    aspect-ratio: 2591 / 495;
    /* 单个卡片的比例 */
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

@keyframes marqueeUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
        /* 滚动到一半时自动重置 */
    }
}

/* --- Homepage Popup Styling --- */
.popup-overlay {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: none;
}

.popup-overlay.show {
    display: block;
    animation: fadeInPopup 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-container {
    position: relative;
    width: 38rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background-color: var(--bg-white);
    transition: transform 0.3s ease;
}

.popup-container:hover {
    transform: translateY(-4px);
}

.popup-image {
    width: 100%;
    height: auto;
    display: block;
}

.popup-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    color: transparent;
    cursor: pointer;
    z-index: 10;
    outline: none;
}

.popup-close:hover {
    background: transparent;
}

@keyframes fadeInPopup {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   响应式设计与媒体查询
   ========================================================================== */

@media (max-width: 1024px) {
    .nav-drawer {
        width: 420px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        /* 隐藏侧边栏，使其悬浮 */
        --header-height: 60px;
    }

    .left-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: auto;
        background-color: var(--bg-white);
        z-index: 1005;
        /* Always on top of everything on mobile */
        display: flex;
        flex-direction: column;
        border-bottom: 1.5px solid var(--border-color);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
        border-radius: 0;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .left-sidebar.menu-open {
        background-color: transparent;
        border-bottom-color: transparent;
        box-shadow: none;
        pointer-events: none;
        /* Allow click-through to drawer below */
    }

    .left-sidebar.menu-open .menu-toggle {
        pointer-events: auto;
        /* Keep close button clickable */
    }

    .header-main-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: var(--header-height);
        padding: 0 20px;
    }

    .menu-toggle .bar {
        background-color: var(--brand-teal);
    }

    .header-logo-mobile {
        display: block;
        height: 24px;
        width: auto;
        object-fit: contain;
        cursor: pointer;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .left-sidebar.menu-open .header-logo-mobile {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .search-toggle-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        outline: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .search-toggle-mobile svg {
        stroke: var(--brand-teal);
        stroke-width: 2.5;
        stroke-linecap: round;
        stroke-linejoin: round;
        fill: none;
    }

    .left-sidebar.menu-open .search-toggle-mobile {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .header-submenu-row {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-height: 40px;
        height: auto;
        padding: 6px 15px;
        border-top: 1px solid var(--border-color);
        background-color: var(--bg-white);
        gap: 20px;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .header-submenu-row.hidden {
        display: none !important;
    }

    .left-sidebar.menu-open .header-submenu-row {
        display: none !important;
    }

    .header-submenu-item {
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 500;
        text-decoration: none;
        text-align: center;
        white-space: normal;
        line-height: 1.3;
        display: block;
        flex-grow: 1;
        flex-shrink: 1;
        flex-basis: 0;
        position: relative;
        transition: var(--transition-fast);
    }

    .header-submenu-item:not(:last-child)::after {
        content: '';
        position: absolute;
        right: -10px;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 12px;
        background-color: var(--border-color);
    }

    .header-submenu-item.active {
        color: var(--brand-teal);
        font-weight: 700;
    }

    .logo-click-trigger {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .nav-drawer {
        left: 0;
        width: 100%;
        max-width: 100%;
        z-index: 1001;
        /* Slide above the page but below active header components */
    }

    .drawer-menu-pane {
        padding: 80px 30px 40px 30px;
    }

    .menu-section {
        margin-bottom: 35px;
    }

    .menu-section-content {
        flex-direction: column;
    }

    .menu-links {
        width: 100%;
    }

    .menu-links li {
        margin-bottom: 18px;
    }

    .menu-links a {
        font-size: 16px;
    }

    .menu-submenu-pane {
        display: none !important;
    }

    .menu-logo {
        width: 100%;
        /* max-width: 260px; */
        margin: 0 auto;
    }

    .menu-banner-text {
        width: 100%;
        /* max-width: 260px; */
        margin: 0 auto;
        font-size: 12px;
        padding: 10px 15px;
    }

    .scroll-indicator {
        right: 20px;
        bottom: 20px;
    }

    .slide-content-wrapper {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        transform: none !important;
        top: 0 !important;
        left: 0 !important;
    }

    .comment-carousel.pc-only {
        display: none !important;
    }

    .comment-carousel.h5-only {
        display: block !important;
        left: 20px !important;
        top: 100px !important;
        bottom: auto !important;
        width: calc(100% - 40px) !important;
        height: 100px !important;
    }

    /* ==========================================================================
       H5 下普通上下滑动展示，不使用轮播
       ========================================================================== */
    .content-section,
    .inner-page-section {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding-top: 60px !important;
        /* Fallback base header height on mobile before JS runs */
    }

    /* 让画廊/幻灯片容器垂直排布，宽度 100%，高度自适应，并重置 transform */
    .section-gallery,
    .horizontal-scroll-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        transform: none !important;
    }

    /* 重置子项定位与高度，使其随图片内容自适应 */
    .section-gallery img,
    .scroll-slide {
        width: 100% !important;
        height: auto !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        position: relative !important;
        overflow: visible !important;
        /* Allow absolute elements like buttons to render */
    }

    .slide-content-wrapper {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
        transform: none !important;
        top: 0 !important;
        left: 0 !important;
    }

    .slide-content-wrapper img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* 轮播指示点与箭头在移动端直接隐藏 */
    .carousel-arrow,
    .carousel-dots {
        display: none !important;
    }

    /* H5 下隐藏第5张主页幻灯片 (只留4张) */
    #home-section .scroll-slide:nth-child(5) {
        display: none !important;
    }

    /* ==========================================================================
       H5 首页中间弹窗样式
       ========================================================================== */
    .popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 2000;
        padding: 20px;
        bottom: auto;
        right: auto;
    }

    .popup-overlay.show {
        display: flex !important;
    }

    .popup-container {
        width: 80%;
        max-width: 300px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    }

    .popup-container:hover {
        transform: none;
    }

    .popup-close {
        top: 0;
        right: 0;
        width: 50px;
        height: 50px;
    }
}