ObsiGate/frontend/style.css

1201 lines
22 KiB
CSS

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');
/* ===== RESET ===== */
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* ===== THEME — DARK (default) ===== */
:root[data-theme="dark"] {
--bg-primary: #0f1117;
--bg-secondary: #161b22;
--bg-sidebar: #13161d;
--bg-hover: #1f2430;
--border: #21262d;
--text-primary: #e6edf3;
--text-secondary: #8b949e;
--text-muted: #484f58;
--accent: #58a6ff;
--accent-green: #3fb950;
--tag-bg: #1f2a3a;
--tag-text: #79c0ff;
--code-bg: #161b22;
--search-bg: #21262d;
--scrollbar: #30363d;
--resize-handle: #30363d;
--overlay-bg: rgba(0,0,0,0.5);
}
/* ===== THEME — LIGHT ===== */
:root[data-theme="light"] {
--bg-primary: #ffffff;
--bg-secondary: #f6f8fa;
--bg-sidebar: #f0f2f5;
--bg-hover: #e8ecf0;
--border: #d0d7de;
--text-primary: #1f2328;
--text-secondary: #57606a;
--text-muted: #9198a1;
--accent: #0969da;
--accent-green: #1a7f37;
--tag-bg: #ddf4ff;
--tag-text: #0969da;
--code-bg: #f6f8fa;
--search-bg: #ffffff;
--scrollbar: #d0d7de;
--resize-handle: #d0d7de;
--overlay-bg: rgba(0,0,0,0.3);
}
/* ===== BASE ===== */
html {
font-size: 16px;
scroll-behavior: smooth;
}
body {
font-family: 'Lora', Georgia, serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.7;
transition: background 200ms ease, color 200ms ease;
overflow: hidden;
height: 100vh;
}
a {
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* ===== LAYOUT ===== */
.app-container {
display: flex;
flex-direction: column;
height: 100vh;
}
/* --- Header --- */
.header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 20px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
z-index: 100;
transition: background 200ms ease;
}
.header-left {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
min-width: 0;
}
.header-center {
display: flex;
justify-content: center;
flex: 2;
max-width: 600px;
}
.header-right {
display: flex;
justify-content: flex-end;
flex: 1;
min-width: 0;
}
.hamburger-btn {
display: none;
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 4px;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.hamburger-btn:hover {
color: var(--accent);
}
.header-logo {
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
font-size: 1.15rem;
color: var(--accent);
white-space: nowrap;
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
transition: opacity 200ms ease;
text-decoration: none;
}
.header-logo:hover {
opacity: 0.8;
text-decoration: none;
}
.search-wrapper {
width: 100%;
max-width: 520px;
position: relative;
}
.search-wrapper input {
width: 100%;
padding: 8px 14px 8px 38px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--search-bg);
color: var(--text-primary);
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
outline: none;
transition: border-color 200ms ease, background 200ms ease;
}
.search-wrapper input:focus {
border-color: var(--accent);
}
.search-wrapper .search-icon {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: var(--text-muted);
pointer-events: none;
}
.active-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 8px;
min-height: 0;
}
.active-tag {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 8px;
background: var(--tag-bg);
color: var(--tag-text);
border-radius: 4px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.75rem;
cursor: pointer;
transition: opacity 150ms ease;
}
.active-tag:hover {
opacity: 0.7;
}
.active-tag .remove-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 14px;
height: 14px;
}
.header-menu {
position: relative;
}
.header-menu-btn {
background: none;
border: 1px solid var(--border);
border-radius: 8px;
padding: 6px 10px;
cursor: pointer;
color: var(--text-secondary);
display: flex;
align-items: center;
transition: color 200ms ease, border-color 200ms ease;
}
.header-menu-btn:hover {
color: var(--accent);
border-color: var(--accent);
}
.header-menu-btn.active {
color: var(--accent);
border-color: var(--accent);
background: var(--tag-bg);
}
.header-menu-dropdown {
display: none;
position: absolute;
top: calc(100% + 8px);
right: 0;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0,0,0,0.3);
min-width: 220px;
z-index: 100;
padding: 8px;
}
.header-menu-dropdown.active {
display: block;
}
.menu-section {
padding: 8px;
}
.menu-label {
font-family: 'JetBrains Mono', monospace;
font-size: 0.7rem;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 6px;
font-weight: 600;
}
.menu-select {
width: 100%;
padding: 6px 10px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--search-bg);
color: var(--text-primary);
font-family: 'JetBrains Mono', monospace;
font-size: 0.8rem;
outline: none;
cursor: pointer;
transition: border-color 200ms ease;
}
.menu-select:hover, .menu-select:focus {
border-color: var(--accent);
}
.menu-divider {
height: 1px;
background: var(--border);
margin: 4px 0;
}
.menu-theme-btn {
width: 100%;
background: none;
border: 1px solid var(--border);
border-radius: 6px;
padding: 8px 12px;
cursor: pointer;
color: var(--text-primary);
display: flex;
align-items: center;
gap: 8px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.8rem;
transition: all 200ms ease;
}
.menu-theme-btn:hover {
background: var(--bg-hover);
border-color: var(--accent);
color: var(--accent);
}
/* --- Main body --- */
.main-body {
display: flex;
flex: 1;
overflow: hidden;
position: relative;
}
/* --- Mobile overlay --- */
.sidebar-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--overlay-bg);
z-index: 199;
}
.sidebar-overlay.active {
display: block;
}
/* --- Sidebar --- */
.sidebar {
width: 280px;
min-width: 200px;
max-width: 500px;
background: var(--bg-sidebar);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
transition: background 200ms ease;
flex-shrink: 0;
}
/* --- Sidebar filter --- */
.sidebar-filter {
padding: 10px 12px;
border-bottom: 1px solid var(--border);
position: relative;
flex-shrink: 0;
}
.sidebar-filter input {
width: 100%;
padding: 6px 10px 6px 32px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--search-bg);
color: var(--text-primary);
font-family: 'JetBrains Mono', monospace;
font-size: 0.78rem;
outline: none;
transition: border-color 200ms ease;
}
.sidebar-filter input:focus {
border-color: var(--accent);
}
.sidebar-filter-icon {
position: absolute;
left: 22px;
top: 50%;
transform: translateY(-50%);
color: var(--text-muted);
pointer-events: none;
}
.sidebar-tree {
flex: 1;
overflow-y: auto;
padding: 12px 0;
min-height: 80px;
}
.sidebar-tree::-webkit-scrollbar {
width: 6px;
}
.sidebar-tree::-webkit-scrollbar-thumb {
background: var(--scrollbar);
border-radius: 3px;
}
.sidebar-section-title {
font-family: 'JetBrains Mono', monospace;
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
padding: 8px 16px 4px;
}
.tree-item {
display: flex;
align-items: center;
gap: 6px;
padding: 5px 16px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.82rem;
color: var(--text-secondary);
cursor: pointer;
border-radius: 0;
transition: background 120ms ease, color 120ms ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tree-item:hover {
background: var(--bg-hover);
color: var(--text-primary);
}
.tree-item.active {
background: var(--bg-hover);
color: var(--accent);
}
.tree-item.filtered-out {
display: none;
}
.tree-item .icon {
width: 16px;
height: 16px;
flex-shrink: 0;
color: var(--text-muted);
}
.tree-item.active .icon {
color: var(--accent);
}
.tree-item.vault-item .icon {
color: var(--accent-green);
}
.tree-children {
padding-left: 16px;
}
.tree-children.collapsed {
display: none;
}
.tree-children.filtered-out {
display: none;
}
/* --- Tag resize handle --- */
.tag-resize-handle {
height: 5px;
cursor: ns-resize;
background: transparent;
border-top: 1px solid var(--border);
flex-shrink: 0;
transition: background 150ms ease;
}
.tag-resize-handle:hover,
.tag-resize-handle.active {
background: var(--accent);
opacity: 0.5;
}
/* --- Tag Cloud --- */
.tag-cloud-section {
padding: 12px 16px;
height: 180px;
min-height: 60px;
max-height: 400px;
overflow-y: auto;
flex-shrink: 0;
}
.tag-cloud-section::-webkit-scrollbar {
width: 6px;
}
.tag-cloud-section::-webkit-scrollbar-thumb {
background: var(--scrollbar);
border-radius: 3px;
}
.tag-cloud-title {
font-family: 'JetBrains Mono', monospace;
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
margin-bottom: 8px;
}
.tag-cloud {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.tag-item {
display: inline-block;
padding: 2px 8px;
background: var(--tag-bg);
color: var(--tag-text);
border-radius: 4px;
font-family: 'JetBrains Mono', monospace;
cursor: pointer;
transition: opacity 150ms ease;
line-height: 1.4;
}
.tag-item:hover {
opacity: 0.8;
}
.tag-item.filtered-out {
display: none;
}
/* --- Sidebar resize handle (horizontal) --- */
.sidebar-resize-handle {
width: 5px;
cursor: ew-resize;
background: transparent;
flex-shrink: 0;
transition: background 150ms ease;
z-index: 10;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.active {
background: var(--accent);
opacity: 0.5;
}
/* --- Content Area --- */
.content-area {
flex: 1;
overflow-y: auto;
padding: clamp(16px, 3vw, 40px) clamp(16px, 4vw, 40px) 60px;
transition: background 200ms ease;
min-width: 0;
}
.content-area::-webkit-scrollbar {
width: 8px;
}
.content-area::-webkit-scrollbar-thumb {
background: var(--scrollbar);
border-radius: 4px;
}
/* Welcome */
.welcome {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--text-muted);
text-align: center;
gap: 12px;
}
.welcome h2 {
font-family: 'JetBrains Mono', monospace;
font-size: 1.6rem;
color: var(--text-secondary);
}
.welcome p {
font-size: 0.95rem;
max-width: 400px;
}
/* Breadcrumb */
.breadcrumb {
font-family: 'JetBrains Mono', monospace;
font-size: 0.78rem;
color: var(--text-muted);
margin-bottom: 12px;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.breadcrumb span {
cursor: pointer;
color: var(--text-secondary);
transition: color 120ms ease;
}
.breadcrumb span:hover {
color: var(--accent);
}
.breadcrumb .sep {
cursor: default;
color: var(--text-muted);
}
.breadcrumb .sep:hover {
color: var(--text-muted);
}
/* File header */
.file-header {
margin-bottom: 20px;
}
.file-title {
font-family: 'JetBrains Mono', monospace;
font-size: 1.6rem;
font-weight: 700;
margin-bottom: 8px;
}
.file-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 6px;
}
.file-tag {
display: inline-block;
padding: 2px 8px;
background: var(--tag-bg);
color: var(--tag-text);
border-radius: 4px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.75rem;
margin-right: 6px;
margin-bottom: 4px;
cursor: pointer;
transition: opacity 150ms ease, transform 100ms ease;
}
.file-tag:hover {
opacity: 0.8;
transform: translateY(-1px);
}
.file-actions {
margin-top: 8px;
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
}
.btn-action {
font-family: 'JetBrains Mono', monospace;
font-size: 0.75rem;
padding: 4px 10px;
border: 1px solid var(--border);
border-radius: 6px;
background: transparent;
color: var(--text-secondary);
cursor: pointer;
transition: color 150ms ease, border-color 150ms ease;
display: inline-flex;
align-items: center;
gap: 4px;
}
.btn-action:hover {
color: var(--accent);
border-color: var(--accent);
}
.btn-action.active {
color: var(--accent);
border-color: var(--accent);
background: var(--tag-bg);
}
/* Frontmatter collapsible */
.frontmatter-toggle {
font-family: 'JetBrains Mono', monospace;
font-size: 0.78rem;
color: var(--text-muted);
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
margin-bottom: 12px;
user-select: none;
}
.frontmatter-toggle:hover {
color: var(--text-secondary);
}
.frontmatter-content {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px 16px;
margin-bottom: 20px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.8rem;
color: var(--text-secondary);
white-space: pre-wrap;
display: none;
}
.frontmatter-content.open {
display: block;
}
/* --- Raw source view --- */
.raw-source-view {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 16px;
margin-top: 12px;
font-family: 'JetBrains Mono', monospace;
font-size: 0.82rem;
color: var(--text-secondary);
white-space: pre-wrap;
word-break: break-word;
overflow-x: auto;
line-height: 1.55;
max-height: 70vh;
overflow-y: auto;
}
/* --- Markdown Rendered Content --- */
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
margin: 1.4em 0 0.5em;
color: var(--text-primary);
}
.md-content h1 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.md-content h2 { font-size: 1.25rem; }
.md-content h3 { font-size: 1.1rem; }
.md-content p {
margin: 0.6em 0;
}
.md-content ul, .md-content ol {
padding-left: 1.6em;
margin: 0.5em 0;
}
.md-content li {
margin: 0.25em 0;
}
.md-content blockquote {
border-left: 3px solid var(--accent);
padding: 4px 16px;
margin: 0.8em 0;
color: var(--text-secondary);
background: var(--bg-secondary);
border-radius: 0 6px 6px 0;
}
.md-content code {
font-family: 'JetBrains Mono', monospace;
background: var(--code-bg);
padding: 2px 6px;
border-radius: 4px;
font-size: 0.88em;
border: 1px solid var(--border);
}
.md-content pre {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 16px;
overflow-x: auto;
margin: 0.8em 0;
}
.md-content pre code {
background: none;
border: none;
padding: 0;
font-size: 0.85rem;
line-height: 1.55;
}
.md-content table {
width: 100%;
border-collapse: collapse;
margin: 0.8em 0;
font-size: 0.92rem;
}
.md-content th, .md-content td {
border: 1px solid var(--border);
padding: 8px 12px;
text-align: left;
}
.md-content th {
background: var(--bg-secondary);
font-family: 'JetBrains Mono', monospace;
font-weight: 600;
font-size: 0.85rem;
}
.md-content img {
max-width: 100%;
border-radius: 8px;
margin: 0.6em 0;
}
.md-content hr {
border: none;
border-top: 1px solid var(--border);
margin: 1.5em 0;
}
.md-content .task-list-item {
list-style: none;
margin-left: -1.2em;
}
.md-content .task-list-item input[type="checkbox"] {
margin-right: 6px;
}
/* Wikilinks */
.wikilink {
color: var(--accent);
border-bottom: 1px dashed var(--accent);
cursor: pointer;
}
.wikilink:hover {
opacity: 0.8;
}
.wikilink-missing {
color: var(--text-muted);
border-bottom: 1px dashed var(--text-muted);
cursor: default;
}
/* --- Search Results --- */
.search-results {
padding: 0;
}
.search-results-header {
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
color: var(--text-muted);
margin-bottom: 16px;
}
.search-result-item {
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: 8px;
margin-bottom: 10px;
cursor: pointer;
transition: background 120ms ease, border-color 120ms ease;
}
.search-result-item:hover {
background: var(--bg-hover);
border-color: var(--accent);
}
.search-result-title {
font-family: 'JetBrains Mono', monospace;
font-size: 0.92rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 4px;
}
.search-result-vault {
font-family: 'JetBrains Mono', monospace;
font-size: 0.72rem;
color: var(--accent-green);
margin-bottom: 4px;
}
.search-result-snippet {
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.5;
}
.search-result-tags {
margin-top: 6px;
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.search-result-tags .file-tag {
font-size: 0.7rem;
padding: 1px 6px;
}
/* --- Loading indicator --- */
.loading-indicator {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
color: var(--text-muted);
gap: 12px;
}
.loading-spinner {
width: 32px;
height: 32px;
border: 3px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* --- Editor Modal --- */
.editor-modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
background: var(--overlay-bg);
align-items: center;
justify-content: center;
padding: 20px;
}
.editor-modal.active {
display: flex;
}
.editor-container {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 12px;
width: 100%;
max-width: 1200px;
max-height: 90vh;
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.editor-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid var(--border);
background: var(--bg-primary);
flex-shrink: 0;
}
.editor-title {
font-family: 'JetBrains Mono', monospace;
font-size: 0.9rem;
color: var(--text-primary);
font-weight: 600;
}
.editor-actions {
display: flex;
gap: 8px;
}
.editor-btn {
font-family: 'JetBrains Mono', monospace;
font-size: 0.8rem;
padding: 6px 12px;
border: 1px solid var(--border);
border-radius: 6px;
background: transparent;
color: var(--text-secondary);
cursor: pointer;
transition: all 150ms ease;
display: inline-flex;
align-items: center;
gap: 4px;
}
.editor-btn:hover {
color: var(--accent);
border-color: var(--accent);
}
.editor-btn.primary {
background: var(--accent);
color: #ffffff;
border-color: var(--accent);
}
.editor-btn.primary:hover {
opacity: 0.9;
}
.editor-body {
flex: 1;
min-height: 0;
position: relative;
overflow-y: auto;
overflow-x: hidden;
}
.cm-editor {
height: auto;
min-height: 100%;
font-size: 0.9rem;
}
.cm-scroller {
font-family: 'JetBrains Mono', monospace;
overflow-y: auto !important;
overflow-x: auto !important;
height: auto;
min-height: 100%;
max-width: 100%;
}
.fallback-editor {
width: 100%;
min-height: 100%;
height: auto;
border: none;
outline: none;
resize: none;
padding: 16px;
background: var(--code-bg);
color: var(--text-primary);
font-family: 'JetBrains Mono', monospace;
font-size: 0.9rem;
line-height: 1.55;
box-sizing: border-box;
overflow-y: auto;
overflow-x: auto;
white-space: pre-wrap;
word-wrap: break-word;
}
/* Mobile editor */
@media (max-width: 768px) {
.editor-modal {
padding: 0;
}
.editor-container {
max-width: 100%;
max-height: 100vh;
border-radius: 0;
height: 100vh;
}
.editor-header {
padding: 10px 12px;
position: sticky;
top: 0;
z-index: 10;
}
.editor-title {
font-size: 0.85rem;
}
.editor-actions {
gap: 6px;
}
.editor-btn {
font-size: 0.75rem;
padding: 8px;
min-width: 36px;
}
.editor-btn-text {
display: none;
}
.editor-body {
height: calc(100vh - 50px);
overflow: auto;
}
.cm-editor {
height: auto;
min-height: 100%;
}
.cm-scroller {
overflow: auto !important;
height: auto;
min-height: 100%;
}
.fallback-editor {
min-height: calc(100vh - 50px);
height: auto;
}
}
/* --- No-select during resize --- */
body.resizing {
user-select: none;
-webkit-user-select: none;
cursor: ew-resize;
}
body.resizing-v {
user-select: none;
-webkit-user-select: none;
cursor: ns-resize;
}
/* --- Responsive — Tablet --- */
@media (max-width: 1024px) {
.sidebar {
width: 240px;
min-width: 200px;
}
}
/* --- Responsive — Mobile --- */
@media (max-width: 768px) {
.hamburger-btn {
display: flex;
}
.header {
gap: 6px;
padding: 8px 10px;
}
.header-left {
flex: 0 0 auto;
gap: 8px;
}
.header-center {
flex: 1;
max-width: none;
}
.header-right {
flex: 0 0 auto;
}
.header-logo {
font-size: 0.95rem;
gap: 6px;
}
.search-wrapper {
max-width: none;
}
.search-wrapper input {
padding: 6px 10px 6px 32px;
font-size: 0.8rem;
}
.header-menu-btn {
padding: 5px 8px;
}
.header-menu-dropdown {
right: -8px;
min-width: 200px;
}
.sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
z-index: 200;
width: 280px !important;
min-width: 280px !important;
max-width: 85vw !important;
transform: translateX(-100%);
transition: transform 250ms ease, background 200ms ease;
box-shadow: none;
}
.sidebar.mobile-open {
transform: translateX(0);
box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}
.sidebar-resize-handle {
display: none;
}
.tag-resize-handle {
display: none;
}
.tag-cloud-section {
height: auto;
max-height: 200px;
min-height: 80px;
}
.content-area {
padding: 16px 12px 60px;
}
.file-title {
font-size: 1.2rem;
}
.file-actions {
flex-wrap: wrap;
}
}