/* notes/notes.css — 笔记页面专用样式 */

/* 文件夹卡片 */
.folder-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 笔记列表卡片 */
.note-card {
    transition: all 0.2s ease;
    cursor: pointer;
}
.note-card:hover {
    border-color: #6366f1;
    background: #fafafe;
}

/* 笔记内容区 */
.note-viewer {
    animation: panelIn 0.3s ease forwards;
}

/* 笔记标签 */
.note-tag {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #eef2ff;
    color: #4338ca;
}

/* Markdown 渲染 */
.prose h1 { font-size: 1.75rem; font-weight: 700; margin: 1.5rem 0 1rem; color: #1e293b; }
.prose h2 { font-size: 1.4rem; font-weight: 700; margin: 1.25rem 0 0.75rem; color: #334155; }
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #475569; }
.prose p  { margin: 0.5rem 0; line-height: 1.7; color: #475569; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin: 0.5rem 0; }
.prose li { margin: 0.25rem 0; color: #475569; line-height: 1.6; }
.prose a  { color: #6366f1; text-decoration: underline; text-underline-offset: 2px; }
.prose strong { font-weight: 600; color: #1e293b; }
.prose code {
    background: #f1f5f9; padding: 0.15rem 0.4rem; border-radius: 4px;
    font-size: 0.875rem; color: #e11d48;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.prose pre {
    background: #1e293b; color: #e2e8f0;
    padding: 1rem 1.25rem; border-radius: 8px;
    overflow-x: auto; margin: 1rem 0;
    font-size: 0.875rem; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote {
    border-left: 4px solid #6366f1; padding: 0.75rem 1rem; margin: 1rem 0;
    background: #eef2ff; border-radius: 0 8px 8px 0; color: #4338ca;
}
.prose blockquote p { color: #4338ca; }
.prose hr {
    border: none; height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e1, transparent);
    margin: 1.5rem 0;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.prose th, .prose td { border: 1px solid #e2e8f0; padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: #f8fafc; font-weight: 600; color: #334155; }
.prose tr:nth-child(even) { background: #f8fafc; }

/* 导航栏（与主站一致） */
.nav-glass {
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.85);
}
.note-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.25s ease;
}
.note-tab:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }
.note-tab.active { color: #fff; background: rgba(99,102,241,0.2); }

/* 移动端菜单 */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.mobile-menu.open { max-height: 400px; }
.mobile-link {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    transition: all 0.2s ease;
}
.mobile-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.mobile-link.active { color: #fff; background: rgba(99,102,241,0.2); }

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    transition: all 0.2s ease;
}
.back-btn:hover { color: #334155; background: #e2e8f0; }

/* 淡入 */
@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==================== 管理界面 ==================== */

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
.modal-box {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}
.modal-overlay.open .modal-box {
    transform: translateY(0);
}

/* 管理员按钮 */
.admin-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.admin-btn-primary {
    background: #4f46e5;
    color: #fff;
}
.admin-btn-primary:hover { background: #4338ca; }
.admin-btn-success {
    background: #059669;
    color: #fff;
}
.admin-btn-success:hover { background: #047857; }
.admin-btn-danger {
    background: #fee2e2;
    color: #dc2626;
}
.admin-btn-danger:hover { background: #fecaca; }
.admin-btn-ghost {
    background: #f1f5f9;
    color: #475569;
}
.admin-btn-ghost:hover { background: #e2e8f0; }

/* 编辑器 */
.editor-area {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    resize: vertical;
    min-height: 350px;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    outline: none;
    width: 100%;
    tab-size: 4;
}
.editor-area:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

/* 编辑器预览 */
.editor-preview {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 350px;
    overflow-y: auto;
    background: #fafafa;
}

/* 管理员状态指示 */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #dcfce7;
    color: #166534;
}

/* 工具栏 */
.note-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 登录表单 */
.login-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.login-input:focus { border-color: #6366f1; }

/* 标签过滤芯片 */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.tag-chip:hover { background: #eef2ff; color: #4338ca; }
.tag-chip.active { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.tag-chip .count {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-left: 0.15rem;
}

/* 搜索结果高亮 */
.search-highlight {
    background: #fef08a;
    padding: 0.05rem 0.15rem;
    border-radius: 2px;
}

/* 相关笔记链接 */
.related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}
.related-link:hover {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}
