/* ================================================
   Index 和 Test 页面移动端适配样式
   ================================================ */

@media (max-width: 768px) {
    /* 防止横向滚动 */
    html {
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    section {
        overflow-x: hidden !important;
    }

    h1, h2, h3, h4, h5, h6, p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* 基础容器 */
    .container {
        padding: 0 1rem !important;
        max-width: 100% !important;
    }

    /* 导航栏 - 蓝色渐变科技风 */
    .navbar {
        padding: 0.75rem 0 !important;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%) !important;
        backdrop-filter: blur(12px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
        box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
    }

    .nav-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        min-height: auto !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .logo-icon {
        width: 1.5rem !important;
        height: 1.5rem !important;
        color: white !important;
    }

    .logo-text {
        font-size: 1rem !important;
        color: white !important;
        font-weight: 600 !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    }

    .nav-menu {
        display: none !important;
    }

    .nav-buttons {
        display: none !important;
    }

    /* 移动端菜单按钮 */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        padding: 0.5rem !important;
        margin: 0 !important;
        z-index: 1000 !important;
        transition: all 0.3s ease !important;
    }

    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.2) !important;
        transform: scale(0.95) !important;
    }

    .mobile-menu-btn span {
        display: block !important;
        width: 22px !important;
        height: 2px !important;
        background: #f8fafc !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    }

    /* 移动端侧边菜单 - 蓝色渐变主题 */
    .mobile-nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, rgba(59, 130, 246, 0.98) 0%, rgba(37, 99, 235, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: -4px 0 30px rgba(59, 130, 246, 0.3);
        border-left: 1px solid rgba(255, 255, 255, 0.2);
        padding: 2rem 1.5rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .mobile-nav.active {
        right: 0;
        display: block;
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-nav-header .logo-text {
        color: white !important;
        font-weight: 600 !important;
    }

    .mobile-nav-close {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        font-size: 1.25rem;
        cursor: pointer;
        padding: 0.375rem 0.625rem;
        color: white;
        transition: all 0.3s ease;
        line-height: 1;
    }

    .mobile-nav-close:active {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(0.95);
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0 0 2rem 0;
    }

    .mobile-nav ul li {
        margin-bottom: 0.375rem;
    }

    .mobile-nav ul li a {
        display: block;
        padding: 0.875rem 1rem;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        border-radius: 10px;
        transition: all 0.25s ease;
        font-weight: 500;
        font-size: 0.9375rem;
    }

    .mobile-nav ul li a:hover,
    .mobile-nav ul li a.active {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        transform: translateX(-2px);
    }

    .mobile-nav-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-nav-buttons a {
        display: block;
        padding: 0.875rem 1rem;
        text-align: center;
        border-radius: 10px;
        text-decoration: none;
        transition: all 0.25s ease;
        font-weight: 600;
        font-size: 0.9375rem;
    }

    .mobile-nav-buttons .btn-outline {
        background: rgba(255, 255, 255, 0.15);
        border: 1.5px solid rgba(255, 255, 255, 0.4);
        color: white;
    }

    .mobile-nav-buttons .btn-outline:active {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(0.98);
    }

    .mobile-nav-buttons .btn-primary {
        background: white;
        color: #2563eb;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-nav-buttons .btn-primary:active {
        opacity: 0.95;
        transform: scale(0.98);
    }

    /* 遮罩层 */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Hero 区域 */
    .hero {
        padding: 3rem 0;
        min-height: auto;
        overflow: hidden;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .hero-content p {
        font-size: 1rem;
        word-break: break-word;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* 特性区域 */
    section .features-grid,
    .features .features-grid,
    .features-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        grid-auto-flow: row !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    .features-grid .feature-card,
    .feature-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        grid-column: 1 / -1 !important;
    }

    /* 价格区域 */
    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pricing-card {
        max-width: 100%;
    }

    /* CTA 区域 */
    .cta h2 {
        font-size: 1.75rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cta-buttons .btn-primary,
    .cta-buttons .btn-outline {
        width: 100%;
    }

    /* 关于我们区域 */
    .about,
    .about-content {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    .about-content {
        flex-direction: column;
        gap: 2rem;
    }

    .about-text,
    .about-image {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    .about-text h2 {
        font-size: 1.75rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto;
        max-width: 100%;
        padding-right: 0.5rem;
    }

    .about-text p {
        font-size: 0.9375rem !important;
        line-height: 1.6;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        max-width: 100%;
        padding-right: 0.5rem;
    }

    /* 关于我们统计卡片 */
    .about-stats {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-top: 2rem !important;
    }

    .about-stat {
        width: 100% !important;
        padding: 1.25rem !important;
    }

    .about-stat-number {
        font-size: 2rem !important;
    }

    .about-stat-label {
        font-size: 0.875rem !important;
    }

    /* 页脚 */
    .footer {
        overflow-x: hidden;
    }

    .footer-content {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 2rem !important;
    }

    .footer-section {
        flex: 1;
        min-width: 45%;
        max-width: 48%;
    }

    .footer-section h3 {
        margin-bottom: 0.75rem;
        font-size: 0.9375rem;
    }

    .footer-section ul {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-section ul li a {
        font-size: 0.8125rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    /* Test 页面 */
    .test-container {
        padding: 2rem 0;
    }

    .test-card {
        padding: 1.5rem;
    }

    .test-card h2 {
        font-size: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .result-card {
        padding: 1.5rem;
    }

    .api-docs {
        padding: 1.5rem;
    }

    .code-block {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    /* 按钮组 */
    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .button-group button {
        width: 100%;
    }

    /* 统计卡片 */
    .stat-item {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕额外优化 */
    body {
        overflow-x: hidden !important;
    }

    .container {
        padding: 0 0.875rem !important;
    }

    /* 导航栏 */
    .navbar {
        padding: 0.5rem 0 !important;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%) !important;
    }

    .logo-icon {
        width: 1.375rem !important;
        height: 1.375rem !important;
        color: white !important;
    }

    .logo-text {
        font-size: 0.9375rem !important;
        color: white !important;
    }

    .mobile-menu-btn {
        padding: 0.375rem !important;
    }

    .mobile-menu-btn span {
        width: 20px !important;
        height: 2px !important;
        background: white !important;
    }

    .hero-content h1 {
        font-size: 1.5rem !important;
    }

    .hero-content p {
        font-size: 0.875rem !important;
    }

    section .features-grid,
    .features .features-grid,
    .features-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-auto-flow: row !important;
        gap: 1rem !important;
    }

    .features-grid .feature-card,
    .feature-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        padding: 1rem !important;
        grid-column: 1 !important;
    }

    .pricing-card,
    .test-card {
        padding: 1rem;
        width: 100% !important;
        max-width: 100% !important;
    }

    .section-title {
        font-size: 1.5rem !important;
        word-break: break-word;
    }

    .section-subtitle {
        font-size: 0.875rem !important;
    }

    /* 关于我们区域 */
    .about,
    .about-content,
    .about-text {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .about-text h2 {
        font-size: 1.25rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        padding: 0 0.5rem;
        margin: 0;
    }

    .about-text p {
        font-size: 0.8125rem !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        padding: 0 0.5rem;
    }

    /* 关于我们统计卡片 */
    .about-stats {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.875rem !important;
        margin-top: 1.5rem !important;
    }

    .about-stat {
        width: 100% !important;
        padding: 1rem !important;
    }

    .about-stat-number {
        font-size: 1.75rem !important;
    }

    .about-stat-label {
        font-size: 0.8125rem !important;
    }

    /* 页脚 */
    .footer-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        text-align: left !important;
    }

    .footer-section {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .footer-section h3 {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .footer-section ul li a {
        font-size: 0.8125rem;
    }

    .footer-bottom {
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

