/* 响应式设计 - 移动端适配 */

/* 平板设备 (768px 及以下) */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 20px 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 10px 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .resources-section {
        padding: 60px 0;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .resource-card {
        padding: 30px 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* 手机设备 (480px 及以下) */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .hero-section {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .resources-section {
        padding: 40px 0;
    }

    .resource-card {
        padding: 25px 15px;
    }

    .card-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .card-icon i {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .card-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .card-button {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .footer {
        padding: 30px 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* 大屏幕设备 (1200px 及以上) */
@media screen and (min-width: 1200px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .resources-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }

    .resource-card {
        padding: 50px 35px;
    }
}

/* 超大屏幕设备 (1400px 及以上) */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .nav-container {
        max-width: 1400px;
    }
}

/* 横屏手机适配 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* 高分辨率屏幕适配 */
@media screen and (-webkit-min-device-pixel-ratio: 2), 
       screen and (min-resolution: 192dpi) {
    .card-icon,
    .nav-logo a {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .footer {
        display: none;
    }

    .main-content {
        margin-top: 0;
    }

    .hero-section {
        background: #f0f0f0 !important;
        color: #333 !important;
        padding: 40px 0;
    }

    .resource-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* 无障碍访问支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .navbar {
        background: #2d2d2d;
    }

    .nav-link {
        color: #b0b0b0;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #64b5f6;
        background-color: rgba(100, 181, 246, 0.1);
    }

    .resource-card {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .card-title {
        color: #e0e0e0;
    }

    .card-description {
        color: #b0b0b0;
    }

    .resources-section {
        background-color: #1a1a1a;
    }
}