bastebin/static/css/style.css

517 lines
15 KiB
CSS

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
--primary: #2563eb;
--primary-h: #1d4ed8;
--bg: #ffffff;
--surface: #f8fafc;
--border: #e2e8f0;
--text: #1e293b;
--text-sub: #64748b;
--text-muted: #94a3b8;
--code-bg: #f8fafc;
--nav-bg: #ffffff;
--nav-border: #e2e8f0;
--danger: #dc2626;
--radius: 4px;
--mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}
[data-theme="dark"] {
--primary: #3b82f6;
--primary-h: #2563eb;
--bg: #0f172a;
--surface: #1e293b;
--border: #334155;
--text: #f1f5f9;
--text-sub: #cbd5e1;
--text-muted: #64748b;
--code-bg: #0f172a;
--nav-bg: #1e293b;
--nav-border: #334155;
--danger: #ef4444;
}
/* ── Layout ────────────────────────────────────────────────────────────── */
html, body {
height: 100%;
overflow: hidden;
}
body {
display: flex;
flex-direction: column;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: var(--bg);
color: var(--text);
font-size: 14px;
line-height: 1.5;
}
/* ── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
flex-shrink: 0;
background: var(--nav-bg);
border-bottom: 1px solid var(--nav-border);
height: 42px;
display: flex;
align-items: center;
padding: 0 1rem;
gap: 0.5rem;
z-index: 10;
}
.nav-content {
display: flex;
align-items: center;
gap: 0.5rem;
width: 100%;
}
.brand {
font-weight: 700;
color: var(--primary);
text-decoration: none;
font-size: 1rem;
white-space: nowrap;
margin-right: 0.5rem;
}
.brand:hover { color: var(--primary-h); }
.nav-links {
display: flex;
align-items: center;
gap: 0.4rem;
flex: 1;
}
/* Nav controls */
.nav-input {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-size: 0.8rem;
padding: 0.25rem 0.5rem;
width: 160px;
outline: none;
}
.nav-input:focus { border-color: var(--primary); }
.nav-select {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-size: 0.8rem;
padding: 0.25rem 0.4rem;
cursor: pointer;
outline: none;
}
.nav-select:focus { border-color: var(--primary); }
.nav-btn {
background: none;
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text-sub);
font-size: 0.8rem;
padding: 0.25rem 0.6rem;
cursor: pointer;
text-decoration: none;
white-space: nowrap;
line-height: 1.4;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn-save {
border-color: var(--primary);
color: var(--primary);
font-weight: 600;
}
.nav-btn-save:hover { background: var(--primary); color: #fff; }
.nav-paste-title {
font-size: 0.85rem;
color: var(--text-sub);
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex-shrink: 1;
}
.nav-label {
display: flex;
align-items: center;
gap: 0.3rem;
font-size: 0.8rem;
color: var(--text-sub);
cursor: pointer;
white-space: nowrap;
user-select: none;
padding: 0 0.2rem;
}
.nav-label:hover { color: var(--primary); }
.nav-label input { cursor: pointer; }
/* ── Prism Line Numbers ────────────────────────────────────────────────── */
.line-numbers .line-numbers-rows {
border-right: 1px solid var(--border) !important;
padding-right: 0.5rem !important;
}
.line-numbers-rows > span:before {
color: var(--text-muted) !important;
}
.theme-toggle {
background: none;
border: none;
font-size: 1rem;
cursor: pointer;
padding: 0.2rem 0.3rem;
border-radius: var(--radius);
line-height: 1;
color: var(--text-sub);
}
.theme-toggle:hover { background: var(--surface); }
/* ── Full-page main ────────────────────────────────────────────────────── */
.full-page {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
/* On the view page, override to allow the discussions to extend below */
.full-page.view-page {
overflow: visible;
overflow-y: auto;
min-height: 0;
flex: 1;
}
/* ── Editor textarea ───────────────────────────────────────────────────── */
.full-editor {
flex: 1;
width: 100%;
height: 100%;
border: none;
outline: none;
resize: none;
padding: 1rem 1.5rem;
font-family: var(--mono);
font-size: 0.875rem;
line-height: 1.6;
background: var(--bg);
color: var(--text);
tab-size: 4;
}
/* ── View: full-page code ──────────────────────────────────────────────── */
.view-full {
min-height: calc(100vh - 42px); /* at least full viewport below navbar */
background: var(--code-bg);
}
.view-full pre {
margin: 0;
padding: 1rem 1.5rem;
min-height: 100%;
background: transparent;
}
.view-full code {
font-family: var(--mono);
font-size: 0.875rem;
line-height: 1.6;
}
/* Word wrap toggle */
.view-full.wrap-lines pre,
.view-full.wrap-lines code {
white-space: pre-wrap;
word-break: break-all;
}
/* ── Inline error (view page) ──────────────────────────────────────────── */
.error-inline {
padding: 0.75rem 1.5rem;
color: var(--danger);
font-size: 0.875rem;
border-bottom: 1px solid var(--border);
background: var(--surface);
}
/* ── Page-container (error pages, etc.) ───────────────────────────────── */
.page-container {
flex: 1;
max-width: 900px;
width: 100%;
margin: 0 auto;
padding: 2rem 1rem;
overflow-y: auto;
}
/* ── Error pages ───────────────────────────────────────────────────────── */
.error-page {
display: flex;
justify-content: center;
align-items: center;
min-height: 60%;
}
.error-content { text-align: center; max-width: 380px; }
.error-content h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.error-content p { color: var(--text-sub); margin-bottom: 1.5rem; }
.error-actions { display: flex; justify-content: center; gap: 0.75rem; }
/* Generic button (used on error pages) */
.btn {
display: inline-block;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.4rem 0.9rem;
font-size: 0.85rem;
text-decoration: none;
cursor: pointer;
background: none;
color: var(--text-sub);
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary); color: #fff; }
/* ── Notification toast ────────────────────────────────────────────────── */
.notification {
position: fixed;
bottom: 1rem;
right: 1rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.5rem 1rem;
font-size: 0.8rem;
color: var(--text-sub);
z-index: 100;
}
/* ── Prism overrides: transparent background ───────────────────────────── */
pre[class*="language-"], code[class*="language-"] {
background: transparent !important;
}
/* ── Line highlight (paste view) ───────────────────────────────────────── */
.view-full pre { position: relative; }
.view-full code { position: relative; z-index: 1; }
/* Overlay bar behind code text */
.line-hl {
position: absolute;
left: 0;
right: 0;
background: rgba(37, 99, 235, 0.1);
border-left: 3px solid var(--primary);
pointer-events: none;
z-index: 0;
}
[data-theme="dark"] .line-hl {
background: rgba(59, 130, 246, 0.15);
}
/* Gutter span for highlighted lines */
.line-numbers-rows > span.hl-active::before {
color: var(--primary) !important;
font-weight: 700;
}
/* Gutter spans are clickable when line numbers are shown */
.line-numbers-rows {
pointer-events: auto !important;
}
.line-numbers-rows > span {
cursor: pointer;
pointer-events: auto;
}
.line-numbers-rows > span:hover::before {
color: var(--text-sub) !important;
}
/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
.nav-input { width: 90px; }
.nav-paste-title { display: none; }
}
/* ── Utility & New Actions ─────────────────────────────────────────────── */
.nav-btn-danger {
color: var(--danger);
border-color: var(--danger);
}
.nav-btn-danger:hover {
background: var(--danger);
color: #fff;
border-color: var(--danger);
}
.nav-user {
font-size: 0.8rem;
color: var(--text-muted);
margin-right: 0.5rem;
}
/* ── Auth Box (Login) ──────────────────────────────────────────────────── */
.auth-box {
max-width: 360px;
margin: 4rem auto;
padding: 2rem;
background: var(--surface);
border: 1px solid var(--nav-border);
border-radius: var(--radius);
text-align: center;
}
.auth-box h1 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.form-group { text-align: left; margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-sub); margin-bottom: 0.3rem; }
.form-group input {
width: 100%; padding: 0.5rem; border: 1px solid var(--border);
border-radius: var(--radius); background: var(--bg); color: var(--text); outline: none;
}
.form-group input:focus { border-color: var(--primary); }
.submit-btn {
width: 100%; padding: 0.6rem; background: var(--primary); color: #fff;
border: none; border-radius: var(--radius); cursor: pointer; font-weight: 600; margin-top: 0.5rem;
}
.submit-btn:hover { background: var(--primary-h); }
.error-msg { color: var(--danger); font-size: 0.8rem; margin-bottom: 1rem; }
/* ── Admin Dashboard ───────────────────────────────────────────────────── */
.admin-header { margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.admin-header h1 { font-size: 1.5rem; }
.admin-header p { color: var(--text-sub); }
.admin-table {
width: 100%;
border-collapse: collapse;
font-size: 0.85rem;
}
.admin-table th, .admin-table td {
padding: 0.75rem;
border-bottom: 1px solid var(--border);
text-align: left;
}
.admin-table th { color: var(--text-sub); font-weight: 600; }
.admin-table tr:hover { background: var(--surface); }
.btn-delete-small {
background: none;
border: 1px solid var(--danger);
color: var(--danger);
padding: 0.2rem 0.5rem;
border-radius: var(--radius);
cursor: pointer;
font-size: 0.75rem;
}
.btn-delete-small:hover { background: var(--danger); color: #fff; }
.table-responsive { overflow-x: auto; }
/* ── Discussions panel ────────────────────────────────────────────────── */
.discussions-panel {
flex-direction: column;
border-top: 2px solid var(--border);
background: var(--surface);
/* no max-height — extends the page naturally */
}
.discussions-panel.collapsed .discussions-body {
display: none;
}
.discussions-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem 1.5rem;
cursor: pointer;
font-size: 0.85rem;
color: var(--text-sub);
flex-shrink: 0;
user-select: none;
border-bottom: 1px solid var(--border);
position: sticky;
top: 42px; /* stick just below navbar */
background: var(--surface);
z-index: 5;
}
.discussions-header:hover { background: var(--bg); }
.discussions-title { font-weight: 600; }
.discussions-chevron { font-size: 0.7rem; color: var(--text-muted); }
.discussions-body {
padding: 0.5rem 0;
}
.comments-list {
padding: 0 1.5rem;
}
.comment-item {
padding: 0.6rem 0;
border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-meta {
font-size: 0.72rem;
color: var(--text-muted);
margin-bottom: 0.3rem;
}
.comment-meta.has-nick {
color: var(--primary);
font-weight: 600;
}
.comment-content {
font-size: 0.85rem;
color: var(--text);
white-space: pre-wrap;
word-break: break-word;
}
.comments-loading, .comments-empty {
font-size: 0.8rem;
color: var(--text-muted);
padding: 0.75rem 0;
}
.comment-form-wrap {
display: flex;
gap: 0.5rem;
padding: 0.75rem 1.5rem 1rem;
border-top: 1px solid var(--border);
align-items: flex-start;
margin-top: 0.25rem;
background: var(--surface);
}
.comment-form-fields {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.35rem;
min-width: 0;
}
.comment-nick {
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: inherit;
font-size: 0.8rem;
padding: 0.3rem 0.6rem;
outline: none;
width: 180px;
}
.comment-nick:focus { border-color: var(--primary); }
.comment-input {
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: inherit;
font-size: 0.85rem;
padding: 0.4rem 0.6rem;
resize: vertical;
min-height: 4rem;
outline: none;
line-height: 1.5;
width: 100%;
}
.comment-input:focus { border-color: var(--primary); }