diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/single.html | 421 | ||||
| -rw-r--r-- | layouts/_markup/render-blockquote.html | 107 | ||||
| -rw-r--r-- | layouts/archives/single.html | 118 | ||||
| -rw-r--r-- | layouts/partials/style.html | 1581 |
4 files changed, 1077 insertions, 1150 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6b3f0a4..3e617ea 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -14,81 +14,69 @@ {{ partial "post_meta.html" . }} -{{ $upvoteEnabled := default .Site.Params.upvote .Params.upvote }} {{ if $upvoteEnabled }} +{{ $upvoteEnabled := default .Site.Params.upvote .Params.upvote }} +{{ if $upvoteEnabled }} <div class="upvote-container"> - <small class="upvote"> - <button class="upvote-btn" id="upvote-btn"> - <svg - xmlns="http://www.w3.org/2000/svg" - viewBox="0 0 24 24" - width="24" - height="24" - stroke="currentColor" - stroke-width="2" - fill="none" - stroke-linecap="round" - stroke-linejoin="round" - class="css-i6dzq1" - > - <polyline points="17 11 12 6 7 11"></polyline> - <polyline points="17 18 12 13 7 18"></polyline> - </svg> - <span class="upvote-count" id="upvote-count">0</span> - </button> - </small> +<small class="upvote"> + <button class="upvote-btn" id="upvote-btn"> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"> + <polyline points="17 11 12 6 7 11"></polyline> + <polyline points="17 18 12 13 7 18"></polyline> + </svg> + <span class="upvote-count" id="upvote-count">0</span> + </button> +</small> </div> - <script> let hasUpvoted = false; let upvoteBtn; let upvoteCount; // 页面加载时获取点赞数量 - document.addEventListener("DOMContentLoaded", function () { - const slug = "{{ .Slug }}"; - upvoteBtn = document.getElementById("upvote-btn"); - upvoteCount = document.getElementById("upvote-count"); + document.addEventListener('DOMContentLoaded', function() { + const slug = '{{ .Slug }}'; + upvoteBtn = document.getElementById('upvote-btn'); + upvoteCount = document.getElementById('upvote-count'); getCount(slug); // 处理点赞按钮的点击事件 - upvoteBtn.addEventListener("click", handleUpvote); + upvoteBtn.addEventListener('click', handleUpvote); }); // 点赞方法 async function handleUpvote() { if (hasUpvoted) { - console.log("You have already upvoted this post!"); + console.log('You have already upvoted this post!'); return; } - const slug = "{{ .Slug }}"; + const slug = '{{ .Slug }}'; // 禁用按钮以防止重复点击 upvoteBtn.disabled = true; // 给按钮添加 upvoted 类以赋以点击过的样式 - upvoteBtn.classList.add("upvoted"); + upvoteBtn.classList.add('upvoted'); // 更新 upvote-count 的值 +1 upvoteCount.innerText = parseInt(upvoteCount.innerText) + 1; try { - const response = await fetch("{{ .Site.Params.upvoteURL }}upvote", { - method: "POST", - mode: "cors", + const response = await fetch('{{ .Site.Params.upvoteURL }}upvote', { + method: 'POST', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, body: JSON.stringify({ postId: slug, diff: 1 }), }); if (response.ok) { - console.log("Upvote successful!"); + console.log('Upvote successful!'); hasUpvoted = true; await getCount(slug, 3); } else { - console.log("Upvote failed!"); + console.log('Upvote failed!'); } } catch (error) { - console.error("Error: ", error); + console.error('Error: ', error); } finally { upvoteBtn.disabled = false; } @@ -97,15 +85,12 @@ // 获取 Upvote 数量的方法,支持设置重试次数,默认不重试 async function getCount(slug, retryCount = 0) { try { - const response = await fetch( - "{{ .Site.Params.upvoteURL }}count?post=" + slug, - { - method: "GET", - headers: { - "Content-Type": "application/json", - }, + const response = await fetch('{{ .Site.Params.upvoteURL }}count?post=' + slug, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', }, - ); + }); const data = await response.json(); @@ -114,15 +99,15 @@ upvoteCount.innerText = count; hasUpvoted = data.data.hasUpvoted; if (hasUpvoted) { - upvoteBtn.classList.add("upvoted"); + upvoteBtn.classList.add('upvoted'); } else { - upvoteBtn.classList.remove("upvoted"); + upvoteBtn.classList.remove('upvoted'); } } else { - console.error("Failed to get upvote count: ", data.msg); + console.error('Failed to get upvote count: ', data.msg); } } catch (error) { - console.error("Error: ", error); + console.error('Error: ', error); if (retryCount > 0) { setTimeout(() => { getCount(slug, retryCount - 1); @@ -133,179 +118,181 @@ </script> {{ end }} + + <!-- Place the TOC at the end to ensure the article content loads first. --> {{ $tocEnabled := default .Site.Params.toc .Params.toc }} {{ if $tocEnabled }} <div class="toc">{{ partial "toc.html" . }}</div> {{ end }} -{{ if .Params.comments | default true }} -<div class="comments-and-webmentions"> - <details> - <summary> - <p style="display: inline">评论 与 Webmentions</p> - </summary> - <div id="giscus-container"></div> - - <div class="wm"> - <div id="webmentions"></div> - <script - src="/js/webmention.min.js" - data-id="webmentions" - data-page-url="https://www.glowisle.me{{ .RelPermalink }}" - data-max-webmentions="50" - data-wordcount="30" - data-sort-by="published" - data-sort-dir="up" - async - ></script> - - <p> - 若想回复本文,请在你的博客或社媒发布含有本文链接的帖子,然后在下方表单提交链接。 - </p> - <div class="wm-guide-content"> - <div class="webmention-form"> - <form - id="webmention-submit-form" - action="https://webmention.io/www.glowisle.me/webmention" - method="post" - > - <!-- 自动填充的目标文章链接 --> - <input - type="hidden" - name="target" - value="https://www.glowisle.me{{ .RelPermalink }}" - /> - <div> - <label for="webmention-source">你的文章链接:</label> - <input - type="url" - id="webmention-source" - name="source" - required - pattern="https?://.+" - /> - <button type="submit" id="webmention-submit-btn">提交</button> - </div> - <div id="webmention-form-feedback"></div> - </form> - <p> - 也可以<a href="mailto:i@glowisle.me?subject=回复《{{ .Title }}》">发送邮件</a>评论。 - </p> - <a href="https://indieweb.org/webmention" - >关于 Webmention 的更多信息</a - > - 以及 - <a href="https://www.glowisle.me/posts/tear-hypocrisy-apart/" - >为什么要这么做?</a - > - </div> - - <script> - function getInitialTheme() { - // 1. 优先检查 localStorage 中的用户偏好 - if ( - typeof localStorage !== "undefined" && - localStorage.getItem("theme") - ) { - return localStorage.getItem("theme"); - } - // 2. 检查系统偏好 - if (window.matchMedia("(prefers-color-scheme: dark)").matches) { - return "dark"; - } - // 3. 默认值 - return "light"; - } - - const currentTheme = getInitialTheme(); - const giscusTheme = currentTheme === "dark" ? "dark" : "light"; - - const giscusScript = document.createElement("script"); - giscusScript.src = "https://giscus.app/client.js"; - giscusScript.setAttribute( - "data-repo", - "yingyu5658/yingyu5658.github.io", - ); - giscusScript.setAttribute("data-repo-id", "R_kgDOOBetsA"); - giscusScript.setAttribute("data-category", "Announcements"); - giscusScript.setAttribute("data-category-id", "DIC_kwDOOBetsM4CoF_Z"); - giscusScript.setAttribute("data-mapping", "title"); - giscusScript.setAttribute("data-strict", "0"); - giscusScript.setAttribute("data-reactions-enabled", "0"); - giscusScript.setAttribute("data-emit-metadata", "0"); - giscusScript.setAttribute("data-input-position", "bottom"); - giscusScript.setAttribute("data-theme", giscusTheme); - giscusScript.setAttribute("data-lang", "zh-CN"); - giscusScript.crossOrigin = "anonymous"; - giscusScript.async = true; - - document.getElementById("giscus-container").appendChild(giscusScript); - - document.addEventListener("DOMContentLoaded", function () { - const form = document.getElementById("webmention-submit-form"); - const submitBtn = document.getElementById("webmention-submit-btn"); - const feedbackEl = document.getElementById( - "webmention-form-feedback", - ); - - if (!form) return; - - form.addEventListener("submit", async function (e) { - e.preventDefault(); - - // 禁用提交按钮防止重复提交 - const originalBtnText = submitBtn.textContent; - submitBtn.disabled = true; - submitBtn.textContent = "发送中..."; - - // 清除之前的反馈信息 - feedbackEl.textContent = ""; - - try { - // 使用 FormData 收集表单数据 - const formData = new FormData(form); - - // 发送 POST 请求 - const response = await fetch(form.action, { - method: "POST", - headers: { - Accept: "application/json", - }, - body: new URLSearchParams(formData), - }); - - const result = await response.json(); - - if (response.ok) { - // 成功响应 - feedbackEl.textContent = - "✅ 提交成功!Webmention 正在处理中。"; - form.reset(); - } else { - // 错误响应 - let errorMsg = "提交失败:"; - if (result.error || result.summary) { - errorMsg += result.error || result.summary; - } - feedbackEl.textContent = errorMsg; - } - } catch (error) { - // 网络错误 - feedbackEl.textContent = - "❌ 提交过程中出现网络错误,请稍后重试。"; - } finally { - // 恢复提交按钮状态 - submitBtn.disabled = false; - submitBtn.textContent = originalBtnText; - } - }); - }); - </script> - - {{ end }} - </div> - </div> - </details> +<!-- {{ if .Params.comments | default true }} --> +<!-- <div class="comments-and-webmentions"> --> +<!-- <details> --> +<!-- <summary> --> +<!-- <p style="display: inline">评论 与 Webmentions</p> --> +<!-- </summary> --> +<!-- <div id="giscus-container"></div> --> + +<!-- <div class="wm"> --> +<!-- <div id="webmentions"></div> --> +<!-- <script --> +<!-- src="/js/webmention.min.js" --> +<!-- data-id="webmentions" --> +<!-- data-page-url="https://www.glowisle.me{{ .RelPermalink }}" --> +<!-- data-max-webmentions="50" --> +<!-- data-wordcount="30" --> +<!-- data-sort-by="published" --> +<!-- data-sort-dir="up" --> +<!-- async --> +<!-- ></script> --> + +<!-- <p> --> +<!-- 若想回复本文,请在你的博客或社媒发布含有本文链接的帖子,然后在下方表单提交链接。 --> +<!-- </p> --> +<!-- <div class="wm-guide-content"> --> +<!-- <div class="webmention-form"> --> +<!-- <form --> +<!-- id="webmention-submit-form" --> +<!-- action="https://webmention.io/www.glowisle.me/webmention" --> +<!-- method="post" --> +<!-- > --> +<!-- <\!-- 自动填充的目标文章链接 -\-> --> +<!-- <input --> +<!-- type="hidden" --> +<!-- name="target" --> +<!-- value="https://www.glowisle.me{{ .RelPermalink }}" --> +<!-- /> --> +<!-- <div> --> +<!-- <label for="webmention-source">你的文章链接:</label> --> +<!-- <input --> +<!-- type="url" --> +<!-- id="webmention-source" --> +<!-- name="source" --> +<!-- required --> +<!-- pattern="https?://.+" --> +<!-- /> --> +<!-- <button type="submit" id="webmention-submit-btn">提交</button> --> +<!-- </div> --> +<!-- <div id="webmention-form-feedback"></div> --> +<!-- </form> --> +<!-- <p> --> +<!-- 也可以<a href="mailto:i@glowisle.me?subject=回复《{{ .Title }}》">发送邮件</a>评论。 --> +<!-- </p> --> +<!-- <a href="https://indieweb.org/webmention" --> +<!-- >关于 Webmention 的更多信息</a --> +<!-- > --> +<!-- 以及 --> +<!-- <a href="https://www.glowisle.me/posts/tear-hypocrisy-apart/" --> +<!-- >为什么要这么做?</a --> +<!-- > --> +<!-- </div> --> + +<!-- <script> --> +<!-- function getInitialTheme() { --> +<!-- // 1. 优先检查 localStorage 中的用户偏好 --> +<!-- if ( --> +<!-- typeof localStorage !== "undefined" && --> +<!-- localStorage.getItem("theme") --> +<!-- ) { --> +<!-- return localStorage.getItem("theme"); --> +<!-- } --> +<!-- // 2. 检查系统偏好 --> +<!-- if (window.matchMedia("(prefers-color-scheme: dark)").matches) { --> +<!-- return "dark"; --> +<!-- } --> +<!-- // 3. 默认值 --> +<!-- return "light"; --> +<!-- } --> + +<!-- const currentTheme = getInitialTheme(); --> +<!-- const giscusTheme = currentTheme === "dark" ? "dark" : "light"; --> + +<!-- const giscusScript = document.createElement("script"); --> +<!-- giscusScript.src = "https://giscus.app/client.js"; --> +<!-- giscusScript.setAttribute( --> +<!-- "data-repo", --> +<!-- "yingyu5658/yingyu5658.github.io", --> +<!-- ); --> +<!-- giscusScript.setAttribute("data-repo-id", "R_kgDOOBetsA"); --> +<!-- giscusScript.setAttribute("data-category", "Announcements"); --> +<!-- giscusScript.setAttribute("data-category-id", "DIC_kwDOOBetsM4CoF_Z"); --> +<!-- giscusScript.setAttribute("data-mapping", "title"); --> +<!-- giscusScript.setAttribute("data-strict", "0"); --> +<!-- giscusScript.setAttribute("data-reactions-enabled", "0"); --> +<!-- giscusScript.setAttribute("data-emit-metadata", "0"); --> +<!-- giscusScript.setAttribute("data-input-position", "bottom"); --> +<!-- giscusScript.setAttribute("data-theme", giscusTheme); --> +<!-- giscusScript.setAttribute("data-lang", "zh-CN"); --> +<!-- giscusScript.crossOrigin = "anonymous"; --> +<!-- giscusScript.async = true; --> + +<!-- document.getElementById("giscus-container").appendChild(giscusScript); --> + +<!-- document.addEventListener("DOMContentLoaded", function () { --> +<!-- const form = document.getElementById("webmention-submit-form"); --> +<!-- const submitBtn = document.getElementById("webmention-submit-btn"); --> +<!-- const feedbackEl = document.getElementById( --> +<!-- "webmention-form-feedback", --> +<!-- ); --> + +<!-- if (!form) return; --> + +<!-- form.addEventListener("submit", async function (e) { --> +<!-- e.preventDefault(); --> + +<!-- // 禁用提交按钮防止重复提交 --> +<!-- const originalBtnText = submitBtn.textContent; --> +<!-- submitBtn.disabled = true; --> +<!-- submitBtn.textContent = "发送中..."; --> + +<!-- // 清除之前的反馈信息 --> +<!-- feedbackEl.textContent = ""; --> + +<!-- try { --> +<!-- // 使用 FormData 收集表单数据 --> +<!-- const formData = new FormData(form); --> + +<!-- // 发送 POST 请求 --> +<!-- const response = await fetch(form.action, { --> +<!-- method: "POST", --> +<!-- headers: { --> +<!-- Accept: "application/json", --> +<!-- }, --> +<!-- body: new URLSearchParams(formData), --> +<!-- }); --> + +<!-- const result = await response.json(); --> + +<!-- if (response.ok) { --> +<!-- // 成功响应 --> +<!-- feedbackEl.textContent = --> +<!-- "✅ 提交成功!Webmention 正在处理中。"; --> +<!-- form.reset(); --> +<!-- } else { --> +<!-- // 错误响应 --> +<!-- let errorMsg = "提交失败:"; --> +<!-- if (result.error || result.summary) { --> +<!-- errorMsg += result.error || result.summary; --> +<!-- } --> +<!-- feedbackEl.textContent = errorMsg; --> +<!-- } --> +<!-- } catch (error) { --> +<!-- // 网络错误 --> +<!-- feedbackEl.textContent = --> +<!-- "❌ 提交过程中出现网络错误,请稍后重试。"; --> +<!-- } finally { --> +<!-- // 恢复提交按钮状态 --> +<!-- submitBtn.disabled = false; --> +<!-- submitBtn.textContent = originalBtnText; --> +<!-- } --> +<!-- }); --> +<!-- }); --> +<!-- </script> --> + +<!-- {{ end }} --> +<!-- </div> --> +<!-- </div> --> +<!-- </details> --> {{ if not .Params.comments }} {{ with .Params.reason }} diff --git a/layouts/_markup/render-blockquote.html b/layouts/_markup/render-blockquote.html new file mode 100644 index 0000000..c11de7e --- /dev/null +++ b/layouts/_markup/render-blockquote.html @@ -0,0 +1,107 @@ +<!-- 来自:https://github.com/BigCoke233/geek-death-project/blob/master/layouts/_markup/render-blockquote.html --> + +<style> + +/* 图标/标题所在的第一个 div */ +blockquote[class*="alert-"] > div:first-child { + font-size: 1.25rem; + font-weight: bold; + user-select: none; +} + +/* 2. 针对不同类型的具体配色 */ + +/* Note - 信息提示 - 蓝色 */ +.alert-note { + border-left-color: #2196f3; +} +.alert-note > div:first-child { + color: #2196f3; +} + +/* Tip - 技巧/建议 - 绿色 */ +.alert-tip { + border-left-color: #4caf50; +} +.alert-tip > div:first-child { + color: #4caf50; +} + +/* Warning - 警告 - 橙色 */ +.alert-warning { + border-left-color: #ff9800; +} +.alert-warning > div:first-child { + color: #ff9800; +} + +/* Caution - 危险/注意 - 红色 */ +.alert-caution { + border-left-color: #f44336; +} +.alert-caution > div:first-child { + color: #f44336; +} + +/* Important - 重要 - 紫色/深蓝 */ +.alert-important { + border-left-color: #9c27b0; +} +.alert-important > div:first-child { + color: #9c27b0; +} + +/* Announcement - 公告 - 青色 */ +.alert-announcement { + border-left-color: #00bcd4; +} +.alert-announcement > div:first-child { + color: #00bcd4; +} + +/* 3. 普通 blockquote 样式 (非 Alert) */ +blockquote.text-secondary { + border-left: 3px solid #e0e0e0; + color: #666; + padding-left: 1.5rem !important; /* 覆盖 p-0 */ +} + +/* 适配暗色模式 (可选) */ +@media (prefers-color-scheme: dark) { + blockquote.text-secondary { + border-left-color: #444; + color: #aaa; + } +} +</style> + + +{{ $emojis := dict + "caution" "🚨" + "important" "☝️" + "note" "ℹ️" + "tip" "💡" + "warning" "⚠️" + "announcement" "📣" +}} + +{{ if eq .Type "alert" }} + <blockquote class="rounded-1 leading-[1.75] mx-0 px-5 + flex gap-3 my-2 alert-{{ .AlertType }}" + > + <div class="py-5"> + {{ with .AlertTitle }} + {{.}} + {{ else }} + {{ index $emojis .AlertType }} + {{ end }} + </div> + <div> + {{ .Text }} + </div> + </blockquote> +{{ else }} + <blockquote class="text-secondary p-0 m-0 ml-[1em]"> + {{ .Text }} + </blockquote> +{{ end }} diff --git a/layouts/archives/single.html b/layouts/archives/single.html index 698fc46..efafdca 100644 --- a/layouts/archives/single.html +++ b/layouts/archives/single.html @@ -1,96 +1,42 @@ {{ define "main" }} <header>{{- partial "header.html" . -}}</header> <content> - {{ if .Site.Params.postSearch }} - <input - id="search-input" - type="text" - placeholder="搜索文章..." - style="margin-top: 16px" - /> - <script> - document.addEventListener('DOMContentLoaded', function () { - const searchInput = document.getElementById('search-input'); - const posts = document.querySelectorAll('.blog-posts li'); - const years = document.querySelectorAll('.blog-posts h3'); - - function updateSearchResults(searchTerm) { - let visiblePosts = 0; - const displayedYears = new Set(); - - posts.forEach(function (post) { - const titleLink = post.querySelector('a'); - const timeElement = post.querySelector('time'); - - if (titleLink && timeElement) { - const title = titleLink.textContent.toLowerCase(); - const year = timeElement.getAttribute('datetime').split('-')[0]; - - if (title.includes(searchTerm)) { - post.style.display = ''; - visiblePosts++; - displayedYears.add(year); - } else { - post.style.display = 'none'; - } - } - }); - - {{ if .Site.Params.groupByYear }} - years.forEach(function (y) { - const year = y.textContent; - y.style.display = displayedYears.has(year) ? '' : 'none'; - }); - {{ end }} - - {{ if .Site.Params.showPostCount }} - const countText = `找到 ${visiblePosts} 篇文章`; - const countElement = document.getElementById('post-count'); - if (countElement) { - countElement.innerHTML = countText; - } - {{ end }} - } - - if (searchInput) { - searchInput.addEventListener('input', function () { - updateSearchResults(this.value.toLowerCase().trim()); - }); - } - }); - </script> - {{ end }} {{ $allPosts := where .Site.RegularPages "Type" "eq" "posts" }} + {{ $allPosts := where .Site.RegularPages "Type" "eq" "posts" }} {{ $excludePosts := where $allPosts "Params.categories" "intersect" (slice "1") }} + {{ $postPages := $allPosts | complement $excludePosts }} - {{ $postPages := $allPosts | complement $excludePosts }} {{ if - .Site.Params.showPostCount }} - <p id="post-count">共有 {{ len $postPages }} 篇文章</p> + {{ if .Site.Params.showPostCount }} + <p id="post-count">共 {{ len $postPages }} 篇文章</p> {{ end }} - <ul class="blog-posts"> - {{ if gt (len $postPages) 0 }} {{ $pagesToShow := $postPages.ByDate.Reverse - }} {{ $currentYear := 0 }} {{ range $pagesToShow }} {{ if .Date }} {{ $year - := .Date.Year }} {{ if and (.Site.Params.groupByYear) (ne $year - $currentYear) }} - <h3>{{ $year }}</h3> - {{ $currentYear = $year }} {{ end }} {{ end }} - - <li> - <span - class="{{ if .Site.Params.groupByYear }}grouped{{else}}ungrouped{{end}}" - > - <i> - <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> - {{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} - </time> - </i> - </span> - <a href="{{ .Permalink }}">{{ .Title }}</a> - </li> - {{ end }} {{ else }} - <li>暂无文章</li> + <div class="blog-posts"> + {{ if gt (len $postPages) 0 }} + {{ range $postPages.GroupByDate "2006" }} + <details> + <summary> + <p style="display: inline;">{{ .Key }} 年 ({{ len .Pages }})</p> + </summary> + + <ul> + {{ range .Pages }} + <li> + <span> + <i> + <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> + {{ .Date.Format (default "2006-01-02" $.Site.Params.dateFormat) }} + </time> + </i> + </span> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </li> + {{ end }} + </ul> + </details> + {{ end }} + {{ else }} + <p>暂无文章</p> {{ end }} - </ul> + </div> </content> <hr /> -{{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/style.html b/layouts/partials/style.html index 24ed22c..a1b8176 100644 --- a/layouts/partials/style.html +++ b/layouts/partials/style.html @@ -1,850 +1,737 @@ <style> - @font-face { - font-family: "Source Serif Pro"; - src: url("/fonts/SourceSerifPro-Regular.otf"); - } - - article p, .summary p { - line-height: 35px; - } - - div.footnotes hr::before { - content: "Footnotes"; - display: block; - font-size: 1.5em; - color: var(--bold-text-color); - margin-top: 16px; - - } - - .recent-posts-item { - margin: 0; - margin-bottom: 120px; - } - - .recent-post-title { - } - - .post-meta { - margin-top: 20px; - margin-bottom: 5px; - } - - .recent-item { - position: relative; - margin-bottom: 8px; - display: flex; - align-items: flex-start; - } - - .item-link { - width: 100%; - display: inline-block; - text-decoration: none; - flex: 1; - overflow: hidden; - text-overflow: ellipsis; - font-size: 1.6em; - word-wrap: break-word; - white-space: normal; - word-wrap: break-word; - } - - .post-title a.item-link { +:root { + --width-max: 700px; + --font-secondary: monospace; + --font-size-primary: 1rem; + --font-size-secondary: .85rem; + --body-bg-color: #ffffff; + --bold-text-color: #222; + --body-text-color: #444; + --link-color: #0066cc; + --link-visited-color: #551a8b; + --table-border-color: #f2f2f2; + --table-th-bg-color: #f2f2f2; + --img-border-color: #f2f2f2; + --code-bg-color: #f2f2f2; + --code-text-color: #222; + --blockquote-border-color: #666; + --blockquote-text-color: #646464; + --upvoted-color: #fa8072; + --caption-text-color: #666; + --toc-text-color: #e5e5e5; + --toc-hover-color: e5e5e5; + --music-bg-hover-light: #e5e5e5; + --music-bg-light: rgba(229, 229, 229, 0.5); + --music-text-secondary: #666; + --music-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + --summary-text-color: #4e4e4e; + --svg-size: 0.85em; + --title-color: #444444; +} + +.e-content :is(h1, h2, h3, h4, h5, h6), .summary :is(h1, h2, h3, h4, h5, h6) { + margin-top: 1.5em; +} + +.post-meta-item a, .rss-icon a, .post-title a, header a, a.title h1, p { + color: var(--body-text-color) +} + +.recent-post-title a.item-link, h2.post-title a.item-link , .post-title, .recent-post-title { + margin-bottom: 0; +} + + +body { + font-family: var(--font-primary); + font-size: var(--font-size-primary); + margin: auto; + padding: 20px; + max-width: var(--width-max); + text-align: left; + background-color: var(--body-bg-color); + word-wrap: break-word; + overflow-wrap: break-word; + line-height: 1.6; + color: var(--body-text-color); +} + +.recent-post-title a, +.post-title a { + margin: 16px 0; +} + +.post-title:hover { + color: var(--link-color); +} + +article p { + line-height: 2; + font-weight: 400; +} + +div.summary { + font-weight: 400; +} + +div.summary p { + line-height: 2; +} + +a { + color: var(--link-color); + cursor: pointer; + text-decoration: none; + transition-duration: 0.3s; +} + +strong, b { + color: var(--bold-text-color); +} + +i { + font-style: normal; +} + +hr { + border: 0; + border-top: 1px dashed; +} + +time { + font-family: var(--font-primary); + color: var(--body-text-color); +} + +header { + margin-top: 30px; + margin-bottom: 4vh; +} + +.title { + text-align: left; + text-decoration: none !important; +} + +.title:hover { + text-decoration: none; +} + +a.title h1 { + margin: 15px 0 15px 0; + font-size: 2.15em; +} + +.title span { + font-weight: 400; +} + +nav { + text-align: left; + margin-bottom: 20px; +} + +nav a { + margin-right: 8px; + text-decoration: none !important; +} + +nav a:hover { + text-decoration: underline 0.5px !important; +} + +footer { + padding: 25px 0; + text-align: left; + font-size: var(--font-size-secondary); +} + +.recent-posts-item { + margin: 0 0 120px 0; +} + +.recent-list { + padding-left: 2vw; +} + +.recent-item { + position: relative; + margin-bottom: 8px; + display: flex; + align-items: flex-start; + list-style-type: none; +} + +.item-link { width: 100%; - display: inline-block; - text-decoration: none; - flex: 1; - overflow: hidden; - text-overflow: ellipsis; - font-size: 1.25em; - word-wrap: break-word; - white-space: normal; - word-wrap: break-word; - - } - - .post-date { - font-size: 0.9em; - color: #666; - display: inline-block; - min-width: 80px; - flex-shrink: 0; - } - - .recent-empty { - text-align: center; - font-style: italic; - } - - @media (max-width: 720px) { - .post-date { - min-width: auto; - font-size: 0.85em; - } - - .item-link { - white-space: normal; - overflow: visible; - } - - - .post-title a.item-link { - font-size: 1em; - } - } - - .post-meta-item svg { - display: inline; - width: var(--svg-size); - height: var(--svg-size); - } - - .post-meta-item { - margin-right: 0.8em; - display: inline-block; - font-size: var(--font-size-secondary); - } - - .post-tag a { - font-size: var(--font-size-secondary) !important; - } - .post-meta-item p { - margin: 0; - } - - .recent-posts .post-meta { - margin-bottom: 6em; - } - - :root { - --width-max: 700px; - --font-primary: "Source Serif Pro", "Source Han Serif SC", serif; - --font-secondary: monospace; - --font-size-primary: 1.15rem; - --font-size-secondary: 1rem; - --body-bg-color: #ffffff; - --bold-text-color: #222; - --body-text-color: #444; - --link-color: #222; - --link-visited-color: #222; - --table-border-color: #f2f2f2; - --table-th-bg-color: #f2f2f2; - --img-border-color: #f2f2f2; - --code-bg-color: #f2f2f2; - --code-text-color: #222; - --blockquote-border-color: #666; - --blockquote-text-color: #646464; - --upvoted-color: #fa8072; - --caption-text-color: #666; - --toc-text-color: #e5e5e5; - --toc-hover-color: #655e5e; - - --music-bg-hover-light: #e5e5e5; /* neutral-200 */ - --music-bg-light: rgba(229, 229, 229, 0.5); /* neutral-200/50 */ - --music-text-secondary: #666; - --music-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), - 0 4px 6px -2px rgba(0, 0, 0, 0.05); - --summary-text-color: #4e4e4e; - --svg-size: 0.85em; - } - - .social-icons { - margin: 15px; - margin-top: 5px; - text-align: center; - } - - .social-icons a { - padding: 5px 5px; - } - - .booklist { - display: grid; - grid-template-columns: repeat(5, 1fr); - gap: 20px; - } - - .booklist-item { - transform: translateZ(0); - transition: transform 0.25s, box-shadow 0.25s; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - } - - .booklist-item img { - height: 100%; - } - - .booklist-item:hover { - transform: translateY(-5px) translateZ(20px); - box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); - } - - .rss-icon { - display: inline; - font-size: 16px; - float: right; - font-family: var(--font-primary); - } - - img.missing { - display: none; - } - - nav a, - h1.post-title a, - .blog-posts li a { - text-decoration: none !important; - } - - nav a:hover, - .post-title a:hover, - .blog-posts a:hover { - text-decoration: underline 0.5px !important; - } - - .wm { - border: 1px #d0d7de solid; - border-radius: 0.25em; - padding-top: 0; - padding: 1.5vw; - background-color: #fffaed; - margin-top: 1vh; - } - - .wm p { - margin-top: 1px; - } - - article p, div.summary { - margin-top: 20px; - font-weight: 400; - } - - .item-link { - white-space: nowrap; - overflow: hidden; - } - - h1.post-title { - margin-top: 2vh; - margin-bottom: 10px; - } - - h1.post-title a { - font-weight: 700; - } - - .recent-list { - padding-left: 2vw; - } - - .recent-item { - list-style-type: none; - } - - .post-date { - display: inline; - } - - .post-date, - .post-date-shortcode { - margin-left: auto; - } - - .music-card img { - border: none !important; - } - - /* --- 主容器 --- */ - /* flex flex-col gap-2 */ - .music-card { - display: flex; - flex-direction: column; - gap: 0.5rem; - width: 100%; - } - - /* --- 信息区域 (左侧) --- */ - /* flex gap-5 items-center */ - .music-info { - display: flex; - align-items: center; - gap: 1.25rem; - } - - /* 封面图 */ - /* w-15 h-15 rounded-lg shadow-lg m-0! */ - .music-cover { - width: 3.75rem; /* 15 * 0.25rem */ - height: 3.75rem; - border-radius: 0.5rem; - box-shadow: var(--music-shadow); - margin: 0 !important; - object-fit: cover; - } - - /* 文本信息 */ - .music-title { - margin: 0; - font-size: 1rem; /* text-size-base */ - font-weight: bold; - line-height: 1.2; - } - - .music-artist { - margin: 0; - font-size: 0.875rem; /* text-size-sm */ - color: var(--music-text-secondary); - } - - /* --- 链接区域 (右侧) --- */ - /* flex gap-2 items-center */ - .music-links { - display: flex; - align-items: center; - gap: 0.5rem; - } - - /* 链接按钮 */ - /* block rounded-full px-3 transition-colors no-underline! text-size-xs inline-flex gap-1 items-center bg... */ - .music-btn { - display: inline-flex; - align-items: center; - gap: 0.25rem; - padding: 0 0.75rem; /* px-3 */ - height: 2rem; - border-radius: 9999px; /* rounded-full */ - text-decoration: none !important; - font-size: 0.75rem; /* text-size-xs */ - transition: background-color 0.3s ease; - - /* 浅色模式背景 */ - background-color: var(--music-bg-light); - color: inherit; - } - - .music-btn:hover { - background-color: var(--music-bg-hover-light); - } - - /* 图标 */ - /* w-3 h-3 m-0! */ - .music-icon { - display: block; - width: 0.75rem; - height: 0.75rem; - margin: 0 !important; - } - - /* 按钮文字 */ - .music-btn-text { - display: inline; - } - - /* --- 桌面端/大屏适配 (Media Query: md / min-width: 768px) --- */ - @media (min-width: 768px) { - /* 容器变为横向排列,两端对齐 */ - /* md:flex-row md:justify-between md:items-center */ - .music-card { - flex-direction: row; - justify-content: space-between; - align-items: center; - } - - /* 按钮在大屏下变为方形图标按钮 */ - /* md:p-4 */ - .music-btn { - padding: 1rem; - justify-content: center; - width: auto; - height: auto; - } - - /* 图标变大 */ - /* md:w-5 md:h-5 */ - .music-icon { - width: 1.25rem; - height: 1.25rem; - } - - /* 文字在大屏下隐藏 */ - /* md:hidden */ - .music-btn-text { - display: none; - } - } - - /* 暗色模式 */ - @media (prefers-color-scheme: dark) { - :root { - --summary-text-color: #c9c6c5; - --body-bg-color: #121212; - --bold-text-color: #eee; - --body-text-color: #e8e6e3; - --link-color: #ddd; - --link-visited-color: #c3b1ee; - --table-border-color: #999; - --table-th-bg-color: #999; - --img-border-color: #999; - --code-bg-color: #141414; - --code-text-color: #ddd; - --blockquote-border-color: #7b7b7b; - --blockquote-text-color: #acacac; - --caption-text-color: #aaa; - --toc-text-color: #373737; - --toc-hover-color: #cac3c3; - --music-bg-hover-dark: #525252; - --music-bg-dark: rgba(82, 82, 82, 0.5); - --music-text-secondary: #a3a3a3; - --color-background: var(--body-bg-color) !important; - } - - .post-meta-item svg { - filter: invert(1) hue-rotate(180deg); - } - - - - div.summary a { - text-decoration: underline 0.1px #888; - } - - strong { - font-weight: 650; - } - - .music-btn { - background-color: var(--music-bg-dark); - } - .music-btn:hover { - background-color: var(--music-bg-hover-dark); - } - - .category-link { - color: #dbdbdb; - } - - .wm { - background-color: #161b22; - border-color: #30363d; - color: var(--body-text-color); - padding: 10px; - } - - .wm input { - background-color: #010409; - border: #30363d 1px solid; - color: var(--body-text-color); - outline: none; - transition: border-color 0.2s ease-in-out; - } - - #webmention-source:focus { - border-color: var(--color-accent-fg, #0969da); - box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1); - } - - .wm button { - color: var(--body-text-color); - background-color: #161b22; - border: #30363d 1px solid; - } - - .post-title a, - { - color: #fff !important; - } - - .post-summary { - color: var(--text-color-primary) !important; - } - - .post-item { - border-bottom: 1px solid #414141 !important; - } - - .pagination-link { - border: 1px solid #414141 !important; - } - - a { - font-weight: 500 !important; - } - } - - body { - font-family: var(--font-primary); - font-size: var(--font-size-primary); - margin: auto; - padding: 20px; - max-width: var(--width-max); - text-align: left; - background-color: var(--body-bg-color); - word-wrap: break-word; - overflow-wrap: break-word; - line-height: 1.6; - color: var(--body-text-color); - } - - h1, - h2, - h3, - h4, - h5, - h6, - strong, - b { - color: var(--bold-text-color); - } - - h1, - h2, - h3, - h4, - h5, - h6 { - margin: 16px 0; - margin-top: 1.5em; - } - - a { - color: var(--link-color); - cursor: pointer; - text-decoration: underline 0.2px #888; - transition-duration: 0.3s; - font-weight: 600; - } - - .posts-list li { - margin-bottom: 12px; - } - - .title { - text-align: left; - text-decoration: none !important; - } - - a.title h1 { - margin: 15px; - margin-left: 0; - font-size: 2.15em; - } - - header { - margin-top: 30px; - margin-bottom: 4vh; - - } - - .title:hover { - text-decoration: none; - } - - .title span { - font-weight: 400; - } - - nav { - text-align: left; - margin-bottom: 20px; - } - - nav a { - margin-right: 8px; - } - - textarea { - width: 100%; - font-size: 16px; - } - - input { - font-size: 14px; - } - - article { - line-height: 1.6; - } - - table { - width: 100%; - border-collapse: collapse; - border: 1px solid var(--table-border-color); - border-radius: 4px; - margin-top: 16px; - } - - th, - td { - border: 1px solid var(--table-border-color); - padding: 4px; - } - - th { - background-color: var(--table-th-bg-color); - } - - hr { - border: 0; - border-top: 1px dashed; - } - - img { - max-width: 100%; - display: block; - margin-left: auto; - margin-right: auto; - content-visibility: auto; - loading: lazy; - } - - img[src*="#minipic"] { - max-width: 50%; - margin-left: 0; - margin-right: auto; - } - - .image-caption figcaption { - text-align: center; - font-style: italic; - font-size: 0.8em; - margin-top: 0.6em; - color: var(--caption-text-color); - } - - .image-caption { - margin: auto; - } - - i { - font-style: normal; - } - - time { - font-family: var(--font-primary); - color: var(--body-text-color); - } - - code { - font-family: var(--font-secondary); - background-color: var(--code-bg-color); - color: var(--code-text-color); - padding: 2px; - border-radius: 4px; - } - - pre code { - display: block; - padding: 16px; - white-space: pre-wrap; - overflow-x: auto; - } - - div.highlight pre { - border-radius: 4px; - } - - div.highlight code { - background-color: var(--code-bg-color); - color: var(--code-text-color); - } - - blockquote { - /* border-left: 4px solid var(--blockquote-border-color); */ - color: var(--blockquote-text-color); - margin: 0; - margin-top: 17px; - padding-left: 20px; - font-style: normal; - } - - footer { - padding: 25px 0; - text-align: left; - font-size: var(--font-size-secondary); - } - - ul li:has(input) { - list-style-type: none; - margin-left: -25.5px; - } - - /* blog post list */ - ul.blog-posts { - list-style-type: none; - padding: unset; - } - - ul.blog-posts li { - display: flex; - margin-bottom: 8px; - } - - ul.blog-posts li span { - flex: 0 0 130px; - } - - ul.blog-posts li span.grouped { - flex: 0 0 80px; - } - - ul.blog-posts li a:visited { - color: var(--link-visited-color); - } - - ul.blog-posts a { - margin-left: 10px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - /* TOC 样式 */ - div.toc { - position: fixed; /* 固定定位 */ - top: 50%; /* 垂直居中 */ - left: calc( - (100vw + var(--width-max)) / 2 - ); /* 水平定位,根据视口宽度和最大内容宽度计算 */ - transform: translateY(-50%); /* 垂直居中调整 */ - width: calc((90vw - var(--width-max)) / 2); /* 宽度计算 */ - max-height: 80vh; /* 最大高度为视口高度的80% */ - overflow-y: auto; /* 垂直方向内容溢出时显示滚动条 */ - border: none; /* 无边框 */ - padding: 0; /* 无内边距 */ - margin: 0; /* 无外边距 */ - z-index: 99; /* 设置堆叠顺序,确保在其他元素之上 */ - - /* 隐藏滚动条 */ - &::-webkit-scrollbar { - /* Webkit 浏览器(Chrome, Safari)滚动条样式 */ - display: none; /* 隐藏滚动条 */ - } - - -ms-overflow-style: none; /* IE 和 Edge 隐藏滚动条 */ - scrollbar-width: none; /* Firefox 隐藏滚动条 */ - } - - .toc-nav { - /* 目录导航容器样式 */ - padding: 1.5rem; /* 内边距 */ - } - - .toc-nav ul { - /* 目录导航无序列表样式 */ - list-style: none; /* 移除列表项标记 */ - padding: 0; /* 移除内边距 */ - margin: 0; /* 移除外边距 */ - } - - .toc-nav li { - /* 目录导航列表项样式 */ - margin: 8px 0; /* 上下外边距 */ - } - - .toc-nav a { - /* 目录链接样式 */ - display: block; /* 块级显示 */ - text-decoration: none; /* 无下划线 */ - color: transparent; /* 默认透明 */ - padding: 0 12px; /* 内边距 */ - transition: all 0.2s ease; /* 所有属性过渡效果 */ - font-size: 0.9rem; /* 字体大小 */ - line-height: 1.4; /* 行高 */ - text-align: left; /* 文本左对齐 */ - white-space: nowrap; /* 禁止换行 */ - overflow: hidden; /* 隐藏溢出内容 */ - text-overflow: ellipsis; /* 显示省略号 */ - max-width: 100%; /* 限制最大宽度 */ - } - - .toc-nav a { - color: var(--toc-text-color); /* hover时显示文字颜色 */ - } - - .toc-nav a::before { - /* 目录链接前的小横线样式 */ - content: ""; /* 生成内容 */ - display: inline-block; /* 行内块级显示 */ - width: 16px; /* 宽度 */ - height: 4px; /* 高度 */ - background-color: var(--toc-text-color); /* 灰色背景 */ - border-radius: 16px; /* 圆角 */ - margin-right: 12px; /* 右外边距 */ - vertical-align: middle; /* 垂直居中对齐 */ - } - - .toc-nav ul ul a::before { - /* 二级目录链接前的小横线样式 */ - width: 12px; /* 显示宽度 */ - margin-right: 16px; /* 调整右外边距,使其与默认 a::before 占据的总宽度一致 (12px + 12px = 24px) */ - } - - .toc-nav ul ul ul a::before { - /* 三级目录链接前的小横线样式 */ - width: 8px; /* 显示宽度 */ - margin-right: 20px; /* 调整右外边距,使其与默认 a::before 占据的总宽度一致 (8px + 16px = 24px) */ - } - - .toc-nav a, /* 活跃状态和鼠标悬停状态的目录链接样式 */ - .toc-nav a { - text-decoration: none; /* 无下划线 */ - color: var(--toc-hover-color); /* 文字颜色变为深灰色 */ - } - - .toc-nav a.active::before, /* 活跃状态和鼠标悬停状态的目录链接前小横线样式 */ - .toc-nav a:hover::before { - background-color: var(--toc-hover-color); /* 背景颜色变为深灰色 */ - } - - /* upvote button style */ - button.upvote-btn { - margin: 0; - margin-left: auto; - padding: 0; - border: none; - background: none; - cursor: pointer; - display: flex; - flex-direction: column; - align-items: center; - color: var(--body-text-color); - } - - button.upvoted { - color: var(--upvoted-color); - } - - span.upvote-count { - margin-top: -4px; - font-size: smaller; - } - - @media (max-width: 800px) { - img[src*="#minipic"] { - max-width: 100%; - margin-left: auto; - margin-right: auto; - } - - div.toc { - display: none; - } - } - - @media (max-width: 700px) { - .booklist { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 10px; - } - } - - @media (max-width: 400px) { - .booklist { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 10px; - } - } + display: inline-block; + text-decoration: none; + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + font-size: 1.6em; + word-wrap: break-word; + white-space: nowrap; +} + +.post-title a.item-link { + font-size: 1.25em; + white-space: normal; /* 覆盖上面的 nowrap */ +} + +.post-date, .post-date-shortcode { + font-size: 0.9em; + color: #666; + display: inline; + min-width: 80px; + flex-shrink: 0; + margin-left: auto; +} + +.recent-empty { + text-align: center; + font-style: italic; +} + +ul.blog-posts { + list-style-type: none; + padding: unset; +} + +ul.blog-posts li { + display: flex; + margin-bottom: 8px; +} + +ul.blog-posts li a { + margin-left: 10px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-decoration: none !important; +} + +ul.blog-posts li a:hover { + text-decoration: underline 0.5px !important; +} + +ul.blog-posts li a:visited { + color: var(--link-visited-color); +} + +ul.blog-posts li span { + flex: 0 0 130px; +} + +ul.blog-posts li span.grouped { + flex: 0 0 80px; +} + +.posts-list li { + margin-bottom: 12px; +} + +.post-meta { + margin-top: 20px; + margin-bottom: 5px; +} + +.recent-posts .post-meta { + margin-bottom: 3em; +} + +.post-meta-item { + margin-right: 0.8em; + display: inline-block; + font-size: var(--font-size-secondary); +} + +.post-meta-item svg { + display: inline; + width: var(--svg-size); + height: var(--svg-size); +} + +.post-meta-item p { + margin: 0; +} + +.post-tag a { + font-size: var(--font-size-secondary) !important; +} + +img { + max-width: 100%; + display: block; + margin-left: auto; + margin-right: auto; + content-visibility: auto; +} + +img.missing { + display: none; +} + +img[src*="#minipic"] { + max-width: 50%; + margin-left: 0; + margin-right: auto; +} + +.image-caption { + margin: auto; +} + +.image-caption figcaption { + text-align: center; + font-style: italic; + font-size: 0.8em; + margin-top: 0.6em; + color: var(--caption-text-color); +} + +.booklist { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 20px; +} + +.booklist-item { + transform: translateZ(0); + transition: transform 0.25s, box-shadow 0.25s; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +.booklist-item:hover { + transform: translateY(-5px) translateZ(20px); + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); +} + +.booklist-item img { + height: 100%; +} + +.rss-icon { + display: inline; + font-size: 16px; + float: right; + font-family: var(--font-primary); +} + +.social-icons { + margin: 15px 15px 5px 15px; + text-align: center; +} + +.social-icons a { + padding: 5px 5px; +} + +code { + font-family: var(--font-secondary); + background-color: var(--code-bg-color); + color: var(--code-text-color); + padding: 2px; + border-radius: 4px; +} + +pre code { + display: block; + padding: 16px; + white-space: pre-wrap; + overflow-x: auto; +} + +div.highlight pre { + border-radius: 4px; +} + +div.highlight code { + background-color: var(--code-bg-color); + color: var(--code-text-color); +} + +blockquote { + color: var(--blockquote-text-color); + margin: 17px 0 0 0; + padding-left: 20px; + font-style: normal; +} + +table { + width: 100%; + border-collapse: collapse; + border: 1px solid var(--table-border-color); + border-radius: 4px; + margin-top: 16px; +} + +th, td { + border: 1px solid var(--table-border-color); + padding: 4px; +} + +th { + background-color: var(--table-th-bg-color); +} + +.wm { + border: 1px #d0d7de solid; + border-radius: 0.25em; + padding: 1.5vw; + padding-top: 0; + background-color: #fffaed; + margin-top: 1vh; +} + +.wm p { + margin-top: 1px; +} + +textarea { + width: 100%; + font-size: 16px; +} + +input { + font-size: 14px; +} + +div.footnotes hr::before { + content: "Footnotes"; + display: block; + font-size: 1.5em; + color: var(--bold-text-color); + margin-top: 16px; +} + +.music-card { + display: flex; + flex-direction: column; + gap: 0.5rem; + width: 100%; +} + +.music-card img { + border: none !important; +} + +.music-info { + display: flex; + align-items: center; + gap: 1.25rem; +} + +.music-cover { + width: 3.75rem; + height: 3.75rem; + border-radius: 0.5rem; + box-shadow: var(--music-shadow); + margin: 0 !important; + object-fit: cover; +} + +.music-title { + margin: 0; + font-size: 1rem; + font-weight: bold; + line-height: 1.2; +} + +.music-artist { + margin: 0; + font-size: 0.875rem; + color: var(--music-text-secondary); +} + +.music-links { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.music-btn { + display: inline-flex; + align-items: center; + gap: 0.25rem; + padding: 0 0.75rem; + height: 2rem; + border-radius: 9999px; + text-decoration: none !important; + font-size: 0.75rem; + transition: background-color 0.3s ease; + background-color: var(--music-bg-light); + color: inherit; +} + +.music-btn:hover { + background-color: var(--music-bg-hover-light); +} + +.music-icon { + display: block; + width: 0.75rem; + height: 0.75rem; + margin: 0 !important; +} + +.music-btn-text { + display: inline; +} + +div.toc { + position: fixed; + top: 50%; + left: calc((100vw + var(--width-max)) / 2); + transform: translateY(-50%); + width: calc((90vw - var(--width-max)) / 2); + max-height: 80vh; + overflow-y: auto; + border: none; + padding: 0; + margin: 0; + z-index: 99; + scrollbar-width: none; + -ms-overflow-style: none; +} + +div.toc::-webkit-scrollbar { + display: none; +} + +.toc-nav { + padding: 1.5rem; +} + +.toc-nav ul { + list-style: none; + padding: 0; + margin: 0; +} + +.toc-nav li { + margin: 8px 0; +} + +.toc-nav a { + display: block; + text-decoration: none; + padding: 0 12px; + transition: all 0.2s ease; + font-size: 0.9rem; + line-height: 1.4; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; + color: var(--toc-text-color); +} + +.toc-nav a:hover, +.toc-nav a.active { + color: var(--toc-hover-color); +} + +.toc-nav a::before { + content: ""; + display: inline-block; + width: 16px; + height: 4px; + background-color: var(--toc-text-color); + border-radius: 16px; + margin-right: 12px; + vertical-align: middle; +} + +.toc-nav a:hover::before, +.toc-nav a.active::before { + background-color: var(--toc-hover-color); +} + +.toc-nav ul ul a::before { width: 12px; margin-right: 16px; } +.toc-nav ul ul ul a::before { width: 8px; margin-right: 20px; } + +button.upvote-btn { + padding: 0; + border: none; + background: none; + cursor: pointer; + display: flex; + flex-direction: column; + align-items: center; + color: var(--body-text-color); +} + +button.upvoted { + color: var(--upvoted-color); +} + +span.upvote-count { + margin-top: -4px; + font-size: smaller; +} + +ul li:has(input) { + list-style-type: none; + margin-left: -25.5px; +} + +@media (prefers-color-scheme: dark) { + :root { + --summary-text-color: #c9c6c5; + --body-bg-color: #121212; + --bold-text-color: #eee; + --body-text-color: #e8e6e3; + --text-color-tertiary: #a0a0a0; + --link-color: #6da6ff; + --link-visited-color: #b388ff; + --table-border-color: #999; + --table-th-bg-color: #121212; + --img-border-color: #999; + --code-bg-color: #141414; + --code-text-color: #ddd; + --blockquote-border-color: #7b7b7b; + --blockquote-text-color: #acacac; + --caption-text-color: #aaa; + --toc-text-color: #cac3c3; + --toc-hover-color: #cac3c3; + --music-bg-hover-dark: #525252; + --music-bg-dark: rgba(82, 82, 82, 0.5); + --music-text-secondary: #a3a3a3; + --color-background: var(--body-bg-color) !important; + } + + a { + color: var(--link-color); + cursor: pointer; + text-decoration: none; + } + + a:hover { + text-decoration: underline; + } + + .post-meta-item svg { + filter: invert(1) hue-rotate(180deg); + } + + strong { + font-weight: 650; + } + + .music-btn { + background-color: var(--music-bg-dark); + } + .music-btn:hover { + background-color: var(--music-bg-hover-dark); + } + + .category-link { + color: #dbdbdb; + } + + .wm { + background-color: #161b22; + border-color: #30363d; + color: var(--body-text-color); + padding: 10px; + } + + .wm input { + background-color: #010409; + border: #30363d 1px solid; + color: var(--body-text-color); + outline: none; + } + + #webmention-source:focus { + border-color: var(--color-accent-fg, #0969da); + box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1); + } + + .wm button { + color: var(--body-text-color); + background-color: #161b22; + border: #30363d 1px solid; + } + + .post-summary { + color: var(--text-color-primary) !important; + } + + .post-item { + border-bottom: 1px solid #414141 !important; + } + + .pagination-link { + border: 1px solid #414141 !important; + } + + a { + font-weight: 500 !important; + } +} + +@media (min-width: 768px) { + .music-card { + flex-direction: row; + justify-content: space-between; + align-items: center; + } + + .music-btn { + padding: 1rem; + justify-content: center; + width: auto; + height: auto; + } + + .music-icon { + width: 1.25rem; + height: 1.25rem; + } + + .music-btn-text { + display: none; + } +} + +@media (max-width: 800px) { + img[src*="#minipic"] { + max-width: 100%; + margin-left: auto; + margin-right: auto; + } + + div.toc { + display: none; + } +} + +@media (max-width: 720px) { + .post-date { + min-width: auto; + font-size: 0.85em; + } + + .item-link { + white-space: normal; + overflow: visible; + } +} + +@media (max-width: 700px) { + .booklist { + grid-template-columns: repeat(3, 1fr); + gap: 10px; + } +} + +@media (max-width: 400px) { + .booklist { + grid-template-columns: repeat(2, 1fr); + gap: 10px; + } +} </style> |
