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

:root {
    --bg-color: #f5f5f5;
    --container-bg: #ffffff;
    --text-color: #333;
    --text-color-light: #7f8c8d;
    --text-color-dark: #2c3e50;
    --text-color-muted: #34495e;
    --border-color: #e0e0e0;
    --primary-color: #27ae60;
    --primary-hover: #229954;
    --post-bg: #fafafa;
    --comment-bg: #fafafa;
    --nav-bg: #f8f9fa;
    --shadow: rgba(0,0,0,0.1);
    --shadow-hover: rgba(0,0,0,0.1);
    --category-pill-bg: #e8f5e9;
    --tag-pill-bg: #f0f0f0;
    --notice-bg: #fff3cd;
    --notice-border: #ffc107;
    --notice-text: #856404;
    --text-on-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --container-bg: #2d2d2d;
        --text-color: #f5f5f5;
        --text-color-light: #d0d0d0;
        --text-color-dark: #ffffff;
        --text-color-muted: #e8e8e8;
        --border-color: #404040;
        --primary-color: #52c97a;
        --primary-hover: #27ae60;
        --post-bg: #3a3a3a;
        --comment-bg: #3a3a3a;
        --nav-bg: #333333;
        --shadow: rgba(0,0,0,0.3);
        --shadow-hover: rgba(0,0,0,0.5);
        --category-pill-bg: #2a4a3a;
        --tag-pill-bg: #3a3a3a;
        --notice-bg: #4a3a1a;
        --notice-border: #ffc107;
        --notice-text: #ffd700;
        --text-on-color: #ffffff;
    }
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #f5f5f5;
    --text-color-light: #d0d0d0;
    --text-color-dark: #ffffff;
    --text-color-muted: #e8e8e8;
    --border-color: #404040;
    --primary-color: #52c97a;
    --primary-hover: #27ae60;
    --post-bg: #3a3a3a;
    --comment-bg: #3a3a3a;
    --nav-bg: #333333;
    --shadow: rgba(0,0,0,0.3);
    --shadow-hover: rgba(0,0,0,0.5);
        --category-pill-bg: #2a4a3a;
        --tag-pill-bg: #3a3a3a;
        --notice-bg: #4a3a1a;
        --notice-border: #ffc107;
        --notice-text: #ffd700;
        --text-on-color: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--primary-color);
    transition: color 0.3s;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--container-bg);
    padding: 40px;
    box-shadow: 0 2px 10px var(--shadow);
    border-radius: 8px;
    transition: background-color 0.3s, box-shadow 0.3s;
    position: relative;
}

.site-header {
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 30px;
    margin-bottom: 40px;
    transition: border-color 0.3s;
}

.site-header h1 {
    font-size: 3em;
    color: var(--text-color-dark);
    margin-bottom: 10px;
    transition: color 0.3s;
}

.site-header h1 a {
    color: var(--text-color-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.site-header h1 a:hover {
    color: var(--primary-color);
}

.site-header .subtitle {
    color: var(--text-color-light);
    font-size: 1.2em;
    margin-top: 10px;
    transition: color 0.3s;
}

header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
    transition: border-color 0.3s;
}

h1 {
    font-size: 2.5em;
    color: var(--text-color-dark);
    margin-bottom: 10px;
    line-height: 1.2;
    transition: color 0.3s;
}

h1 a {
    color: var(--text-color-dark);
    text-decoration: none;
    transition: color 0.3s;
}

h1 a:hover {
    color: var(--primary-color);
}

.post-meta {
    color: var(--text-color-light);
    font-size: 0.95em;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.post-meta time {
    margin-right: 15px;
}

.author {
    color: var(--text-color-muted);
    font-style: italic;
    transition: color 0.3s;
}

.content {
    font-size: 1.1em;
    line-height: 1.8;
    margin-top: 30px;
}

.content p {
    margin-bottom: 1.2em;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
    display: block;
}

.content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, color 0.3s;
}

.content a:hover {
    border-bottom-color: var(--primary-color);
}

.content .image-caption {
    display: block;
    text-align: center;
    color: var(--text-color-light);
    font-style: italic;
    font-size: 0.9em;
    margin-top: -15px;
    margin-bottom: 20px;
    padding: 0 20px;
    transition: color 0.3s;
}

.content p:has(img) {
    text-align: center;
}

/* YouTube embeds */
.youtube-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
    border-radius: 4px;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.navigation {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
}

.nav-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--text-on-color);
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s, color 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--primary-hover);
}

.nav-link.disabled {
    background: var(--text-color-light);
    cursor: not-allowed;
    pointer-events: none;
}

footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color-light);
    font-size: 0.9em;
    transition: border-color 0.3s, color 0.3s;
}

.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.comments-section h2 {
    font-size: 1.8em;
    color: var(--text-color-dark);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s, border-color 0.3s;
}

.comment {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--comment-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.comment-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: var(--text-color-dark);
    font-size: 1.1em;
    transition: color 0.3s;
}

.comment-author a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.comment-author a:hover {
    text-decoration: underline;
}

.comment-date {
    color: var(--text-color-light);
    font-size: 0.9em;
    transition: color 0.3s;
}

.comment-content {
    color: var(--text-color);
    line-height: 1.6;
    margin-top: 10px;
    transition: color 0.3s;
}

.comment-content p {
    margin-bottom: 0.8em;
}

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

.comment-reply {
    margin-left: 40px;
    margin-top: 20px;
    border-left: 2px solid var(--border-color);
    padding-left: 20px;
    transition: border-color 0.3s;
}

.no-comments {
    color: var(--text-color-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
    transition: color 0.3s;
}

.post-list {
    list-style: none;
}

.post-item {
    padding: 20px;
    margin-bottom: 20px;
    background: var(--post-bg);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.post-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px var(--shadow-hover);
}

.post-item a.post-link {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    text-decoration: none;
    color: var(--text-color-dark);
    transition: color 0.3s;
}

.post-item h2 {
    font-size: 1.5em;
    margin-bottom: 8px;
    color: var(--text-color-dark);
    transition: color 0.3s;
}

.post-item .date {
    color: var(--text-color-light);
    font-size: 0.9em;
    transition: color 0.3s;
}

.post-count {
    text-align: center;
    color: var(--text-color-light);
    margin-bottom: 30px;
    font-size: 1.1em;
    transition: color 0.3s;
}

.notice {
    background: var(--notice-bg);
    border: 1px solid var(--notice-border);
    border-left: 4px solid var(--notice-border);
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    color: var(--notice-text);
    transition: background-color 0.3s, color 0.3s;
}

.notice p {
    margin-bottom: 1em;
}

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

.notice a {
    color: var(--notice-text);
    text-decoration: underline;
    transition: color 0.3s;
}

.notice a:hover {
    opacity: 0.8;
}

/* Post thumbnails and excerpts */

.post-thumbnail {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
}

.post-content .excerpt {
    color: var(--text-color-light);
    font-size: 0.95em;
    margin-top: 10px;
    line-height: 1.5;
    transition: color 0.3s;
}

/* Taxonomy pills */
.post-taxonomy {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.taxonomy-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.taxonomy-group:last-child {
    margin-bottom: 0;
}

.taxonomy-label {
    font-weight: 600;
    color: var(--text-color-dark);
    font-size: 0.9em;
    transition: color 0.3s;
}

.taxonomy-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s;
}

.category-pill {
    background: var(--category-pill-bg);
    color: var(--text-color-dark);
    border: 1px solid var(--primary-color);
    transition: all 0.3s;
}

.category-pill:hover {
    background: var(--primary-color);
    color: var(--text-on-color);
}

.tag-pill {
    background: var(--tag-pill-bg);
    color: var(--text-color-dark);
    border: 1px solid var(--text-color-light);
    transition: all 0.3s;
}

.tag-pill:hover {
    background: var(--text-color-light);
    color: var(--text-on-color);
}

/* Index navigation */
.index-navigation {
    margin: 30px 0;
    padding: 20px;
    background: var(--nav-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: background-color 0.3s;
}

.index-navigation h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--text-color-dark);
    transition: color 0.3s;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--container-bg);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid var(--primary-color);
    transition: all 0.2s;
    font-weight: 500;
}

.nav-links a:hover {
    background: var(--primary-color);
    color: var(--text-on-color);
}

/* Year and category lists */
.year-list,
.category-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.year-item,
.category-item {
    margin: 0;
}

.year-item a,
.category-item a {
    display: block;
    padding: 20px;
    background: var(--post-bg);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color-dark);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
}

.year-item a:hover,
.category-item a:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px var(--shadow-hover);
}

.year-item h2,
.category-item h2 {
    font-size: 1.5em;
    margin-bottom: 8px;
    color: var(--text-color-dark);
    transition: color 0.3s;
}

.year-item .post-count,
.category-item .post-count {
    color: var(--text-color-light);
    font-size: 0.9em;
    transition: color 0.3s;
}

/* Tags cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.tag-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--tag-pill-bg);
    color: var(--text-color-dark);
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid var(--text-color-light);
    transition: all 0.2s;
    font-size: 0.9em;
}

.tag-link:hover {
    background: var(--text-color-light);
    color: var(--text-on-color);
}

/* Blogroll */
.blogroll-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.blogroll-item {
    margin: 0;
}

.blogroll-item a {
    display: block;
    padding: 20px;
    background: var(--post-bg);
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color-dark);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, color 0.3s;
}

.blogroll-item a:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px var(--shadow-hover);
}

.blogroll-item h2 {
    font-size: 1.3em;
    margin-bottom: 8px;
    color: var(--text-color-dark);
    transition: color 0.3s;
}

.blogroll-item .link-description {
    color: var(--text-color-light);
    font-size: 0.9em;
    margin: 0;
    transition: color 0.3s;
}

