From ef3eb27ecb994669a1a232b58cf7f4f5fd2662cd Mon Sep 17 00:00:00 2001 From: yiqiu Date: Fri, 20 Mar 2026 20:35:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=97=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F+?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95(=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E8=B5=84=E6=96=99/=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/common.css | 75 ++++++++++++++++++++++++++++++++++++++++++++++ public/header.html | 7 +++++ 2 files changed, 82 insertions(+) diff --git a/css/common.css b/css/common.css index 54677cd..242ebc7 100644 --- a/css/common.css +++ b/css/common.css @@ -138,6 +138,81 @@ header:hover { text-decoration: none; } +/* ============================================ + 用户头像 & 下拉菜单 + ============================================ */ + +.user-avatar-wrap { + position: relative; + margin-left: 12px; +} + +.user-avatar { + width: 36px; + height: 36px; + border-radius: 50%; + background: #3B82F6; + color: #fff; + font-size: 15px; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: all 0.2s ease; + border: 2px solid rgba(255, 255, 255, 0.2); +} + +.user-avatar:hover { + border-color: rgba(255, 255, 255, 0.5); + transform: scale(1.05); +} + +.user-dropdown { + display: none; + position: absolute; + top: calc(100% + 8px); + right: 0; + min-width: 140px; + background: #1F2937; + border-radius: 12px; + padding: 6px 0; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); + border: 1px solid rgba(255, 255, 255, 0.1); + z-index: 1000; +} + +.user-avatar-wrap:hover .user-dropdown { + display: block; +} + +/* 下拉箭头 */ +.user-dropdown::before { + content: ''; + position: absolute; + top: -6px; + right: 12px; + width: 12px; + height: 12px; + background: #1F2937; + border-top: 1px solid rgba(255, 255, 255, 0.1); + border-left: 1px solid rgba(255, 255, 255, 0.1); + transform: rotate(45deg); +} + +.user-dropdown-item { + padding: 10px 18px; + color: #E5E7EB; + font-size: 14px; + cursor: pointer; + transition: all 0.15s ease; +} + +.user-dropdown-item:hover { + background: rgba(255, 255, 255, 0.08); + color: #fff; +} + /* ============================================ 登录注册区域 - 撑满高度设计 ============================================ */ diff --git a/public/header.html b/public/header.html index b02b58e..8e71196 100644 --- a/public/header.html +++ b/public/header.html @@ -45,6 +45,13 @@