整理项目结构

This commit is contained in:
Zuoling Rong
2025-05-01 03:18:17 +08:00
parent 3600e83b54
commit 7f82481076
14 changed files with 251 additions and 809 deletions

994
assets/style.css Normal file
View File

@@ -0,0 +1,994 @@
/* 全局样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 防止滚动条导致的布局偏移 */
html {
overflow-y: scroll; /* 始终显示垂直滚动条 */
scrollbar-width: thin; /* Firefox */
}
/* 搜索高亮样式 */
.highlight {
background-color: rgba(74, 158, 255, 0.3);
border-radius: 2px;
padding: 0 2px;
font-weight: bold;
color: #ffffff;
}
body {
font-family: var(--font-body);
font-weight: var(--font-weight-body);
line-height: 1.6;
background-color: #1a1b1e;
color: #e4e6eb;
min-height: 100vh;
overflow: hidden; /* 防止body滚动 */
padding-right: 0 !important; /* 防止滚动条导致的布局偏移 */
}
/* 布局 */
.layout {
display: flex;
min-height: 100vh;
opacity: 0;
animation: fadeIn 0.3s ease-out forwards;
position: relative;
z-index: 1;
overflow: hidden; /* 防止layout滚动 */
}
/* 移动端基础样式 */
.mobile-buttons {
display: none;
position: fixed;
top: 1rem;
left: 0;
right: 0;
width: 100%;
padding: 0 1rem;
justify-content: space-between;
z-index: 1000; /* 确保在最上层 */
pointer-events: none; /* 防止按钮区域阻挡其他内容 */
}
.menu-toggle,
.search-toggle {
background: #2d2e32;
border: none;
color: #fff;
width: 40px;
height: 40px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
pointer-events: auto; /* 恢复按钮的点击事件 */
}
.menu-toggle:hover,
.search-toggle:hover {
background: #3a3b3f;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.menu-toggle:active,
.search-toggle:active {
transform: translateY(0);
}
/* 遮罩层 */
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
opacity: 0;
visibility: hidden;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 90;
backdrop-filter: blur(4px);
}
.overlay.active {
opacity: 1;
visibility: visible;
}
/* 侧边栏样式 */
.sidebar {
width: 240px;
background-color: #2d2e32;
padding: 2rem 1.2rem;
display: flex;
flex-direction: column;
gap: 2rem;
position: fixed;
top: 0;
left: 0;
bottom: 0;
overflow-y: auto;
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
z-index: 100;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
transform: translateZ(0);
height: 100vh; /* 确保高度固定 */
}
.sidebar::-webkit-scrollbar {
width: 6px;
}
.sidebar::-webkit-scrollbar-track {
background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
background-color: rgba(255, 255, 255, 0.2);
}
.logo h1 {
font-size: 1.4rem;
color: #fff;
margin-bottom: 2rem;
padding-left: 0.5rem;
letter-spacing: 0.5px;
}
/* 导航区域样式 */
.nav-section {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.section-title {
font-size: 1rem;
color: #4a9eff;
padding: 0.5rem;
margin-bottom: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.section-title i {
font-size: 1.2rem;
}
.nav-item {
display: flex;
align-items: center;
padding: 0.8rem;
color: #a1a2a5;
text-decoration: none;
border-radius: 8px;
transition: all 0.3s ease;
position: relative;
}
.nav-item .icon-container {
width: 24px;
display: flex;
justify-content: center;
align-items: center;
margin-right: 1rem;
}
.nav-item .nav-text {
flex: 1;
}
.nav-item .external-icon {
font-size: 0.9rem;
opacity: 0.6;
margin-left: 0.5rem;
transition: all 0.3s ease;
}
.nav-item:hover {
background-color: #3a3b3f;
color: #fff;
}
.nav-item:hover .external-icon {
opacity: 1;
transform: translateX(2px);
}
.nav-item.active {
background-color: #3a3b3f;
color: #fff;
}
.nav-item i {
width: 20px;
text-align: center;
}
/* 主内容区域 - 修复滚动条问题 */
.content {
flex: 1;
margin-left: 240px;
padding: 2rem 0;
background-color: #1a1b1e;
position: relative;
height: 100vh; /* 固定高度 */
overflow-y: scroll; /* 始终使用滚动而不是auto */
overflow-x: hidden;
max-width: calc(100vw - 240px);
display: flex;
flex-direction: column;
align-items: center;
scrollbar-width: thin; /* Firefox */
}
.content::-webkit-scrollbar {
width: 8px; /* 固定滚动条宽度 */
}
.content::-webkit-scrollbar-track {
background: transparent;
}
.content::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 4px;
}
.content::-webkit-scrollbar-thumb:hover {
background-color: rgba(255, 255, 255, 0.2);
}
/* 搜索框容器 - 固定在顶部 */
.search-container {
width: 100%;
display: flex;
justify-content: center;
padding: 0 2rem;
margin-bottom: 1rem;
position: sticky;
top: 0;
z-index: 10;
}
/* 搜索框 */
.search-box {
position: relative;
width: 100%;
max-width: 600px;
background-color: #2d2e32;
border-radius: 12px;
}
.search-box::after {
content: '';
position: absolute;
right: 3.5rem;
top: 50%;
transform: translateY(-50%);
width: 6px;
height: 6px;
border-radius: 50%;
opacity: 0;
transition: all 0.3s ease;
}
.search-box.has-results::after {
background-color: #4caf50;
opacity: 1;
}
.search-box.no-results::after {
background-color: #f44336;
opacity: 1;
}
.search-box input {
width: 100%;
padding: 1rem 4rem 1rem 1.5rem;
border: none;
border-radius: 12px;
background-color: transparent;
color: #fff;
font-size: 1rem;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.search-box input:focus {
outline: none;
background-color: #3a3b3f;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.search-box input::placeholder {
color: #8b8c8f;
}
.search-box i {
position: absolute;
right: 1.5rem;
top: 50%;
transform: translateY(-50%);
color: #8b8c8f;
transition: all 0.3s ease;
}
.search-box.has-results i {
color: #4caf50;
}
.search-box.no-results i {
color: #f44336;
}
/* 页面容器 */
.page {
position: relative;
width: 100%;
display: none;
flex-direction: column;
align-items: center;
padding-top: 2rem;
}
.page.active {
display: flex;
animation: fadeIn 0.3s ease-out forwards;
}
/* 欢迎区域 */
.welcome-section {
width: 100%;
max-width: 1200px;
margin: 0 auto 3.5rem auto;
padding: 0 6rem 0 8rem;
text-align: left;
position: relative;
z-index: 5;
}
.welcome-section h2 {
font-family: var(--font-title);
font-weight: var(--font-weight-title);
font-size: 2.4rem;
color: #fff;
margin-bottom: 0.5rem;
letter-spacing: 0.5px;
}
.welcome-section h3 {
font-family: var(--font-subtitle);
font-weight: var(--font-weight-subtitle);
font-size: 2rem;
margin-bottom: 1rem;
letter-spacing: 0.3px;
background: linear-gradient(135deg, #4a9eff 0%, #a855f7 50%, #ff6b6b 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
position: relative;
display: inline-block;
text-shadow: 0 0 20px rgba(74, 158, 255, 0.1);
animation: glow 2s ease-in-out infinite alternate;
}
.welcome-section h3::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: inherit;
filter: blur(20px);
opacity: 0.3;
z-index: -1;
}
.welcome-section .subtitle {
color: #8b8c8f;
font-size: 1.1rem;
line-height: 1.5;
}
@keyframes glow {
from {
filter: drop-shadow(0 0 2px rgba(74, 158, 255, 0.2))
drop-shadow(0 0 4px rgba(168, 85, 247, 0.2));
}
to {
filter: drop-shadow(0 0 4px rgba(74, 158, 255, 0.4))
drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
}
}
/* 分类样式 */
.category {
background: linear-gradient(145deg, #2f3035, #2b2c30);
border-radius: 16px;
padding: 2rem;
margin: 0 auto 2.5rem auto;
width: 100%;
max-width: 1100px;
position: relative;
z-index: 1;
opacity: 0;
animation: fadeIn 0.5s ease-out forwards;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
border: 1px solid rgba(255, 255, 255, 0.03);
}
.category h2 {
font-size: 1.2rem;
margin-bottom: 1.5rem;
color: #fff;
display: flex;
align-items: center;
gap: 0.8rem;
letter-spacing: 0.3px;
}
.category h2 i {
color: #4a9eff;
font-size: 1.3rem;
}
/* 网站卡片网格 */
.sites-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 1.2rem;
position: relative;
z-index: 1;
width: 100%;
}
/* 网站卡片样式 */
.site-card {
background: linear-gradient(145deg, #363940, #31343a);
border-radius: 12px;
padding: 1.2rem;
text-decoration: none;
color: inherit;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
backface-visibility: hidden;
transform: translateZ(0);
will-change: transform;
max-width: 100%;
position: relative;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
border: 1px solid rgba(255, 255, 255, 0.05);
z-index: 2;
}
.site-card:hover {
transform: translateY(-4px);
background: linear-gradient(145deg, #3e4249, #383b41);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
border-color: rgba(255, 255, 255, 0.1);
}
.site-card i {
font-size: 1.8rem;
margin-bottom: 1rem;
color: #4a9eff;
transition: all 0.3s ease;
}
.site-card:hover i {
transform: scale(1.1);
color: #5ba9ff;
}
.site-card h3 {
font-size: 1rem;
margin-bottom: 0.5rem;
color: #fff;
font-weight: 500;
letter-spacing: 0.3px;
}
.site-card p {
font-size: 0.9rem;
color: #a1a2a5;
margin: 0;
line-height: 1.4;
}
/* 添加编辑按钮 */
.edit-buttons {
position: absolute;
top: 0.5rem;
right: 0.5rem;
display: flex;
gap: 0.5rem;
opacity: 0;
transition: opacity 0.3s ease;
}
.site-card:hover .edit-buttons {
opacity: 1;
}
.edit-btn, .delete-btn {
background: none;
border: none;
color: #8b8c8f;
cursor: pointer;
padding: 0.3rem;
border-radius: 4px;
transition: all 0.3s ease;
}
.edit-btn:hover, .delete-btn:hover {
color: #fff;
background-color: #4a4b4f;
}
/* 添加网站按钮 */
.add-site-btn {
background: linear-gradient(145deg, #363940, #31343a);
border: 2px dashed rgba(255, 255, 255, 0.1);
border-radius: 14px;
padding: 1.5rem;
color: #8b8c8f;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 180px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.add-site-btn:hover {
background: linear-gradient(145deg, #3e4249, #383b41);
border-color: #4a9eff;
color: #fff;
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.add-site-btn i {
font-size: 2.2rem;
margin-bottom: 0.8rem;
transition: transform 0.3s ease;
}
.add-site-btn:hover i {
transform: scale(1.1);
}
/* 模态框样式 */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
backdrop-filter: blur(4px);
}
.modal.active {
display: flex;
animation: modalFadeIn 0.3s ease-out forwards;
}
.modal-content {
background-color: #2d2e32;
border-radius: 16px;
padding: 2.2rem;
width: 90%;
max-width: 520px;
position: relative;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
transform: scale(0.95);
opacity: 0;
animation: modalContentShow 0.3s ease-out forwards;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.modal-header h3 {
color: #fff;
font-size: 1.3rem;
letter-spacing: 0.3px;
font-weight: 500;
}
.close-modal {
background: none;
border: none;
color: #8b8c8f;
cursor: pointer;
font-size: 1.5rem;
padding: 0.5rem;
transition: all 0.3s ease;
border-radius: 8px;
}
.close-modal:hover {
color: #fff;
background-color: #3a3b3f;
}
/* 表单样式 */
.site-form {
display: flex;
flex-direction: column;
gap: 1.2rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.6rem;
}
.form-group label {
color: #8b8c8f;
font-size: 0.95rem;
letter-spacing: 0.2px;
}
.form-group input, .form-group select {
background-color: #3a3b3f;
border: 1px solid transparent;
border-radius: 10px;
padding: 0.9rem 1.2rem;
color: #fff;
font-size: 1rem;
transition: all 0.3s ease;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.form-group input:focus, .form-group select:focus {
outline: none;
background-color: #3a3b3f;
border-color: #4a9eff;
box-shadow: 0 2px 8px rgba(74, 158, 255, 0.15);
}
.form-group input::placeholder {
color: #8b8c8f;
}
.form-actions {
display: flex;
justify-content: flex-end;
gap: 1rem;
margin-top: 2rem;
}
.btn {
padding: 0.9rem 1.8rem;
border: none;
border-radius: 10px;
cursor: pointer;
font-size: 1rem;
font-weight: 500;
letter-spacing: 0.3px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.btn-primary {
background-color: #4a9eff;
color: #fff;
}
.btn-primary:hover {
background-color: #3a8eef;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}
.btn-secondary {
background-color: #3a3b3f;
color: #8b8c8f;
}
.btn-secondary:hover {
background-color: #4a4b4f;
color: #fff;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* 响应式设计 */
@media (max-width: 1200px) {
.welcome-section {
padding: 0 4rem;
margin-bottom: 3rem;
}
.category {
max-width: 900px;
margin-bottom: 2rem;
}
}
@media (max-width: 768px) {
/* 显示移动端按钮 */
.mobile-buttons {
display: flex;
}
/* 内容区域样式 */
.content {
margin-left: 0;
max-width: 100vw;
padding: 4.5rem 1rem 2rem;
}
/* 侧边栏样式 */
.sidebar {
transform: translateX(-100%);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
width: 240px;
z-index: 150;
padding-top: calc(2rem + 60px); /* 增加顶部padding为按钮留出空间 */
}
.sidebar.active {
transform: translateX(0);
}
/* 搜索框容器样式 */
.search-container {
position: fixed;
top: calc(1rem + 50px); /* 将搜索框下移,避开按钮 */
right: 1rem;
width: 0;
padding: 0;
margin: 0;
overflow: hidden;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
background: transparent;
z-index: 150;
}
.search-container.active {
width: calc(100% - 2rem); /* 调整宽度计算 */
right: 1rem; /* 统一右侧间距 */
}
.search-box {
width: 100%;
opacity: 0;
transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-container.active .search-box {
opacity: 1;
}
/* 搜索框样式优化 */
.search-box input {
padding: 0.8rem 3rem 0.8rem 1.2rem;
font-size: 0.95rem;
background-color: #2d2e32;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.search-box i {
right: 1.2rem;
}
/* 导航文字显示 */
.sidebar .logo h1,
.sidebar .section-title,
.sidebar .nav-item span {
opacity: 1;
display: block;
}
/* 欢迎区域样式 */
.welcome-section {
padding: 0 1rem;
margin-top: 1rem; /* 增加顶部间距 */
}
.welcome-section h2 {
font-size: 2rem;
}
.welcome-section h3 {
font-size: 1.6rem;
background: linear-gradient(135deg, #4a9eff 0%, #a855f7 100%);
-webkit-background-clip: text;
background-clip: text;
animation: glow 3s ease-in-out infinite alternate;
}
/* 分类样式优化 */
.category {
margin: 0 1rem 1.5rem;
padding: 1.5rem;
}
.sites-grid {
gap: 1rem;
}
}
@media (max-width: 480px) {
.welcome-section {
padding: 0 1.5rem;
margin-bottom: 2rem;
}
.category {
margin: 0 1rem 1.2rem 1rem;
padding: 1.2rem;
}
.search-container {
padding: 0 1rem;
}
.page {
padding-top: 1rem;
}
}
/* 动画效果 */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 搜索结果页面 */
#search-results {
position: relative;
width: 100%;
display: none;
flex-direction: column;
align-items: center;
z-index: 15;
transform: none !important; /* 确保没有变换 */
min-height: 400px; /* 确保最小高度,防止内容过少时的布局跳动 */
}
#search-results.active {
display: flex;
animation: fadeIn 0.3s ease-out forwards;
}
/* 搜索结果区域 */
.search-section {
width: 100%;
max-width: 1100px;
margin: 0 auto 2.5rem auto; /* 添加底部间距 */
position: relative;
z-index: 1;
transform: none !important; /* 确保没有变换 */
opacity: 1 !important; /* 确保可见 */
}
/* 确保搜索结果中的网格有正确的间距 */
.search-section .sites-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 1.2rem; /* 确保间距一致 */
position: relative;
z-index: 1;
width: 100%;
}
/* 确保搜索结果中的卡片样式正确 */
.search-section .site-card {
margin: 0; /* 重置可能的外边距 */
width: 100%; /* 确保宽度正确 */
}
/* 清除之前可能导致问题的样式 */
.page {
transform: none !important;
visibility: visible;
transition: none;
width: 100% !important; /* 确保宽度一致 */
left: 0 !important; /* 确保位置固定 */
}
/* 优化布局结构 */
.layout {
position: relative;
z-index: 1;
}
.sidebar {
z-index: 100;
}
/* 确保内容不会重叠 */
.site-card {
position: relative;
z-index: 2;
}
.sites-grid {
position: relative;
z-index: 1;
width: 100%;
}
@keyframes modalFadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes modalContentShow {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
/* 版权声明 */
.copyright {
margin-top: auto;
padding-top: 1rem;
text-align: center;
color: #8b8c8f;
font-size: 0.85rem;
border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.copyright a {
color: #4a9eff;
text-decoration: none;
transition: all 0.3s ease;
}
.copyright a:hover {
color: #3a8eef;
text-decoration: underline;
}