/* 响应式设计 - 平板设备 */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .nav-menu {
        gap: 24px;
    }
    
    .main-container {
        grid-template-columns: 240px 1fr;
        gap: 20px;
        padding: 20px 16px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .content-area {
        border-radius: 8px;
    }
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
    /* 导航栏移动端适配 */
    .nav-container {
        padding: 0 12px;
        height: 56px;
    }
    
    .nav-brand .brand-text {
        display: none;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-actions .btn-primary {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .user-avatar img {
        width: 36px;
        height: 36px;
    }
    
    /* 主要内容区域移动端布局 */
    .main-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 12px;
    }
    
    /* 侧边栏移动端样式 */
    .sidebar {
        display: none;
    }
    
    /* 发布框移动端适配 */
    .post-composer {
        padding: 16px;
        border-radius: 8px;
    }
    
    .composer-header {
        gap: 12px;
    }
    
    .composer-header img {
        width: 40px;
        height: 40px;
    }
    
    .composer-textarea {
        min-height: 60px;
        font-size: 14px;
        padding: 12px;
    }
    
    .composer-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .composer-tools {
        justify-content: center;
    }
    
    .btn-post {
        width: 100%;
        padding: 10px;
    }
    
    /* 动态列表移动端适配 */
    .feed-container {
        padding: 0 16px;
    }
    
    .feed-item {
        padding: 16px 0;
    }
    
    .feed-header {
        gap: 10px;
    }
    
    .feed-header .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .username {
        font-size: 15px;
    }
    
    .post-time {
        font-size: 13px;
    }
    
    .feed-content p {
        font-size: 15px;
    }
    
    .feed-images {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .feed-images img {
        height: 150px;
    }
    
    .feed-actions {
        gap: 16px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .action-btn img {
        width: 18px;
        height: 18px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 8px;
    }
    
    .main-container {
        padding: 12px 8px;
        gap: 12px;
    }
    
    .post-composer {
        padding: 12px;
    }
    
    .composer-textarea {
        min-height: 50px;
        font-size: 13px;
    }
    
    .tool-btn img {
        width: 20px;
        height: 20px;
    }
    
    .feed-container {
        padding: 0 12px;
    }
    
    .feed-item {
        padding: 12px 0;
    }
    
    .feed-images {
        grid-template-columns: 1fr;
    }
    
    .feed-images img {
        height: 200px;
    }
    
    .feed-actions {
        gap: 12px;
    }
}

/* 横屏模式适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        position: relative;
    }
    
    .main-container {
        padding: 12px;
    }
    
    .post-composer {
        padding: 12px;
    }
    
    .composer-textarea {
        min-height: 40px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:active,
    .btn-post:active,
    .nav-link:active,
    .tool-btn:active,
    .action-btn:active,
    .follow-btn:active {
        transform: scale(0.95);
    }
    
    .feed-images img:active {
        transform: scale(0.98);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --bg-primary: #ffffff;
        --bg-secondary: #f5f5f5;
        --border-color: #666666;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #ff8c42;
        --secondary-color: #ffa726;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-light: #808080;
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --border-color: #404040;
        --shadow-light: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-medium: 0 4px 16px rgba(0,0,0,0.4);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    :root {
        --transition: none;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .sidebar,
    .post-composer,
    .feed-actions {
        display: none;
    }
    
    .main-container {
        grid-template-columns: 1fr;
        max-width: none;
        padding: 0;
    }
    
    .feed-item {
        break-inside: avoid;
        border-bottom: 1px solid #ccc;
    }
}