/* ===== 响应式设计 ===== */

/* 超大屏幕 (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1440px;
    }

    .hero-title {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }

    .carousel-slide .slide-title {
        font-size: 4rem;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* 大屏幕 (1200px - 1439px) */
@media (max-width: 1439px) and (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .hero-title {
        font-size: 3.25rem;
    }

    .carousel-slide .slide-title {
        font-size: 3.5rem;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* 平板 (992px - 1199px) */
@media (max-width: 1199px) {
    .container {
        padding: 0 20px;
    }

    /* 平板端导航栏参照电脑端：横排菜单、无下拉、背景通铺 */
    .navbar {
        background: var(--bg-dark) !important;
        height: auto !important;
    }

    .navbar .container {
        height: auto;
    }

    .nav-toggle {
        display: none !important;
    }

    .nav-wrapper {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        max-width: 100%;
    }

    .nav-brand .logo-tagline {
        display: inline !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: none !important;
        font-size: 0.7rem !important;
        letter-spacing: 0.5px !important;
    }

    .nav-brand .logo {
        flex-shrink: 1 !important;
    }

    .nav-brand .logo-icon svg {
        width: 44px !important;
        height: 44px !important;
    }

    .nav-brand .logo-text {
        font-size: 1.25rem !important;
        white-space: nowrap !important;
    }

    .nav-brand .logo-text-wrapper {
        overflow: visible !important;
        max-width: none !important;
    }

    .nav-menu {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        background: none !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 0 !important;
        gap: 2px !important;
        border-top: none !important;
        box-shadow: none !important;
        z-index: auto !important;
        overflow: hidden !important;
        height: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        flex-shrink: 1;
    }

    .nav-menu.active {
        transform: none !important;
    }

    .nav-item {
        width: auto !important;
        border-bottom: none !important;
    }

    .nav-link {
        display: flex !important;
        align-items: center !important;
        padding: 8px 8px !important;
        font-size: 0.85rem !important;
        font-weight: 400 !important;
        color: var(--text-secondary) !important;
        border-radius: 0 !important;
        white-space: nowrap !important;
        border-left: none !important;
        background: none !important;
        justify-content: flex-start !important;
    }

    .nav-link:hover,
    .nav-item.active .nav-link {
        color: var(--text-primary) !important;
        background: none !important;
    }

    .nav-item.active .nav-link {
        color: var(--primary-light) !important;
    }

    /* 平板端底部栏logo与导航栏对齐 */
    .footer-brand .logo-icon svg {
        width: 44px !important;
        height: 44px !important;
    }

    .footer-brand .logo-icon {
        width: 44px !important;
        height: 44px !important;
    }

    .footer-brand .logo-text {
        font-size: 1.25rem !important;
    }

    .footer-brand .logo-tagline {
        font-size: 0.7rem !important;
        letter-spacing: 0.5px !important;
    }

    .footer-brand .logo {
        gap: 12px !important;
    }

    /* 平板端AI聊天窗口：固定大小，不铺满屏幕 */
    .ai-chat-widget {
        bottom: 30px !important;
        right: 30px !important;
    }

    .chat-toggle {
        width: 56px !important;
        height: 56px !important;
    }

    .chat-window {
        position: fixed !important;
        width: 360px !important;
        max-width: 90vw !important;
        max-height: 520px !important;
        bottom: 100px !important;
        right: 30px !important;
        left: auto !important;
        border-radius: 20px !important;
    }

    .chat-messages {
        max-height: 320px !important;
    }

    .hero-section .container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-visual {
        height: 400px;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-content {
        text-align: center;
    }

    /* 轮播图响应式 */
    .carousel-controls {
        padding: 0 20px;
    }

    .carousel-slide .slide-title {
        font-size: 2.5rem;
    }

    .carousel-slide .slide-description {
        font-size: 1.1rem;
    }

    .hero-description {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
        padding: 0 20px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        overflow: hidden;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .partners-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 平板端核心团队、资质荣誉强制一行4列 */
    .team-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .team-card {
        padding: 20px 12px !important;
    }

    .team-avatar {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
        margin-bottom: 12px !important;
    }

    .team-name {
        font-size: 0.95rem !important;
    }

    .team-title, .team-description {
        font-size: 0.8rem !important;
    }

    .certificates-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .certificate-card {
        padding: 24px 12px !important;
    }

    .certificate-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
    }

    .certificate-title {
        font-size: 0.95rem !important;
    }

    .certificate-desc {
        font-size: 0.8rem !important;
    }

    /* 平板端服务优势一行4列 */
    .advantages-list {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 16px !important;
        overflow: hidden;
    }

    .advantage-item {
        padding: 20px 12px !important;
    }

    .advantage-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
        margin-bottom: 12px !important;
    }

    .advantage-title {
        font-size: 0.95rem !important;
        margin-bottom: 6px !important;
    }

    .advantage-desc {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
    }

    /* 平板端联系卡片一行4列 */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .contact-cards {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 16px !important;
    }

    .contact-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 20px 12px !important;
        gap: 12px !important;
    }

    .contact-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.1rem !important;
        margin: 0 auto !important;
    }

    .contact-title {
        font-size: 0.9rem !important;
    }

    .contact-text {
        font-size: 0.78rem !important;
    }

    /* 平板端时间线对齐 */
    .timeline-year {
        width: 60px !important;
        height: 60px !important;
        font-size: 0.85rem !important;
    }

    .timeline-item {
        padding-left: 80px !important;
    }

    .timeline::before {
        left: 30px !important;
    }

    .timeline-content {
        min-height: 60px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
}

/* 小平板 (768px - 991px) */
@media (max-width: 991px) {
    section {
        padding: 60px 0;
    }

    /* 导航栏 */
    .navbar {
        height: auto;
        z-index: 9999 !important;
        background: var(--bg-dark) !important;
        overflow: hidden;
    }
    
    .navbar .container {
        height: 65px;
    }
    
    .nav-toggle {
        display: flex;
        width: 44px;
        height: 44px;
        padding: 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        z-index: 1001;
    }
    
    .nav-toggle span {
        width: 24px;
        height: 3px;
        background: white;
        border-radius: 2px;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .nav-menu {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: linear-gradient(180deg, #0a1628 0%, #0f2942 100%);
        padding: 20px 0;
        gap: 0;
        transform: translateX(100%);
        opacity: 1;
        visibility: visible;
        transition: transform 0.3s ease;
        border-top: none;
        box-shadow: none;
        z-index: 1000;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-item {
        width: auto !important;
        border-bottom: none !important;
    }
    
    .nav-item:last-child {
        border-bottom: none !important;
    }

    .nav-link {
        padding: 16px 24px;
        justify-content: flex-start;
        font-size: 1.05rem;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .nav-item.active .nav-link {
        color: #00d4ff;
        background: rgba(0, 212, 255, 0.1);
        border-left: 3px solid #00d4ff;
    }

    .hero-section {
        min-height: auto;
        padding: 100px 0 80px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .advantages-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        overflow: hidden;
    }

    .advantage-item {
        padding: 18px 12px;
        text-align: center;
    }

    .advantage-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 8px;
        position: relative;
        top: auto;
        left: auto;
        margin: 0 auto 10px;
    }

    .advantage-item {
        padding-left: 12px;
        padding-right: 12px;
    }

    .advantage-title {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .advantage-description {
        font-size: 0.75rem;
        line-height: 1.6;
    }

    /* 底部社交图标：平板端缩小、单行显示 */
    .footer-social {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    .social-link {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        border-radius: 6px !important;
    }

    /* 轮播图响应式 */
    .carousel-controls {
        padding: 0 15px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .carousel-indicators {
        bottom: 40px;
        gap: 8px;
    }

    .carousel-indicator {
        width: 10px;
        height: 10px;
    }

    .carousel-progress {
        bottom: 60px;
        width: calc(10px * 6 + 8px * 5);
    }

    .carousel-slide .slide-title {
        font-size: 2rem;
    }

    .carousel-slide .slide-description {
        font-size: 1rem;
    }

    .advantage-grid {
        gap: 30px;
    }

    .advantage-item {
        padding-left: 0;
    }

    .advantage-number {
        position: relative;
        margin-bottom: 16px;
    }

    .stat-number {
        font-size: 2.75rem;
    }

    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chat-window {
        width: 340px;
    }
}

/* 手机 (576px - 767px) */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    /* 导航栏 */
    .navbar {
        height: 60px;
        z-index: 9999 !important;
        background: rgba(10, 14, 26, 0.98) !important;
        overflow: hidden;
    }
    
    .navbar .container {
        height: 60px;
    }

    /* 确保导航栏在最上层 */
    .nav-toggle {
        display: flex;
        width: 44px;
        height: 44px;
        padding: 10px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        z-index: 1001;
    }
    
    .nav-toggle span {
        width: 24px;
        height: 3px;
        background: white;
        border-radius: 2px;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: linear-gradient(180deg, #0a1628 0%, #0f2942 100%);
        padding: 20px 0;
        gap: 0;
        transform: translateX(100%);
        opacity: 1;
        visibility: visible;
        transition: transform 0.3s ease;
        border-top: none;
        box-shadow: none;
        z-index: 1000;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-item {
        width: auto !important;
        border-bottom: none !important;
    }

    .nav-item:last-child {
        border-bottom: none !important;
    }

    .nav-link {
        padding: 16px 24px;
        justify-content: flex-start;
        font-size: 1.1rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .nav-item.active .nav-link {
        color: #00d4ff;
        background: rgba(0, 212, 255, 0.1);
        border-left: 3px solid #00d4ff;
    }

    .nav-link:active {
        background: rgba(0, 212, 255, 0.15);
    }

    /* Logo适配 */
    .nav-brand .logo {
        flex-shrink: 0;
    }
    
    .nav-brand .logo-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .nav-brand .logo-text {
        font-size: 1.1rem;
    }
    
    .nav-brand .logo-tagline {
        display: none;
    }

    /* 底部栏logo与导航栏对齐 */
    .footer-brand .logo-icon {
        width: 40px !important;
        height: 40px !important;
    }

    .footer-brand .logo-icon svg {
        width: 40px !important;
        height: 40px !important;
    }

    .footer-brand .logo-text {
        font-size: 1.1rem !important;
    }

    .footer-brand .logo-tagline {
        display: none !important;
    }

    .footer-brand .logo {
        gap: 10px !important;
    }

    /* 轮播图响应式 */
    .carousel-controls {
        padding: 0 10px;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .carousel-indicators {
        bottom: 30px;
        gap: 6px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
    }

    .carousel-progress {
        bottom: 45px;
        width: calc(8px * 6 + 6px * 5);
    }

    .carousel-slide .slide-title {
        font-size: 1.75rem;
    }

    .carousel-slide .slide-description {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .carousel-slide .slide-badge {
        padding: 6px 16px;
        font-size: 0.8rem;
        margin-bottom: 15px;
    }

    /* 英雄区域 */
    .hero-section {
        padding: 100px 0 60px;
    }

    .hero-section .container {
        gap: 30px;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 12px 24px;
    }

    .hero-visual {
        height: 300px;
    }

    .tech-circles {
        width: 280px;
        height: 280px;
    }

    .floating-icons i {
        font-size: 2rem;
    }

    .icon-5 {
        font-size: 2.25rem;
    }

    /* 轮播图响应式 */
    .carousel-controls {
        padding: 0 8px;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .carousel-indicators {
        bottom: 25px;
        gap: 5px;
    }

    .carousel-indicator {
        width: 6px;
        height: 6px;
    }

    .carousel-slide .slide-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .carousel-slide .slide-description {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .carousel-slide .slide-badge {
        padding: 5px 12px;
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .carousel-slide .btn-lg {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* 区块样式 */
    section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 40px;
    }

    /* 核心业务 */
    .services-grid {
        gap: 20px;
    }

    .service-card {
        padding: 30px 24px;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .service-title {
        font-size: 1.25rem;
    }

    /* 核心优势 */
    .advantages-grid {
        gap: 24px;
    }

    /* 数据统计 */
    .stats-section {
        padding: 60px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .stat-number {
        font-size: 2.25rem;
    }

    .stat-item {
        padding: 20px 15px;
    }

    .stat-label {
        font-size: 1rem;
    }

    /* 合作伙伴 */
    .partners-slide {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 10px;
    }

    .partner-logo {
        padding: 10px 6px;
        font-size: 0.8rem;
        min-height: 45px;
    }

    /* 页脚 */
    .footer {
        padding: 60px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-social {
        justify-content: flex-start;
    }

    /* AI客服 */
    .ai-chat-widget {
        bottom: 20px;
        right: 20px;
    }

    .chat-toggle {
        width: 50px;
        height: 50px;
    }

    .chat-toggle-icon {
        font-size: 1.5rem;
    }

    .chat-window {
        width: calc(100% - 40px);
        max-width: 380px;
        bottom: 70px;
    }

    .chat-messages {
        max-height: 300px;
    }

    /* 回到顶部 */
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }

    /* 新闻页面移动端单列 */
    .news-list {
        grid-template-columns: 1fr !important;
    }

    .news-image {
        height: 180px !important;
    }
}

/* 小型手机 (480px及以下) */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 1.625rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .hero-buttons {
        gap: 12px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .service-card {
        padding: 24px 20px;
    }

    .service-icon {
        width: 55px;
        height: 55px;
        font-size: 1.375rem;
    }

    .service-title {
        font-size: 1.125rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .partners-slide {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 8px;
    }

    .partner-logo {
        padding: 8px 4px;
        font-size: 0.75rem;
        min-height: 40px;
    }

    .footer-links li,
    .footer-contact li {
        font-size: 0.95rem;
    }

    .chat-window {
        width: calc(100% - 32px);
    }

    .chat-input {
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .message-content p {
        font-size: 0.875rem;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1600px) {
    .hero-title {
        font-size: 4.5rem;
    }

    .hero-section .container {
        gap: 80px;
    }

    .section-title {
        font-size: 3.25rem;
    }

    .hero-visual {
        height: 600px;
    }

    .tech-circles {
        width: 500px;
        height: 500px;
    }
}

/* 横屏手机优化 */
@media (max-width: 767px) and (max-height: 500px) {
    .hero-section {
        padding: 80px 0 40px;
    }

    .hero-section .container {
        gap: 20px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-visual {
        height: 200px;
    }

    section {
        padding: 40px 0;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .ai-chat-widget,
    .back-to-top,
    .hero-visual {
        display: none;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    .main-content {
        padding-top: 0;
    }

    .hero-section {
        min-height: auto;
        padding: 40px 0;
    }
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-secondary: #e0e0e0;
    }

    .btn-primary,
    .chat-toggle {
        box-shadow: none;
    }
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    /* 已经默认使用深色主题,这里可以添加额外的深色优化 */
}

/* 亮色模式支持 */
@media (prefers-color-scheme: light) {
    /* 如果需要支持亮色模式,可以在这里添加 */
}
