/* ═══════════════════════════════════════════════
   MoonTree - Windows 탐색기 스타일 홈페이지
   ═══════════════════════════════════════════════ */

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

:root {
    /* 색상 팔레트 */
    --bg-primary: #0a0f16;
    --bg-secondary: #111821;
    --bg-tertiary: #182230;
    --bg-hover: #202b39;
    --bg-active: #1f6feb22;

    --border-color: #30363d;
    --border-active: #1f6feb;

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --danger: #f85149;
    --danger-hover: #ff6e6a;
    --success: #3fb950;
    --warning: #d29922;

    --like-color: #f85149;
    --like-active: #ff6e6a;

    /* 레이아웃 */
    --header-height: 44px;
    --tree-width: 268px;
    --resize-width: 4px;

    /* 폰트 */
    --font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;

    /* 그림자 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    /* 트랜지션 */
    --transition: 0.2s ease;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    color-scheme: dark;
}

/* ── 헤더 ── */
#app-header {
    height: var(--header-height);
    background: linear-gradient(90deg, #111821 0%, #131c28 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 100;
}

.header-left .logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-btn {
    padding: 5px 11px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-family);
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* ── 메인 레이아웃 ── */
#app-main {
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* ── 좌측 트리 패널 ── */
#tree-panel {
    width: var(--tree-width);
    min-width: 200px;
    max-width: 500px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

#tree-container {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

/* 트리 스크롤바 */
#tree-container::-webkit-scrollbar {
    width: 6px;
}
#tree-container::-webkit-scrollbar-track {
    background: transparent;
}
#tree-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
#tree-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── 트리 아이템 ── */
.tree-category {
    user-select: none;
}

.category-header {
    display: flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px 0 12px;
    cursor: pointer;
    transition: background var(--transition);
    gap: 6px;
}

.category-header:hover {
    background: var(--bg-hover);
}

.category-header.active {
    background: var(--bg-active);
    color: var(--accent);
}

.category-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform var(--transition);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.category-arrow.open {
    transform: rotate(90deg);
}

.category-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.category-name {
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.category-header:hover .category-actions {
    opacity: 1;
}

.tree-action-btn {
    width: auto;
    min-width: 18px;
    height: 18px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    padding: 0 2px;
    font-size: 0.68rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.tree-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tree-action-btn.delete:hover {
    color: var(--danger);
}

.category-branch {
    display: none;
}

.category-branch.open {
    display: block;
}

.tree-level-2 > .category-header {
    padding-left: 28px;
}

.tree-level-2 > .category-branch > .post-item {
    padding-left: 52px;
}

.tree-level-1 > .category-branch > .post-item {
    padding-left: 30px;
}

.tree-category.is-private > .category-header .category-name {
    color: #c6b8ff;
}

.post-item {
    display: flex;
    align-items: center;
    min-height: 20px;
    padding: 0 10px 0 28px;
    cursor: pointer;
    transition: background var(--transition);
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
}

.post-item:hover {
    background: var(--bg-hover);
}

.post-item.active {
    background: var(--bg-active);
    color: var(--accent);
}

.post-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.post-name {
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-item .tree-action-btn {
    opacity: 0;
}

.post-item:hover .tree-action-btn {
    opacity: 1;
}

/* ── 하단 상태바 ── */
#status-bar {
    padding: 6px 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── 리사이즈 핸들 ── */
#resize-handle {
    width: var(--resize-width);
    background: var(--border-color);
    cursor: col-resize;
    transition: background var(--transition);
    flex-shrink: 0;
}

#resize-handle:hover,
#resize-handle.active {
    background: var(--accent);
}

/* ── 우측 콘텐츠 패널 ── */
#content-panel {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--bg-primary);
}

#content-panel::-webkit-scrollbar {
    width: 8px;
}
#content-panel::-webkit-scrollbar-track {
    background: transparent;
}
#content-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* ── 대시보드 ── */
#dashboard {
    padding: 34px 28px;
    max-width: 920px;
    margin: 0 auto;
}

.dashboard-welcome {
    text-align: center;
    margin-bottom: 28px;
}

.dashboard-welcome h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.dashboard-welcome p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 1.35rem;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dashboard-content {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.9fr);
    gap: 12px;
    margin-top: 14px;
}

.dashboard-section {
    min-width: 0;
    padding: 13px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.dashboard-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-section-header h2 {
    font-size: 14px;
    font-weight: 700;
}

.dashboard-section-header span {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.dashboard-post-list {
    display: grid;
    gap: 2px;
}

.dashboard-post-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.dashboard-post-link.has-rank {
    grid-template-columns: 24px minmax(0, 1fr) auto;
}

.dashboard-post-link:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.dashboard-rank {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.dashboard-post-copy {
    min-width: 0;
}

.dashboard-post-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-post-path {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-post-meta {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.dashboard-private {
    margin-right: 4px;
    color: #c6b8ff;
}

.dashboard-empty {
    padding: 22px 8px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* ── 게시글 본문 ── */
#post-view {
    max-width: 980px;
    margin: 0 auto;
    padding: 26px 32px 40px;
}

.post-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.post-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.meta-badge {
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent);
}

.meta-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

.post-body h1, .post-body h2, .post-body h3 {
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.post-body p {
    margin-bottom: 4px;
}

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

.post-body li {
    margin-bottom: 6px;
}

.post-body a {
    color: var(--accent);
    text-decoration: none;
}
.post-body a:hover {
    text-decoration: underline;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.post-body pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
}

.post-body code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-body pre code {
    background: transparent;
    padding: 0;
}

.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 16px;
    margin: 12px 0;
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

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

.post-body th, .post-body td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-body th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.post-body iframe {
    max-width: 100%;
    margin: 12px 0;
    border-radius: 8px;
}

/* 게시글 하단 */
.post-footer {
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.stat-item {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.like-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    font-family: var(--font-family);
}

.like-btn:hover {
    border-color: var(--like-color);
    color: var(--like-color);
    background: rgba(248, 81, 73, 0.1);
}

.like-btn.liked {
    border-color: var(--like-color);
    color: var(--like-color);
    background: rgba(248, 81, 73, 0.15);
}

.post-actions {
    display: flex;
    gap: 8px;
}

/* ── 댓글 ── */
#comments-section {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.comments-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

#comment-count {
    color: var(--accent);
}

.comments-guide,
.comment-char-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

#comment-form {
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

#comment-content {
    display: block;
    width: 100%;
    min-height: 70px;
    max-height: 180px;
    resize: vertical;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    line-height: 1.55;
}

#comment-content::placeholder {
    color: var(--text-muted);
}

.comment-form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.comment-submit-btn,
.comment-load-more {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
}

.comment-submit-btn {
    padding: 6px 14px;
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.comment-submit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.comment-submit-btn:disabled,
.comment-load-more:disabled {
    cursor: wait;
    opacity: 0.65;
}

.comment-item {
    padding: 12px 2px;
    border-bottom: 1px solid var(--border-color);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.comment-author {
    color: var(--text-secondary);
    font-weight: 600;
}

.comment-delete-btn {
    margin-left: auto;
    padding: 2px 7px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.72rem;
    cursor: pointer;
}

.comment-delete-btn:hover {
    background: rgba(248, 81, 73, 0.12);
    color: var(--danger);
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-empty {
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

.comment-load-more {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
}

.comment-load-more:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-hover);
}

.comment-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 액션 버튼 ── */
.action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-family);
}

.action-btn.edit {
    background: var(--bg-tertiary);
    color: var(--accent);
    border-color: var(--accent);
}
.action-btn.edit:hover {
    background: rgba(31, 111, 235, 0.15);
}

.action-btn.delete {
    background: var(--bg-tertiary);
    color: var(--danger);
    border-color: var(--danger);
}
.action-btn.delete:hover {
    background: rgba(248, 81, 73, 0.15);
}

.action-btn.save {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.action-btn.save:hover {
    background: var(--accent-hover);
}

.action-btn.cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
.action-btn.cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── 에디터 ── */
#post-editor {
    max-width: 980px;
    margin: 0 auto;
    padding: 26px 32px 40px;
}

.editor-header {
    margin-bottom: 16px;
}

.editor-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row select,
.form-row input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition);
}

.form-row select:focus,
.form-row input[type="text"]:focus {
    border-color: var(--accent);
}

.editor-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Summernote 다크 모드 오버라이드 */
.note-editor.note-frame {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.note-toolbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.note-btn:not(.note-color-btn) {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.note-btn:not(.note-color-btn):hover {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.note-editing-area .note-editable {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    min-height: 300px;
}

.note-statusbar {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color) !important;
}

.note-status-output {
    color: var(--text-muted) !important;
}

/* ── 빈 카테고리 ── */
.empty-message {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.empty-message p {
    font-size: 1rem;
}

/* ── 로그인 모달 ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box h3 {
    font-size: 1.2rem;
    margin-bottom: 24px;
    text-align: center;
}

.modal-box input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 16px;
    outline: none;
    font-family: var(--font-family);
}

.modal-box input[type="password"]:focus {
    border-color: var(--accent);
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition);
    font-family: var(--font-family);
}

.modal-btn:hover {
    background: var(--accent-hover);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-error {
    margin-top: 12px;
    padding: 10px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 6px;
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
}

/* ── 토스트 알림 ── */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fff;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease-out;
    max-width: 320px;
}

.toast.success {
    background: linear-gradient(135deg, #2ea043, #3fb950);
}

.toast.error {
    background: linear-gradient(135deg, #da3633, #f85149);
}

.toast.info {
    background: linear-gradient(135deg, #1f6feb, #58a6ff);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ── 모바일 대응 ── */
@media (max-width: 768px) {
    #app-main {
        flex-direction: column;
    }

    #tree-panel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        max-height: 34vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    #resize-handle {
        display: none;
    }

    #content-panel {
        flex: 1;
    }

    #post-view,
    #post-editor {
        padding: 16px;
    }

    #dashboard {
        padding: 22px 16px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .post-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .category-actions {
        opacity: 1;
    }

    #comments-section {
        margin-top: 22px;
        padding-top: 18px;
    }
}
