/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    line-height: 1.8;
    color: #333;
    background: #f5f5f5;
}

a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== Layout ========== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ========== Header ========== */
.site-header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 0;
}

.site-header h1 {
    font-size: 1.3rem;
}

.site-header h1 a {
    color: #fff;
}

.site-header .subtitle {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 2px;
}

/* ========== Navigation ========== */
.category-nav {
    background: #16213e;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
}

.category-nav a {
    display: inline-block;
    color: #ccc;
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 20px;
    transition: background 0.2s;
}

.category-nav a:hover,
.category-nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
}

/* ========== Article List ========== */
.post-list {
    margin-top: 20px;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.post-card .meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 6px;
}

.post-card .meta .category {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.post-card h2 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.post-card h2 a {
    color: #333;
}

.post-card .excerpt {
    font-size: 0.9rem;
    color: #666;
}

/* ========== Article Detail ========== */
.article {
    background: #fff;
    border-radius: 8px;
    padding: 24px 20px;
    margin-top: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.article .meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 16px;
}

.article .meta .category {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.article h1 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.article-body h2 {
    font-size: 1.2rem;
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e0e0e0;
}

.article-body h3 {
    font-size: 1.05rem;
    margin: 20px 0 8px;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul, .article-body ol {
    margin: 0 0 16px 24px;
}

.article-body code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.article-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.5;
}

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

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.article-body th, .article-body td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    font-size: 0.9rem;
}

.article-body th {
    background: #f8f8f8;
}

/* ========== Images & Figures ========== */
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.article-body figure {
    margin: 20px 0;
    text-align: center;
}

.article-body figure img {
    max-width: 320px;
}

.article-body figcaption {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

/* ========== Back link ========== */
.back-link {
    display: inline-block;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ========== Footer ========== */
.site-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: #999;
}

/* ========== Pagination ========== */
.pagination {
    text-align: center;
    margin: 24px 0;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.pagination a {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pagination span.current {
    background: #1a73e8;
    color: #fff;
}
