/* 移动端专用样式文件 */

/* 移动端CSS重置和优先级提升 */
@media (max-width: 768px) {
    /* 强制覆盖内联样式 */
    .section-title {
        font-size: 32px !important;
        margin-bottom: 12px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* 确保标题文字在一行显示 */
    .section-title span {
        white-space: nowrap !important;
        display: inline !important;
    }
    
    .section-description {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
    }
    
    /* 强制覆盖AI服务区域的样式 */
    #ai-companion h2 {
        font-size: 36px !important;
        margin-bottom: 40px !important;
        margin-top: 0 !important;
    }
    
    #ai-companion .section-container > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    #ai-companion .section-container > div:last-child > div {
        padding: 20px 8px 16px 8px !important;
        border-radius: 12px !important;
        min-width: 0 !important;
        border: 2px solid #222 !important;
        background: #fff !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child {
        font-size: 28px !important;
        margin-bottom: 12px !important;
        margin-top: 0 !important;
        color: #222 !important;
        font-weight: 700 !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child span {
        font-size: 24px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:last-child {
        font-size: 14px !important;
        color: #666 !important;
    }
    
    /* 强制覆盖内容包装器样式 */
    .content-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 32px !important;
    }
    
    .text-content {
        margin-bottom: 24px !important;
        text-align: center !important;
    }
    
    .media-content {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .media-content img {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 32px rgba(0,0,0,0.08) !important;
    }
}

/* 移动端基础设置 */
@media (max-width: 768px) {
    /* 导航栏移动端优化 */
    .navbar {
        padding: 0;
    }
    
    .nav-container {
        padding: 0 12px;
        height: 50px;
        position: relative;
    }
    
    /* 移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
        z-index: 1001;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #333;
        transition: all 0.3s ease;
        border-radius: 1px;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* 移动端菜单 */
    .nav-menu {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu .nav-item {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 16px;
        border-radius: 0;
    }
    
    .nav-menu .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-menu .download-btn {
        margin: 10px 20px;
        width: calc(100% - 40px);
        border-radius: 25px;
    }
    
    .nav-logo {
        gap: 4px;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
        margin-left: 0;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    /* 移动端导航菜单样式 */
    .nav-menu {
        gap: 8px;
    }
    
    .nav-item {
        font-size: 12px;
        padding: 6px 8px;
        border-radius: 4px;
    }
    
    .download-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 15px;
    }
    
    /* 首页移动端优化 */
    .home-section {
        min-height: 100vh;
        padding-top: 50px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        background-attachment: fixed !important;
        background-size: cover !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    /* 修复首页背景分离问题 */
    .home-background {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        z-index: -1 !important;
        opacity: 1 !important;
    }
    
    .home-content {
        position: relative !important;
        z-index: 2 !important;
        background: transparent !important;
        margin-top: 60px;
        padding: 0 16px;
        text-align: center;
    }
    

    
    .main-title {
        font-size: 20px;
        margin-bottom: 12px;
        letter-spacing: 1px;
    }
    
    .sub-title {
        font-size: 10px;
        letter-spacing: 0.2em;
        margin-bottom: 24px;
        line-height: 1.4;
    }
    
    .download-button {
        font-size: 16px;
        padding: 12px 32px;
        border-radius: 24px;
        margin-top: 0;
    }
    
    .download-text {
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    /* 内容区域移动端优化 */
    .content-section {
        padding: 60px 0;
    }
    
    .section-container {
        padding: 0 16px;
    }
    
    .content-wrapper {
        flex-direction: column;
        gap: 32px;
    }
    
    .text-content {
        margin-bottom: 24px;
        text-align: center;
    }
    
    .section-title {
        font-size: 32px !important;
        margin-bottom: 12px;
        line-height: 1.2;
    }
    
    .section-description {
        font-size: 16px !important;
        line-height: 1.5;
        margin-bottom: 0;
    }
    
    .media-content img {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 12px !important;
    }
    
    /* AI服务网格移动端优化 */
    #ai-companion .section-container {
        padding: 0 16px;
    }
    
    #ai-companion h2 {
        font-size: 36px !important;
        margin-bottom: 40px !important;
    }
    
    #ai-companion .section-container > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    #ai-companion .section-container > div:last-child > div {
        padding: 20px 8px 16px 8px !important;
        border-radius: 12px !important;
        min-width: 0 !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child {
        font-size: 28px !important;
        margin-bottom: 12px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child span {
        font-size: 24px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:last-child {
        font-size: 14px !important;
    }
    
    /* 页脚移动端优化 */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-container {
        padding: 0 16px;
    }
    
    .footer-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .footer-section ul li {
        margin-bottom: 6px;
    }
    
    .footer-section ul li a {
        font-size: 14px;
    }
    
    .footer-bottom {
        padding-top: 16px;
        margin-top: 20px;
    }
    
    .footer-bottom p {
        font-size: 12px;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    /* 强制覆盖内联样式 - 小屏幕 */
    .section-title {
        font-size: 28px !important;
        margin-bottom: 10px !important;
        line-height: 1.2 !important;
    }
    
    .section-description {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
    }
    
    /* 强制覆盖AI服务区域的样式 - 小屏幕 */
    #ai-companion h2 {
        font-size: 32px !important;
        margin-bottom: 32px !important;
        margin-top: 0 !important;
    }
    
    #ai-companion .section-container > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    #ai-companion .section-container > div:last-child > div {
        padding: 16px 6px 12px 6px !important;
        border-radius: 12px !important;
        min-width: 0 !important;
        border: 2px solid #222 !important;
        background: #fff !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child {
        font-size: 24px !important;
        margin-bottom: 8px !important;
        margin-top: 0 !important;
        color: #222 !important;
        font-weight: 700 !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child span {
        font-size: 20px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:last-child {
        font-size: 12px !important;
        color: #666 !important;
    }
    
    /* 强制覆盖内容包装器样式 - 小屏幕 */
    .content-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 24px !important;
    }
    
    .text-content {
        margin-bottom: 20px !important;
        text-align: center !important;
    }
    
    .media-content {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .media-content img {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 32px rgba(0,0,0,0.08) !important;
    }
    .nav-container {
        padding: 0 8px;
        height: 44px;
    }
    
    .logo-img {
        width: 36px;
        height: 36px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    /* 小屏幕导航菜单样式 */
    .nav-menu {
        gap: 6px;
    }
    
    .nav-item {
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .download-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .home-content {
        margin-top: 50px;
        padding: 0 12px;
        position: relative !important;
        z-index: 2 !important;
        background: transparent !important;
    }
    
    .main-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .sub-title {
        font-size: 9px;
        letter-spacing: 0.15em;
        margin-bottom: 20px;
    }
    
    .download-button {
        font-size: 14px;
        padding: 10px 24px;
        border-radius: 20px;
    }
    
    .download-text {
        font-size: 14px;
    }
    
    .content-section {
        padding: 50px 0;
    }
    
    .section-container {
        padding: 0 12px;
    }
    
    .content-wrapper {
        gap: 24px;
    }
    
    .text-content {
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 28px !important;
        margin-bottom: 10px;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .section-title span {
        white-space: nowrap !important;
        display: inline !important;
    }
    
    .section-description {
        font-size: 14px !important;
    }
    
    #ai-companion h2 {
        font-size: 32px !important;
        margin-bottom: 32px !important;
    }
    
    #ai-companion .section-container > div:last-child {
        gap: 12px !important;
    }
    
    #ai-companion .section-container > div:last-child > div {
        padding: 16px 6px 12px 6px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child span {
        font-size: 20px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:last-child {
        font-size: 12px !important;
    }
    
    .footer {
        padding: 32px 0 16px;
    }
    
    .footer-container {
        padding: 0 12px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-section h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .footer-section ul li {
        margin-bottom: 5px;
    }
    
    .footer-section ul li a {
        font-size: 13px;
    }
    
    .footer-bottom {
        padding-top: 12px;
        margin-top: 16px;
    }
    
    .footer-bottom p {
        font-size: 11px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    /* 强制覆盖内联样式 - 超小屏幕 */
    .section-title {
        font-size: 24px !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
    }
    
    .section-description {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
    }
    
    /* 强制覆盖AI服务区域的样式 - 超小屏幕 */
    #ai-companion h2 {
        font-size: 28px !important;
        margin-bottom: 28px !important;
        margin-top: 0 !important;
    }
    
    #ai-companion .section-container > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    #ai-companion .section-container > div:last-child > div {
        padding: 14px 4px 10px 4px !important;
        border-radius: 12px !important;
        min-width: 0 !important;
        border: 2px solid #222 !important;
        background: #fff !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child {
        font-size: 20px !important;
        margin-bottom: 6px !important;
        margin-top: 0 !important;
        color: #222 !important;
        font-weight: 700 !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child span {
        font-size: 18px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:last-child {
        font-size: 11px !important;
        color: #666 !important;
    }
    
    /* 强制覆盖内容包装器样式 - 超小屏幕 */
    .content-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 20px !important;
    }
    
    .text-content {
        margin-bottom: 16px !important;
        text-align: center !important;
    }
    
    .media-content {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .media-content img {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 32px rgba(0,0,0,0.08) !important;
    }
    .nav-container {
        padding: 0 6px;
        height: 40px;
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    /* 超小屏幕导航菜单样式 */
    .nav-menu {
        gap: 4px;
    }
    
    .nav-item {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    .download-btn {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .home-content {
        margin-top: 45px;
        padding: 0 8px;
        position: relative !important;
        z-index: 2 !important;
        background: transparent !important;
    }
    
    .main-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .sub-title {
        font-size: 8px;
        letter-spacing: 0.1em;
        margin-bottom: 16px;
    }
    
    .download-button {
        font-size: 12px;
        padding: 8px 20px;
        border-radius: 18px;
    }
    
    .download-text {
        font-size: 12px;
    }
    
    .content-section {
        padding: 40px 0;
    }
    
    .section-container {
        padding: 0 8px;
    }
    
    .content-wrapper {
        gap: 20px;
    }
    
    .text-content {
        margin-bottom: 16px;
    }
    
    .section-title {
        font-size: 24px !important;
        margin-bottom: 8px;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .section-title span {
        white-space: nowrap !important;
        display: inline !important;
    }
    
    .section-description {
        font-size: 13px !important;
    }
    
    #ai-companion h2 {
        font-size: 28px !important;
        margin-bottom: 28px !important;
    }
    
    #ai-companion .section-container > div:last-child {
        gap: 10px !important;
    }
    
    #ai-companion .section-container > div:last-child > div {
        padding: 14px 4px 10px 4px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child {
        font-size: 20px !important;
        margin-bottom: 6px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:first-child span {
        font-size: 18px !important;
    }
    
    #ai-companion .section-container > div:last-child > div > div:last-child {
        font-size: 11px !important;
    }
    
    .footer {
        padding: 28px 0 12px;
    }
    
    .footer-container {
        padding: 0 8px;
    }
    
    .footer-content {
        gap: 16px;
    }
    
    .footer-section h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .footer-section ul li {
        margin-bottom: 4px;
    }
    
    .footer-section ul li a {
        font-size: 12px;
    }
    
    .footer-bottom {
        padding-top: 10px;
        margin-top: 12px;
    }
    
    .footer-bottom p {
        font-size: 10px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .home-section {
        min-height: 100vh;
        padding-top: 40px;
    }
    
    .home-content {
        margin-top: 40px;
    }
    
    .main-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .sub-title {
        font-size: 9px;
        margin-bottom: 16px;
    }
    
    .download-button {
        font-size: 14px;
        padding: 8px 20px;
    }
    
    .content-section {
        padding: 40px 0;
    }
    
    #ai-companion .section-container > div:last-child {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover {
        background: none;
        color: inherit;
    }
    
    .download-btn:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
    
    .download-button:hover {
        transform: none;
        box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    }
    
    .content-image:hover {
        transform: none;
    }
    
    .footer-section ul li a:hover {
        color: inherit;
    }
    
    /* 触摸反馈 */
    .nav-item:active,
    .download-btn:active,
    .download-button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.9);
    }
    
    /* 移动端滚动优化 */
    body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 防止双击缩放 */
    * {
        touch-action: manipulation;
    }
    
    /* 移动端图片优化 */
    img {
        max-width: 100%;
        height: auto;
        -webkit-user-drag: none;
        -khtml-user-drag: none;
        -moz-user-drag: none;
        -o-user-drag: none;
        user-drag: none;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .media-content img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 移动端性能优化 */
@media (max-width: 768px) {
    /* 减少动画以提高性能 */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    /* 优化字体渲染 */
    body {
        text-rendering: optimizeSpeed;
        font-feature-settings: "liga" 0;
    }
    
    /* 移动端视口优化 */
    .section {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* 移动端安全区域支持 */
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    .footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* 移动端加载优化 */
    .home-section {
        will-change: transform;
    }
    
    /* 移动端滚动优化 */
    .content-section {
        contain: layout style paint;
    }
}

/* 移动端无障碍优化 */
@media (max-width: 768px) {
    /* 增加触摸目标大小 */
    .nav-item,
    .download-btn,
    .download-button {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 提高对比度 */
    .section-description {
        color: #555 !important;
    }
    
    /* 增加焦点指示器 */
    .nav-item:focus,
    .download-btn:focus,
    .download-button:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
} 