* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search form {
    display: flex;
    gap: 5px;
}

.header-search input {
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    font-size: 14px;
    width: 200px;
    background: rgba(255,255,255,0.1);
    color: white;
}

.header-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.header-search input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.2);
}

.header-search button {
    padding: 8px 20px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.header-search button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.site-title {
    font-size: 24px;
    font-weight: bold;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 30px auto;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.card h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.card h3 a {
    color: #333;
    text-decoration: none;
}

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

.excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.time {
    color: #666;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    text-decoration: underline;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.widget {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.random-articles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.random-article-item a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.random-article-item a:hover {
    color: #667eea;
}

.search-keywords,
.related-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-keywords a,
.related-keywords a {
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    transition: background 0.3s, color 0.3s;
}

.search-keywords a:hover,
.related-keywords a:hover {
    background: #667eea;
    color: white;
}

.article-detail {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.article-meta .keyword {
    color: #667eea;
    font-weight: bold;
}

.article-content {
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
}

.article-content h1 {
    font-size: 28px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.article-content h2 {
    font-size: 24px;
    border-left: 4px solid #667eea;
    padding-left: 15px;
}

.article-content h3 {
    font-size: 20px;
    color: #34495e;
}

.article-content h4 {
    font-size: 18px;
    color: #555;
}

.article-content h5 {
    font-size: 16px;
    color: #666;
}

.article-content h6 {
    font-size: 14px;
    color: #777;
}

.article-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.article-content p:first-child {
    margin-top: 0;
}

.article-content p:last-child {
    margin-bottom: 0;
}

.article-content ul,
.article-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

.article-content a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.article-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.article-content strong,
.article-content b {
    font-weight: bold;
    color: #2c3e50;
}

.article-content em,
.article-content i {
    font-style: italic;
    color: #555;
}

.article-content blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    color: #555;
}

.article-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #e74c3c;
}

.article-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-content th,
.article-content td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.article-content th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.article-content tr:nth-child(even) {
    background: #f8f9fa;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-content hr {
    border: none;
    border-top: 2px solid #eee;
    margin: 30px 0;
}

footer {
    background: #333;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

footer .container {
    text-align: center;
}

footer p {
    margin-bottom: 10px;
}

.friend-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.friend-links a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
}

.friend-links a:hover {
    color: white;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        margin-top: 15px;
    }
    
    nav a {
        margin: 0 10px;
    }
    
    .article-content h1 {
        font-size: 24px;
    }
    
    .article-content h2 {
        font-size: 20px;
    }
    
    .article-content h3 {
        font-size: 18px;
    }
    
    .article-content h4 {
        font-size: 16px;
    }
    
    .article-content h5 {
        font-size: 15px;
    }
    
    .article-content h6 {
        font-size: 14px;
    }
    
    .article-content {
        font-size: 15px;
    }
    
    .article-content table {
        font-size: 14px;
    }
    
    .article-content th,
    .article-content td {
        padding: 8px;
    }
}
