/* ===================================================
   移动端适配样式表 (≤768px)
   仅在小屏设备加载，不影响桌面端
   =================================================== */

/* 1. 统一盒模型 & 字体基准 */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0 4vw;
    overflow-x: hidden;
}

/* 2. 图片、视频、iframe 响应式处理 */
img, 
video, 
iframe,
embed,
object {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

img.logo-small,
.site-branding img {
    width: auto;
    max-width: 180px !important;
    height: auto !important;
}

/* 3. 容器宽度适配 - Elementor & 通用容器 */
.elementor-section.elementor-section-boxed > .elementor-container,
.elementor-container,
.e-con,
.container,
.container-fluid,
.ls-wp-container {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 4vw !important;
    padding-right: 4vw !important;
}

/* LayerSlider 特殊处理 */
.ls-wp-container,
#layerslider_2_1xb782rv44qfy {
    height: 50vw !important;
    min-height: 200px !important;
    max-height: 300px !important;
}

.ls-slide,
.ls-inner,
.ls-wrapper {
    width: 100% !important;
    height: 100% !important;
}

/* 4. 表格响应式 - 横向滚动 */
table {
    width: 100% !important;
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}

table th,
table td {
    white-space: nowrap;
    padding: 8px !important;
    font-size: 14px !important;
}

/* 5. 文本尺寸自适应 */
h1, .h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
    line-height: 1.3 !important;
}

h2, .h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
    line-height: 1.3 !important;
}

h3, .h3 {
    font-size: clamp(1.2rem, 4vw, 1.6rem) !important;
    line-height: 1.3 !important;
}

h4, .h4 {
    font-size: clamp(1rem, 3.5vw, 1.4rem) !important;
}

h5, .h5 {
    font-size: clamp(0.95rem, 3vw, 1.2rem) !important;
}

h6, .h6 {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem) !important;
}

p, li, span, div {
    font-size: clamp(14px, 3.5vw, 16px) !important;
    line-height: 1.6 !important;
}

/* 6. 导航菜单适配 */
/* 隐藏桌面主导航 */
#site-navigation,
.header-icon-area {
    display: none !important;
}

/* 显示移动端汉堡菜单 */
#meanmenu,
.rt-header-menu.mean-container {
    display: block !important;
    position: relative;
}

.mean-bar {
    background-color: #ffffff !important;
    padding: 10px 4vw !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.mean-bar img {
    max-width: 150px !important;
    height: auto !important;
}

.sidebarBtn {
    font-size: 24px !important;
    cursor: pointer;
}

/* 移动端菜单展开样式 */
.rt-slide-nav {
    width: 100% !important;
}

.rt-slide-nav .menu {
    padding: 0 !important;
}

.rt-slide-nav .menu li {
    width: 100% !important;
    border-bottom: 1px solid #eee;
}

.rt-slide-nav .menu li a {
    display: block !important;
    padding: 12px 4vw !important;
    font-size: 16px !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* 确保没有子菜单的项目可点击 */
.rt-slide-nav .menu li:not(.menu-item-has-children) > a {
    pointer-events: auto !important;
}

.rt-slide-nav .sub-menu {
    padding-left: 20px !important;
}

/* 7. Header 头部适配 */
.masthead-container {
    padding: 10px 0 !important;
}

.site-header .row {
    flex-direction: column !important;
}

.site-header .col-sm-2,
.site-header .col-sm-10 {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center;
}

.site-branding {
    text-align: center !important;
    margin-bottom: 10px;
}

/* 8. Elementor 栅格列堆叠 */
[class*="col-"],
.elementor-column {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-bottom: 20px !important;
}

.elementor-row,
.row {
    flex-direction: column !important;
}

/* 9. Section 间距优化 */
.elementor-section,
.elementor-widget {
    margin: 0 !important;
    padding: 4vw 0 !important;
}

.elementor-section-stretched {
    width: 100vw !important;
    left: 0 !important;
    margin-left: 0 !important;
}

/* 10. 超链接触控优化 */
a {
    display: inline-block;
    padding: 0.3em 0.1em;
    min-height: 44px;
    line-height: 1.5;
}

a img {
    display: inline-block;
}

/* 11. 按钮适配 */
.btn,
button,
input[type="submit"],
input[type="button"],
.wp-block-button__link {
    width: 100% !important;
    max-width: 100%;
    padding: 12px 20px !important;
    font-size: 16px !important;
    text-align: center;
    display: block !important;
    margin: 10px 0 !important;
}

/* 12. 表单元素适配 */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100% !important;
    max-width: 100%;
    padding: 10px !important;
    font-size: 16px !important;
    box-sizing: border-box;
}

/* 13. 倒计时 & 活动信息块 */
.upcoming-event-layout2 h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
}

.event-location {
    font-size: clamp(1rem, 3.5vw, 1.2rem) !important;
}

.elementor-countdown-wrapper {
    max-width: 100% !important;
    flex-direction: row !important;
    justify-content: center !important;
}

.elementor-countdown-item {
    margin: 0 5px !important;
    font-size: 14px !important;
}

/* 14. Footer 页脚适配 */
.footer-layout2 .footer-top-area .row {
    flex-direction: column !important;
}

.footer-layout2 .footer-top-area [class*="col-"] {
    width: 100% !important;
    margin-bottom: 20px;
}

/* 15. 隐藏不必要元素 */
.ls-nav-prev,
.ls-nav-next {
    display: none !important;
}

/* 16. 固定宽度元素强制适配 */
.site-wrp,
#page,
#content,
#primary,
.content-area {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* 17. WooCommerce 商品适配 */
.woocommerce .products,
.woocommerce-page .products {
    display: flex !important;
    flex-direction: column !important;
}

.woocommerce .product,
.woocommerce-page .product {
    width: 100% !important;
}

/* 18. 防止内容溢出 */
* {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

pre, code {
    white-space: pre-wrap !important;
    word-break: break-all !important;
}

/* 19. 背景图片适配 */
[style*="background-image"] {
    background-size: cover !important;
    background-position: center !important;
}

/* 20. 特定页面元素微调 */
.about-layout3,
.event-page-area {
    padding: 4vw !important;
}

/* 确保文本可读性 */
.elementor-widget-text-editor {
    font-size: 15px !important;
    line-height: 1.7 !important;
}

/* 21. 响应式嵌入内容 */
.elementor-video-wrapper,
.wp-video,
.wp-block-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.elementor-video-wrapper iframe,
.wp-video video,
.wp-block-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}
