:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}
* { box-sizing: border-box; }
body { background: var(--gray-50); font-family: -apple-system, 'Segoe UI', sans-serif; color: var(--gray-900); margin: 0; }

/* ── 사이드바 ── */
.sidebar {
    position: fixed; top: 0; left: 0; width: 220px; height: 100vh;
    background: var(--gray-900); color: #fff; z-index: 100;
    display: flex; flex-direction: column;
}
.sidebar-brand {
    padding: 20px; font-size: 1.1rem; font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand i { color: var(--primary); }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: rgba(255,255,255,.6);
    text-decoration: none; font-size: .9rem; transition: all .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav a.active { border-left: 3px solid var(--primary); }
.sidebar-nav a i { width: 18px; text-align: center; }

/* ── 메인 ── */
.main-content { margin-left: 220px; padding: 24px 28px; min-height: 100vh; }
.main-content.full { padding: 0; }

/* ── 카테고리 칩 ── */
.tp-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600;
    border: 1.5px solid var(--gray-200); background: #fff; cursor: pointer; transition: all .15s;
}
.tp-chip:hover { border-color: var(--primary); }
.tp-chip.active { color: #fff !important; border-color: transparent !important; }
.tp-chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── 지도 ── */
.tp-map-wrap { position: relative; height: calc(100vh - 72px); }
#tpMap { width: 100%; height: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--gray-200); }

/* ── FAB ── */
.tp-fab {
    position: absolute; bottom: 24px; right: 24px; z-index: 50;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    font-size: 1.4rem; box-shadow: 0 4px 14px rgba(37,99,235,.4);
    cursor: pointer; transition: transform .15s;
}
.tp-fab:hover { transform: scale(1.08); }

/* ── 피드 사이드바 ── */
.tp-feed {
    position: absolute; top: 0; right: -320px; width: 310px; height: 100%;
    background: #fff; border-left: 1px solid var(--gray-200); border-radius: 0 10px 10px 0;
    transition: right .25s ease; z-index: 40; display: flex; flex-direction: column;
}
.tp-feed.open { right: 0; }
.tp-feed-header {
    padding: 14px 16px; border-bottom: 1px solid var(--gray-200);
    font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 8px;
}
.tp-feed-header .live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
    animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.tp-feed-body { flex: 1; overflow-y: auto; padding: 0; }
.tp-feed-item {
    padding: 10px 16px; cursor: pointer; transition: background .1s;
    border-bottom: 1px solid var(--gray-100);
}
.tp-feed-item:hover { background: var(--gray-50); }
.tp-feed-item .fi-nick { font-weight: 600; font-size: .8rem; }
.tp-feed-item .fi-content {
    font-size: .82rem; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
.tp-feed-item .fi-meta { font-size: .72rem; color: var(--gray-500); margin-top: 3px; display: flex; gap: 8px; }
.tp-feed-toggle {
    position: absolute; top: 12px; right: 12px; z-index: 45;
    padding: 7px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--gray-200);
    font-size: .8rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

/* ── 위치 선택 오버레이 ── */
.tp-pick-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.35); z-index: 60;
    display: flex; align-items: center; justify-content: center;
}
.tp-pick-msg {
    background: #fff; padding: 20px 30px; border-radius: 12px;
    text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.tp-pick-msg h5 { font-weight: 700; margin-bottom: 6px; }
.tp-pick-msg p { color: var(--gray-500); font-size: .85rem; margin-bottom: 12px; }

/* ── 모달 카테고리 칩 ── */
.tp-cat-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tp-cat-chip {
    padding: 5px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600;
    border: 1.5px solid var(--gray-200); background: #fff; cursor: pointer; transition: all .15s;
}
.tp-cat-chip.selected { color: #fff !important; border-color: transparent !important; }
.tp-img-preview { max-width: 200px; max-height: 150px; border-radius: 8px; margin-top: 8px; display: block; }

/* ── 상세 페이지 ── */
.tp-detail { max-width: 680px; margin: 0 auto; }
.tp-detail-card {
    background: #fff; border-radius: 10px; border: 1px solid var(--gray-200);
    overflow: hidden; margin-bottom: 16px;
}
.tp-detail-map { width: 100%; height: 250px; }
.tp-detail-body { padding: 20px; }
.tp-detail-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tp-detail-cat { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .75rem; font-weight: 600; color: #fff; }
.tp-detail-nick { font-weight: 700; font-size: 1rem; }
.tp-detail-time { font-size: .78rem; color: var(--gray-500); margin-left: auto; }
.tp-detail-content { font-size: .92rem; line-height: 1.6; margin-bottom: 12px; white-space: pre-wrap; }
.tp-detail-img { max-width: 100%; border-radius: 8px; margin-bottom: 12px; }
.tp-detail-meta { display: flex; gap: 12px; font-size: .8rem; color: var(--gray-500); }
.tp-detail-expire { color: var(--danger); font-weight: 600; }

/* ── 댓글 ── */
.tp-comments { padding: 16px 20px; }
.tp-comments h6 { font-weight: 700; font-size: .9rem; margin-bottom: 12px; }
.tp-comment { padding: 10px 0; border-bottom: 1px solid var(--gray-100); display: flex; gap: 10px; }
.tp-comment:last-child { border-bottom: none; }
.tp-comment-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: var(--gray-500); flex-shrink: 0;
}
.tp-comment-body { flex: 1; }
.tp-comment-nick { font-weight: 600; font-size: .82rem; }
.tp-comment-text { font-size: .85rem; margin-top: 2px; }
.tp-comment-meta { font-size: .72rem; color: var(--gray-500); margin-top: 3px; display: flex; gap: 8px; }
.tp-comment-del { cursor: pointer; color: var(--danger); }
.tp-comment-del:hover { text-decoration: underline; }
.tp-comment-form { display: flex; gap: 8px; margin-top: 12px; }
.tp-comment-form input { flex: 0 0 100px; }
.tp-comment-form textarea { flex: 1; resize: none; }

/* ── 나의 핀 ── */
.tp-my { max-width: 800px; }
.tp-my-search {
    background: #fff; border-radius: 10px; border: 1px solid var(--gray-200);
    padding: 20px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center;
}
.tp-my-table {
    background: #fff; border-radius: 10px; border: 1px solid var(--gray-200); overflow: hidden;
}
.tp-my-table table { margin: 0; }
.tp-my-table th {
    background: var(--gray-50); font-size: .78rem; font-weight: 600;
    color: var(--gray-500); border-bottom: 2px solid var(--gray-200); white-space: nowrap;
}
.tp-my-table td { font-size: .85rem; vertical-align: middle; }
.tp-my-table tbody tr:hover { background: #eff6ff; }
.tp-my-empty { text-align: center; padding: 40px; color: var(--gray-500); }
.tp-my-pagination { display: flex; justify-content: center; margin-top: 16px; }

.st-active { color: var(--success); font-weight: 600; }
.st-expired { color: var(--gray-500); }
.st-deleted { color: var(--danger); }

/* ── 반응형 ── */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-brand span, .sidebar-nav a span { display: none; }
    .main-content { margin-left: 60px; padding: 16px; }
    .main-content.full { margin-left: 60px; }
    .tp-feed { width: 100%; right: -100%; }
    .tp-feed.open { right: 0; }
    .tp-fab { bottom: 16px; right: 16px; }
}
