/* 
 * 云启主题响应式样式文件
 * Theme Name: 云启主题
 * Author: 十九云栈
 * Version: 1.0.0
 */

/* ==================== 超大屏幕 (≥1200px) ==================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-banner {
        min-height: 500px;
    }
    
    .content-area {
        grid-template-columns: 3fr 1fr;
        gap: 3rem;
    }
}

/* ==================== 大屏幕 (992px - 1199px) ==================== */
@media (min-width: 992px) and (max-width: 1199px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-banner {
        min-height: 400px;
    }
    
    .content-area {
        gap: 2rem;
    }
}

/* ==================== 中等屏幕 (768px - 991px) ==================== */
@media (min-width: 768px) and (max-width: 991px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-content {
        padding: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .header-actions .user-name {
        display: none;
    }
    
    .footer-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 小屏幕 (576px - 767px) ==================== */
@media (min-width: 576px) and (max-width: 767px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content {
        padding: 1.5rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .content-area {
        gap: 1.5rem;
    }
    
    .sidebar {
        margin-top: 2rem;
    }
    
    .footer-widgets-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ==================== 超小屏幕 (<576px) ==================== */
@media (max-width: 575px) {
    /* 基础布局调整 */
    .container {
        padding: 0 0.75rem;
    }
    
    .content-area {
        margin: 1rem 0;
        gap: 1rem;
    }
    
    /* 头部响应式调整 */
    .header-inner {
        padding: 0.75rem 0;
    }
    
    .site-branding .custom-logo {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .search-toggle, .user-toggle, .mobile-menu-toggle {
        padding: 0.25rem;
        font-size: 1.125rem;
    }
    
    /* 文章卡片调整 */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-card {
        border-radius: 6px;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .entry-title {
        font-size: 1.125rem;
    }
    
    .post-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }
    
    .post-actions {
        gap: 0.5rem;
    }
    
    .post-action {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
    
    /* 英雄区域调整 */
    .hero-banner {
        min-height: 300px;
    }
    
    .hero-content {
        padding: 1rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .hero-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* 表单调整 */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* 分页调整 */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination a, .pagination span {
        padding: 0.25rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 侧边栏调整 */
    .sidebar {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .widget {
        margin-bottom: 1.5rem;
    }
    
    .widget-title {
        font-size: 1.125rem;
    }
    
    /* 底部调整 */
    .site-footer {
        margin-top: 2rem;
    }
    
    .footer-widgets {
        padding: 1.5rem 0;
    }
    
    .footer-widgets-grid {
        gap: 1.5rem;
    }
    
    .site-info {
        padding: 1rem 0;
    }
    
    .copyright p {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .footer-social {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .footer-social a {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    /* 搜索覆盖层调整 */
    .search-overlay {
        padding: 1rem;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-field {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .search-submit {
        right: 1rem;
    }
    
    .search-close {
        right: 3.5rem;
    }
    
    /* 移动端菜单调整 */
    .mobile-menu-panel {
        width: 280px;
        right: -280px;
    }
    
    .mobile-menu-header {
        padding: 1rem;
    }
    
    .mobile-user-name {
        font-size: 1rem;
    }
    
    .mobile-user-level {
        font-size: 0.75rem;
    }
    
    .mobile-navigation .menu {
        padding: 1rem;
    }
    
    .mobile-menu-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* 用户下拉菜单调整 */
    .user-dropdown-menu {
        min-width: 180px;
    }
    
    .dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 面包屑调整 */
    .breadcrumb {
        padding: 0.75rem 0;
        font-size: 0.75rem;
    }
    
    /* 无内容提示调整 */
    .no-posts {
        padding: 2rem 0.75rem;
    }
    
    .no-posts-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .no-posts h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .no-posts p {
        font-size: 0.875rem;
    }
    
    /* 返回顶部按钮调整 */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* 加载动画调整 */
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* ==================== 横屏手机 (landscape) ==================== */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-banner {
        min-height: 250px;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .posts-grid {
        gap: 0.75rem;
    }
    
    .post-card {
        margin-bottom: 0.75rem;
    }
}

/* ==================== 高分辨率屏幕 ==================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 在高分辨率屏幕上优化图片显示 */
    .post-thumbnail img {
        image-rendering: -webkit-optimize-contrast;
    }
    
    .hero-background img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ==================== 触摸设备优化 ==================== */
@media (hover: none) and (pointer: coarse) {
    /* 为触摸设备优化悬停效果 */
    .btn:hover {
        transform: none;
    }
    
    .post-card:hover {
        transform: none;
    }
    
    .main-navigation a:hover::after {
        width: 0;
    }
    
    /* 增加触摸目标大小 */
    .post-action {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    
    .search-toggle, .user-toggle, .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .search-overlay,
    .mobile-menu-panel,
    .overlay,
    .post-actions,
    .sidebar,
    .pagination-wrapper {
        display: none !important;
    }
    
    .content-area {
        display: block;
        grid-template-columns: 1fr;
    }
    
    .posts-grid {
        display: block;
    }
    
    .post-card {
        break-inside: avoid;
        margin-bottom: 2rem;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero-banner {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .entry-title a {
        color: #000 !important;
    }
}

/* ==================== 减少动画偏好设置 ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ==================== 深色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #404040;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .post-card {
        background-color: #2d2d2d;
    }
    
    .sidebar {
        background-color: #2d2d2d;
    }
    
    .form-control {
        background-color: #2d2d2d;
        color: var(--text-color);
        border-color: var(--border-color);
    }
    
    .btn-outline {
        border-color: #3498db;
        color: #3498db;
    }
}