/* ==========================================
   响应式设计
   ========================================== */

/* 平板设备 (最大宽度 768px) */
@media (max-width: 768px) {
    /* 导航栏 */
    .nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding-top: 1rem;
    }

    .theme-toggle {
        order: 2;
    }

    /* 英雄区 */
    .hero {
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* 文章网格 */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 页面标题 */
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* 筛选栏 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    /* 关于页面 */
    .about-header h1 {
        font-size: 2rem;
    }

    .avatar-placeholder {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .about-card {
        padding: 1.5rem;
    }

    /* 文章详情 */
    .post-detail h1 {
        font-size: 2rem;
    }

    .post-body {
        padding: 1.5rem;
    }

    /* 网格布局 */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* 小型平板设备 (最大宽度 640px) */
@media (max-width: 640px) {
    .container {
        padding: 0 15px;
    }

    /* 导航栏 */
    .logo {
        font-size: 1.25rem;
    }

    /* 英雄区 */
    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    /* 按钮 */
    .btn,
    .btn-secondary {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }

    /* 文章卡片 */
    .post-card h3 {
        font-size: 1.125rem;
    }

    .post-content {
        padding: 1.25rem;
    }

    /* 筛选按钮 */
    .filter-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.75rem;
    }

    /* 关于页面 */
    .skill-tag {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    /* 文章详情 */
    .post-meta-detail {
        flex-wrap: wrap;
    }
}

/* 手机设备 (最大宽度 480px) */
@media (max-width: 480px) {
    /* 英雄区 */
    .hero h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    /* 最新文章标题 */
    .latest-posts h2 {
        font-size: 2rem;
    }

    /* 页面标题 */
    .page-header {
        padding: 3rem 0;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    /* 文章卡片 */
    .post-image {
        height: 180px;
    }

    /* 关于页面 */
    .about-header h1 {
        font-size: 1.75rem;
    }

    .avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .about-card h2 {
        font-size: 1.25rem;
    }

    /* 文章详情 */
    .post-detail h1 {
        font-size: 1.75rem;
    }

    .post-body {
        padding: 1rem;
    }

    .post-body h2 {
        font-size: 1.5rem;
    }

    .post-body h3 {
        font-size: 1.25rem;
    }

    /* 页脚 */
    .social-links a {
        margin: 0 0.5rem;
        font-size: 0.875rem;
    }
}

/* 超小设备 (最大宽度 360px) */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.25rem;
    }

    .latest-posts h2 {
        font-size: 1.5rem;
    }

    .post-content {
        padding: 1rem;
    }

    .about-card {
        padding: 1rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }

    .page-header {
        padding: 2rem 0;
    }
}

/* 大屏幕优化 (最小宽度 1440px) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .latest-posts h2 {
        font-size: 3rem;
    }
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .theme-toggle,
    .filter-bar,
    .post-navigation {
        display: none;
    }

    body {
        color: #000;
        background-color: #fff;
    }

    .post-body {
        box-shadow: none;
        padding: 0;
    }
}

