/* Root variables for themes */
:root[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #222222;
    --text-secondary: #666666;
    --link-color: #0066cc;
    --link-hover: #0052a3;
    --border-color: #e0e0e0;
    --code-bg: #f5f5f5;
    --header-bg: #fafafa;
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --link-color: #6ca0dc;
    --link-hover: #8ab4e5;
    --border-color: #333333;
    --code-bg: #252525;
    --header-bg: #0f0f0f;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

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

/* Header & Navigation */
header {
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--link-color);
}

/* Typography */
h1 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 20px;
}

h2 {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 40px;
    margin-bottom: 20px;
}

h3 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 30px;
    margin-bottom: 15px;
}

h4 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 10px;
}

p {
    margin-bottom: 20px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-hover);
}

/* Home page */
.intro {
    margin-bottom: 60px;
}

.intro h1 {
    font-size: 36px;
    margin-bottom: 30px;
}

.intro p {
    font-size: 20px;
    line-height: 1.6;
}

.blog-section {
    margin-top: 60px;
}

.post-list {
    list-style: none;
    margin-top: 30px;
}

.post-list li {
    margin-bottom: 30px;
}

.post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s;
}

.post-item:hover {
    color: var(--link-color);
}

.post-emoji {
    font-size: 24px;
}

.post-summary {
    margin-top: 8px;
    margin-left: 36px;
    color: var(--text-secondary);
    font-size: 16px;
}

.no-posts {
    color: var(--text-secondary);
    font-style: italic;
}

/* Post detail */
.post-detail, .page-detail {
    margin-bottom: 60px;
}

.post-header, .page-header {
    margin-bottom: 40px;
}

.post-emoji-large {
    font-size: 48px;
    margin-bottom: 20px;
}

.post-meta {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 10px;
}

.post-content, .page-content {
    line-height: 1.8;
}

.post-content h1,
.page-content h1 {
    margin-top: 50px;
    margin-bottom: 25px;
}

.post-content h2,
.page-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.post-content h3,
.page-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.post-content h4,
.page-content h4 {
    margin-top: 25px;
    margin-bottom: 10px;
}

.post-content ul,
.page-content ul {
    margin-left: 30px;
    margin-bottom: 20px;
}

.post-content ol,
.page-content ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.post-content li,
.page-content li {
    margin-bottom: 8px;
}

.post-content code,
.page-content code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 16px;
}

.post-content pre,
.page-content pre {
    background-color: var(--code-bg);
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.post-content pre code,
.page-content pre code {
    background: none;
    padding: 0;
}

.post-content table,
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.post-content th,
.post-content td,
.page-content th,
.page-content td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.post-content th,
.page-content th {
    background-color: var(--code-bg);
    font-weight: 600;
}

.post-content blockquote,
.page-content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content hr,
.page-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 40px 0;
}

.post-footer, .page-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--text-secondary);
    font-size: 16px;
}

.back-link:hover {
    color: var(--link-color);
}

/* Footer */
footer {
    margin-top: 100px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: var(--text-secondary);
}

footer a:hover {
    color: var(--link-color);
}

/* Error page */
.error-page {
    text-align: center;
    padding: 100px 0;
}

.error-page h1 {
    font-size: 72px;
    margin-bottom: 20px;
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: var(--bg-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 15px;
    }

    header {
        padding: 30px 0;
        margin-bottom: 40px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .intro h1 {
        font-size: 28px;
    }

    .intro p {
        font-size: 18px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    .post-emoji-large {
        font-size: 36px;
    }

    .theme-toggle {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

