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

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --link-color: #0000EE;
    --border-color: #e0e0e0;
    --hover-bg: #f5f5f5;
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --link-color: #6b9eff;
    --border-color: #2a2a2a;
    --hover-bg: #1a1a1a;
}

[data-theme="sepia"] {
    --bg-color: #f4ecd8;
    --text-color: #5c4a3a;
    --link-color: #8b6f47;
    --border-color: #d4c4a8;
    --hover-bg: #e8dcc0;
}

[data-theme="blue"] {
    --bg-color: #e8f1f8;
    --text-color: #1a3a52;
    --link-color: #2563eb;
    --border-color: #c2d9e8;
    --hover-bg: #d6e5f0;
}

[data-theme="contrast"] {
    --bg-color: #000000;
    --text-color: #ffffff;
    --link-color: #ffff00;
    --border-color: #ffffff;
    --hover-bg: #333333;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Main layout - single column */
.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Header with logo and title */
.site-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 40px;
}

.site-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--text-color);
}

.header-spacer {
    flex: 1;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: 'Times New Roman', Times, serif;
}

.theme-toggle:hover {
    background: var(--hover-bg);
}

.view-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: 'Times New Roman', Times, serif;
}

.view-toggle:hover {
    background: var(--hover-bg);
}

.view-toggle.active {
    background: var(--hover-bg);
}

/* Main content layout with sidebar */
.main-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 60px;
    padding: 40px 40px 80px 40px;
}

/* Sidebar navigation */
.sidebar-nav {
    position: sticky;
    top: 40px;
    align-self: start;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 20px;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.2s;
    display: block;
}

.nav-menu a:hover {
    opacity: 0.6;
}

.nav-menu a.active {
    text-decoration: underline;
}

/* Main content */
.main-content {
    max-width: 800px;
}

/* Welcome message */
.welcome-message {
    font-size: 1.1rem;
    line-height: 1.8;
}

.welcome-message p {
    margin-bottom: 1.5rem;
}

/* Article list */
.article-list {
    list-style: none;
}

.article-list li {
    margin-bottom: 24px;
}

.article-list a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 1.05rem;
    display: inline-block;
    transition: all 0.2s;
}

.article-list a:hover {
    text-decoration: underline;
}

.article-meta {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.5;
    margin-top: 4px;
}

/* Grid view for articles */
.article-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.article-list.grid-view li {
    margin-bottom: 0;
    padding: 20px;
    background: var(--hover-bg);
    border-radius: 8px;
    transition: transform 0.2s, opacity 0.2s;
}

.article-list.grid-view li:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.article-list.grid-view a {
    display: block;
}

/* Article content */
.article-content h1 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.article-content a {
    color: var(--link-color);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    padding-left: 1.5rem;
    margin: 2rem 0;
    opacity: 0.8;
    font-style: italic;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
}

.article-content code {
    background: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.article-content pre {
    background: var(--hover-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

/* Back link */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header {
        padding: 20px;
    }

    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 20px;
    }

    .sidebar-nav {
        position: static;
        padding-bottom: 20px;
    }

    .nav-menu {
        display: flex;
        gap: 20px;
        flex-wrap: wrap;
    }

    .nav-menu li {
        margin-bottom: 0;
    }

    .article-content h1 {
        font-size: 2rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }
}