feat: 登录注册系统 + 游客使用限制

功能:
- 登录/注册界面(本地存储用户数据)
- 我的页面显示用户状态、登录/退出按钮
- 游客配额显示(对话会话/消息/智能体消息)

游客限制:
- 每天最多1个对话会话
- 每天最多20条对话消息
- 只能使用通用助手智能体
- 每天最多20条智能体消息
- 登录用户无限制

限制提示:
- 达到限制弹出提示对话框
- 提示登录解锁全部功能
This commit is contained in:
2026-04-27 11:06:20 +08:00
parent 439743c051
commit c8cea4c1a1
3 changed files with 913 additions and 14 deletions

View File

@@ -689,6 +689,321 @@ body {
opacity: 1;
}
/* ==================== 登录注册页面 ==================== */
.auth-page {
display: flex;
flex-direction: column;
height: 100vh;
height: 100dvh;
background: #f5f5f5;
}
.auth-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
}
.auth-header h1 {
font-size: 18px;
font-weight: 600;
margin-left: 12px;
}
.auth-content {
flex: 1;
padding: 24px 16px;
display: flex;
flex-direction: column;
}
.auth-form {
background: white;
padding: 24px;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.auth-input-group {
margin-bottom: 20px;
}
.auth-input-group label {
display: block;
font-size: 14px;
font-weight: 500;
color: var(--text-color);
margin-bottom: 8px;
}
.auth-input-group input {
width: 100%;
padding: 12px 16px;
border: 2px solid var(--border-color);
border-radius: 10px;
font-size: 16px;
outline: none;
transition: border-color 0.2s;
}
.auth-input-group input:focus {
border-color: var(--primary);
}
.auth-submit-btn {
width: 100%;
padding: 14px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s;
}
.auth-submit-btn:hover {
transform: scale(1.02);
}
.auth-submit-btn:active {
transform: scale(0.98);
}
.auth-footer {
text-align: center;
padding: 24px;
color: var(--text-light);
}
.auth-link {
color: var(--primary);
font-weight: 500;
cursor: pointer;
}
.auth-link:hover {
color: #5a67d8;
}
/* ==================== 我的页面 ==================== */
.profile-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 24px;
background: white;
border-radius: 12px;
margin-bottom: 16px;
}
.profile-avatar {
font-size: 48px;
margin-bottom: 8px;
}
.profile-name {
font-size: 18px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 8px;
}
.profile-status {
font-size: 14px;
color: #22c55e;
margin-bottom: 16px;
}
.profile-status.guest {
color: var(--text-light);
}
.profile-login-buttons {
display: flex;
flex-direction: column;
gap: 12px;
width: 100%;
}
.login-btn, .register-btn, .logout-btn {
width: 100%;
padding: 12px;
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: transform 0.2s;
}
.login-btn:hover, .register-btn:hover, .logout-btn:hover {
transform: scale(1.02);
}
.register-btn {
background: white;
border: 2px solid var(--primary);
color: var(--primary);
}
.logout-btn {
background: #fee2e2;
color: #e53e3e;
}
.skip-btn {
width: 100%;
padding: 10px;
background: transparent;
border: 1px solid var(--border-color);
color: var(--text-light);
border-radius: 8px;
font-size: 14px;
cursor: pointer;
}
.skip-btn:hover {
background: rgba(0,0,0,0.05);
}
/* ==================== 配额显示 ==================== */
.quota-card {
background: white;
padding: 16px;
border-radius: 12px;
margin-bottom: 16px;
border: 1px solid var(--border-color);
}
.quota-title {
font-size: 14px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.quota-items {
display: flex;
flex-direction: column;
gap: 8px;
}
.quota-item {
display: flex;
justify-content: space-between;
align-items: center;
}
.quota-label {
font-size: 14px;
color: var(--text-light);
}
.quota-value {
font-size: 14px;
font-weight: 500;
color: var(--primary);
}
.quota-tip {
text-align: center;
font-size: 12px;
color: #f59e0b;
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid var(--border-color);
}
/* ==================== 限制提示对话框 ==================== */
.limit-dialog {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 2000;
}
.limit-dialog-content {
background: white;
padding: 24px;
border-radius: 16px;
max-width: 300px;
text-align: center;
animation: dialogSlideUp 0.2s ease;
}
@keyframes dialogSlideUp {
from { transform: translateY(20px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.limit-dialog-icon {
font-size: 48px;
margin-bottom: 16px;
}
.limit-dialog-title {
font-size: 18px;
font-weight: 600;
color: var(--text-color);
margin-bottom: 12px;
}
.limit-dialog-message {
font-size: 14px;
color: var(--text-light);
line-height: 1.6;
margin-bottom: 20px;
white-space: pre-line;
}
.limit-dialog-actions {
display: flex;
gap: 12px;
}
.limit-dialog-btn {
flex: 1;
padding: 12px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.limit-dialog-btn.login {
background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
color: white;
border: none;
}
.limit-dialog-btn.login:hover {
transform: scale(1.02);
}
.limit-dialog-btn.cancel {
background: white;
border: 1px solid var(--border-color);
color: var(--text-light);
}
.limit-dialog-btn.cancel:hover {
background: var(--bg-color);
}
/* 最近使用的智能体列表 */
.recent-agents-list {
display: flex;