/* 公共移动端适配样式 - 头部导航和底部 */

/* 移动端菜单按钮默认隐藏 */
.mobile-menu-btn {
    display: none;
}

/* 基础响应式设置 */
@media screen and (max-width: 768px) {
    /* 重置基础样式 */
    * {
        box-sizing: border-box;
    }

    /* 基础设置 - 适配flexible.js */
    html {
        /* flexible.js会动态设置font-size，这里不需要手动设置 */
    }

    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
        font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        line-height: 1.6;
    }

    /* 导航栏移动端适配 */
    .navbar {
        height: 3.75rem; /* 60px */
        padding: 0 0.9375rem; /* 15px */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
        backdrop-filter: blur(10px);
    }

    .navbar-content {
        padding: 0;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        max-width: 100%;
    }

    .logo {
        width: 7.5rem; /* 120px */
        height: 2.25rem; /* 36px */
        min-width: auto;
        min-height: auto;
        flex-shrink: 0;
    }

    .logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* 隐藏桌面端导航链接 */
    .nav-links {
        display: none;
        position: fixed;
        top: 3.75rem; /* 60px */
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1.25rem 0; /* 20px */
        margin-left: 0;
        gap: 0;
        z-index: 999;
        max-height: calc(100vh - 3.75rem); /* 60px */
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .nav-item > h2 {
        padding: 0.9375rem 1.25rem; /* 15px 20px */
        margin: 0;
    }

    .nav-item > h2 > a {
        font-size: 1rem; /* 16px */
        line-height: 1.5rem; /* 24px */
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        text-decoration: none;
    }

    /* 移动端下拉箭头 */
    .nav-item.dropdown .dropdown-arrow {
        font-size: 0.8rem;
        transition: transform 0.3s ease;
    }

    /* 移动端下拉菜单 */
    .nav-item.dropdown .dropdown-menu {
        position: static;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: none;
        border-radius: 0;
        padding: 0;
        min-width: auto;
        opacity: 0;
        visibility: hidden;
        transform: none;
        transition: all 0.3s ease;
        z-index: auto;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
    }

    .nav-item.dropdown.active .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        max-height: 13.33rem !important; /* 500px / 37.5 = 13.33rem */
        transform: translateY(0) !important;
    }

    .nav-item.dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-item.dropdown .dropdown-menu a {
        display: block;
        padding: 0.75rem 2.5rem;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        font-size: 0.9rem;
        line-height: 1.4;
        transition: all 0.3s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-item.dropdown .dropdown-menu a:last-child {
        border-bottom: none;
    }

    .nav-item.dropdown .dropdown-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #FFFFFF;
    }

    /* 移动端菜单按钮 */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 1.067rem; /* 24px / 37.5 = 0.64rem */
        height: 1.067rem; /* 18px / 37.5 = 0.48rem */
        cursor: pointer;
        padding: 0;
        background: none;
        border: none;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background: #fff;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* 隐藏语言切换和桌面菜单 */
    .language-switch,
    .menu {
        display: none;
    }

    /* Footer移动端适配 */
    .footer {
        padding: 1.5rem 1rem;
        background: #f8f9fa;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 1rem;
    }

    .footer-section {
        width: 100%;
    }

    .footer-section h3 {
        font-size: 0.8rem; /* 18px */
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.7rem !important; /* 14px */
        line-height: 1.6;
        margin-bottom: 0.5rem;
    }

    .contact-info {
        flex-direction: column;
        gap: 1rem;
        padding-top: 0;
    }

    .map-container {
        width: 100%;
        height: 12.5rem; /* 200px */
        border-radius: 0.5rem;
        order: 2;
    }

    .contact-details {
        order: 1;
        padding-top: 0;
        gap: 0.75rem;
    }

    .contact-item {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.7rem; /* 14px */
        font-weight: 500;
    }

    .contact-item span {
        width: 100%;
        font-size: 0.7rem; /* 14px */
        font-weight: normal;
        display: contents;
    }

    .footer-bottom {
        padding-top: 1rem;
        border-top: 1px solid #e9ecef;
    }

    .footer-bottom-copyright {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .footer-bottom-copyright p {
        font-size: 0.7rem; /* 12px */
        margin: 0;
    }

    .footer-bottom-copyright div {
        display: none;
    }

    /* 通用移动端优化 */
    /* 触摸优化 */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    /* 文字选择优化 */
    p, span, div, h1, h2, h3, h4, h5, h6 {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }

    /* 滚动优化 */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }

    /* 表格响应式 */
    table {
        width: 100%;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    /* 按钮触摸优化 */
    button, .btn, a {
        touch-action: manipulation;
        font-size: 0.875rem; /* 14px */;
    }

    /* 输入框优化 */
    input, textarea, select {
        font-size: 0.427rem; /* 16px / 37.5 - 防止iOS缩放 */
    }
}

/* 平板适配 (769px - 1024px) - 使用rem单位 */
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        height: 1.867rem; /* 70px / 37.5 */
        padding: 0 0.8rem; /* 30px / 37.5 */
    }

    .logo img {
        height: 1.067rem; /* 40px / 37.5 */
    }

    .nav-links {
        display: flex !important;
        position: static !important;
        background: transparent !important;
        backdrop-filter: none !important;
        flex-direction: row !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0.8rem !important; /* 30px / 37.5 */
        max-height: none !important;
        overflow: visible !important;
    }

    .mobile-menu-btn {
        display: none !important;
    }
}

/* 显示/隐藏类 */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }
}