/* AIWorkflowNews 响应式样式 */

/* 移动端优先的响应式设计 */

/* 超小屏幕 (手机, 小于576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .news-card {
        margin-bottom: 15px;
    }
    
    .news-card .card-body {
        padding: 15px;
    }
    
    .news-card .card-title {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .news-card .card-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .news-meta {
        font-size: 0.8rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-filters .form-control,
    .search-filters .form-select {
        width: 100%;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .stats-section .col-md-3 {
        margin-bottom: 20px;
    }
    
    .user-center-nav .nav-pills {
        flex-direction: column;
    }
    
    .user-center-nav .nav-link {
        text-align: center;
        margin-bottom: 5px;
    }
}

/* 小屏幕 (平板, 576px 到 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .news-card .card-title {
        font-size: 1.1rem;
    }
    
    .search-filters {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .search-filters .form-control {
        flex: 1 1 200px;
    }
    
    .search-filters .form-select {
        flex: 1 1 150px;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .stats-section .col-md-3 {
        margin-bottom: 15px;
    }
}

/* 中等屏幕 (平板横屏, 768px 到 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .news-card .card-title {
        font-size: 1.2rem;
    }
    
    .search-filters {
        justify-content: space-between;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .sidebar {
        margin-top: 20px;
    }
}

/* 大屏幕 (桌面, 992px 到 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .news-card .card-title {
        font-size: 1.25rem;
    }
    
    .container {
        max-width: 960px;
    }
}

/* 超大屏幕 (大桌面, 1200px 及以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .news-card .card-title {
        font-size: 1.3rem;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 12px 16px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .news-card {
        transition: none;
    }
    
    .news-card:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .news-card {
        border: 2px solid #000;
    }
    
    .btn-outline-primary {
        border-width: 2px;
    }
    
    .text-muted {
        color: #666 !important;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .news-card {
        transition: none;
    }
    
    .btn {
        transition: none;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .search-filters,
    .load-more-section,
    .footer,
    .btn,
    .news-actions {
        display: none !important;
    }
    
    .news-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
    
    .news-card .card-body {
        padding: 15px;
    }
    
    .news-meta {
        color: #666;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    a:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* 横屏手机优化 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .hero-section p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bs-body-bg: #1a1a1a;
        --bs-body-color: #e9ecef;
        --bs-card-bg: #2d2d2d;
        --bs-border-color: #404040;
    }
    
    body {
        background-color: var(--bs-body-bg);
        color: var(--bs-body-color);
    }
    
    .card {
        background-color: var(--bs-card-bg);
        border-color: var(--bs-border-color);
    }
    
    .navbar {
        background-color: #2d2d2d !important;
    }
    
    .form-control,
    .form-select {
        background-color: var(--bs-card-bg);
        border-color: var(--bs-border-color);
        color: var(--bs-body-color);
    }
    
    .form-control:focus,
    .form-select:focus {
        background-color: var(--bs-card-bg);
        border-color: #0d6efd;
        color: var(--bs-body-color);
    }
    
    .text-muted {
        color: #adb5bd !important;
    }
    
    .btn-outline-primary {
        color: #6ea8fe;
        border-color: #6ea8fe;
    }
    
    .btn-outline-primary:hover {
        background-color: #6ea8fe;
        border-color: #6ea8fe;
        color: #000;
    }
}

/* 可访问性增强 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点可见性增强 */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* 跳转链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #0d6efd;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* 加载状态优化 */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 错误状态样式 */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
}

/* 网格布局优化 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 575.98px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* 粘性导航优化 */
.sticky-top {
    top: 0;
    z-index: 1020;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
} 