/* 
 * 提示词管理平台 - 响应式样式文件
 * 针对不同设备尺寸的样式优化
 */

/* ===== 超大屏幕 (≥1400px) ===== */
@media (min-width: 1400px) {
    .container-xxl {
        max-width: 1320px;
    }
    
    .prompt-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hero-section {
        padding: 6rem 0;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

/* ===== 大屏幕 (≥1200px) ===== */
@media (min-width: 1200px) {
    .prompt-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .sidebar {
        position: sticky;
        top: 100px;
        height: fit-content;
    }
    
    .hero-section {
        padding: 5rem 0;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .search-form-large {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .search-form-large .form-control {
        font-size: 1.1rem;
        padding: 0.75rem 1.25rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== 中等屏幕 (≥992px) ===== */
@media (min-width: 992px) {
    .prompt-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
    
    .dropdown-menu {
        min-width: 250px;
    }
    
    .modal-lg {
        max-width: 800px;
    }
}

/* ===== 小屏幕 (≥768px) ===== */
@media (min-width: 768px) {
    .prompt-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-results-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .filter-toggle {
        display: none;
    }
    
    .filter-sidebar {
        display: block !important;
    }
}

/* ===== 超小屏幕 (<768px) ===== */
@media (max-width: 767.98px) {
    /* 基础布局 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .main-content {
        padding-top: 1rem;
    }
    
    /* 网格布局 */
    .prompt-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* 英雄区域 */
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* 导航栏 */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand .brand-text {
        display: none;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        border-top: 1px solid #e9ecef;
        padding-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f8f9fa;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* 搜索表单 */
    .search-form-mobile {
        margin: 1rem 0;
    }
    
    .search-form-mobile .input-group {
        width: 100%;
    }
    
    /* 卡片组件 */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* 按钮 */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* 模态框 */
    .modal-dialog {
        margin: 1rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* 表单 */
    .form-control {
        font-size: 1rem; /* 防止iOS缩放 */
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    /* 筛选侧边栏 */
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 1rem;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .filter-sidebar.show {
        left: 0;
    }
    
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .filter-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .filter-toggle {
        display: inline-block;
        margin-bottom: 1rem;
    }
    
    .filter-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #6c757d;
        cursor: pointer;
    }
    
    /* 搜索结果 */
    .search-results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-sort-options {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .search-sort-options .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 分页 */
    .pagination {
        font-size: 0.875rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    /* 页脚 */
    .footer {
        text-align: center;
    }
    
    .footer .row > div {
        margin-bottom: 2rem;
    }
    
    .footer .social-links {
        justify-content: center;
    }
    
    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-links li {
        margin: 0;
    }
    
    /* 工具提示 */
    .tooltip {
        display: none !important;
    }
    
    /* 下拉菜单 */
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: #f8f9fa;
        margin-top: 0.5rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
}

/* ===== 超小屏幕 (<576px) ===== */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .filter-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .pagination .page-link {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* ===== 横屏模式优化 ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .filter-sidebar {
        height: 100vh;
        overflow-y: auto;
    }
}

/* ===== 高分辨率屏幕优化 ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .user-avatar,
    .brand-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .filter-sidebar,
    .filter-toggle,
    .back-to-top,
    .navbar,
    .footer,
    .modal,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .prompt-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero-section {
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
        color: #000;
    }
}
