yuanjing/src/assets/less/Header/header.less
2026-04-17 17:41:38 +08:00

385 lines
7.0 KiB
Plaintext

// 头部容器
.header-container {
position: relative;
z-index: 100;
}
// 头部主容器
.header {
width: 100%;
height: 80px;
display: flex;
justify-content: space-between;
align-items: center;
padding-right: 2rem;
background: rgba(10, 12, 18, 0.74);
backdrop-filter: blur(16px);
@media (max-width: 768px) {
padding: 0 1rem;
height: 70px;
}
}
// Logo样式
.logo {
display: flex;
align-items: center;
gap: 12px;
img {
width: 48px;
height: 48px;
border-radius: 12px;
transition: all 0.3s ease;
}
.header-title {
font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
font-size: 28px;
font-weight: 700;
color: #fff;
letter-spacing: 0.04em;
@media (max-width: 768px) {
font-size: 24px;
}
}
}
// 操作区
.header-actions {
display: flex;
align-items: center;
gap: 14px;
@media (max-width: 768px) {
gap: 12px;
}
}
// ==============================================
// 【一体化】余额 + 充值按钮(核心修改)
// ==============================================
.balance-recharge-combo {
height: 52px;
padding: 0 10px 0 12px;
display: flex;
align-items: center;
gap: 12px;
font-size: 15px;
font-weight: 500;
color: #fff;
background: linear-gradient(180deg, rgba(31, 35, 46, 0.95), rgba(18, 21, 30, 0.96));
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 18px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
.balance-main {
display: flex;
align-items: center;
gap: 10px;
}
.balance-icon-wrap {
width: 32px;
height: 32px;
border-radius: 12px;
background: linear-gradient(135deg, rgba(139, 124, 255, 0.22), rgba(246, 184, 106, 0.18));
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.iconfont {
font-size: 16px;
color: #f6b86a;
}
.balance-copy {
display: flex;
flex-direction: column;
gap: 2px;
}
.balance-label {
font-size: 11px;
color: rgba(255, 255, 255, 0.48);
letter-spacing: 0.08em;
}
.balance-text {
font-weight: 700;
color: #fff;
line-height: 1.1;
}
.combo-divider {
width: 1px;
height: 24px;
background: rgba(255, 255, 255, 0.08);
}
.recharge-text {
min-width: 72px;
height: 36px;
padding: 0 14px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 12px;
font-size: 13px;
color: #fff;
font-weight: 600;
background: linear-gradient(135deg, #6e5cff, #8b7cff);
box-shadow: 0 10px 24px rgba(110, 92, 255, 0.3);
}
&:hover {
transform: translateY(-1px);
border-color: rgba(139, 124, 255, 0.26);
box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}
@media (max-width: 768px) {
height: 42px;
padding: 0 8px 0 10px;
font-size: 13px;
gap: 6px;
.balance-icon-wrap {
width: 28px;
height: 28px;
border-radius: 10px;
}
.balance-label {
display: none;
}
.combo-divider {
height: 18px;
}
.recharge-text {
min-width: 60px;
height: 30px;
padding: 0 10px;
font-size: 12px;
}
}
}
// 登录按钮
.btn {
min-width: 120px;
height: 48px;
font-size: 16px;
background-image: linear-gradient(135deg, #6e5cff, #8b7cff);
border-radius: 16px;
display: flex;
justify-content: center;
align-items: center;
font-weight: 600;
color: #fff;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 12px 28px rgba(110, 92, 255, 0.3);
&:hover {
background-image: linear-gradient(135deg, #7d6dff, #978bff);
transform: translateY(-2px);
box-shadow: 0 16px 36px rgba(110, 92, 255, 0.34);
}
@media (max-width: 768px) {
min-width: 100px;
height: 40px;
font-size: 14px;
}
}
// 用户个人信息区域
.user-profile {
position: relative;
display: inline-block;
}
.user-profile.dropdown-open .user-trigger .dropdown-icon {
transform: rotate(180deg);
color: #8b7cff;
}
.user-trigger {
display: flex;
align-items: center;
gap: 10px;
padding: 0 16px 0 12px;
height: 52px;
background: rgba(255, 255, 255, 0.04);
border-radius: 18px;
color: #fff;
cursor: pointer;
transition: all 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
&:hover {
background: rgba(255, 255, 255, 0.07);
border-color: rgba(139, 124, 255, 0.2);
transform: translateY(-1px);
}
.user-avatar {
width: 30px;
height: 30px;
border-radius: 11px;
display: flex;
align-items: center;
justify-content: center;
// font-size: 50px;
.iconfont{
font-size: 28px;
}
// font-weight: 700;
// color: #fff;
// background: linear-gradient(135deg, rgba(139, 124, 255, 0.9), rgba(246, 184, 106, 0.72));
flex-shrink: 0;
}
.user-name {
font-size: 15px;
font-weight: 600;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dropdown-icon {
width: 16px;
height: 16px;
transition: transform 0.3s ease;
color: rgba(255, 255, 255, 0.56);
}
@media (max-width: 768px) {
height: 36px;
padding: 0 12px;
.user-avatar {
width: 24px;
height: 24px;
border-radius: 8px;
font-size: 11px;
}
.user-name {
max-width: 80px;
font-size: 13px;
}
}
}
// 用户下拉菜单
.user-dropdown {
position: absolute;
top: 100%;
right: 0;
margin-top: 8px;
width: 220px;
background: rgba(16, 19, 28, 0.98);
backdrop-filter: blur(14px);
border-radius: 16px;
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
overflow: hidden;
z-index: 1000;
&::before {
content: '';
position: absolute;
top: -8px;
right: 20px;
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-bottom: 8px solid rgba(16, 19, 28, 0.98);
}
}
// 下拉菜单项
.dropdown-item {
display: flex;
align-items: center;
padding: 12px 16px;
color: #fff;
transition: all 0.2s ease;
cursor: pointer;
&:hover {
background: rgba(255, 255, 255, 0.05);
}
&.user-id {
justify-content: space-between;
font-size: 14px;
.item-label {
color: rgba(255, 255, 255, 0.7);
}
.item-value {
color: #8b7cff;
font-family: monospace;
font-size: 13px;
}
}
&.logout {
gap: 8px;
font-size: 14px;
.item-icon {
width: 16px;
height: 16px;
color: rgba(255, 255, 255, 0.8);
}
&:hover {
color: #ff6b6b;
.item-icon {
color: #ff6b6b;
}
}
}
}
// 下拉菜单分隔线
.dropdown-divider {
height: 1px;
background: rgba(255, 255, 255, 0.06);
margin: 4px 0;
}
// 下拉菜单动画
.dropdown-enter-active,
.dropdown-leave-active {
transition: all 0.3s ease;
}
.dropdown-enter-from {
opacity: 0;
transform: translateY(-10px) scale(0.95);
}
.dropdown-leave-to {
opacity: 0;
transform: translateY(-10px) scale(0.95);
}