/* 石家庄市恒业建设监理 - 响应式样式优化 */

/* ===================== 平板设备 (769px - 1024px) ===================== */
@media (max-width: 1024px) {
    /* 网格布局调整 */
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }

    /* Hero区域调整 */
    .hero-container {
        padding: 0 var(--space-4);
    }

    .hero-title {
        font-size: var(--text-4xl);
    }

    .hero-description {
        font-size: var(--text-lg);
    }

    /* 服务卡片调整 */
    .service-card {
        padding: var(--space-5);
    }

    /* 统计数据调整 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    /* 案例展示调整 */
    .case-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================== 移动设备 (481px - 768px) ===================== */
@media (max-width: 768px) {
    /* Header响应式 */
    .header-container {
        height: var(--header-height-mobile);
        padding: 0 var(--space-4);
    }

    .header-actions {
        display: none;
    }

    .logo-title {
        font-size: var(--text-lg);
    }

    .logo-subtitle {
        display: none;
    }

    /* 移动端导航菜单 */
    .nav-menu {
        position: fixed;
        top: var(--header-height-mobile);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height-mobile));
        background: white;
        flex-direction: column;
        padding: var(--space-6);
        transition: left var(--duration-base) var(--ease-out);
        box-shadow: var(--shadow-xl);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-link {
        display: block;
        padding: var(--space-4) 0;
        font-size: var(--text-lg);
    }

    /* 下拉菜单移动端样式 */
    .dropdown {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        background: var(--bg-secondary);
        padding: 0;
        margin-top: 0;
    }

    .nav-item.active .dropdown {
        display: block;
    }

    .dropdown-link {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-base);
        border-left: 3px solid var(--primary-color);
    }

    /* Hero移动端优化 */
    .hero {
        padding: calc(var(--header-height-mobile) + var(--space-6)) 0 var(--space-16);
    }

    .hero-container {
        padding: 0 var(--space-4);
        gap: var(--space-3);
    }

    .hero-title {
        font-size: var(--text-2xl);
        line-height: 1.35;
    }

    .hero-description {
        font-size: var(--text-base);
        margin: 0;
    }

    .hero-meta {
        font-size: var(--text-sm);
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    /* 网格系统移动端 */
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* 服务区域移动端 */
    .service-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .service-card {
        padding: var(--space-4);
    }

    /* 统计数据移动端 */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* 案例展示移动端 */
    .case-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* 新闻区域移动端 */
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* CTA区域移动端 */
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }

    /* Footer移动端 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    /* 标题大小调整 */
    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    /* 间距调整 */
    .section {
        padding: var(--space-12) 0;
    }

    .container {
        padding: 0 var(--space-4);
    }
}

/* ===================== 小屏幕手机 (最大 480px) ===================== */
@media (max-width: 480px) {
    /* 更小的间距和字体 */
    :root {
        font-size: 14px;
    }

    /* Header进一步优化 */
    .header-container {
        padding: 0 var(--space-3);
    }

    .logo-text {
        max-width: 150px;
    }

    /* Hero区域小屏优化 */
    .hero {
        padding: calc(var(--header-height-mobile) + var(--space-4)) 0 var(--space-12);
    }

    .hero-container {
        padding: 0 var(--space-3);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-description {
        font-size: var(--text-sm);
    }

    .hero-meta {
        font-size: var(--text-xs);
    }

    /* 按钮小屏优化 */
    .btn-primary,
    .btn-outline {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }

    /* 服务卡片小屏优化 */
    .service-card {
        padding: var(--space-3);
    }

    .service-icon {
        width: 48px;
        height: 48px;
    }

    /* 统计数据小屏优化 */
    .stat-number {
        font-size: var(--text-2xl);
    }

    /* 案例卡片小屏优化 */
    .case-card {
        min-height: 200px;
    }

    /* 新闻卡片小屏优化 */
    .news-card {
        padding: var(--space-3);
    }

    /* Footer小屏优化 */
    .footer {
        padding: var(--space-8) 0 var(--space-4);
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-2);
    }

    /* 表单元素小屏优化 */
    input,
    textarea,
    select {
        font-size: 16px; /* 防止iOS缩放 */
    }

    /* 模态框小屏优化 */
    .modal-content {
        width: 95%;
        margin: var(--space-2) auto;
        padding: var(--space-4);
    }
}

/* ===================== 超小屏幕设备 (最大 360px) ===================== */
@media (max-width: 360px) {
    .hero-title {
        font-size: var(--text-xl);
    }

    .hero-description {
        font-size: var(--text-sm);
    }

    .section-title {
        font-size: var(--text-xl);
    }
}

/* ===================== 横屏模式优化 ===================== */
@media (orientation: landscape) and (max-height: 600px) {
    .header {
        position: sticky;
    }

    .hero {
        padding-top: var(--header-height-mobile);
        padding-bottom: var(--space-12);
    }

    .nav-menu {
        height: calc(100vh - var(--header-height-mobile));
        overflow-y: auto;
    }
}

/* ===================== 打印样式 ===================== */
@media print {
    .header,
    .footer,
    .mobile-menu-btn,
    .cta-section {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }

    a {
        text-decoration: none;
        color: black;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* ===================== 高分辨率屏幕优化 ===================== */
@media (min-width: 1536px) {
    .container {
        max-width: var(--container-2xl);
    }

    .hero-title {
        font-size: var(--text-6xl);
    }

    .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .case-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===================== 移动端菜单按钮样式 ===================== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--primary-color);
    cursor: pointer;
    padding: var(--space-2);
    transition: transform var(--duration-fast) var(--ease-out);
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

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

/* ===================== 触控设备优化 ===================== */
@media (hover: none) and (pointer: coarse) {
    /* 增加可点击区域 */
    .nav-link,
    .dropdown-link,
    button,
    a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* 移除悬停效果 */
    .service-card:hover,
    .case-card:hover {
        transform: none;
    }
}
