:root {
    --color-bg: #fdfcf9;
    --color-text: #1a1a1a;
    --color-accent: #81b11f;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --max-width: 680px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
}

.site-header {
    padding: 2rem 1.5rem 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.site-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-text);
}

.search-form {
    display: flex;
    gap: 0.4rem;
}

.search-form input[type="text"] {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
    width: 160px;
    background: var(--color-bg);
}

.search-form button {
    border: 1px solid var(--color-accent);
    background: var(--color-accent);
    color: #fff;
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.category-nav {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-size: 0.9rem;
}

.category-nav a {
    color: #555;
    text-decoration: none;
}

.category-nav a:hover {
    color: var(--color-accent);
}

.category-nav .count {
    color: #aaa;
    font-size: 0.8rem;
}

.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
}

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

.post-list-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.post-list-item a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.post-list-item a:hover {
    color: var(--color-accent);
}

.post-meta {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.post-category {
    color: var(--color-accent) !important;
    font-weight: 500 !important;
    padding-right: 0.2rem;
    text-decoration: none !important;
}

.post-date {
    font-size: 0.85rem;
    color: #888;
}

.search-result-count {
    color: #888;
    font-size: 0.9rem;
}

.return-button a {
    color: var(--color-accent);
    font-size: 0.9rem;
    text-decoration: none !important;
}

/* 허니팟(봇 방지용 숨김 필드) - 사람 눈에는 안 보이지만 화면에서 완전히 제거하진 않음(봇이 display:none 감지 우회 방지 목적으로 접근성 트리에선 숨김) */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* 댓글 영역 */
.comments-section {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.comment-list,
.comment-children {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.comment-children {
    padding-left: 1.5rem;
    border-left: 2px solid #eee;
    margin-top: 0.8rem;
}

.comment {
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    font-size: 0.8rem;
    color: #999;
    padding-left: 0.4rem;
}

.comment-message {
    margin: 0.3rem 0 0.4rem;
}

.reply-link,
.delete-link,
.reply-cancel {
    font-size: 0.85rem;
    color: var(--color-accent);
    text-decoration: none;
}

.delete-link {
    color: #b00020;
}

.reply-link:hover,
.reply-cancel:hover,
.delete-link:hover {
    text-decoration: underline;
}

.no-comments {
    color: #888;
}

.comment-form,
.reply-form,
.delete-form,
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 480px;
    margin-top: 0.8rem;
}

.delete-form {
    max-width: 320px;
}

.reply-form {
    margin: 0.6rem 0 0.6rem;
}

.comment-form input[type="text"],
.comment-form input[type="password"],
.reply-form input[type="text"],
.reply-form input[type="password"],
.delete-form input[type="password"],
.admin-form input {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-bg);
}

.comment-form textarea,
.reply-form textarea,
.delete-form textarea {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    min-height: 80px;
    resize: vertical;
    background: var(--color-bg);
}

.comment-form button,
.reply-form button,
.delete-form button,
.admin-form button {
    align-self: flex-start;
    border: 1px solid var(--color-accent);
    background: var(--color-accent);
    color: #fff;
    font-size: 0.95rem;
    border-radius: 6px;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
}

.delete-form button {
    border-color: #b00020;
    background: #b00020;
}
 

/* 관리자 페이지 */
.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.form-error {
    color: #b00020;
    font-size: 0.9rem;
}

.form-success {
    color: #2e7d32;
    font-size: 0.9rem;
}

.upload-snippet {
    background: #f4f2ee;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    overflow-x: auto;
}

.upload-preview {
    max-width: 300px;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.post h1 {
    margin-bottom: 0.3rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 1rem 0;
}

.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: #999;
}
