/* 响应式设计 */
:root {
    --primary-color: #009688;
    --secondary-color: #FF9800;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --container-width: 1200px;
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 1024px;
}

/* 移动优先基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 16px;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* 图片自适应 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-fluid {
    width: 100%;
    height: auto;
}

/* 表格响应式 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* 导航响应式 */
.main-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.tagline {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* 响应式网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.featured-large {
    grid-column: span 2;
}

.news-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* 响应式断点 */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-large {
        grid-column: span 1;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 4px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        padding: 2rem;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav a.active::after {
        display: none;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .nav-top-left,
    .nav-top-right {
        text-align: center;
        width: 100%;
    }
    
    .navbar-top .container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .header-wrapper {
        flex-wrap: wrap;
    }
    
    .logo {
        order: 1;
    }
    
    .mobile-menu-btn {
        order: 2;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
    }
}

/* 打印样式 */
@media print {
    .main-nav,
    .navbar-top,
    .footer,
    .share-buttons,
    .mobile-menu-btn {
        display: none;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    a {
        color: black;
        text-decoration: none;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    article {
        page-break-before: auto;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f8f9fa;
        --light-bg: #212529;
        --border-color: #495057;
    }
    
    body {
        background-color: #121416;
        color: var(--text-color);
    }
    
    .main-header {
        background: #1e2125;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}