/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #1a73e8;
    text-decoration: none;
}

a:hover {
    color: #1557b0;
}

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    color: white;
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    display: block;
}

.nav {
    flex-shrink: 0;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav a {
    color: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    white-space: nowrap;
    font-size: 15px;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.search-box {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.search-box button {
    padding: 8px 15px;
    border: none;
    background: #ff6b6b;
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #ee5a5a;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

/* Main */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.news-card .cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #eee;
}

.news-card .content {
    padding: 20px;
}

.news-card .category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-bottom: 10px;
}

.news-card h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-card h3 a {
    color: #333;
}

.news-card h3 a:hover {
    color: #667eea;
}

.news-card .summary {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .meta {
    font-size: 0.8em;
    color: #999;
    display: flex;
    justify-content: space-between;
}

/* News List */
.news-list {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.news-list h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.news-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item .cover {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: #eee;
}

.news-item .content {
    flex: 1;
}

.news-item .category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    margin-bottom: 8px;
}

.news-item h3 {
    font-size: 1.2em;
    margin-bottom: 8px;
}

.news-item h3 a {
    color: #333;
}

.news-item h3 a:hover {
    color: #667eea;
}

.news-item .summary {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item .meta {
    font-size: 0.8em;
    color: #999;
}

/* Article Detail */
.article {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.article h1 {
    font-size: 2em;
    margin-bottom: 20px;
    line-height: 1.4;
}

.article .meta {
    color: #666;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.article .meta span {
    margin-right: 20px;
}

.article .content {
    font-size: 1.1em;
    line-height: 1.8;
}

.article .content p {
    margin-bottom: 1.5em;
}

.article .content img {
    border-radius: 5px;
    margin: 20px 0;
}

/* Related News */
.related-news {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.related-news h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.pagination button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
    color: #999;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }
    
    .nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: 10px;
    }
    
    .nav.active {
        display: block;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav a {
        display: block;
        padding: 10px 15px;
    }
    
    .search-box {
        width: 100%;
        order: 4;
        margin-top: 10px;
    }
    
    .search-box input {
        flex: 1;
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 5px 10px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-item {
        flex-direction: column;
    }
    
    .news-item .cover {
        width: 100%;
        height: 200px;
    }
    
    .article {
        padding: 20px;
    }
    
    .article h1 {
        font-size: 1.5em;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination button {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 30px;
    }
    }
    
    .news-card .content {
        padding: 15px;
    }
}
