/* =============================================
   기본 & 타이포그래피
   ============================================= */
body {
    background: #f1f5f9;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
    color: #1e293b;
}

/* =============================================
   내비게이션바
   ============================================= */
.navbar {
    background: #1e293b !important;
    border-bottom: none !important;
    padding: 0 1.5rem;
    height: 56px;
}
.navbar-brand {
    color: #fff !important;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}
.navbar-brand span {
    color: #6366f1;
}
.navbar .nav-link, .navbar-nav .btn-link {
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.88rem;
    padding: 0 12px !important;
    line-height: 56px;
    text-decoration: none;
    transition: color 0.15s;
}
.navbar .nav-link:hover, .navbar-nav .btn-link:hover {
    color: #fff !important;
}
/* 페이지 내부 탭 (쪽지, 마이페이지 등) */
.nav-tabs .nav-link {
    color: #475569 !important;
    font-size: 0.9rem;
    padding: 8px 16px !important;
    line-height: 1.5 !important;
    border-radius: 6px 6px 0 0;
    font-weight: 500;
}
.nav-tabs .nav-link:hover { color: #6366f1 !important; }
.nav-tabs .nav-link.active {
    color: #6366f1 !important;
    font-weight: 700;
    border-bottom: 2px solid #6366f1;
}
.navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
/* 알림 뱃지 */
.badge-danger { background: #ef4444; }

/* =============================================
   배너 광고 영역
   ============================================= */
.banner-section {
    background: #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
    padding: 8px 0;
    overflow-x: auto;
}
.banner-grid {
    display: grid;
    grid-template-columns: repeat(4, 400px);
    gap: 4px;
    width: fit-content;
    margin: 0 auto;
}
.banner-slot {
    width: 400px;
    height: 50px;
    background: #cbd5e1;
    border: 1px dashed #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 3px;
}
.banner-slot a {
    display: block;
    width: 100%;
    height: 100%;
}
.banner-slot img {
    width: 400px;
    height: 50px;
    object-fit: cover;
    display: block;
}

/* =============================================
   가로 카테고리 바
   ============================================= */
.category-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    padding: 0 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.category-bar-item {
    display: inline-block;
    padding: 12px 20px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.category-bar-item:hover {
    color: #6366f1;
    text-decoration: none;
}
.category-bar-item.category-active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    font-weight: 700;
}

/* =============================================
   게시판 컨테이너
   ============================================= */
.board-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 16px;
}
.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

/* =============================================
   게시판 테이블
   ============================================= */
.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.board-table thead tr {
    background: #f8fafc;
    border-top: none;
}
.board-table thead th {
    padding: 10px 14px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.board-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.board-table tbody tr:hover {
    background: #f8fafc;
}
.board-table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
    text-align: center;
}
.board-table td.td-title {
    text-align: left;
}
.board-table .td-num {
    color: #94a3b8;
    font-size: 0.8rem;
    width: 52px;
}
.board-table .td-vote {
    width: 50px;
}
.board-table .td-view {
    width: 55px;
    color: #94a3b8;
    font-size: 0.8rem;
}
.board-table .td-author {
    width: 90px;
    color: #475569;
    font-size: 0.83rem;
}
.board-table .td-date {
    width: 90px;
    color: #94a3b8;
    font-size: 0.8rem;
}
.board-table .td-reply {
    width: 80px;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* 제목 링크 */
.board-table .post-title {
    color: #1e293b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.board-table .post-title:hover {
    color: #6366f1;
    text-decoration: none;
}

/* 채택 아이콘 */
.icon-accepted {
    color: #22c55e;
    margin-right: 4px;
    font-size: 0.85rem;
}

/* 답변 수 뱃지 */
.reply-count {
    display: inline-block;
    background: #fee2e2;
    color: #ef4444;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

/* 추천 뱃지 */
.vote-badge {
    display: inline-block;
    background: #fef3c7;
    color: #d97706;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

/* 카테고리 뱃지 */
.badge-category {
    display: inline-block;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    margin-left: 5px;
    vertical-align: middle;
}

/* 태그 뱃지 */
.badge-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
    text-decoration: none;
}
.badge-tag:hover {
    background: #bae6fd;
    color: #0369a1;
    text-decoration: none;
}

/* =============================================
   페이징
   ============================================= */
.pagination .page-link {
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px !important;
    margin: 0 2px;
    transition: all 0.15s;
}
.pagination .page-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.pagination .page-item.active .page-link {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    color: #cbd5e1;
}

/* =============================================
   버튼
   ============================================= */
.btn-write {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    display: inline-block;
}
.btn-write:hover {
    background: #4f46e5;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* =============================================
   게시글 / 답변 본문
   ============================================= */
.editor-preview img,
.editor-preview-side img,
.card-text img {
    max-width: 400px;
    max-height: 400px;
    width: auto;
    height: auto;
    display: block;
}

/* =============================================
   댓글
   ============================================= */
.comment {
    border-top: 1px dotted #e2e8f0;
    font-size: 0.78rem;
    color: #64748b;
    padding: 6px 0;
}

/* =============================================
   맨 위로 버튼
   ============================================= */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: background 0.2s;
}
#scrollTopBtn:hover { background: #4f46e5; }

/* =============================================
   다크모드 토글 버튼
   ============================================= */
.dark-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 12px;
    line-height: 56px;
    margin-left: auto;
}
.dark-toggle-btn:hover { opacity: 0.8; }

/* =============================================
   다크모드
   ============================================= */
body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}
body.dark-mode .navbar { background: #1e293b !important; }
body.dark-mode .banner-section { background: #1e293b; }
body.dark-mode .category-bar { background: #1e293b; border-color: #334155; }
body.dark-mode .category-bar-item { color: #94a3b8; }
body.dark-mode .category-bar-item:hover,
body.dark-mode .category-bar-item.category-active { color: #818cf8; border-color: #818cf8; }
body.dark-mode .board-container { background: #1e293b; box-shadow: none; }
body.dark-mode .board-toolbar { background: #1e293b; border-color: #334155; }
body.dark-mode .board-table thead tr { background: #0f172a; }
body.dark-mode .board-table thead th { color: #94a3b8; border-color: #334155; }
body.dark-mode .board-table tbody tr { border-color: #334155; }
body.dark-mode .board-table tbody tr:hover { background: #0f172a; }
body.dark-mode .board-table .post-title { color: #e2e8f0; }
body.dark-mode .card { background: #1e293b; border-color: #334155; }
body.dark-mode .card-body { background: #1e293b; }
body.dark-mode .card-text { color: #e2e8f0; }
body.dark-mode .form-control { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .bg-light { background: #1e293b !important; }
body.dark-mode .badge-light { background: #334155; color: #e2e8f0; }
body.dark-mode .border-bottom { border-color: #334155 !important; }
body.dark-mode .pagination .page-link { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-mode .pagination .page-item.active .page-link { background: #6366f1; }

/* =============================================
   SNS 공유 버튼
   ============================================= */
.share-buttons { display: flex; gap: 6px; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.8; text-decoration: none; }
.share-twitter { background: #000; color: #fff; }
.share-copy { background: #e2e8f0; color: #475569; }

/* =============================================
   인기글 섹션
   ============================================= */
.popular-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}
.popular-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.popular-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.popular-item {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.1s;
}
.popular-item:last-child { border-bottom: none; }
.popular-item:hover { background: #f8fafc; }
.popular-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}
.popular-item:nth-child(1) .popular-rank { background: #f59e0b; }
.popular-item:nth-child(2) .popular-rank { background: #94a3b8; }
.popular-item:nth-child(3) .popular-rank { background: #b45309; }
.popular-title {
    flex: 1;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.popular-title:hover { color: #6366f1; text-decoration: none; }
.popular-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =============================================
   갤러리 뷰
   ============================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.gallery-card {
    display: block;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.1s;
    overflow: hidden;
}
.gallery-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
}
.gallery-card-body {
    padding: 14px;
}
.gallery-card-title {
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-card-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* 뷰 토글 버튼 */
.view-toggle-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.view-toggle-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.view-toggle-btn:hover:not(.active) {
    background: #e2e8f0;
}

/* =============================================
   프로필 / 회원등급
   ============================================= */
.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}
.profile-avatar-lg {
    width: 80px !important;
    height: 80px !important;
    font-size: 2rem !important;
}
.profile-header-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.grade-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 4px;
}
.author-card {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.author-card:hover {
    background: #f1f5f9;
    text-decoration: none;
    color: inherit;
}

/* =============================================
   북마크 버튼
   ============================================= */
.share-bookmark {
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1rem;
    transition: all 0.2s;
}
.share-bookmark.bookmarked {
    background: #fef3c7;
    color: #f59e0b;
}
.share-bookmark:hover {
    background: #fef3c7;
    color: #f59e0b;
}

/* =============================================
   중고거래 게시판
   ============================================= */
.trade-status-tabs {
    display: flex;
    gap: 4px;
}
.trade-tab {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.15s;
    border: 1px solid #e2e8f0;
}
.trade-tab:hover { text-decoration: none; background: #e2e8f0; }
.trade-tab.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.trade-tab.selling.active { background: #198754; border-color: #198754; }
.trade-tab.reserved.active { background: #fd7e14; border-color: #fd7e14; }
.trade-tab.sold.active { background: #6c757d; border-color: #6c757d; }

.trade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.trade-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.1s;
    color: inherit;
}
.trade-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.trade-card.sold-out { opacity: 0.6; }
.trade-card-img {
    position: relative;
    height: 160px;
    background: #f1f5f9;
    overflow: hidden;
}
.trade-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.trade-no-img {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #cbd5e1;
}
.trade-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}
.trade-card-body {
    padding: 12px;
}
.trade-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trade-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: #6366f1;
    margin-bottom: 4px;
}
.trade-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
}
.trade-price-lg {
    font-size: 1.6rem;
    font-weight: 800;
    color: #6366f1;
}
.trade-main-img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
}
.trade-thumb-row {
    display: flex;
    gap: 8px;
}
.trade-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    border: 2px solid #e2e8f0;
    transition: border-color 0.15s;
}
.trade-thumb:hover { border-color: #6366f1; }
.trade-no-img-lg {
    height: 240px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #cbd5e1;
}
.trade-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
}
.trade-filter-bar {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* =============================================
   쪽지(DM)
   ============================================= */
.message-row {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.message-row:hover { background: #f8fafc; }
.message-row.unread { background: #eff6ff; border-left: 3px solid #6366f1; }
.msg-new-badge {
    background: #6366f1; color: #fff;
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 6px; border-radius: 8px;
}
.msg-subject {
    font-size: 0.92rem; font-weight: 500;
    color: #1e293b; text-decoration: none;
}
.msg-subject:hover { color: #6366f1; }
.msg-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }

/* =============================================
   이미지 갤러리
   ============================================= */
.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.gallery-photo-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.15s, transform 0.1s;
}
.gallery-photo-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}
.gallery-photo-wrap {
    position: relative;
    padding-top: 75%; /* 4:3 비율 */
    overflow: hidden;
    background: #f1f5f9;
}
.gallery-photo-wrap img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery-photo-card:hover .gallery-photo-wrap img {
    transform: scale(1.05);
}
.gallery-photo-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    color: #fff;
    padding: 20px 12px 10px;
    opacity: 0;
    transition: opacity 0.2s;
}
.gallery-photo-card:hover .gallery-photo-overlay { opacity: 1; }
.gallery-photo-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 4px; }
.gallery-photo-stats { font-size: 0.75rem; display: flex; gap: 10px; }
.gallery-photo-author {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #475569;
    border-top: 1px solid #f1f5f9;
}
.gallery-detail-img-wrap {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 560px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.gallery-detail-img {
    max-width: 100%;
    max-height: 560px;
    object-fit: contain;
}
.gallery-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 1rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}
.gallery-like-btn.liked { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }
.gallery-like-btn:hover:not(.liked) { background: #ffe4e6; color: #f87171; }

/* =============================================
   중고거래 댓글
   ============================================= */
.trade-quick-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.trade-quick-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}
.trade-quick-btn:hover { background: #ede9fe; border-color: #a5b4fc; color: #6366f1; }
.trade-comment-list { display: flex; flex-direction: column; gap: 4px; }
.trade-comment-item {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}
.trade-comment-item:hover { background: #f1f5f9; }

/* =============================================
   다크모드 추가 스타일
   ============================================= */
body.dark-mode #author-popup { background:#1e293b; border-color:#334155; }
body.dark-mode #author-popup a { color:#e2e8f0 !important; }
body.dark-mode #author-popup-name { color:#64748b; border-color:#334155; }
body.dark-mode .message-row { border-color: #334155; }
body.dark-mode .message-row:hover { background: #0f172a; }
body.dark-mode .message-row.unread { background: #1e3a5f; }
body.dark-mode .msg-subject { color: #e2e8f0; }
body.dark-mode .gallery-photo-card { background: #1e293b; box-shadow: none; }
body.dark-mode .gallery-photo-author { border-color: #334155; color: #94a3b8; }
body.dark-mode .trade-comment-item { background: #1e293b; border-color: #334155; }
body.dark-mode .trade-comment-item:hover { background: #0f172a; }
body.dark-mode .trade-quick-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-mode .popular-section { background: #1e293b; }
body.dark-mode .popular-item:hover { background: #0f172a; }
body.dark-mode .popular-title { color: #e2e8f0; }
body.dark-mode .gallery-card { background: #1e293b; border-color: #334155; }
body.dark-mode .gallery-card-title { color: #e2e8f0; }
body.dark-mode .profile-header-card { background: #1e293b; }
body.dark-mode .author-card { background: #0f172a; }
body.dark-mode .author-card:hover { background: #1e293b; }
body.dark-mode .trade-card { background: #1e293b; border-color: #334155; }
body.dark-mode .trade-card-title { color: #e2e8f0; }
body.dark-mode .trade-card-img { background: #0f172a; }
body.dark-mode .trade-no-img-lg { background: #0f172a; }
body.dark-mode .trade-filter-bar { background: #1e293b; }
body.dark-mode .trade-content { color: #e2e8f0; }

/* =============================================
   모바일 반응형 (768px 이하)
   ============================================= */
@media (max-width: 768px) {

    /* 배너: 2열로 변경 */
    .banner-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
    .banner-slot {
        width: 100%;
        height: 40px;
    }
    .banner-slot img {
        width: 100%;
        height: 40px;
        object-fit: cover;
    }

    /* 카테고리 바: 가로 스크롤 */
    .category-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-bar::-webkit-scrollbar {
        display: none;
    }
    .category-bar-item {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* 게시판 툴바: 세로 정렬 */
    .board-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .board-toolbar .input-group {
        width: 100% !important;
    }

    /* 게시판 테이블: 불필요한 컬럼 숨기기 */
    .board-table .td-num,
    .board-table .td-view,
    .board-table .td-author,
    .board-table .td-reply {
        display: none;
    }
    .board-table thead th:nth-child(1),
    .board-table thead th:nth-child(3),
    .board-table thead th:nth-child(5),
    .board-table thead th:nth-child(7) {
        display: none;
    }
    .board-table tbody td:nth-child(1),
    .board-table tbody td:nth-child(3),
    .board-table tbody td:nth-child(5),
    .board-table tbody td:nth-child(7) {
        display: none;
    }
    .board-table {
        font-size: 0.82rem;
    }
    .board-table tbody td {
        padding: 10px 8px;
    }

    /* 질문 등록 버튼: 전체 너비 */
    .btn-write {
        display: block;
        text-align: center;
    }

    /* 게시글 이미지: 100% 너비 */
    .editor-preview img,
    .editor-preview-side img,
    .card-text img {
        max-width: 100%;
        max-height: none;
    }

    /* 컨테이너 패딩 축소 */
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* 페이징 버튼 크기 축소 */
    .pagination .page-link {
        padding: 5px 9px;
        font-size: 0.8rem;
    }
}
