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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    padding: 16px 0;
    margin-bottom: 32px;
    background-color: #fff;
    z-index: 100;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background-color: #fff;
    z-index: -1;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 1px;
    background-color: #eee;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #111;
}

.logo:hover {
    color: #4a90d9;
}

/* Page Title */
.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #111;
}

/* Post List */
.post-list {
    list-style: none;
}

.post-item {
    border-bottom: 1px solid #eee;
}

.post-item:last-child {
    border-bottom: none;
}

.post-link {
    display: block;
    padding: 20px 0;
    transition: background-color 0.15s;
}

.post-link:hover {
    background-color: #f5f5f5;
    margin: 0 -12px;
    padding: 20px 12px;
    border-radius: 8px;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.post-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.post-meta span + span {
    margin-left: 12px;
}

.post-comment-count {
    color: #4a90d9;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    background-color: #e8f0fe;
    color: #4a90d9;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.no-posts {
    text-align: center;
    color: #888;
    padding: 60px 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
}

.page-link {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: background-color 0.15s;
}

a.page-link:hover {
    background-color: #f0f0f0;
}

.page-link.disabled {
    color: #ccc;
    border-color: #eee;
    cursor: default;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* Post Detail */
.post-detail {
    margin-bottom: 40px;
}

.post-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-detail-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
}

.post-detail-meta span + span {
    margin-left: 12px;
}

.post-detail .post-tags {
    margin-bottom: 32px;
}

/* Markdown Content */
.post-content {
    padding: 32px 0;
    border-top: 1px solid #eee;
}

.markdown-body h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.markdown-body h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 12px;
}

.markdown-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
}

.markdown-body p {
    margin: 12px 0;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 24px;
    margin: 12px 0;
}

.markdown-body li {
    margin: 4px 0;
}

.markdown-body code {
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.markdown-body pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    line-height: 1.5;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: 14px;
}

.markdown-body blockquote {
    border-left: 4px solid #4a90d9;
    padding: 8px 16px;
    margin: 16px 0;
    background-color: #f8f9fa;
    color: #555;
}

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

.markdown-body th, .markdown-body td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.markdown-body th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.markdown-body a {
    color: #4a90d9;
    text-decoration: underline;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
    padding: 24px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.nav-prev, .nav-next {
    flex: 1;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: background-color 0.15s;
}

.nav-prev:hover, .nav-next:hover {
    background-color: #f5f5f5;
}

.nav-prev.empty, .nav-next.empty {
    border: none;
}

.nav-next {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.nav-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.nav-list {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 14px;
    color: #666;
    border: 1px solid #eee;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-list:hover {
    background-color: #f5f5f5;
}

/* Comment Section */
.comment-section {
    padding: 32px 0;
}

.comment-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.comment-form input[type="text"],
.comment-form input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
}

.comment-form textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.comment-form button {
    align-self: flex-end;
    padding: 10px 20px;
    background-color: #4a90d9;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.comment-form button:hover {
    background-color: #357abd;
}

/* Comment List */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    padding: 16px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-header strong {
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: #888;
}

.btn-delete-comment {
    margin-left: auto;
    padding: 4px;
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.btn-delete-comment:hover {
    color: #e74c3c;
}

.comment-content {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.no-comments {
    text-align: center;
    color: #888;
    padding: 20px 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 360px;
}

.modal-content h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.modal-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.modal-content input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-actions button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background-color: #fff;
}

.modal-actions button:hover {
    background-color: #f5f5f5;
}

.btn-danger {
    background-color: #e74c3c !important;
    color: white !important;
    border-color: #e74c3c !important;
}

.btn-danger:hover {
    background-color: #c0392b !important;
}

