/* ========================================
   云佳美日化科技集团 - 响应式适配
   三端：PC / 平板 / 手机
   ======================================== */

/* ===== 大屏桌面 ( > 1200px ) ===== */
@media (min-width: 1440px) {
    :root {
        --max-width: 1280px;
    }
    
    .container-wide {
        max-width: 1600px;
    }
    
    .navbar {
        padding: 0 80px;
    }
}

/* ===== 中等桌面 ( 1024px ~ 1199px ) ===== */
@media (max-width: 1199px) {
    .section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2.1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 40px;
    }
    
    .footer-grid .footer-col:nth-child(4) {
        grid-column: 1 / -1;
    }
}

/* ===== 平板 ( 768px ~ 1023px ) ===== */
@media (max-width: 1023px) {
    :root {
        --nav-height: 64px;
    }
    
    .container,
    .container-wide {
        padding: 0 32px;
    }
    
    .navbar {
        padding: 0 32px;
    }
    
    /* 导航变汉堡 */
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        right: -100%;
        width: 300px;
        height: calc(100vh - var(--nav-height));
        background: var(--color-white);
        flex-direction: column;
        align-items: stretch;
        padding: 30px 0;
        gap: 0;
        transition: right 0.4s ease;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }
    
    .nav-menu > li > a {
        padding: 16px 30px;
        font-size: 1rem;
        border-radius: 0;
    }
    
    .nav-menu > li > a.active::after {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }

    /* 移动端二级菜单 */
    .nav-submenu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        padding: 0;
        min-width: auto;
        background: var(--color-bg-gray);
    }

    .nav-dropdown.expanded .nav-submenu {
        max-height: 300px;
    }

    .nav-dropdown.open .nav-submenu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-submenu li a {
        padding: 14px 30px 14px 50px;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }

    .nav-arrow {
        margin-left: auto;
    }

    .nav-dropdown > a {
        justify-content: space-between;
    }

    /* 网格适配 */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .footer-grid .footer-col:nth-child(4) {
        grid-column: auto;
    }
    
    /* Banner */
    .page-banner {
        height: 300px;
    }

    .page-banner h1 {
        font-size: 2rem;
    }

    .page-banner-content {
        padding: 0 30px;
    }
    
    /* 首页轮播文字 */
    .hero-slide-content h2 {
        font-size: 2.5rem !important;
    }
    
    .hero-slide-content p {
        font-size: 1.1rem !important;
    }
    
    /* 时间轴变单列 */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding: 0 0 40px 50px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
        padding: 0 0 40px 50px;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        text-align: left;
    }
    
    .timeline-dot {
        left: 12px;
        right: auto;
    }
    
    .timeline-item:nth-child(even) .timeline-dot {
        left: 12px;
    }
    
    /* 新闻卡片 */
    .news-card {
        flex-direction: column;
    }
    
    .news-card-img {
        width: 100%;
        min-height: 200px;
    }
    
    /* 快捷入口 */
    .quick-entry {
        height: 220px;
    }
}

/* ===== 手机 ( < 768px ) ===== */
@media (max-width: 767px) {
    :root {
        --nav-height: 60px;
    }
    
    .container,
    .container-wide {
        padding: 0 20px;
    }
    
    .navbar {
        padding: 0 20px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-sm {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.7rem;
        letter-spacing: 1px;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 35px;
    }
    
    .title-divider {
        margin: 16px auto 30px;
    }

    /* 导航Logo */
    .nav-logo-img {
        height: 44px;
        max-width: 220px;
    }

    /* 网格全单列 */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer {
        padding: 40px 0 0;
    }
    
    /* Banner */
    .page-banner {
        height: 240px;
        margin-top: var(--nav-height);
    }

    .page-banner h1 {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }

    .page-banner p {
        font-size: 0.88rem;
    }

    .page-banner-content {
        padding: 0 20px;
    }
    
    /* 首页轮播 */
    .hero-slide-content h2 {
        font-size: 1.8rem !important;
        letter-spacing: 1px !important;
        white-space: normal !important;
    }
    
    .hero-slide-brand {
        font-size: 4rem !important;
        letter-spacing: 10px !important;
    }
    
    .hero-slide-content p {
        font-size: 0.95rem !important;
        letter-spacing: 1px !important;
    }
    
    .hero-slide-content .btn {
        padding: 10px 24px;
        font-size: 0.85rem;
    }
    
    /* 统计数字 */
    .stat-number {
        font-size: 2.2rem;
    }
    
    /* 快捷入口 */
    .quick-entry {
        height: 180px;
        padding: 24px;
    }
    
    .quick-entry-content h3 {
        font-size: 1.2rem;
    }
    
    /* 团队卡片 */
    .team-card-photo {
        height: 280px;
    }
    
    /* 产品卡片 */
    .product-card-img {
        height: 220px;
    }
    
    /* 新闻卡片 */
    .news-card-body {
        padding: 20px;
    }
    
    .news-card-title {
        font-size: 1.05rem;
    }
    
    /* 时间轴 */
    .timeline {
        padding: 10px 0;
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    .timeline-year {
        font-size: 1.3rem;
    }
    
    /* 联系卡片 */
    .contact-info-card {
        padding: 28px 20px;
    }
    
    /* 按钮 */
    .btn {
        padding: 12px 28px;
        font-size: 0.88rem;
    }
    
    /* 回到顶部 */
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 42px;
        height: 42px;
    }
    
    /* 移动端菜单 */
    .nav-menu {
        width: 100%;
    }
}

/* ===== 超小屏 ( < 480px ) ===== */
@media (max-width: 479px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .page-banner h1 {
        font-size: 1.5rem;
    }
    
    .hero-slide-content h2 {
        font-size: 1.4rem !important;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .quick-entry {
        height: 150px;
    }
    
    .quick-entry-content h3 {
        font-size: 1.05rem;
    }
    
    .container,
    .container-wide {
        padding: 0 16px;
    }
}
