:root {
    --bg-body: #f4f5f7;
    --bg-content: #ffffff;
    --text-main: #333333;
    --text-light: #777777;
    --border-color: #e0e0e0;
    --primary-color: #546e7a;
    --accent-color: #37474f;
    --link-color: #1565c0;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 0; background-color: var(--bg-body); color: var(--text-main); font-family: 'Malgun Gothic', sans-serif; font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.pc-only { display: table-cell; }
.m-only { display: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 15px; }

.site-header { background-color: var(--primary-color); color: white; padding: 15px 0; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; width: 100%; }
.header-top h1 { margin: 0; font-size: 22px; }
.logo-wrapper { display: flex; align-items: center; gap: 10px; }
.main-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background-color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.login-status { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.btn-login { padding: 3px 8px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 3px; color: #fff; font-size: 12px; transition: all 0.2s; }
.btn-login:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }

.gnb { display: flex; gap: 15px; border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 12px; width: 100%; clear: both; }
.gnb a { color: #cfd8dc; font-weight: bold; }
.gnb a:hover { color: white; }

.content-area { background-color: var(--bg-content); min-height: 700px; padding: 0; margin-top: 0; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.board-header { border-bottom: 2px solid var(--accent-color); padding: 10px 20px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background-color: var(--bg-content); z-index: 100; }
.board-header h2 { margin: 0; font-size: 20px; }

.category-filter { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; padding: 0 20px; }
.category-filter a { padding: 4px 12px; font-size: 13px; border: 1px solid var(--border-color); border-radius: 15px; color: var(--text-light); background: #fff; }
.category-filter a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.category-filter a.active { background: var(--primary-color); color: white; border-color: var(--primary-color); font-weight: bold; }

.board-list { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.board-list th { border-bottom: 1px solid var(--border-color); padding: 10px; background: #fafafa; font-size: 13px; }
.board-list td { border-bottom: 1px solid var(--border-color); padding: 10px; text-align: center; }
.board-list .title-cell { text-align: left; }
.board-list .comment-count { color: #ff5722; font-size: 12px; margin-left: 5px; font-weight: bold; }
.board-list .title-cell a:hover { text-decoration: underline; color: var(--link-color); }

.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 20px; padding-bottom: 30px; }
.pagination a { padding: 6px 12px; border: 1px solid var(--border-color); background: #fff; color: var(--text-main); font-size: 13px; border-radius: 3px; }
.pagination a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pagination a.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); font-weight: bold; }

.btn { display: inline-block; padding: 7px 15px; border: 1px solid #ccc; background: white; border-radius: 3px; cursor: pointer; font-size: 13px; }
.btn-primary { background: var(--primary-color); color: white; border: none; }
.board-footer { text-align: right; }

.write-wrap { padding: 0 20px 20px; }
.write-form .form-group { margin-bottom: 15px; }
.write-form .row { display: flex; gap: 10px; }
.write-form input, .write-form select, .write-form textarea { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 3px; outline: none; }
.write-form textarea { resize: vertical; }

.post-view { padding: 20px; }
.post-view .view-header { border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.post-view .view-meta { color: var(--text-light); font-size: 12px; margin-top: 5px; }
.post-view .view-content { min-height: 300px; white-space: pre-wrap; line-height: 1.8; }

.site-footer { text-align: center; padding: 30px 0; color: var(--text-light); font-size: 12px; }

@media (max-width: 768px) {
    .pc-only, .pc-only-tr { display: none !important; }
    .m-only { display: block; }
    .header-top { flex-direction: row; }
    
    .board-list thead { display: none; }
    .board-item { display: flex; align-items: center; padding: 12px 10px; border-bottom: 1px solid var(--border-color); }
    
    .title-cell { flex: 1; padding: 0 !important; border: none !important; }
    .m-title-area { display: flex; flex-direction: column; gap: 4px; }
    
    .m-row-1 { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
    .m-cat { color: var(--primary-color); font-size: 12px; white-space: nowrap; }
    .post-title { 
        display: block;
        max-width: 250px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .m-row-2 { display: flex; gap: 10px; font-size: 11px; color: var(--text-light); }
    .m-row-2 span:not(:last-child)::after { content: "|"; margin-left: 10px; opacity: 0.3; }

    .col-m-comments { 
        width: 50px; 
        display: flex !important; 
        justify-content: center; 
        align-items: center; 
        padding: 0 !important;
        border: none !important;
    }
    .m-comment-badge { 
        background: #f0f0f0; color: #666; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: bold;
    }

    .write-form .row { flex-direction: column; }
}
