Files
gongxue-new/docs/.vitepress/theme/style.css

239 lines
4.6 KiB
CSS

@tailwind base;
@tailwind components;
@tailwind utilities;
/* ============ 基础样式 ============ */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
font-family: "SF Pro Display", "SF Pro Text", "Inter", "Noto Sans SC", system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #ffffff;
color: #1D1D1F;
line-height: 1.5;
}
/* ============ 移动端触控优化 ============ */
button, a, [role="button"] {
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
}
/* ============ 滚动条美化 ============ */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: #d1d1d6;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #a1a1a6;
}
/* 隐藏滚动条样式 */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
/* ============ 动画延迟工具类 ============ */
.animation-delay-100 {
animation-delay: 0.1s;
}
.animation-delay-200 {
animation-delay: 0.2s;
}
.animation-delay-300 {
animation-delay: 0.3s;
}
.animation-delay-500 {
animation-delay: 0.5s;
}
/* ============ 毛玻璃效果 ============ */
.glass {
background: rgba(255, 255, 255, 0.7);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}
.glass-dark {
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}
/* ============ 渐变文字 ============ */
.gradient-text {
background: linear-gradient(135deg, #0071E3 0%, #5E5CE6 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* ============ 卡片悬停效果 ============ */
.card-hover {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
transform: translateY(-4px);
box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}
/* ============ 按钮基础样式 ============ */
.btn-primary {
@apply px-6 py-3 bg-apple-blue hover:bg-apple-blue-hover text-white rounded-full font-medium transition-all transform hover:scale-105 shadow-lg;
}
.btn-secondary {
@apply px-6 py-3 bg-white/80 backdrop-blur-md text-apple-dark border border-gray-200 rounded-full font-medium hover:bg-white transition-all;
}
.btn-dark {
@apply px-6 py-3 bg-apple-dark hover:bg-black text-white rounded-full font-medium transition-all transform hover:scale-105 shadow-lg;
}
/* ============ 文本截断 ============ */
.line-clamp-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.line-clamp-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* ============ 骨架屏动画 ============ */
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
/* ============ 表单样式 ============ */
input:focus,
select:focus,
textarea:focus {
outline: none;
border-color: #0071E3;
box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}
/* ============ 富文本内容样式 ============ */
.prose-apple {
max-width: none;
}
.prose-apple h1 {
@apply text-3xl font-bold text-apple-dark mb-6;
}
.prose-apple h2 {
@apply text-2xl font-bold text-apple-dark mb-4 mt-8;
}
.prose-apple h3 {
@apply text-xl font-semibold text-apple-dark mb-3 mt-6;
}
.prose-apple p {
@apply text-gray-600 leading-relaxed mb-4;
}
.prose-apple ul,
.prose-apple ol {
@apply mb-4 pl-6;
}
.prose-apple li {
@apply text-gray-600 mb-2;
}
.prose-apple a {
@apply text-apple-blue hover:underline;
}
.prose-apple img {
@apply rounded-xl my-6;
}
.prose-apple blockquote {
@apply border-l-4 border-apple-blue pl-4 italic text-gray-500 my-6;
}
/* ============ 页面过渡 ============ */
.page-enter {
opacity: 0;
transform: translateY(10px);
}
.page-enter-active {
opacity: 1;
transform: translateY(0);
transition: opacity 0.3s ease, transform 0.3s ease;
}
.page-exit {
opacity: 1;
}
.page-exit-active {
opacity: 0;
transition: opacity 0.2s ease;
}
/* ============ VitePress 默认覆盖 ============ */
.VPDoc {
padding: 0 !important;
}
.VPDoc .container {
max-width: none !important;
margin: 0 !important;
padding: 0 !important;
}
.VPDoc .content {
max-width: none !important;
padding: 0 !important;
}