+
这篇文档有帮助吗?
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/css/custom.css b/src/css/custom.css
index 66c18c0..8f02718 100644
--- a/src/css/custom.css
+++ b/src/css/custom.css
@@ -159,4 +159,132 @@ html[data-theme='dark'] .docusaurus-highlight-code-line {
.cardContainer:hover {
background-color: #cce0ff !important;
box-shadow: 0 4px 12px rgba(70, 106, 255, 0.15);
-}
\ No newline at end of file
+}
+
+/* ===== 文档投票组件样式 ===== */
+.vote-container {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ gap: 1.2rem;
+ padding: 1.5rem 0 0.5rem 0;
+ margin-top: 1.5rem;
+ border-top: 1px solid var(--ifm-toc-border-color);
+}
+
+.vote-label {
+ font-weight: 500;
+ color: var(--ifm-color-emphasis-600);
+ font-size: 0.95rem;
+ white-space: nowrap;
+}
+
+.vote-buttons {
+ display: flex;
+ align-items: center;
+ gap: 0.6rem;
+}
+
+.vote-btn {
+ display: flex;
+ align-items: center;
+ gap: 0.35rem;
+ padding: 0.4rem 0.85rem;
+ border: none;
+ border-radius: 20px;
+ background: var(--ifm-color-emphasis-100);
+ cursor: pointer;
+ font-size: 1rem;
+ transition: all 0.2s ease;
+ user-select: none;
+ outline: none;
+}
+
+.vote-btn:hover {
+ background: var(--ifm-color-emphasis-200);
+ transform: scale(1.05);
+}
+
+.vote-btn:active {
+ transform: scale(0.97);
+}
+
+.vote-emoji {
+ font-size: 1.25rem;
+ line-height: 1;
+}
+
+.vote-count {
+ color: var(--ifm-color-emphasis-700);
+ font-weight: 600;
+ font-size: 0.95rem;
+ min-width: 1ch;
+ text-align: center;
+}
+
+/* 👍 高亮状态 */
+.vote-btn-active-up {
+ background: #e6f0ff;
+ box-shadow: 0 0 0 2px rgba(70, 106, 255, 0.25);
+}
+
+.vote-btn-active-up:hover {
+ background: #d6e4ff;
+}
+
+.vote-btn-active-up .vote-count {
+ color: #466aff;
+}
+
+/* 👎 高亮状态 */
+.vote-btn-active-down {
+ background: #fff0e6;
+ box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.25);
+}
+
+.vote-btn-active-down:hover {
+ background: #ffe4d0;
+}
+
+.vote-btn-active-down .vote-count {
+ color: #ff6600;
+}
+
+/* 暗色模式适配 */
+html[data-theme='dark'] .vote-btn {
+ background: var(--ifm-color-emphasis-200);
+}
+
+html[data-theme='dark'] .vote-btn:hover {
+ background: var(--ifm-color-emphasis-300);
+}
+
+html[data-theme='dark'] .vote-count {
+ color: var(--ifm-color-emphasis-600);
+}
+
+html[data-theme='dark'] .vote-btn-active-up {
+ background: rgba(70, 106, 255, 0.2);
+ box-shadow: 0 0 0 2px rgba(70, 106, 255, 0.35);
+}
+
+html[data-theme='dark'] .vote-btn-active-up:hover {
+ background: rgba(70, 106, 255, 0.3);
+}
+
+html[data-theme='dark'] .vote-btn-active-up .vote-count {
+ color: #8aa3ff;
+}
+
+html[data-theme='dark'] .vote-btn-active-down {
+ background: rgba(255, 102, 0, 0.15);
+ box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.3);
+}
+
+html[data-theme='dark'] .vote-btn-active-down:hover {
+ background: rgba(255, 102, 0, 0.25);
+}
+
+html[data-theme='dark'] .vote-btn-active-down .vote-count {
+ color: #ff9944;
+}
diff --git a/src/theme/DocItem/Layout/index.js b/src/theme/DocItem/Layout/index.js
new file mode 100644
index 0000000..e738b64
--- /dev/null
+++ b/src/theme/DocItem/Layout/index.js
@@ -0,0 +1,57 @@
+import React from 'react';
+import clsx from 'clsx';
+import {useWindowSize} from '@docusaurus/theme-common';
+import {useDoc} from '@docusaurus/plugin-content-docs/client';
+import DocItemPaginator from '@theme/DocItem/Paginator';
+import DocVersionBanner from '@theme/DocVersionBanner';
+import DocVersionBadge from '@theme/DocVersionBadge';
+import DocItemFooter from '@theme/DocItem/Footer';
+import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
+import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
+import DocItemContent from '@theme/DocItem/Content';
+import DocBreadcrumbs from '@theme/DocBreadcrumbs';
+import ContentVisibility from '@theme/ContentVisibility';
+import VoteButtons from '@site/src/components/VoteButtons';
+import styles from './styles.module.css';
+
+function useDocTOC() {
+ const {frontMatter, toc} = useDoc();
+ const windowSize = useWindowSize();
+ const hidden = frontMatter.hide_table_of_contents;
+ const canRender = !hidden && toc.length > 0;
+ const mobile = canRender ?