* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: #333;
    font-size: 1.8rem;
}

.update-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#lastUpdate {
    color: #666;
    font-size: 0.9rem;
}

#refreshBtn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

#refreshBtn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group h4 {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.filter-select, .search-input {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border 0.3s;
    margin-bottom: 0.5rem;
}

.filter-select:focus, .search-input:focus {
    outline: none;
    border-color: #667eea;
}

#searchBtn {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

#searchBtn:hover {
    background: #5568d3;
}

.news-container {
    min-height: 500px;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.news-content {
    padding: 1.2rem;
}

.news-meta {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.news-category, .news-region {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.news-category {
    background: #e3f2fd;
    color: #1976d2;
}

.news-region {
    background: #f3e5f5;
    color: #7b1fa2;
}

.news-title {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.6rem;
    line-height: 1.4;
    font-weight: 600;
}

.news-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid #f0f0f0;
}

.news-time {
    color: #999;
    font-size: 0.8rem;
}

.read-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.read-btn:hover {
    background: #5568d3;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 2rem;
    border-radius: 12px;
    max-width: 800px;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.modal-description {
    color: #444;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.modal-description pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin: 0;
}

.modal-content-text {
    color: #444;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.modal-content-text p {
    margin-bottom: 1rem;
}

.modal-content-text h3 {
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.news-author {
    background: #fff3e0;
    color: #e65100;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.speak-btn, .source-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.speak-btn {
    background: #4caf50;
    color: white;
}

.speak-btn:hover {
    background: #45a049;
}

.speak-btn.speaking {
    background: #f44336;
}

.source-btn {
    background: #2196f3;
    color: white;
}

.source-btn:hover {
    background: #0b7dda;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .filters {
        position: static;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
}
