blog / style.css
wop's picture
Update style.css
370befe verified
Raw
History Blame Contribute Delete
17.7 kB
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@1,400;1,600&display=swap');
:root {
--bg: #eaf4fb;
--bg-gradient-top: #7cb8e0;
--bg-gradient-bottom: #eaf4fb;
--text: #2d3e50;
--heading: #1a2b3c;
--muted: #6b7f92;
--surface: rgba(255,255,255,0.55);
--surface-2: rgba(255,255,255,0.75);
--border: rgba(255,255,255,0.7);
--border-soft: rgba(120, 160, 200, 0.18);
--accent: #4a90c2;
--accent-soft: #7cb8e0;
--white: #ffffff;
--transition: 0.2s ease;
--radius: 18px;
--shadow-soft: 0 8px 32px rgba(120, 160, 200, 0.15);
--shadow-hover: 0 12px 40px rgba(74, 144, 194, 0.2);
}
/* -------------------- BASE -------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
*, *::before, *::after {
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
}
}
body {
background: var(--bg);
color: var(--text);
font-family: Inter, system-ui, sans-serif;
line-height: 1.75;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
color: var(--heading);
letter-spacing: -0.02em;
}
h1 {
font-family: 'Newsreader', serif;
font-style: italic;
}
p { color: var(--text); }
img {
max-width: 100%;
height: auto;
border-radius: var(--radius);
box-shadow: var(--shadow-soft);
}
a {
color: var(--accent);
text-decoration: none;
transition: opacity var(--transition);
}
a:hover { opacity: 0.75; }
a:focus-visible, .post-card a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 4px;
border-radius: 4px;
opacity: 1;
}
/* -------------------- BACKGROUND -------------------- */
.background {
position: fixed;
inset: 0;
z-index: -1;
background: linear-gradient(180deg, #7cb8e0 0%, #a8d0e8 40%, #d8ebf5 75%, #eaf4fb 100%);
overflow: hidden;
}
/* Soft cloud-like glow */
.background::before {
content: '';
position: absolute;
top: 10%;
left: -10%;
width: 60%;
height: 40%;
background: radial-gradient(ellipse at center, rgba(255,255,255,0.6) 0%, transparent 70%);
filter: blur(40px);
pointer-events: none;
}
.background::after {
content: '';
position: absolute;
top: 30%;
right: -5%;
width: 50%;
height: 30%;
background: radial-gradient(ellipse at center, rgba(255,255,255,0.5) 0%, transparent 70%);
filter: blur(50px);
pointer-events: none;
}
.background .floating-logo {
position: absolute;
width: 180px; !important
height: 120px;
opacity: 0.35;
filter: drop-shadow(0 8px 24px rgba(120,160,200,0.3));
animation: float-logo 45s linear infinite;
}
.background .floating-logo:nth-child(1) { left: 2%; top: 10%; animation-duration: 50s; animation-delay: 0s; width: 150px; height: 150px; }
.background .floating-logo:nth-child(2) { right: 2%; left: auto; top: 5%; animation-duration: 38s; animation-delay: -8s; width: 110px; height: 110px; opacity: 0.28; }
.background .floating-logo:nth-child(3) { left: 3%; top: 65%; animation-duration: 55s; animation-delay: -20s; width: 170px; height: 170px; opacity: 0.25; }
.background .floating-logo:nth-child(4) { right: 3%; left: auto; top: 70%; animation-duration: 42s; animation-delay: -12s; width: 100px; height: 100px; opacity: 0.30; }
.background .floating-logo:nth-child(5) { right: 5%; left: auto; top: 40%; animation-duration: 60s; animation-delay: -30s; width: 130px; height: 130px; opacity: 0.28; }
@keyframes float-logo {
0% { transform: translate(0, 0) rotate(0deg); }
25% { transform: translate(80px, -60px) rotate(90deg); }
50% { transform: translate(-40px, -120px) rotate(180deg); }
75% { transform: translate(60px, 40px) rotate(270deg); }
100% { transform: translate(0, 0) rotate(360deg); }
}
/* -------------------- LAYOUT -------------------- */
.container {
max-width: 820px;
margin: auto;
padding: 80px 24px;
}
.hero { margin-bottom: 60px; }
.hero h1 {
font-size: clamp(2.5rem, 8vw, 4rem);
font-weight: 800;
letter-spacing: -0.05em;
line-height: 1.1;
background: linear-gradient(135deg, #ffffff 0%, #4a90c2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 0 2px 20px rgba(255,255,255,0.3);
}
.subtitle {
margin-top: 12px;
color: var(--muted);
font-size: 1.05rem;
}
.discord {
display: inline-block;
margin-top: 18px;
color: var(--accent);
}
/* -------------------- POSTS -------------------- */
.posts {
display: flex;
flex-direction: column;
gap: 18px;
}
.post-card {
padding: 26px;
border-radius: var(--radius);
background: var(--surface);
border: 1px solid var(--border);
backdrop-filter: blur(20px) saturate(1.2);
-webkit-backdrop-filter: blur(20px) saturate(1.2);
box-shadow: var(--shadow-soft);
transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.post-card:hover {
transform: translateY(-3px);
background: var(--surface-2);
border-color: rgba(74, 144, 194, 0.35);
box-shadow: var(--shadow-hover);
}
.post-card h2 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 1.4rem;
}
.post-card p {
color: var(--muted);
margin-bottom: 14px;
}
.date {
color: var(--muted);
font-size: 0.85rem;
}
/* -------------------- ARTICLE -------------------- */
.article {
max-width: 760px;
margin: auto;
padding: 80px 24px;
}
.article p, .article h1, .article h2 {
overflow-wrap: break-word;
}
.article h1 {
font-size: clamp(2rem, 6vw, 3rem);
margin-bottom: 18px;
line-height: 1.2;
}
.article h2 {
margin-top: 44px;
margin-bottom: 12px;
}
.article p {
margin-bottom: 18px;
color: var(--text);
}
.meta {
color: var(--muted);
margin-bottom: 18px;
}
.back {
display: inline-block;
margin-bottom: 28px;
color: var(--accent);
}
/* -------------------- BLOCKQUOTE -------------------- */
blockquote {
margin: 24px 0;
padding: 16px 20px;
background: rgba(255,255,255,0.5);
border-left: 3px solid var(--accent);
border-radius: 0 12px 12px 0;
color: #3d5568;
font-size: 1.05rem;
font-style: italic;
box-shadow: var(--shadow-soft);
}
/* -------------------- CODE & SYNTAX HIGHLIGHTING -------------------- */
pre {
background: rgba(255,255,255,0.75);
border: 1px solid var(--border-soft);
border-radius: 14px;
padding: 20px;
overflow-x: auto;
margin: 20px 0;
position: relative;
box-shadow: var(--shadow-soft);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 0.88rem;
color: #2d3e50;
line-height: 1.7;
}
p code {
background: rgba(255,255,255,0.7);
padding: 2px 6px;
border-radius: 6px;
border: 1px solid var(--border-soft);
color: #2d3e50;
font-size: 0.88rem;
}
/* Light-theme syntax highlighting */
.tok-keyword { color: #c14a7b; }
.tok-string { color: #2a8f5f; }
.tok-comment { color: #8ba0b5; font-style: italic; }
.tok-number { color: #4a90c2; }
.tok-builtin { color: #c47a2c; }
.tok-function { color: #3a7ba8; }
.tok-decorator { color: #c47a2c; }
.tok-operator { color: #c14a7b; }
.tok-self { color: #c47a2c; font-style: italic; }
.tok-punctuation{ color: #6b7f92; }
/* -------------------- TABLES -------------------- */
table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
margin: 24px 0;
font-size: 0.95rem;
display: block;
overflow-x: auto;
background: rgba(255,255,255,0.5);
border-radius: 12px;
box-shadow: var(--shadow-soft);
}
th, td {
padding: 12px 14px;
border-bottom: 1px solid var(--border-soft);
text-align: left;
}
th {
color: var(--heading);
font-weight: 600;
background: rgba(255,255,255,0.6);
}
td {
color: var(--text);
transition: background 0.15s ease;
}
td:hover {
background: rgba(74, 144, 194, 0.1);
}
/* -------------------- KATEX OVERRIDES -------------------- */
.katex { color: var(--text); font-size: 1.08em; }
.katex-display {
margin: 24px 0;
overflow-x: auto;
overflow-y: hidden;
padding: 4px 0;
}
.katex-display > .katex { color: var(--heading); }
/* -------------------- INLINE ELEMENTS -------------------- */
mark {
background: rgba(74, 144, 194, 0.2);
color: var(--heading);
padding: 1px 5px;
border-radius: 4px;
}
kbd {
background: rgba(255, 255, 255, 0.8);
border: 1px solid var(--border-soft);
border-bottom-width: 2px;
border-radius: 5px;
padding: 2px 7px;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 0.82em;
color: var(--heading);
box-shadow: 0 1px 3px rgba(120,160,200,0.15);
}
hr {
border: none;
border-top: 1px solid var(--border-soft);
margin: 36px 0;
}
/* -------------------- DETAILS / SUMMARY -------------------- */
details {
margin: 16px 0;
padding: 16px 20px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
box-shadow: var(--shadow-soft);
}
details summary {
cursor: pointer;
color: var(--heading);
font-weight: 500;
list-style: none;
transition: color var(--transition);
display: flex;
align-items: center;
gap: 6px;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
content: '';
display: inline-block;
width: 0;
height: 0;
border-left: 5px solid var(--accent);
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
transition: transform var(--transition);
flex-shrink: 0;
}
details[open] summary::before {
transform: rotate(90deg);
}
details summary:hover { color: var(--accent); }
details p { margin-top: 12px; }
/* -------------------- LIGHTBOX -------------------- */
.lightbox-overlay {
position: fixed;
inset: 0;
z-index: 1000;
background: rgba(180, 210, 230, 0.85);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox-overlay.active {
opacity: 1;
visibility: visible;
}
.lightbox-img {
max-width: 90vw;
max-height: 85vh;
border-radius: 10px;
object-fit: contain;
transform: scale(0.92);
opacity: 0;
transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
box-shadow: 0 24px 80px rgba(60, 100, 140, 0.4);
user-select: none;
-webkit-user-drag: none;
}
.lightbox-overlay.active .lightbox-img {
transform: scale(1);
opacity: 1;
}
.lightbox-btn {
position: absolute;
border: 1px solid rgba(255, 255, 255, 0.8);
background: rgba(255, 255, 255, 0.7);
color: var(--heading);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s ease, border-color 0.2s ease;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.lightbox-btn:hover {
background: rgba(255, 255, 255, 0.95);
border-color: var(--accent);
}
.lightbox-btn:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.lightbox-close {
top: 20px;
right: 20px;
width: 44px;
height: 44px;
border-radius: 50%;
}
.lightbox-arrow {
top: 50%;
transform: translateY(-50%);
width: 50px;
height: 50px;
border-radius: 50%;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
position: absolute;
bottom: 28px;
left: 50%;
transform: translateX(-50%);
color: var(--heading);
background: rgba(255,255,255,0.7);
padding: 4px 12px;
border-radius: 20px;
font-size: 0.82rem;
font-variant-numeric: tabular-nums;
letter-spacing: 0.04em;
pointer-events: none;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
@media (max-width: 640px) {
.lightbox-arrow { width: 42px; height: 42px; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; }
.lightbox-img { max-width: 95vw; max-height: 78vh; border-radius: 8px; }
.lightbox-counter { bottom: 16px; }
}
/* -------------------- CLICKABLE ARTICLE IMAGES -------------------- */
.article img {
cursor: zoom-in;
transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.article img:hover {
filter: brightness(1.03);
transform: scale(1.005);
box-shadow: var(--shadow-hover);
}
/* -------------------- SIDEBAR -------------------- */
.article-sidebar {
position: fixed;
top: 80px;
right: 24px;
width: 220px;
max-height: calc(100vh - 120px);
overflow-y: auto;
padding: 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 14px;
backdrop-filter: blur(20px) saturate(1.2);
-webkit-backdrop-filter: blur(20px) saturate(1.2);
box-shadow: var(--shadow-soft);
z-index: 100;
}
.sidebar-title {
color: var(--muted);
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.08em;
margin-bottom: 8px;
margin-top: 16px;
}
.sidebar-title:first-child { margin-top: 0; }
.sidebar-toc, .sidebar-files {
list-style: none;
padding: 0;
margin: 0 0 8px 0;
}
.sidebar-toc li { margin-bottom: 2px; }
.sidebar-toc a {
display: block;
padding: 3px 8px;
color: var(--muted);
font-size: 0.8rem;
border-radius: 6px;
transition: color 0.15s, background 0.15s;
text-decoration: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar-toc a:hover { color: var(--heading); background: rgba(255,255,255,0.6); }
.sidebar-toc a.active { color: var(--accent); background: rgba(74,144,194,0.15); }
.toc-h1 a { font-weight: 600; }
.toc-h2 a { padding-left: 16px; }
.toc-h3 a { padding-left: 28px; font-size: 0.75rem; }
.sidebar-files li { margin-bottom: 4px; }
.sidebar-file-btn {
display: flex;
align-items: center;
gap: 6px;
width: 100%;
padding: 5px 8px;
background: rgba(255,255,255,0.5);
border: 1px solid var(--border-soft);
border-radius: 8px;
color: var(--muted);
font-size: 0.78rem;
cursor: pointer;
transition: color 0.15s, background 0.15s, border-color 0.15s;
text-align: left;
font-family: inherit;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar-file-btn:hover {
color: var(--accent);
background: rgba(74,144,194,0.1);
border-color: rgba(74,144,194,0.4);
}
.sidebar-file-btn svg { flex-shrink: 0; }
@media (max-width: 1200px) {
.article-sidebar { display: none; }
}
/* -------------------- COLLAPSIBLE CODE -------------------- */
.code-collapsible { margin: 20px 0; }
.code-toggle {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
padding: 10px 16px;
background: rgba(255,255,255,0.65);
border: 1px solid var(--border-soft);
border-radius: 14px 14px 0 0;
color: var(--heading);
font-size: 0.85rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
cursor: pointer;
transition: background 0.15s;
text-align: left;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.code-toggle:hover { background: rgba(255,255,255,0.85); }
.code-toggle-arrow {
color: var(--accent);
font-size: 0.7rem;
transition: transform 0.2s;
}
.code-collapsible pre {
margin-top: 0;
border-top: none;
border-radius: 0 0 14px 14px;
max-height: 2000px;
transition: max-height 0.3s ease;
}
.code-collapsible pre.collapsed {
max-height: 0;
padding: 0 20px;
overflow: hidden;
border-color: transparent;
}
.code-collapsible .code-toggle[aria-expanded="false"] + pre {
border-top: none;
}
.code-collapsible .code-toggle[aria-expanded="false"] {
border-radius: 14px;
}
/* copy button */
pre { position: relative; }
.copy-btn {
position: absolute;
top: 8px;
right: 8px;
background: rgba(255,255,255,0.9);
color: var(--heading);
border: 1px solid var(--border-soft);
padding: 4px 8px;
font-size: 12px;
border-radius: 6px;
cursor: pointer;
opacity: 0;
transition: 0.2s;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: #fff; border-color: var(--accent); color: var(--accent); }
.copy-btn:active { transform: scale(0.95); }
/* -------------------- SELECTION & SCROLLBARS -------------------- */
::selection {
background: rgba(74,144,194,0.3);
color: var(--heading);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.3); }
::-webkit-scrollbar-thumb { background: rgba(120,160,200,0.4); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74,144,194,0.6); }