/* 响应式设计 */

/* 大屏幕 (1200px 以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-container {
        max-width: 1200px;
    }
}

/* 中等屏幕 (992px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 32px;
    }
}

/* 平板 (768px - 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    .hero-container {
        max-width: 720px;
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .hero-subtitle {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        max-width: 350px;
        gap: 20px;
    }
    
    .consultation-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .nav-menu {
        gap: 24px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .section-subtitle {
        font-size: 16px;
    }
}

/* 手机 (576px - 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    .hero-container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 24px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 20px 0;
        gap: 20px;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .language-switch {
        margin-top: 10px;
    }
    
    .portal-button {
        margin-top: 10px;
        margin-left: 0;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .section-subtitle {
        font-size: 16px;
    }
    
    .about {
        padding: 60px 0;
    }
    
    .services {
        padding: 60px 0;
    }
    
    .partners {
        padding: 60px 0;
    }
    
    .news {
        padding: 60px 0;
    }
    
    .consultation {
        padding: 60px 0;
    }
    
    .contact {
        padding: 60px 0;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        max-width: 100%;
    }
    
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        max-width: 100%;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-card {
        padding: 30px 20px;
    }
    
    .contact-info {
        gap: 16px;
    }
    
    .wechat-qr {
        width: 160px;
        height: 160px;
    }
    
    .map-container {
        max-width: 100%;
    }
    
    .map-image {
        height: 300px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .consultation-form {
        padding: 30px 20px;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-item {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

/* 小手机 (575px 以下) */
@media (max-width: 575px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .hero-container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .hero {
        padding: 120px 0 0px;
        min-height: auto;
        margin-top: 30px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 22px;
    }
    
    .hero-description {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    .about-item h3 {
        font-size: 20px;
    }
    
    .about-item p {
        font-size: 14px;
    }
    
    .service-card {
        padding: 30px 20px;
    }
    
    .service-card h3 {
        font-size: 18px;
    }
    
    .service-card p {
        font-size: 14px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i {
        font-size: 24px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 100%;
    }
    
    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 100%;
    }
    
    .partner-logo {
        height: 80px !important;
        width: 120px !important;
        max-height: 80px !important;
        max-width: 120px !important;
        min-height: 80px !important;
        min-width: 90px !important;
    }
    

    
    .news-card .news-content {
        padding: 20px;
    }
    
    .news-title {
        font-size: 16px;
    }
    
    .news-excerpt {
        font-size: 13px;
    }
    
    .consultation-text h2 {
        font-size: 24px;
    }
    
    .consultation-text p {
        font-size: 16px;
    }
    
    .feature-item span {
        font-size: 14px;
    }
    
    .contact-card {
        padding: 30px 20px;
    }
    
    .contact-details h4 {
        font-size: 15px;
    }
    
    .contact-details p {
        font-size: 13px;
    }
    
    .wechat-qr {
        width: 120px;
        height: 120px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 30px 20px;
        width: 95%;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content p {
        font-size: 14px;
    }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }
    
    .hero-container {
        gap: 30px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 22px;
    }
    
    .hero-description {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .nav-container {
        height: 60px;
    }
    
    .nav-menu {
        top: 60px;
    }
}

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

/* 打印样式 */
@media print {
    .navbar,
    .nav-toggle,
    .hero-buttons,
    .consultation-form,
    .modal,
    .footer {
        display: none !important;
    }
    
    .hero {
        padding: 20px 0;
        min-height: auto;
    }
    
    .section-title {
        page-break-after: avoid;
    }
    
    .service-card,
    .partner-item,
    .news-card {
        page-break-inside: avoid;
    }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --text-dark: #000000;
        --text-light: #333333;
        --border-color: #000000;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
    
    .btn-primary {
        border: 2px solid #000000;
    }
    
    .service-card {
        border: 2px solid #000000;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #ffffff;
        --text-light: #cccccc;
        --text-lighter: #999999;
        --background-light: #1a1a1a;
        --background-gray: #2d2d2d;
        --border-color: #404040;
    }
    
    .navbar {
        background-color: rgba(255, 255, 255, 0.95); /* 保持白色背景 */
    }
    
    /* Dark mode navbar 文字样式 */
    .nav-link {
        color: var(--secondary-color) !important; /* 深咖色文字 */
    }
    
    .nav-link:hover {
        color: var(--primary-color) !important; /* 橙色悬停效果 */
    }
    
    .nav-link::after {
        background-color: var(--primary-color); /* 橙色下划线 */
    }
    
    .logo-text {
        color: var(--secondary-color); /* 深咖色 logo 文字 */
    }
    
    .hero {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }
    
    .service-card {
        background-color: #2d2d2d;
    }
    
    .contact-card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .consultation-form {
        background-color: #2d2d2d;
    }
    
    .form-group input,
    .form-group textarea {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    /* Dark mode footer 样式 */
    .footer {
        background-color: var(--primary-color); /* 橙色背景 */
        color: #ffffff; /* 白色普通文字 */
    }
    
    .footer-section h3 {
        color: var(--secondary-color); /* 深咖色标题 */
    }
    
    .footer-section ul li a {
        color: #ffffff; /* 白色链接 */
    }
    
    .footer-section ul li a:hover {
        color: var(--secondary-color); /* 深咖色悬停效果 */
    }
    
    .footer-bottom {
        color: #ffffff; /* 白色底部文字 */
        border-top-color: rgba(255, 255, 255, 0.3); /* 白色边框 */
    }
    
    .social-link {
        background-color: var(--secondary-color); /* 深咖色社交图标背景 */
        color: #ffffff; /* 白色图标 */
    }
    
    .social-link:hover {
        background-color: #ffffff; /* 白色悬停背景 */
        color: var(--secondary-color); /* 深咖色悬停图标 */
    }
    
    /* Dark mode footer logo 样式 */
    .footer-logo .logo {
        height: 80px;
        background-color: #ffffff; /* 白色背景 */
        padding: 10px; /* 添加内边距 */
        border-radius: 10px; /* 圆角 */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* 超小手机 (390px 以下) */
@media (max-width: 390px) {
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        max-width: 100%;
    }
    
    .stat-item {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }
    
    .stat-icon i {
        font-size: 20px;
    }
}
