/* 侧边栏 */ .sidebar { position: fixed; top: -30px; left: 0; width: 250px; bottom: 24px; background-color: #f4f4f4; color: rgb(100, 99, 99); /* logo颜色 */ display: flex; flex-direction: column; align-items: center; /* 水平居中 */ padding: 20px; transition: transform 0.3s ease-in-out; z-index: 2000; } .logo { font-family: 'Pacifico', cursive; /* 使用本地字体 Pacifico */ margin: 0; padding-top: 48px; text-align: center; /* 确保整个 logo 居中 */ display: flex; flex-direction: column; /* 将 part1 和 part2 垂直排列 */ align-items: center; /* 确保每个部分居中 */ } .logo .part1 { font-size: 50px; /* "dream" 字体较大 */ } .logo .part2 { font-size: 40px; /* ".life" 字体较小 */ } /* 侧边栏链接的基础样式 */ .sidebar-link { position: relative; font-size: 22px; font-weight: bold; margin-top: 48px; color: rgb(117, 115, 115); text-decoration: none; /* 去掉默认的下划线 */ display: inline-block; padding: 10px 20px; background-color: #f4f4f4; transition: all 0.3s ease; /* 添加平滑过渡效果 */ } /* 侧边栏链接内容的容器 */ .sidebar-link .link-content { display: flex; background-color: #f4f4f4; align-items: center; /* 确保文字和图标垂直居中 */ transition: transform 0.3s ease; /* 添加平滑过渡 */ } /* 悬停时图标和文字一起上浮 */ .sidebar-link:hover .link-content { transform: translateY(-3px); /* 向上浮起5px */ } /* 图标样式 */ .sidebar-link .icon { margin-right: 10px; /* 给图标和文字之间留点空隙 */ } /* 悬停时改变链接的颜色 */ .sidebar-link:hover { color: #000; } /* 按钮文本和图标的状态样式 */ .sidebar-link.fullscreen .icon { transform: rotate(90deg); /* 图标旋转 */ } /* 退出全屏时的样式 */ .sidebar-link.fullscreen span { content: "退出全屏"; /* 修改文本为"退出全屏" */ } .sidebar { flex: 1 1 250px; /* 允许侧边栏在可用空间内缩放 */ } /* 侧边栏按钮容器 */ #sidebar { display: flex; flex-direction: column; /* 垂直排列按钮 */ align-items: center; /* 确保按钮水平居中 */ padding-top: 30px; } /* 按钮样式:药丸形 */ .tag-btn { display: block; /* 让按钮变成 block 级元素 */ width: 100px; /* 设置按钮的宽度 */ height: 34px; /* 设置按钮的高度 */ padding: 8px 10px; /* 调整内边距,让内容更舒适 */ border-radius: 20px; color: #fff; margin: 5px; border: none; cursor: pointer; font-weight: bold; /* 加粗字体 */ text-align: center; /* 让文字居中 */ line-height: 17px; /* 调整文本垂直居中 */ transition: transform 0.5s ease, box-shadow 0.5s ease; } /* 按钮动画完成状态 */ .tag_btn.animated { opacity: 1; transform: translateY(0); /* 恢复到正常位置 */ } /* 按钮悬停效果 */ .tag-btn:hover { transform: scale(1.03); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); }