Files
rustpad/static/styles.css
T
2026-07-20 23:24:07 +02:00

294 lines
22 KiB
CSS

:root {
color-scheme: dark;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
font-synthesis: none;
background: #0b0d11;
color: #f4f6f8;
--bg: #0b0d11;
--surface: #11141a;
--surface-2: #151922;
--surface-3: #1a1f29;
--border: #272d38;
--border-strong: #343c49;
--text: #f4f6f8;
--muted: #929cab;
--muted-2: #697383;
--accent: #7c68ee;
--accent-hover: #8d79f8;
--accent-soft: #272246;
--danger: #ff7b91;
--success: #40d3a3;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
.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; }
.brand { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.site-header { width: min(720px, calc(100% - 32px)); min-height: 64px; margin: 0 auto; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.home-layout { width: min(520px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0; }
.home-intro { margin-bottom: 28px; }
.home-intro h1 { margin: 0; font-size: clamp(2rem, 7vw, 3rem); letter-spacing: -.04em; }
.home-intro p { margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.panel { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.create-panel { padding: 24px; }
#create-form { display: grid; gap: 20px; padding-top: 22px; }
.field { display: grid; gap: 8px; }
.field label { color: #dce1e8; font-size: .86rem; font-weight: 750; }
.label-row, .field-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row span, .field-meta, .field small { color: var(--muted-2); font-size: .73rem; }
input, select { border: 1px solid var(--border-strong); outline: none; background: #0e1116; color: var(--text); }
input { width: 100%; min-height: 46px; padding: 0 13px; border-radius: 10px; }
input:focus, select:focus, textarea:focus { border-color: #7567db; outline: 1px solid #7567db; outline-offset: 1px; }
.password-input { position: relative; }
.password-input input { padding-right: 72px; }
.text-button { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: transparent; color: #a99ef8; padding: 7px; font-size: .78rem; }
.form-message { min-height: 1.2em; margin: -5px 0 0; font-size: .8rem; }
.error { color: var(--danger); }
.primary-button, .secondary-button, .inline-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border-radius: 8px; font-weight: 650; text-decoration: none; }
.primary-button { width: 100%; border: 1px solid #8372ef; background: var(--accent); color: white; padding: 0 16px; }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { border: 1px solid var(--border-strong); background: var(--surface-2); color: #d2d8e1; padding: 0 13px; }
.secondary-button:hover { border-color: #4b5565; background: var(--surface-3); }
.inline-button { width: auto; margin-top: 18px; padding: 0 16px; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 70px; padding: 0 20px; border-bottom: 1px solid var(--border); background: #0d1015; }
.app-header__main, .header-actions { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-divider { width: 1px; height: 30px; background: var(--border); }
.document-heading { min-width: 0; }
.document-heading h1 { overflow: hidden; margin: 0; font-size: 1rem; white-space: nowrap; text-overflow: ellipsis; }
.document-url { overflow: hidden; max-width: 360px; margin: 3px 0 0; color: var(--muted-2); font-size: .72rem; white-space: nowrap; text-overflow: ellipsis; }
.status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; color: var(--muted); font-size: .78rem; }
.status__dot { width: 7px; height: 7px; border-radius: 50%; background: #e3a94d; }
.status__dot.is-online { background: var(--success); }
.status__dot.is-offline { background: var(--danger); }
.editor-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 0; height: calc(100vh - 70px); overflow: hidden; transition: grid-template-columns .18s ease; }
.history-open .editor-layout { grid-template-columns: minmax(0, 1fr) 340px; }
.editor-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: var(--surface); }
.editor-toolbar { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #101319; }
.toolbar-group, .view-switch { display: inline-flex; align-items: center; gap: 4px; padding-right: 8px; border-right: 1px solid var(--border); }
.toolbar-group:last-child, .view-switch { padding-right: 0; border-right: 0; }
.toolbar-fill { flex: 1; }
.editor-toolbar button, .editor-toolbar select { min-height: 34px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #b8c0cc; padding: 0 9px; font-size: .78rem; }
.editor-toolbar button:hover, .editor-toolbar select:hover { border-color: var(--border); background: var(--surface-2); color: white; }
.editor-toolbar select { border-color: var(--border); background: #11151c; }
.view-switch { padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: #0d1015; }
.view-switch button.active { background: var(--surface-3); color: white; }
.workspace { display: grid; min-height: 0; background: #0e1116; }
.workspace.view-split { grid-template-columns: 1fr 1fr; }
.workspace.view-edit { grid-template-columns: 1fr; }
.workspace.view-preview { grid-template-columns: 1fr; }
.workspace.view-edit .preview-column, .workspace.view-preview .editor-column { display: none; }
.editor-column, .preview-column { display: grid; grid-template-rows: 30px minmax(0, 1fr); min-width: 0; min-height: 0; }
.preview-column { border-left: 1px solid var(--border); }
.column-label { display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid #202631; background: #10141a; color: var(--muted-2); font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
textarea { display: block; width: 100%; height: 100%; min-height: 0; resize: none; padding: 24px; border: 0; outline: none; background: #0d1015; color: #edf1f6; font: 400 17px/1.72 ui-monospace, SFMono-Regular, Consolas, monospace; caret-color: #9b89ff; }
textarea::placeholder { color: #515a68; }
textarea::selection { background: rgba(124,104,238,.35); }
.preview { overflow: auto; min-height: 0; padding: 24px; color: #dce2eb; line-height: 1.72; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.25em 0 .5em; letter-spacing: -.03em; }
.markdown-body h1:first-child, .markdown-body h2:first-child, .markdown-body h3:first-child { margin-top: 0; }
.markdown-body h1 { font-size: 2rem; }
.markdown-body h2 { font-size: 1.5rem; }
.markdown-body p { margin: .72em 0; }
.markdown-body code { padding: .16em .36em; border: 1px solid #303745; border-radius: 5px; background: #1a2029; }
.markdown-body pre { overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #0a0d12; }
.markdown-body pre code { padding: 0; border: 0; background: transparent; }
.markdown-body blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--accent); color: #abb5c3; }
.markdown-body a { color: #aa9df8; }
.markdown-body hr { border: 0; border-top: 1px solid var(--border); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 38px; padding: 0 16px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: .72rem; }
.document-stats { display: flex; gap: 14px; }
.history-panel { position: relative; width: 340px; overflow: hidden; border-left: 1px solid var(--border); background: #101319; transform: translateX(100%); transition: transform .18s ease; }
.history-panel.open { transform: translateX(0); }
.history-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; }
.history-help { margin: 0; padding: 0 18px 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .8rem; line-height: 1.5; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: #c5ccd6; font-size: 1.2rem; }
.history-list { overflow: auto; height: calc(100vh - 185px); padding: 10px 18px 24px; }
.revision { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 10px; padding: 13px 0; }
.revision::after { content: ""; position: absolute; top: 25px; bottom: -13px; left: 5px; width: 1px; background: var(--border); }
.revision:last-child::after { display: none; }
.revision__marker { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid #8b7af4; border-radius: 50%; background: #101319; }
.revision time { display: block; color: #d1d7df; font-size: .8rem; }
.revision small { display: block; margin-top: 4px; color: var(--muted-2); }
.revision button { margin-top: 10px; border: 0; background: transparent; color: #9e92f5; padding: 0; font-size: .76rem; font-weight: 750; }
.empty { padding: 28px 0; color: var(--muted-2); text-align: center; font-size: .82rem; }
dialog { width: min(420px, calc(100% - 24px)); padding: 0; border: 0; background: transparent; color: inherit; }
dialog::backdrop { background: rgba(4,6,9,.82); }
.dialog-panel { display: grid; gap: 12px; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; }
.dialog-panel input { margin-top: 6px; }
.dialog-panel .primary-button { margin-top: 2px; }
.dialog-link { color: var(--muted); font-size: .78rem; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: #171b23; color: #e6eaf0; font-size: .8rem; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .16s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; text-align: center; }
.error-page h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.05em; }
.error-page p { color: var(--muted); }
@media (max-width: 980px) {
.app-header { align-items: flex-start; min-height: auto; padding: 12px 14px; }
.app-header__main, .header-actions { flex-wrap: wrap; }
.editor-layout { height: calc(100vh - 92px); }
.toolbar-settings { display: none; }
.history-open .editor-layout { grid-template-columns: minmax(0, 1fr); }
.history-panel { position: absolute; top: 0; right: 0; bottom: 0; z-index: 10; }
}
@media (max-width: 720px) {
.site-header, .home-layout { width: min(100% - 24px, 520px); }
.document-url, .header-divider { display: none; }
.home-layout { padding: 44px 0; }
.app-header { gap: 10px; }
.status { display: none; }
.editor-toolbar { overflow-x: auto; flex-wrap: nowrap; }
.toolbar-fill { display: none; }
.workspace.view-split { grid-template-columns: 1fr; }
.workspace.view-split .preview-column { display: none; }
.view-switch button[data-view="split"] { display: none; }
.preview-column { border-left: 0; }
textarea, .preview { padding: 18px; }
.editor-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; padding: 7px 12px; }
}
@media (max-width: 480px) {
.create-panel { padding: 20px; }
.header-actions { gap: 6px; }
.secondary-button { min-height: 36px; padding: 0 10px; font-size: .75rem; }
.history-panel { width: 100%; }
}
.markdown-toggle { border: 1px solid var(--border) !important; }
.markdown-toggle.active { background: var(--surface-3) !important; color: white !important; }
.preview--raw { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.workspace-page { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 80px; }
.workspace-top { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.workspace-top h2 { margin: 0; font-size: 2rem; }
.workspace-top p { margin: 7px 0 0; color: var(--muted); }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding-top: 20px; }
.note-card { min-height: 130px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-decoration: none; transition: border-color .15s, background .15s; }
.note-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.note-card h3 { margin: 0; font-size: 1rem; }
.note-card p { margin: 36px 0 0; color: var(--muted); font-size: .75rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inline-button { width: auto; padding-inline: 18px; }
.error-card { width: min(560px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.error-code { margin: 0 0 10px; color: var(--muted-2); font: 700 .78rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.error-card h1 { font-size: clamp(1.8rem, 6vw, 3rem); }
.error-card > p:not(.error-code) { max-width: 46ch; margin: 14px auto 0; line-height: 1.6; }
.error-actions { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
@media (max-width: 480px) { .error-card { padding: 24px 18px; } .error-actions { flex-direction: column; } .error-actions .inline-button { width: 100%; } }
/* Home: standalone note and workspace are separate choices. */
.home-layout--wide { width: min(1040px, calc(100% - 32px)); }
.create-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.create-panel__heading { margin-bottom: 22px; }
.create-panel__heading h2 { margin: 0; font-size: 1.35rem; }
.create-panel__heading p { margin: 7px 0 0; color: var(--muted); line-height: 1.5; }
.create-panel form { display: grid; gap: 18px; }
.create-panel .primary-button { width: 100%; }
@media (max-width: 760px) {
.home-layout--wide { width: min(100% - 24px, 560px); }
.create-grid { grid-template-columns: 1fr; }
}
/* Collaborative editor additions */
.editor-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 0; overflow: hidden; background: #0d1015; }
.line-gutter { width: 62px; overflow: hidden; padding: 24px 8px 24px 0; border-right: 1px solid var(--border); color: var(--muted-2); font: 400 17px/1.72 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; user-select: none; }
.line-gutter div { height: 1.72em; padding-right: 8px; border-right: 3px solid var(--owner, transparent); }
.hide-line-numbers .editor-shell { grid-template-columns: 0 minmax(0, 1fr); }
.hide-line-numbers .line-gutter { width: 0; padding: 0; border: 0; }
.editor-shell textarea { padding-left: 18px; }
.line-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.line-toggle input { width: auto; min-height: auto; margin: 0; accent-color: var(--accent); }
.user-chip { display: inline-flex; align-items: center; gap: 7px; color: #dce2eb; font-size: .78rem; }
.user-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--owner, var(--accent)); }
.dialog-copy { margin: 0 0 4px; color: var(--muted); line-height: 1.5; }
.history-header h2 { margin: 0; }
.history-header p { margin: 4px 0 0; color: var(--muted-2); font-size: .75rem; }
.revision__marker { border-color: var(--owner, #8b7af4); background: var(--owner, #8b7af4); }
.revision__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.revision__meta strong { font-size: .82rem; }
.revision__snippet { margin: 8px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.revision__preview { max-height: 180px; overflow: auto; margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: #0b0e13; color: #c9d0da; font: .72rem/1.5 ui-monospace, monospace; white-space: pre-wrap; }
.revision button + button { margin-left: 12px; }
.mermaid { overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #0a0d12; }
@media (max-width: 720px) { .line-gutter { width: 48px; padding-top: 18px; font-size: 15px; } .editor-shell textarea { padding: 18px 12px; font-size: 15px; } .user-chip { display: none; } }
.markdown-body img { display: block; max-width: 100%; height: auto; margin: 16px auto; border-radius: 10px; }
.markdown-body a { overflow-wrap: anywhere; }
.public-page { min-height: 100vh; background: var(--background); }
.public-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 max(20px, calc((100vw - 900px) / 2)); border-bottom: 1px solid var(--border); background: rgba(13,16,21,.92); backdrop-filter: blur(12px); }
.public-document { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 96px; }
.public-document > h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); line-height: 1.08; }
.public-meta { margin: 12px 0 36px; color: var(--muted); font-size: .8rem; }
.public-content { min-height: 240px; padding: 32px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.public-content img { cursor: zoom-in; }
@media (max-width: 600px) { .public-document { padding-top: 32px; } .public-content { padding: 20px; } }
/* Layout safeguards and home footer */
.app-header__main, .document-heading { min-width: 0; }
.document-url { overflow-wrap: anywhere; }
.home-page { display: flex; min-height: 100vh; flex-direction: column; }
.home-page .home-layout { flex: 1 0 auto; }
.home-footer { flex: 0 0 auto; width: min(1040px, calc(100% - 32px)); margin: auto auto 28px; padding-top: 24px; color: var(--muted-2); font-size: .76rem; text-align: center; }
.home-footer a { color: var(--muted); text-decoration: none; }
.home-footer a:hover { color: white; }
.home-header { border-bottom-color: rgba(195, 91, 54, .28); background: linear-gradient(135deg, rgba(126, 48, 27, .28), rgba(51, 25, 18, .08) 58%, transparent); }
.home-brand { background: linear-gradient(110deg, #f0aa74 0%, #cf633d 48%, #8f3827 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 760px) { .home-footer { width: min(100% - 24px, 560px); margin-bottom: 20px; } }
/* Show an author once at the start of each contiguous ownership block. */
.line-gutter div { position: relative; }
.line-owner-label { position: absolute; left: 7px; top: 50%; max-width: 88px; overflow: hidden; padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--owner) 65%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--owner) 18%, #0d1015); color: #eef1f5; font: 600 10px/1.2 system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; transform: translateY(-50%); }
@media (min-width: 721px) { .line-gutter { width: 132px; } }
@media (max-width: 720px) { .line-owner-label { display: none; } }
/* Compact line numbers; author labels sit over the edited text, not in the gutter. */
.line-gutter { width: 48px; }
.line-gutter div { position: static; }
.owner-labels { position: absolute; z-index: 2; top: 0; right: 12px; left: 48px; height: 100%; overflow: hidden; pointer-events: none; }
.owner-label { position: absolute; right: 8px; max-width: min(180px, 45%); overflow: hidden; padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--owner) 62%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--owner) 18%, #0d1015); color: #eef1f5; font: 600 10px/1.25 system-ui, sans-serif; opacity: .82; text-overflow: ellipsis; white-space: nowrap; }
.hide-line-numbers .owner-labels { left: 0; }
.line-owner-label { display: none !important; }
@media (min-width: 721px) { .line-gutter { width: 48px; } }
@media (max-width: 720px) { .line-gutter { width: 42px; } .owner-labels { left: 42px; right: 4px; } }
/* The rust gradient belongs only to the wordmark. */
.home-header { background: transparent; }
/* Editor display preferences and author overlay */
.editor-shell { position: relative; }
.owner-labels { z-index: 4; top: 0; bottom: 0; height: auto; }
.owner-line { position: absolute; right: 0; left: 0; height: var(--editor-line-height, 31px); border-left: 3px solid var(--owner); background: linear-gradient(90deg, color-mix(in srgb, var(--owner) 8%, transparent), transparent 24%); }
.owner-label { z-index: 1; transform: translateY(2px); }
.editor-controls { display: inline-flex; align-items: center; gap: 7px; }
.editor-controls label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .72rem; }
.editor-controls select { width: auto; min-height: 30px; padding: 3px 24px 3px 7px; border-radius: 6px; font-size: .74rem; }
.editor-workspace-font-system textarea, .editor-workspace-font-system .preview { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.editor-workspace-font-serif textarea, .editor-workspace-font-serif .preview { font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif; }
.editor-workspace-font-arial textarea, .editor-workspace-font-arial .preview { font-family: Arial, Helvetica, sans-serif; }
.editor-workspace-font-georgia textarea, .editor-workspace-font-georgia .preview { font-family: Georgia, "Times New Roman", serif; }
.editor-workspace-font-mono textarea, .editor-workspace-font-mono .preview { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.compact-editor .editor-toolbar { min-height: 42px; padding-top: 5px; padding-bottom: 5px; }
.compact-editor .column-label { min-height: 30px; font-size: .68rem; }
.compact-editor textarea, .compact-editor .preview { padding-top: 14px; padding-bottom: 14px; font-size: calc(var(--editor-font-size, 18px) - 2px); line-height: 1.45; }
.workspace textarea, .workspace .preview { font-size: var(--editor-font-size, 18px); }
@media (max-width: 900px) { .editor-controls { order: 3; width: 100%; } .editor-toolbar { flex-wrap: wrap; } }