From e54ef0202d22a3f7e1bb6b492527a881db0e8ad7 Mon Sep 17 00:00:00 2001 From: seaHi Date: Fri, 7 Aug 2026 12:53:43 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=20UI=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=B7=E5=BC=8F=E4=B8=8E=E5=B8=83=E5=B1=80=E5=B9=B6?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=20Hugo=20=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.css | 1619 +++++++++-------- src/app.d.ts | 9 +- src/app.html | 13 +- src/lib/components/Toast.svelte | 51 +- .../admin/FeaturedImagePicker.svelte | 96 +- src/lib/components/admin/Tabs.svelte | 30 +- src/lib/hugoParser.ts | 41 +- 7 files changed, 1063 insertions(+), 796 deletions(-) diff --git a/src/app.css b/src/app.css index 9da6e76..6035212 100644 --- a/src/app.css +++ b/src/app.css @@ -1,458 +1,479 @@ -@import "highlight.js/styles/github.css"; +@import 'highlight.js/styles/github.css'; :root { - --bg-color: #ffffff; - --text-color: rgba(0, 0, 0, 0.86); - --text-muted: rgba(0, 0, 0, 0.6); - --border-color: rgba(0, 0, 0, 0.05); - - --header-bg: #000000; - --header-bg-blur: rgba(0, 0, 0, 0.85); - --header-text: #ffffff; - --header-text-hover: #ffffff; + --bg-color: #ffffff; + --text-color: rgba(0, 0, 0, 0.86); + --text-muted: rgba(0, 0, 0, 0.6); + --border-color: rgba(0, 0, 0, 0.05); - --accent-color: #419b38; - - --font-sans: 'Open Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', 'Segoe UI Emoji', 'Segoe UI Symbol', Helvetica, Arial, -apple-system, system-ui, sans-serif; - --font-serif: 'Noto Serif SC', var(--font-sans); - - --layout-width: 860px; - - --hero-height: 40vh; + --header-bg: #000000; + --header-bg-blur: rgba(0, 0, 0, 0.85); + --header-text: #ffffff; + --header-text-hover: #ffffff; + + --accent-color: #419b38; + + --font-sans: + 'Open Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', + 'Segoe UI Emoji', 'Segoe UI Symbol', Helvetica, Arial, -apple-system, system-ui, sans-serif; + --font-serif: 'Noto Serif SC', var(--font-sans); + + --layout-width: 860px; + + --hero-height: 40vh; } * { - box-sizing: border-box; + box-sizing: border-box; } html { - font-size: 16px; + font-size: 16px; } body { - margin: 0; - padding: 0; - font-family: var(--font-sans); - background-color: var(--bg-color); - color: var(--text-color); + margin: 0; + padding: 0; + font-family: var(--font-sans); + background-color: var(--bg-color); + color: var(--text-color); line-height: 1.8; } .frontend-layout { - display: flex; - flex-direction: column; - min-height: 100vh; + display: flex; + flex-direction: column; + min-height: 100vh; } .frontend-layout > main { - flex: 1 0 auto; + flex: 1 0 auto; } -h1, h2, h3, h4, h5, h6 { - font-family: var(--font-sans); - color: var(--title-color); - font-weight: 600; - margin-top: 1.5em; - margin-bottom: 1em; +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: var(--font-sans); + color: var(--title-color); + font-weight: 600; + margin-top: 1.5em; + margin-bottom: 1em; } a { - color: inherit; - text-decoration: none; - transition: opacity 0.2s; + color: inherit; + text-decoration: none; + transition: opacity 0.2s; } a:hover { - opacity: 0.7; + opacity: 0.7; } /* Base Layout */ -.wrapper, .container { - max-width: var(--layout-width); - margin: 0 auto; - padding: 0 20px; +.wrapper, +.container { + max-width: var(--layout-width); + margin: 0 auto; + padding: 0 20px; } @media screen and (min-width: 1024px) { - .wrapper.wide, .container.wide { - max-width: 1024px; - } + .wrapper.wide, + .container.wide { + max-width: 1024px; + } } /* Header (VOID style - dark glass, centered links) */ .header { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 58px; - background-color: var(--header-bg); - color: var(--header-text); - z-index: 1000; - transform: translateZ(0); - transition: box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 58px; + background-color: var(--header-bg); + color: var(--header-text); + z-index: 1000; + transform: translateZ(0); + transition: box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); } @supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) { - .header { - background-color: var(--header-bg-blur); - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - } + .header { + background-color: var(--header-bg-blur); + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + } } .header.scrolled { - box-shadow: 0 0 10px rgba(0, 0, 0, 0.7); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.7); } .header .container { - display: flex; - justify-content: center; /* Center the navigation */ - align-items: center; - height: 100%; - max-width: 100%; - margin: 0 auto; - padding: 0 20px; - position: relative; + display: flex; + justify-content: center; /* Center the navigation */ + align-items: center; + height: 100%; + max-width: 100%; + margin: 0 auto; + padding: 0 20px; + position: relative; } .header .brand { - font-weight: 600; - font-size: 1.7rem; - letter-spacing: 0.075rem; - color: var(--header-text); - position: absolute; - left: 20px; - z-index: 10; - text-decoration: none; + font-weight: 600; + font-size: 1.7rem; + letter-spacing: 0.075rem; + color: var(--header-text); + position: absolute; + left: 20px; + z-index: 10; + text-decoration: none; } .header nav { - display: flex; - height: 100%; - justify-content: center; - flex: 1; + display: flex; + height: 100%; + justify-content: center; + flex: 1; } .header nav a { - display: flex; - align-items: center; - justify-content: center; - color: var(--header-text); - font-size: 1rem; - padding: 0.3rem 0.55rem; - height: 100%; - transition: 0.3s; - position: relative; + display: flex; + align-items: center; + justify-content: center; + color: var(--header-text); + font-size: 1rem; + padding: 0.3rem 0.55rem; + height: 100%; + transition: 0.3s; + position: relative; } .header nav a:hover { - color: var(--header-text-hover); - background-color: rgba(255, 255, 255, 0.12); + color: var(--header-text-hover); + background-color: rgba(255, 255, 255, 0.12); } .header nav a.active, .header nav .nav-dropdown-trigger.active { - font-weight: 600; - color: var(--header-text-hover); - background-color: rgba(255, 255, 255, 0.08); + font-weight: 600; + color: var(--header-text-hover); + background-color: rgba(255, 255, 255, 0.08); } .header nav a.active::after, .header nav .nav-dropdown-trigger.active::after { - content: ""; - position: absolute; - bottom: 0; - left: 0; - right: 0; - height: 2px; - background-color: var(--accent-color, #419b38); - transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 2px; + background-color: var(--accent-color, #419b38); + transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); } /* Header Dropdown Menu Styles */ .header nav .nav-dropdown { - position: relative; - display: flex; - align-items: center; - height: 100%; + position: relative; + display: flex; + align-items: center; + height: 100%; } .header nav .nav-dropdown-trigger { - display: flex; - align-items: center; - justify-content: center; - color: var(--header-text); - font-size: 1rem; - padding: 0.3rem 0.55rem; - height: 100%; - transition: 0.3s; - cursor: pointer; - position: relative; + display: flex; + align-items: center; + justify-content: center; + color: var(--header-text); + font-size: 1rem; + padding: 0.3rem 0.55rem; + height: 100%; + transition: 0.3s; + cursor: pointer; + position: relative; } .header nav .nav-dropdown-trigger:hover, .header nav .nav-dropdown:hover .nav-dropdown-trigger { - color: var(--header-text-hover); - background-color: rgba(255, 255, 255, 0.12); + color: var(--header-text-hover); + background-color: rgba(255, 255, 255, 0.12); } .header nav .dropdown-menu { - position: absolute; - top: 100%; - left: 0; - min-width: 120px; - background-color: var(--header-bg, #000000); - border: 1px solid rgba(255, 255, 255, 0.15); - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); - opacity: 0; - pointer-events: none; - transform: translateY(-4px); - transition: opacity 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94); - z-index: 1100; - padding: 4px 0; + position: absolute; + top: 100%; + left: 0; + min-width: 120px; + background-color: var(--header-bg, #000000); + border: 1px solid rgba(255, 255, 255, 0.15); + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); + opacity: 0; + pointer-events: none; + transform: translateY(-4px); + transition: + opacity 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94), + transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94); + z-index: 1100; + padding: 4px 0; } .header nav .nav-dropdown:hover .dropdown-menu { - opacity: 1; - pointer-events: auto; - transform: translateY(0); + opacity: 1; + pointer-events: auto; + transform: translateY(0); } .header nav .dropdown-menu a { - display: block; - padding: 8px 16px; - height: auto; - color: var(--header-text); - font-size: 0.9rem; - white-space: nowrap; - justify-content: flex-start; + display: block; + padding: 8px 16px; + height: auto; + color: var(--header-text); + font-size: 0.9rem; + white-space: nowrap; + justify-content: flex-start; } .header nav .dropdown-menu a:hover { - background-color: rgba(255, 255, 255, 0.15); - color: var(--header-text-hover); + background-color: rgba(255, 255, 255, 0.15); + color: var(--header-text-hover); } /* DoIt Style Home Profile */ .home-profile { - text-align: center; - padding: calc(58px + 8vh) 0 2rem; - animation: fade-in 1s ease-out; + text-align: center; + padding: calc(58px + 8vh) 0 2rem; + animation: fade-in 1s ease-out; } .home-avatar { - padding: 0.5rem; + padding: 0.5rem; } .home-avatar img { - display: inline-block; - width: 8rem; - height: auto; - margin: 0 auto; - border-radius: 100%; - box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05); - transition: all 0.4s ease; + display: inline-block; + width: 8rem; + height: auto; + margin: 0 auto; + border-radius: 100%; + box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05); + transition: all 0.4s ease; } .home-avatar img:hover { - transform: translateY(-0.75rem); + transform: translateY(-0.75rem); } .home-title { - font-size: 1.5rem; - font-weight: bold; - margin: 0; - padding: 0.5rem; - color: var(--title-color); + font-size: 1.5rem; + font-weight: bold; + margin: 0; + padding: 0.5rem; + color: var(--title-color); } .home-subtitle { - font-size: 1rem; - font-weight: normal; - margin: 0; - padding: 0.5rem; - color: var(--text-muted); + font-size: 1rem; + font-weight: normal; + margin: 0; + padding: 0.5rem; + color: var(--text-muted); } @keyframes fade-in { - from { opacity: 0; transform: translateY(20px); } - to { opacity: 1; transform: translateY(0); } + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } } /* Post List & Grid Layout */ .post-list { - display: grid; - grid-template-columns: 1fr; - gap: 30px; - margin: 2rem 0; + display: grid; + grid-template-columns: 1fr; + gap: 30px; + margin: 2rem 0; } /* Single column toggle */ body.single-col .post-list { - grid-template-columns: 1fr; + grid-template-columns: 1fr; } @media screen and (max-width: 767px) { - .post-list { - grid-template-columns: 1fr; - } + .post-list { + grid-template-columns: 1fr; + } } .card-link { - display: block; + display: block; } .card { - padding-bottom: 30px; - background-color: transparent; - display: flex; - flex-direction: column; + padding-bottom: 30px; + background-color: transparent; + display: flex; + flex-direction: column; } @media screen and (max-width: 767px) { - .card { - border-bottom: 1px solid var(--border-color); - } + .card { + border-bottom: 1px solid var(--border-color); + } } @media screen and (min-width: 767px) { - .card { - padding: 20px; - border: 2px solid var(--text-color); - border-bottom: 2px solid var(--text-color); - transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) border-color; - } - .card.has-cover { - padding-top: 0; - padding-left: 0; - padding-right: 0; - } - .card.has-cover .content-wrap { - padding-left: 20px; - padding-right: 20px; - } - .card-link:hover .card { - border-color: var(--accent-color); - } + .card { + padding: 20px; + border: 2px solid var(--text-color); + border-bottom: 2px solid var(--text-color); + transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) border-color; + } + .card.has-cover { + padding-top: 0; + padding-left: 0; + padding-right: 0; + } + .card.has-cover .content-wrap { + padding-left: 20px; + padding-right: 20px; + } + .card-link:hover .card { + border-color: var(--accent-color); + } } .card .title { - font-size: 1.71rem; - font-weight: bold; - margin: 0 0 0.6rem 0; - color: var(--text-color); - line-height: 1.35; - transition: 0.2s color; + font-size: 1.71rem; + font-weight: bold; + margin: 0 0 0.6rem 0; + color: var(--text-color); + line-height: 1.35; + transition: 0.2s color; } @media screen and (min-width: 767px) { - .card .title { - font-size: 1.85rem; - } - .card-link:hover .title { - color: var(--accent-color) !important; - } + .card .title { + font-size: 1.85rem; + } + .card-link:hover .title { + color: var(--accent-color) !important; + } } .card .post-meta-index { - color: rgba(0, 0, 0, 0.125); - font-size: 14px; - font-weight: bold; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; - text-transform: uppercase; - margin-bottom: 3px; + color: rgba(0, 0, 0, 0.125); + font-size: 14px; + font-weight: bold; + font-family: + -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', + 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + text-transform: uppercase; + margin-bottom: 3px; } .card .excerpt { - margin-top: 0.6rem; - margin-bottom: 0; - flex-grow: 1; + margin-top: 0.6rem; + margin-bottom: 0; + flex-grow: 1; } .card .full-link { - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - transition: 0.3s; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + transition: 0.3s; } .card-link:hover .full-link { - border-bottom-color: var(--accent-color); - color: var(--accent-color); + border-bottom-color: var(--accent-color); + color: var(--accent-color); } /* Article Detail */ .article-detail { - padding: 2rem 0 4rem 0; + padding: 2rem 0 4rem 0; } @keyframes float-down { - 0% { - opacity: 0; - transform: translateY(-18px); - } - 100% { - opacity: 1; - transform: translateY(0); - } + 0% { + opacity: 0; + transform: translateY(-18px); + } + 100% { + opacity: 1; + transform: translateY(0); + } } .banner-title { - position: relative; - width: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - padding: 70px 45px; - animation: float-down 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; + position: relative; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 70px 45px; + animation: float-down 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; } @media screen and (max-width: 767px) { - .banner-title { - padding: 50px 1rem; - } + .banner-title { + padding: 50px 1rem; + } } .banner-title .post-title { - text-align: center; - font-weight: 400; - word-break: break-word; - font-size: 2.7rem; - line-height: 1.67; - margin: 0; - color: var(--title-color); + text-align: center; + font-weight: 400; + word-break: break-word; + font-size: 2.7rem; + line-height: 1.67; + margin: 0; + color: var(--title-color); } @media screen and (max-width: 767px) { - .banner-title .post-title { - font-size: 2.2rem; - } + .banner-title .post-title { + font-size: 2.2rem; + } } .banner-title .post-meta { - text-align: center; - font-size: 14px; - font-weight: 300; - margin-bottom: 0; - color: var(--text-color); + text-align: center; + font-size: 14px; + font-weight: 300; + margin-bottom: 0; + color: var(--text-color); } .banner-title .post-meta a { - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - transition: 0.3s; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + transition: 0.3s; } .banner-title .post-meta a:hover { - border-bottom-color: var(--accent-color); - color: var(--accent-color); + border-bottom-color: var(--accent-color); + color: var(--accent-color); } .article-content { - font: 400 18px/1.75 'Open Sans', var(--font-sans); - word-break: break-word; + font: + 400 18px/1.75 'Open Sans', + var(--font-sans); + word-break: break-word; } .article-content p { - margin: 0.92em 0; + margin: 0.92em 0; } .article-content h1, @@ -461,788 +482,942 @@ body.single-col .post-list { .article-content h4, .article-content h5, .article-content h6 { - font-family: var(--font-sans); - position: relative; + font-family: var(--font-sans); + position: relative; } .article-content h1 { - font-size: 1.8em; - margin: 1.206em 0 0.36em; + font-size: 1.8em; + margin: 1.206em 0 0.36em; } .article-content > h1 { - margin-top: 0; - font-size: 2.2em; + margin-top: 0; + font-size: 2.2em; } .article-content h2 { - font-size: 1.5em; - margin: 1.005em 0 0.375em; - border-bottom: none; - padding-bottom: 0; + font-size: 1.5em; + margin: 1.005em 0 0.375em; + border-bottom: none; + padding-bottom: 0; } .article-content h3 { - font-size: 1.17em; - margin: 1em 0 0.2925em; + font-size: 1.17em; + margin: 1em 0 0.2925em; } .article-content h4, .article-content h5, .article-content h6 { - font-size: 1em; - margin: 1em 0 0.35em; + font-size: 1em; + margin: 1em 0 0.35em; } .article-content h6 { - font-weight: 500; + font-weight: 500; } -.article-content a:not([data-fancybox="gallery"]):not(.post-like):not(.edit-button) { - word-wrap: break-word; - word-break: break-all; - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - transition: border-color 0.2s; - text-decoration: none; +.article-content a:not([data-fancybox='gallery']):not(.post-like):not(.edit-button) { + word-wrap: break-word; + word-break: break-all; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + transition: border-color 0.2s; + text-decoration: none; } -.article-content a:not([data-fancybox="gallery"]):not(.post-like):not(.edit-button):hover { - border-color: #000; - opacity: 1; +.article-content a:not([data-fancybox='gallery']):not(.post-like):not(.edit-button):hover { + border-color: #000; + opacity: 1; } .article-content img { - max-width: 100%; - height: auto; - display: block; - margin: 0 auto; + max-width: 100%; + height: auto; + display: block; + margin: 0 auto; } /* 适配 VOID 的图文混排结构 (figure + figcaption) */ .article-content figure { - margin: 1.5rem 0; - text-align: center; + margin: 1.5rem 0; + text-align: center; } .article-content figcaption { - font-size: 0.9rem; - color: #888; - margin-top: 0.5rem; + font-size: 0.9rem; + color: #888; + margin-top: 0.5rem; } /* ========== DoIt 代码块样式 ========== */ .highlight, .code-block { - font-family: "Source Code Pro", Menlo, Consolas, Monaco, monospace; - font-size: 0.875rem; + font-family: 'Source Code Pro', Menlo, Consolas, Monaco, monospace; + font-size: 0.875rem; } .code-block code, .code-block pre { - background-color: #f5f5f5 !important; + background-color: #f5f5f5 !important; } .code-block { - margin: 0.5rem 0; - border-radius: 0; - overflow: hidden; + margin: 0.5rem 0; + border-radius: 0; + overflow: hidden; } /* 标题栏 — 高度与 admonition-title 精确对齐 */ .code-block-header { - display: flex; - justify-content: space-between; - align-items: center; - width: 100%; - background-color: #ededed; - font-size: 1rem; + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + background-color: #ededed; + font-size: 1rem; } .code-block-title-btn { - margin: 0; - display: flex; - align-items: center; - flex: 1; - background: none; - border: none; - cursor: pointer; - padding: 0.25rem 2rem; - color: inherit; - font: inherit; - position: relative; + margin: 0; + display: flex; + align-items: center; + flex: 1; + background: none; + border: none; + cursor: pointer; + padding: 0.25rem 2rem; + color: inherit; + font: inherit; + position: relative; } /* 箭头图标 — 与 admonition 完全一致的绝对定位和间距 */ .code-block-title-btn .chevron-icon { - font-size: 0.9rem; - width: 0.85em; - height: 0.85em; - position: absolute; - top: 0.6rem; - left: 0.75rem; - transition: transform 0.3s ease-in-out; + font-size: 0.9rem; + width: 0.85em; + height: 0.85em; + position: absolute; + top: 0.6rem; + left: 0.75rem; + transition: transform 0.3s ease-in-out; } .code-block.is-open .code-block-title-btn .chevron-icon { - transform: rotate(90deg); + transform: rotate(90deg); } .code-block-title-btn .code-title { - user-select: none; - display: block; - line-height: 1.6; + user-select: none; + display: block; + line-height: 1.6; } /* 右侧按钮区 */ .code-header-actions { - display: flex; - align-items: center; + display: flex; + align-items: center; } .code-header-actions button, .code-header-actions .ellipsis-icon { - background: none; - border: none; - cursor: pointer; - user-select: none; - margin-inline: 0.5rem; - padding: 0; - color: inherit; - display: flex; - align-items: center; - justify-content: center; - line-height: 1; + background: none; + border: none; + cursor: pointer; + user-select: none; + margin-inline: 0.5rem; + padding: 0; + color: inherit; + display: flex; + align-items: center; + justify-content: center; + line-height: 1; } .code-header-actions button span { - display: flex; - align-items: center; - justify-content: center; - line-height: 1; + display: flex; + align-items: center; + justify-content: center; + line-height: 1; +} + +.code-header-actions .check-icon { + display: none; } .code-header-actions svg { - display: block; + display: block; } /* 操作按钮:默认隐藏,展开时显示 */ .code-header-actions .action-icon { - display: none; + display: none; } .code-block.is-open .code-header-actions .action-icon { - display: flex; + display: flex; } /* 省略号:默认显示,展开时隐藏 */ .code-header-actions .ellipsis-icon { - display: flex; + display: flex; } .code-block.is-open .code-header-actions .ellipsis-icon { - display: none; + display: none; } /* 按钮激活态(行号/换行开启时高亮) */ .code-header-actions button.is-active { - color: #2d809a; + color: #2d809a; } .code-header-actions button:hover { - color: #2d809a; + color: #2d809a; } /* pre */ .code-block pre { - display: block; - margin: 0; - padding: 0; - border-radius: 0; + display: block; + margin: 0; + padding: 0; + border-radius: 0; +} + +.code-block .code-pre { + counter-reset: codeblock; } /* code — max-height + padding 同时过渡,收缩彻底无残留 */ .code-block pre code { - display: block !important; - margin: 0; - max-height: 0; - padding: 0; - transition: max-height 0.3s ease-out, padding 0.3s ease-out; - overflow: hidden; - line-height: 1.6; + display: block !important; + margin: 0; + max-height: 0; + padding: 0; + transition: + max-height 0.3s ease-out, + padding 0.3s ease-out; + overflow: hidden; + line-height: 1.6; } /* 覆盖 highlight.js github.css 的默认白色背景 */ .code-block pre code.hljs { - padding: 0.8rem 0.75rem; - background: #f5f5f5 !important; - overflow-x: auto; + padding: 0.8rem 0.75rem; + background: #f5f5f5 !important; + overflow-x: auto; } .code-block.is-closed pre code.hljs { - padding-top: 0 !important; - padding-bottom: 0 !important; - overflow: hidden !important; /* 防止横向滚动条撑开高度导致“半行内容”残留 */ + padding-top: 0 !important; + padding-bottom: 0 !important; + overflow: hidden !important; /* 防止横向滚动条撑开高度导致“半行内容”残留 */ } /* ---- 行号功能 ---- */ .code-block.show-line-numbers pre code .code-line::before { - counter-increment: codeblock; - content: counter(codeblock); - display: inline-block; - min-width: 2.5ch; - text-align: right; - margin-right: 0.75rem; - color: #8c8fa1; - user-select: none; + counter-increment: codeblock; + content: counter(codeblock); + display: inline-block; + min-width: 2.5ch; + text-align: right; + margin-right: 0.75rem; + color: #8c8fa1; + user-select: none; } /* ---- 换行功能 ---- */ .code-block.is-wrap pre code { - white-space: pre-wrap; - word-break: break-all; + white-space: pre-wrap; + word-break: break-all; } .article-content code:not(pre code) { - background-color: rgba(0, 0, 0, 0.05); - border-radius: 4px; - padding: 0.2em 0.4em; - font-size: 85%; - color: #e96900; + background-color: rgba(0, 0, 0, 0.05); + border-radius: 4px; + padding: 0.2em 0.4em; + font-size: 85%; + color: #e96900; } .badge { - background-color: rgba(0, 0, 0, 0.05); - border-radius: 4px; - padding: 0.2em 0.4em; - font-size: 85%; - font-family: monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier; - color: #e96900; - border: none; - display: inline-block; + background-color: rgba(0, 0, 0, 0.05); + border-radius: 4px; + padding: 0.2em 0.4em; + font-size: 85%; + font-family: monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier; + color: #e96900; + border: none; + display: inline-block; } .article-content blockquote { - margin: 1.5em 0; - padding: 0.5rem 1rem; - border-left: 0.25rem solid #6bd6fd; - background-color: rgba(107, 214, 253, 0.2); - color: var(--text-color); + margin: 1.5em 0; + padding: 0.5rem 1rem; + border-left: 0.25rem solid #6bd6fd; + background-color: rgba(107, 214, 253, 0.2); + color: var(--text-color); } /* Admonitions (DoIt style - full 14 types) */ .admonition { - position: relative; - margin: 1rem 0; - padding: 0 0.75rem; - border-left: 0.25rem solid transparent; - font-family: var(--font-sans); + position: relative; + margin: 1rem 0; + padding: 0 0.75rem; + border-left: 0.25rem solid transparent; + font-family: var(--font-sans); } .admonition .details-content { - max-height: 0; - overflow: hidden; - transition: max-height 0.3s ease-out; + max-height: 0; + overflow: hidden; + transition: max-height 0.3s ease-out; } .admonition.open .details-content { - /* maxHeight is dynamically set by JS */ + /* maxHeight is dynamically set by JS */ } .admonition .admonition-title { - font-weight: bold; - margin: 0 -0.75rem; - padding: 0.25rem 1.8rem; - border-bottom: 1px solid transparent; - font-size: 1rem; - line-height: 1.6; - display: flex; - align-items: center; - cursor: pointer; - list-style: none; + font-weight: bold; + margin: 0 -0.75rem; + padding: 0.25rem 1.8rem; + border-bottom: 1px solid transparent; + font-size: 1rem; + line-height: 1.6; + display: flex; + align-items: center; + cursor: pointer; + list-style: none; } .admonition .admonition-title::-webkit-details-marker { - display: none; + display: none; } .admonition .admonition-title::after { - content: ""; - position: absolute; - right: 0.75rem; - top: 0.85rem; - width: 0.4rem; - height: 0.4rem; - border-right: 2px solid currentColor; - border-bottom: 2px solid currentColor; - transform: rotate(-45deg); - transition: transform 0.2s ease-in-out; - opacity: 0.6; + content: ''; + position: absolute; + right: 0.75rem; + top: 0.85rem; + width: 0.4rem; + height: 0.4rem; + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + transform: rotate(-45deg); + transition: transform 0.2s ease-in-out; + opacity: 0.6; } .admonition.open .admonition-title::after { - transform: rotate(45deg); - top: 0.7rem; + transform: rotate(45deg); + top: 0.7rem; } .admonition .details-content { - padding: 0; + padding: 0; } .admonition .admonition-content { - padding: 0.5rem 0.75rem; + padding: 0.5rem 0.75rem; } .admonition .admonition-content > p:first-child { - margin-top: 0; + margin-top: 0; } .admonition .admonition-content > p:last-child { - margin-bottom: 0; + margin-bottom: 0; } .admonition span.icon > svg { - font-size: 0.9rem; - position: absolute; - top: 0.6rem; - left: 0.4rem; + font-size: 0.9rem; + position: absolute; + top: 0.6rem; + left: 0.4rem; } .admonition p { - font-family: var(--font-sans); - font-size: 0.95rem; - line-height: 1.6; - margin-bottom: 0; - color: var(--text-color); + font-family: var(--font-sans); + font-size: 0.95rem; + line-height: 1.6; + margin-bottom: 0; + color: var(--text-color); } .admonition:last-child { - margin-bottom: 0.75rem; + margin-bottom: 0.75rem; } /* 1. note */ -.admonition.note { border-left-color: #448aff; background-color: rgba(68, 138, 255, 0.1); } -.admonition.note .admonition-title { border-bottom-color: rgba(68, 138, 255, 0.1); background-color: rgba(68, 138, 255, 0.25); } -.admonition.note.open .admonition-title { background-color: rgba(68, 138, 255, 0.1); } -.admonition.note span.icon > svg { color: #448aff; } +.admonition.note { + border-left-color: #448aff; + background-color: rgba(68, 138, 255, 0.1); +} +.admonition.note .admonition-title { + border-bottom-color: rgba(68, 138, 255, 0.1); + background-color: rgba(68, 138, 255, 0.25); +} +.admonition.note.open .admonition-title { + background-color: rgba(68, 138, 255, 0.1); +} +.admonition.note span.icon > svg { + color: #448aff; +} /* 2. abstract */ -.admonition.abstract { border-left-color: #00b0ff; background-color: rgba(0, 176, 255, 0.1); } -.admonition.abstract .admonition-title { border-bottom-color: rgba(0, 176, 255, 0.1); background-color: rgba(0, 176, 255, 0.25); } -.admonition.abstract.open .admonition-title { background-color: rgba(0, 176, 255, 0.1); } -.admonition.abstract span.icon > svg { color: #00b0ff; } +.admonition.abstract { + border-left-color: #00b0ff; + background-color: rgba(0, 176, 255, 0.1); +} +.admonition.abstract .admonition-title { + border-bottom-color: rgba(0, 176, 255, 0.1); + background-color: rgba(0, 176, 255, 0.25); +} +.admonition.abstract.open .admonition-title { + background-color: rgba(0, 176, 255, 0.1); +} +.admonition.abstract span.icon > svg { + color: #00b0ff; +} /* 3. info */ -.admonition.info { border-left-color: #00b8d4; background-color: rgba(0, 184, 212, 0.1); } -.admonition.info .admonition-title { border-bottom-color: rgba(0, 184, 212, 0.1); background-color: rgba(0, 184, 212, 0.25); } -.admonition.info.open .admonition-title { background-color: rgba(0, 184, 212, 0.1); } -.admonition.info span.icon > svg { color: #00b8d4; } +.admonition.info { + border-left-color: #00b8d4; + background-color: rgba(0, 184, 212, 0.1); +} +.admonition.info .admonition-title { + border-bottom-color: rgba(0, 184, 212, 0.1); + background-color: rgba(0, 184, 212, 0.25); +} +.admonition.info.open .admonition-title { + background-color: rgba(0, 184, 212, 0.1); +} +.admonition.info span.icon > svg { + color: #00b8d4; +} /* 4. tip */ -.admonition.tip { border-left-color: #00bfa5; background-color: rgba(0, 191, 165, 0.1); } -.admonition.tip .admonition-title { border-bottom-color: rgba(0, 191, 165, 0.1); background-color: rgba(0, 191, 165, 0.25); } -.admonition.tip.open .admonition-title { background-color: rgba(0, 191, 165, 0.1); } -.admonition.tip span.icon > svg { color: #00bfa5; } +.admonition.tip { + border-left-color: #00bfa5; + background-color: rgba(0, 191, 165, 0.1); +} +.admonition.tip .admonition-title { + border-bottom-color: rgba(0, 191, 165, 0.1); + background-color: rgba(0, 191, 165, 0.25); +} +.admonition.tip.open .admonition-title { + background-color: rgba(0, 191, 165, 0.1); +} +.admonition.tip span.icon > svg { + color: #00bfa5; +} /* 5. success */ -.admonition.success { border-left-color: #00c853; background-color: rgba(0, 200, 83, 0.1); } -.admonition.success .admonition-title { border-bottom-color: rgba(0, 200, 83, 0.1); background-color: rgba(0, 200, 83, 0.25); } -.admonition.success.open .admonition-title { background-color: rgba(0, 200, 83, 0.1); } -.admonition.success span.icon > svg { color: #00c853; } +.admonition.success { + border-left-color: #00c853; + background-color: rgba(0, 200, 83, 0.1); +} +.admonition.success .admonition-title { + border-bottom-color: rgba(0, 200, 83, 0.1); + background-color: rgba(0, 200, 83, 0.25); +} +.admonition.success.open .admonition-title { + background-color: rgba(0, 200, 83, 0.1); +} +.admonition.success span.icon > svg { + color: #00c853; +} /* 6. question */ -.admonition.question { border-left-color: #64dd17; background-color: rgba(100, 221, 23, 0.1); } -.admonition.question .admonition-title { border-bottom-color: rgba(100, 221, 23, 0.1); background-color: rgba(100, 221, 23, 0.25); } -.admonition.question.open .admonition-title { background-color: rgba(100, 221, 23, 0.1); } -.admonition.question span.icon > svg { color: #64dd17; } +.admonition.question { + border-left-color: #64dd17; + background-color: rgba(100, 221, 23, 0.1); +} +.admonition.question .admonition-title { + border-bottom-color: rgba(100, 221, 23, 0.1); + background-color: rgba(100, 221, 23, 0.25); +} +.admonition.question.open .admonition-title { + background-color: rgba(100, 221, 23, 0.1); +} +.admonition.question span.icon > svg { + color: #64dd17; +} /* 7. warning */ -.admonition.warning { border-left-color: #ff9100; background-color: rgba(255, 145, 0, 0.1); } -.admonition.warning .admonition-title { border-bottom-color: rgba(255, 145, 0, 0.1); background-color: rgba(255, 145, 0, 0.25); } -.admonition.warning.open .admonition-title { background-color: rgba(255, 145, 0, 0.1); } -.admonition.warning span.icon > svg { color: #ff9100; } +.admonition.warning { + border-left-color: #ff9100; + background-color: rgba(255, 145, 0, 0.1); +} +.admonition.warning .admonition-title { + border-bottom-color: rgba(255, 145, 0, 0.1); + background-color: rgba(255, 145, 0, 0.25); +} +.admonition.warning.open .admonition-title { + background-color: rgba(255, 145, 0, 0.1); +} +.admonition.warning span.icon > svg { + color: #ff9100; +} /* 8. failure */ -.admonition.failure { border-left-color: #ff5252; background-color: rgba(255, 82, 82, 0.1); } -.admonition.failure .admonition-title { border-bottom-color: rgba(255, 82, 82, 0.1); background-color: rgba(255, 82, 82, 0.25); } -.admonition.failure.open .admonition-title { background-color: rgba(255, 82, 82, 0.1); } -.admonition.failure span.icon > svg { color: #ff5252; } +.admonition.failure { + border-left-color: #ff5252; + background-color: rgba(255, 82, 82, 0.1); +} +.admonition.failure .admonition-title { + border-bottom-color: rgba(255, 82, 82, 0.1); + background-color: rgba(255, 82, 82, 0.25); +} +.admonition.failure.open .admonition-title { + background-color: rgba(255, 82, 82, 0.1); +} +.admonition.failure span.icon > svg { + color: #ff5252; +} /* 9. danger */ -.admonition.danger { border-left-color: #ff1744; background-color: rgba(255, 23, 68, 0.1); } -.admonition.danger .admonition-title { border-bottom-color: rgba(255, 23, 68, 0.1); background-color: rgba(255, 23, 68, 0.25); } -.admonition.danger.open .admonition-title { background-color: rgba(255, 23, 68, 0.1); } -.admonition.danger span.icon > svg { color: #ff1744; } +.admonition.danger { + border-left-color: #ff1744; + background-color: rgba(255, 23, 68, 0.1); +} +.admonition.danger .admonition-title { + border-bottom-color: rgba(255, 23, 68, 0.1); + background-color: rgba(255, 23, 68, 0.25); +} +.admonition.danger.open .admonition-title { + background-color: rgba(255, 23, 68, 0.1); +} +.admonition.danger span.icon > svg { + color: #ff1744; +} /* 10. bug */ -.admonition.bug { border-left-color: #f50057; background-color: rgba(245, 0, 87, 0.1); } -.admonition.bug .admonition-title { border-bottom-color: rgba(245, 0, 87, 0.1); background-color: rgba(245, 0, 87, 0.25); } -.admonition.bug.open .admonition-title { background-color: rgba(245, 0, 87, 0.1); } -.admonition.bug span.icon > svg { color: #f50057; } +.admonition.bug { + border-left-color: #f50057; + background-color: rgba(245, 0, 87, 0.1); +} +.admonition.bug .admonition-title { + border-bottom-color: rgba(245, 0, 87, 0.1); + background-color: rgba(245, 0, 87, 0.25); +} +.admonition.bug.open .admonition-title { + background-color: rgba(245, 0, 87, 0.1); +} +.admonition.bug span.icon > svg { + color: #f50057; +} /* 11. example */ -.admonition.example { border-left-color: #651fff; background-color: rgba(101, 31, 255, 0.1); } -.admonition.example .admonition-title { border-bottom-color: rgba(101, 31, 255, 0.1); background-color: rgba(101, 31, 255, 0.25); } -.admonition.example.open .admonition-title { background-color: rgba(101, 31, 255, 0.1); } -.admonition.example span.icon > svg { color: #651fff; } +.admonition.example { + border-left-color: #651fff; + background-color: rgba(101, 31, 255, 0.1); +} +.admonition.example .admonition-title { + border-bottom-color: rgba(101, 31, 255, 0.1); + background-color: rgba(101, 31, 255, 0.25); +} +.admonition.example.open .admonition-title { + background-color: rgba(101, 31, 255, 0.1); +} +.admonition.example span.icon > svg { + color: #651fff; +} /* 12. quote */ -.admonition.quote { border-left-color: #9e9e9e; background-color: rgba(159, 159, 159, 0.1); } -.admonition.quote .admonition-title { border-bottom-color: rgba(159, 159, 159, 0.1); background-color: rgba(159, 159, 159, 0.25); } -.admonition.quote.open .admonition-title { background-color: rgba(159, 159, 159, 0.1); } -.admonition.quote span.icon > svg { color: #9e9e9e; } +.admonition.quote { + border-left-color: #9e9e9e; + background-color: rgba(159, 159, 159, 0.1); +} +.admonition.quote .admonition-title { + border-bottom-color: rgba(159, 159, 159, 0.1); + background-color: rgba(159, 159, 159, 0.25); +} +.admonition.quote.open .admonition-title { + background-color: rgba(159, 159, 159, 0.1); +} +.admonition.quote span.icon > svg { + color: #9e9e9e; +} /* 13. important */ -.admonition.important { border-left-color: #8957e5; background-color: rgba(137, 87, 229, 0.1); } -.admonition.important .admonition-title { border-bottom-color: rgba(137, 87, 229, 0.1); background-color: rgba(137, 87, 229, 0.25); } -.admonition.important.open .admonition-title { background-color: rgba(137, 87, 229, 0.1); } -.admonition.important span.icon > svg { color: #8957e5; } +.admonition.important { + border-left-color: #8957e5; + background-color: rgba(137, 87, 229, 0.1); +} +.admonition.important .admonition-title { + border-bottom-color: rgba(137, 87, 229, 0.1); + background-color: rgba(137, 87, 229, 0.25); +} +.admonition.important.open .admonition-title { + background-color: rgba(137, 87, 229, 0.1); +} +.admonition.important span.icon > svg { + color: #8957e5; +} /* 14. caution */ -.admonition.caution { border-left-color: #da3633; background-color: rgba(218, 54, 51, 0.1); } -.admonition.caution .admonition-title { border-bottom-color: rgba(218, 54, 51, 0.1); background-color: rgba(218, 54, 51, 0.25); } -.admonition.caution.open .admonition-title { background-color: rgba(218, 54, 51, 0.1); } -.admonition.caution span.icon > svg { color: #da3633; } +.admonition.caution { + border-left-color: #da3633; + background-color: rgba(218, 54, 51, 0.1); +} +.admonition.caution .admonition-title { + border-bottom-color: rgba(218, 54, 51, 0.1); + background-color: rgba(218, 54, 51, 0.25); +} +.admonition.caution.open .admonition-title { + background-color: rgba(218, 54, 51, 0.1); +} +.admonition.caution span.icon > svg { + color: #da3633; +} /* Footer */ footer { - position: relative; - background-color: #000; - padding-bottom: 1.5rem; - margin-top: 4rem; + position: relative; + background-color: #000; + padding-bottom: 1.5rem; + margin-top: 4rem; } footer .container { - display: flex; + display: flex; } footer section { - flex: 1; - position: relative; - margin: 1rem 0.5rem 0 0.5rem; + flex: 1; + position: relative; + margin: 1rem 0.5rem 0 0.5rem; } footer section:nth-child(2) { - text-align: right; + text-align: right; } -footer section, footer section * { - color: #ddd; - font-weight: 300; - text-decoration: none; +footer section, +footer section * { + color: #ddd; + font-weight: 300; + text-decoration: none; } footer section p { - line-height: 1.5; - margin: 0.5rem 0; - font-size: 16px; + line-height: 1.5; + margin: 0.5rem 0; + font-size: 16px; } footer section p:first-child { - margin-top: 1rem; + margin-top: 1rem; } @media screen and (max-width: 767px) { - footer .container { - flex-direction: column; - } - footer section:nth-child(2) { - margin-top: 0.5rem; - text-align: left; - } - footer section:nth-child(2) p:nth-child(1) { - margin-top: 0; - } + footer .container { + flex-direction: column; + } + footer section:nth-child(2) { + margin-top: 0.5rem; + text-align: left; + } + footer section:nth-child(2) p:nth-child(1) { + margin-top: 0; + } } /* Floating Controllers */ #ctrler-panel { - position: fixed; - right: 1.5rem; - bottom: 1.5rem; - z-index: 100; - display: flex; - flex-direction: column; - transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + position: fixed; + right: 1.5rem; + bottom: 1.5rem; + z-index: 100; + display: flex; + flex-direction: column; + transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); } .ctrler-item a { - display: flex; - align-items: center; - justify-content: center; - width: 40px; - height: 40px; - background-color: #111; - color: #cececf; - transition: 0.3s; + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + background-color: #111; + color: #cececf; + transition: 0.3s; } .ctrler-item a:hover { - background-color: var(--accent-color); - opacity: 1; + background-color: var(--accent-color); + opacity: 1; } /* ========== VOID 风格 TOC (侧栏目录) ========== */ .toc-mask { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - background: rgba(255, 255, 255, 0.85); - z-index: 3; - opacity: 0; - visibility: hidden; - transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s 0.3s; - display: block; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(255, 255, 255, 0.85); + z-index: 3; + opacity: 0; + visibility: hidden; + transition: + opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), + visibility 0s 0.3s; + display: block; } @media screen and (max-width: 1199.5px) { - .sidebar-show .toc-mask { - opacity: 1; - visibility: visible; - transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); - } + .sidebar-show .toc-mask { + opacity: 1; + visibility: visible; + transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + } } .TOC { - position: fixed; - top: 0; - bottom: 0; - z-index: 4; - overflow: auto; - -webkit-overflow-scrolling: touch; - width: 280px; - right: -280px; - background-color: #111; /* VOID style dark background */ - box-shadow: -2px 0 8px rgba(0,0,0,0.05); - padding: 1rem; - padding-right: 0; - padding-top: 60px; - transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + position: fixed; + top: 0; + bottom: 0; + z-index: 4; + overflow: auto; + -webkit-overflow-scrolling: touch; + width: 280px; + right: -280px; + background-color: #111; /* VOID style dark background */ + box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05); + padding: 1rem; + padding-right: 0; + padding-top: 60px; + transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); } .TOC::-webkit-scrollbar { - display: none; + display: none; } .TOC::before { - content: "Contents"; - position: absolute; - left: 0; - top: 0; - line-height: 60px; - height: 60px; - width: 100%; - font-size: 20px; - font-weight: 600; - text-transform: uppercase; - text-align: center; - color: #b0b0b0; /* VOID style dark text */ - box-sizing: border-box; + content: 'Contents'; + position: absolute; + left: 0; + top: 0; + line-height: 60px; + height: 60px; + width: 100%; + font-size: 20px; + font-weight: 600; + text-transform: uppercase; + text-align: center; + color: #b0b0b0; /* VOID style dark text */ + box-sizing: border-box; } .sidebar-show .TOC { - right: 0; + right: 0; } /* 目录内容列表样式 */ .TOC .toc-list { - position: relative; - list-style: none; - padding-left: 0; - margin: 0; - line-height: 2.1; + position: relative; + list-style: none; + padding-left: 0; + margin: 0; + line-height: 2.1; } .TOC .toc-list .toc-list { - position: unset; - padding-left: 1rem; + position: unset; + padding-left: 1rem; } .TOC .is-collapsible { - max-height: 1000px; - overflow: hidden; - transition: all 300ms ease-in-out; + max-height: 1000px; + overflow: hidden; + transition: all 300ms ease-in-out; } .TOC .is-collapsed { - max-height: 0; + max-height: 0; } .TOC li a { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - display: block; - width: 100%; - position: relative; - color: #b0b0b0; /* VOID style dark text */ - transition: color 0.2s; - text-decoration: none; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + display: block; + width: 100%; + position: relative; + color: #b0b0b0; /* VOID style dark text */ + transition: color 0.2s; + text-decoration: none; } -.TOC li a:hover, .TOC li a.is-active-link { - color: #419b38; - opacity: 1; +.TOC li a:hover, +.TOC li a.is-active-link { + color: #419b38; + opacity: 1; } .TOC li a.is-active-link { - font-weight: 700; + font-weight: 700; } .TOC .is-active-link::before { - content: ""; - background-color: rgba(0, 0, 0, 0.3); /* VOID style dark highlight */ - display: block; - height: 2.1rem; - left: -1rem; - top: 0; - position: absolute; - width: calc(100% + 1rem); - border-left: 2px solid #419b38; - z-index: -1; - box-sizing: border-box; + content: ''; + background-color: rgba(0, 0, 0, 0.3); /* VOID style dark highlight */ + display: block; + height: 2.1rem; + left: -1rem; + top: 0; + position: absolute; + width: calc(100% + 1rem); + border-left: 2px solid #419b38; + z-index: -1; + box-sizing: border-box; } @media screen and (min-width: 1199.5px) { - .TOC .toc-link:hover::before { - content: ""; - background-color: rgba(0, 0, 0, 0.3); - display: block; - height: 2.1rem; - left: -1rem; - top: 0; - position: absolute; - width: calc(100% + 1rem); - border-left: 2px solid #419b38; - z-index: -1; - box-sizing: border-box; - } + .TOC .toc-link:hover::before { + content: ''; + background-color: rgba(0, 0, 0, 0.3); + display: block; + height: 2.1rem; + left: -1rem; + top: 0; + position: absolute; + width: calc(100% + 1rem); + border-left: 2px solid #419b38; + z-index: -1; + box-sizing: border-box; + } } /* 主体偏移 */ @media screen and (min-width: 1199.5px) { - div.contents-wrap, - .header nav, - footer, - footer .container.wide { - transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); - } - - .sidebar-show div.contents-wrap, - .sidebar-show .header nav, - .sidebar-show footer { - transform: translateX(-140px); - } + div.contents-wrap, + .header nav, + footer, + footer .container.wide { + transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + } - .sidebar-show footer .container.wide { - max-width: 860px; - } + .sidebar-show div.contents-wrap, + .sidebar-show .header nav, + .sidebar-show footer { + transform: translateX(-140px); + } + + .sidebar-show footer .container.wide { + max-width: 860px; + } } @media screen and (max-width: 1199.5px) { - div.contents-wrap { - transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); - } + div.contents-wrap { + transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + } } /* 展开/关闭按钮 */ #toggle-toc { - position: fixed; - right: 1.5rem; - bottom: calc(1.5rem + 40px); /* Exactly above the go-top button */ - width: 40px; - height: 40px; - background-color: #111; - display: flex; - justify-content: center; - align-items: center; - cursor: pointer; - z-index: 101; - transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); - color: #cececf; + position: fixed; + right: 1.5rem; + bottom: calc(1.5rem + 40px); /* Exactly above the go-top button */ + width: 40px; + height: 40px; + background-color: #111; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + z-index: 101; + transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); + color: #cececf; } #toggle-toc:hover { - background-color: var(--accent-color); + background-color: var(--accent-color); } #toggle-toc svg, .ctrler-item svg { - width: 20px; - height: 20px; - transition: transform 0.3s; + width: 20px; + height: 20px; + transition: transform 0.3s; } .sidebar-show #toggle-toc svg { - transform: rotate(180deg); + transform: rotate(180deg); } @media screen and (min-width: 1199.5px) { - .sidebar-show #toggle-toc, - .sidebar-show #ctrler-panel { - right: 300px; - } + .sidebar-show #toggle-toc, + .sidebar-show #ctrler-panel { + right: 300px; + } } /* Tags Styling (VOID style) */ .tags { - margin: 1.5rem 0; - padding-top: 1.125rem; - padding-bottom: calc(1.125rem - 5px); - border-top: 1px solid rgba(0, 0, 0, 0.08); - border-bottom: 1px solid rgba(0, 0, 0, 0.08); + margin: 1.5rem 0; + padding-top: 1.125rem; + padding-bottom: calc(1.125rem - 5px); + border-top: 1px solid rgba(0, 0, 0, 0.08); + border-bottom: 1px solid rgba(0, 0, 0, 0.08); } .tags .tag-item { - font-size: 15px; - font-family: 'Open Sans', var(--font-sans); - margin-right: 12px; - margin-bottom: 5px; - display: inline-block; - border: none !important; - opacity: 0.6; - text-decoration: none; - color: var(--text-color); - transition: opacity 0.3s; + font-size: 15px; + font-family: 'Open Sans', var(--font-sans); + margin-right: 12px; + margin-bottom: 5px; + display: inline-block; + border: none !important; + opacity: 0.6; + text-decoration: none; + color: var(--text-color); + transition: opacity 0.3s; } .tags .tag-item:hover { - opacity: 1; + opacity: 1; } .tags .tag-item::before { - content: "#"; - margin-right: 2px; + content: '#'; + margin-right: 2px; } /* Featured Image Styles */ .post-cover { - width: 100%; - height: 300px; - overflow: hidden; - border-bottom: none; + width: 100%; + height: 300px; + overflow: hidden; + border-bottom: none; } .post-cover img { - width: 100%; - height: 100%; - object-fit: cover; - display: block; - border-radius: 0; + width: 100%; + height: 100%; + object-fit: cover; + display: block; + border-radius: 0; } .article-content.has-cover .content-wrap { - padding-top: 20px; + padding-top: 20px; } .detail-cover { - height: auto; - border-bottom: none; - border-radius: 0; - margin-bottom: 30px; + height: auto; + border-bottom: none; + border-radius: 0; + margin-bottom: 30px; } .detail-cover img { - width: 100%; - height: auto; - object-fit: contain; - border-radius: 0; + width: 100%; + height: auto; + object-fit: contain; + border-radius: 0; } diff --git a/src/app.d.ts b/src/app.d.ts index faa2a81..f83fb02 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -3,20 +3,17 @@ declare global { namespace App { interface Platform { - env: { - DB: D1Database; - R2: R2Bucket; - } & Env; + env: Env; context: ExecutionContext; caches: CacheStorage & { default: Cache }; - cf?: IncomingRequestCfProperties + cf?: IncomingRequestCfProperties; } // interface Error {} interface Locals { user?: { email: string; - } + }; } // interface PageData {} // interface PageState {} diff --git a/src/app.html b/src/app.html index 14dd826..1eaa811 100644 --- a/src/app.html +++ b/src/app.html @@ -4,9 +4,16 @@ - - - + + + %sveltekit.head% diff --git a/src/lib/components/Toast.svelte b/src/lib/components/Toast.svelte index e20b3d4..05009d3 100644 --- a/src/lib/components/Toast.svelte +++ b/src/lib/components/Toast.svelte @@ -12,26 +12,65 @@ out:fade={{ duration: 200 }} > {#if msg.type === 'success'} - + {:else if msg.type === 'error'} - + {:else} - + {/if} {msg.text} - + + {/if} - {#if activeTab === 'url'} - + {:else if activeTab === 'upload'}
{:else if activeTab === 'library'}
- {#each images as img} + {#each images as img (img.id || img)} -
{ cover = img.url; activeTab = 'url'; }} title={img.filename}> +
{ + cover = img.url; + activeTab = 'url'; + }} + title={img.filename} + > {img.filename}
{/each}
{#if hasMore} - {/if} @@ -246,7 +284,7 @@ font-weight: 600; backdrop-filter: blur(4px); } - + .btn-clear:hover { background: rgba(217, 83, 79, 1); } @@ -259,7 +297,9 @@ font-family: inherit; box-sizing: border-box; border-radius: 0; - transition: border-color 0.3s ease, box-shadow 0.3s ease; + transition: + border-color 0.3s ease, + box-shadow 0.3s ease; } .full-width-input:focus { @@ -280,9 +320,9 @@ } .upload-area label:hover { - background: rgba(0,0,0,0.03); + background: rgba(0, 0, 0, 0.03); } - + .upload-area.disabled label { opacity: 0.6; cursor: not-allowed; diff --git a/src/lib/components/admin/Tabs.svelte b/src/lib/components/admin/Tabs.svelte index d2c9337..fe7b3ea 100644 --- a/src/lib/components/admin/Tabs.svelte +++ b/src/lib/components/admin/Tabs.svelte @@ -1,15 +1,15 @@ -
- {#each tabs as tab} -