/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0891b2;
    --secondary-color: #0e7490;
    --accent-color: #f97316;
    --dark-color: #164e63;
    --light-color: #f0fdfa;
    --gray-color: #64748b;
    --border-color: #cbd5e1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--light-color);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 主内容区 */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* 文章列表区 */
.blog-list-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    color: var(--dark-color);
    font-size: 1.5rem;
}

.article-count {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.blog-meta .category {
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.blog-meta .date {
    color: var(--gray-color);
}

.blog-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.blog-card h2 a {
    transition: color 0.3s;
}

.blog-card h2 a:hover {
    color: var(--primary-color);
}

.blog-card .summary {
    color: var(--gray-color);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-color);
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.widget h3 {
    color: var(--dark-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.category-list,
.popular-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.category-list a:hover {
    background-color: var(--light-color);
}

.category-list span {
    background: var(--primary-color);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.popular-list li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.popular-list li:last-child {
    border-bottom: none;
}

.popular-list a {
    font-size: 0.9rem;
    color: var(--dark-color);
    transition: color 0.3s;
}

.popular-list a:hover {
    color: var(--primary-color);
}

.widget p {
    color: var(--gray-color);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 订阅表单 */
.subscribe-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.subscribe-form input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.subscribe-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.subscribe-form button:hover {
    background: var(--secondary-color);
}

/* 文章详情页 */
.detail-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.detail-header .category {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.detail-header h1 {
    color: var(--dark-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.detail-content {
    line-height: 1.8;
    color: #444;
}

.detail-content p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.detail-content h3 {
    color: var(--dark-color);
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
}

.detail-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.back-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background: var(--secondary-color);
}

.error {
    text-align: center;
    padding: 3rem;
    color: var(--gray-color);
    font-size: 1.2rem;
}

/* 页脚 */
.main-footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #a5f3fc;
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #a5f3fc;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #155e75;
    color: #a5f3fc;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .blog-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}