纯粹的黑 (Pure Black):背景不再是杂乱的渐变,而是纯粹的 #000,配合中心极其微弱的蓝色呼吸光,像是在深海或太空。
整块巨石 (The Monolith):登录卡片不再有明显的边框,而是一块极其厚重、高度模糊的暗色玻璃。顶部有一道微弱的“聚光灯”效果。
内嵌式输入框 (Carved Inputs):抛弃了传统的边框设计,输入框像是直接在玻璃上雕刻出来的凹槽(Inner Shadow),质感极强。
全息按钮 (Holographic Button):主按钮默认是极简的黑白配色,但当你悬停时,背后会浮现出流动的全息极光色彩。
字体升级:引入了 Space Grotesk 配合 Inter,让标题和标签更有科技杂志的排版感。
This commit is contained in:
2026-01-26 15:19:04 +08:00
parent 605171b87b
commit 3bef846077
2 changed files with 236 additions and 161 deletions

View File

@@ -1,234 +1,328 @@
/* Modern Login Page Styles */ /* "Ethereal Void" Ultra-Modern Theme */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');
:root {
--primary-glow: conic-gradient(from 180deg at 50% 50%, #2a8af6 0deg, #a853ba 180deg, #e92a67 360deg);
--glass-surface: rgba(255, 255, 255, 0.03);
--glass-border: rgba(255, 255, 255, 0.08);
}
.login-page { .login-page {
min-height: 100vh; min-height: 100vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: var(--bg-primary); background-color: #000000;
/* Rich Mesh Gradient Background */
background: linear-gradient(-45deg, #1e293b, #0f172a, #1e1b4b, #2e1065);
background-size: 400% 400%;
animation: meshGradient 15s ease infinite;
padding: 1rem;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
font-family: 'Inter', sans-serif;
color: #fff;
}
/* 1. Dynamic "Void" Background */
.login-page::before {
content: '';
position: absolute;
width: 150vw;
height: 150vw;
background: radial-gradient(circle at center, rgba(56, 189, 248, 0.08) 0%, rgba(0, 0, 0, 0) 50%);
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: pulseLight 8s ease-in-out infinite alternate;
pointer-events: none;
} }
/* Background Glowing Orbs */
.login-page::before,
.login-page::after { .login-page::after {
content: ''; content: '';
position: absolute; position: absolute;
width: 40vw; top: -20%;
height: 40vw; left: -10%;
border-radius: 50%; width: 50vw;
filter: blur(80px); height: 50vw;
z-index: 0; background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
opacity: 0.15; filter: blur(60px);
animation: floatOrb 15s ease-in-out infinite;
} }
.login-page::before { @keyframes pulseLight {
top: -10vw;
left: -10vw;
background: var(--accent-primary);
animation: float 20s ease-in-out infinite alternate;
}
.login-page::after {
bottom: -10vw;
right: -10vw;
background: #3b82f6;
animation: float 25s ease-in-out infinite alternate-reverse;
}
@keyframes float {
0% { 0% {
transform: translate(0, 0); opacity: 0.5;
transform: translate(-50%, -50%) scale(1);
} }
100% { 100% {
transform: translate(10vw, 10vw); opacity: 1;
transform: translate(-50%, -50%) scale(1.2);
} }
} }
@keyframes floatOrb {
/* Glass Card */ 0%,
100% {
transform: translate(0, 0);
}
50% {
transform: translate(20px, 40px);
}
}
/* 2. The Monolith Card */
.login-container { .login-container {
background: var(--glass-panel-bg);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border: 1px solid var(--glass-border);
border-radius: 2rem;
/* Larger radius */
padding: 3rem;
max-width: 440px;
width: 100%; width: 100%;
box-shadow: var(--shadow-2xl), var(--shadow-glow-primary); max-width: 400px;
animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1); padding: 3rem;
margin: 1rem;
position: relative; position: relative;
z-index: 1; z-index: 10;
/* Ultra-refined Glass */
background: rgba(10, 10, 10, 0.6);
backdrop-filter: blur(40px);
-webkit-backdrop-filter: blur(40px);
border-radius: 32px;
border: 1px solid var(--glass-border);
box-shadow:
0 0 0 1px rgba(0, 0, 0, 1),
/* inner black line */
0 20px 60px rgba(0, 0, 0, 0.8),
0 0 0 1px rgba(255, 255, 255, 0.05) inset;
/* subtle inner highlight */
animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) backwards;
} }
/* Top "Spotlight" Border Effect */
.login-container::after {
content: "";
position: absolute;
top: 0;
left: 20%;
right: 20%;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
width: 60%;
}
@keyframes slideUpFade {
from {
opacity: 0;
transform: translateY(40px) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
/* 3. Minimalist Header */
.login-header { .login-header {
text-align: center; text-align: center;
margin-bottom: 2.5rem; margin-bottom: 3rem;
} }
.login-logo { .login-logo {
width: 64px; width: 64px;
height: 64px; height: 64px;
background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%); margin: 0 auto 1.5rem;
border-radius: 1rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: 0 auto 1.5rem;
color: white; /* Gem-like appearance */
box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3); background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.01));
transform: rotate(-5deg); border: 1px solid rgba(255, 255, 255, 0.2);
transition: transform 0.3s ease; border-radius: 20px;
color: #fff;
position: relative;
} }
.login-container:hover .login-logo { /* The neon ring */
transform: rotate(0deg) scale(1.05); .login-logo::before {
content: '';
position: absolute;
inset: -1px;
z-index: -1;
border-radius: 21px;
background: var(--primary-glow);
opacity: 0.5;
filter: blur(8px);
} }
.login-title { .login-title {
font-family: 'Space Grotesk', sans-serif;
font-size: 1.75rem; font-size: 1.75rem;
font-weight: 700; font-weight: 600;
color: var(--text-primary); color: white;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
letter-spacing: -0.5px; letter-spacing: -0.03em;
} }
.login-subtitle { .login-subtitle {
color: var(--text-secondary); color: #8899a6;
font-size: 0.95rem; font-size: 0.9rem;
letter-spacing: 0.01em;
} }
/* 4. "Carved" Inputs */
.login-form { .login-form {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.5rem; gap: 1.25rem;
}
.login-error {
background: rgba(239, 68, 68, 0.1);
color: #ef4444;
padding: 0.875rem 1rem;
border-radius: 0.75rem;
font-size: 0.875rem;
text-align: center;
border: 1px solid rgba(239, 68, 68, 0.2);
} }
.login-field { .login-field {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.6rem;
} }
.login-label { .login-label {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
font-size: 0.875rem; font-size: 0.8rem;
font-weight: 600; font-weight: 500;
color: var(--text-secondary); font-family: 'Space Grotesk', sans-serif;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #6b7280;
margin-left: 4px;
} }
.login-input { .login-input {
width: 100%; width: 100%;
padding: 0.875rem 1rem; padding: 1rem 1.25rem;
border: 1px solid var(--border-color);
border-radius: 0.75rem;
font-size: 0.95rem; font-size: 0.95rem;
background: rgba(255, 255, 255, 0.5); font-family: 'Inter', sans-serif;
color: var(--text-primary);
transition: all 0.2s; /* Seamless dark background */
background: rgba(0, 0, 0, 0.4);
color: #fff;
/* No visible border initially, just depth */
border: 1px solid transparent;
border-radius: 16px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) inset;
/* Inner shadow depth */
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
} }
.login-input:focus { .login-input:focus {
outline: none; outline: none;
background: white; background: rgba(0, 0, 0, 0.6);
border-color: var(--accent-primary); border-color: rgba(255, 255, 255, 0.1);
box-shadow: 0 0 0 4px var(--bg-hover); box-shadow:
0 4px 12px rgba(0, 0, 0, 0.4) inset,
0 0 0 1px rgba(255, 255, 255, 0.05);
/* Subtle ring */
color: #fff;
} }
/* Password Toggle */
.login-password-wrapper { .login-password-wrapper {
position: relative; position: relative;
} }
.login-password-toggle { .login-password-toggle {
position: absolute; position: absolute;
right: 1rem; right: 1.25rem;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
background: none; background: none;
border: none; border: none;
color: var(--text-muted); color: #4b5563;
cursor: pointer; cursor: pointer;
padding: 0; padding: 4px;
display: flex;
align-items: center;
transition: color 0.2s; transition: color 0.2s;
} }
.login-password-toggle:hover { .login-password-toggle:hover {
color: var(--text-primary); color: #e5e7eb;
} }
/* 5. Holographic Button */
.login-button { .login-button {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 0.5rem; gap: 0.75rem;
padding: 1rem; padding: 1.1rem;
border: none; border: none;
border-radius: 0.75rem; border-radius: 16px;
font-size: 1rem; font-size: 0.95rem;
font-weight: 600; font-weight: 600;
font-family: 'Space Grotesk', sans-serif;
cursor: pointer; cursor: pointer;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); margin-top: 1rem;
margin-top: 0.5rem; position: relative;
} overflow: hidden;
transition: all 0.3s;
.login-button:disabled {
opacity: 0.7;
cursor: not-allowed;
} }
/* Primary "Glow" Button */
.login-button--primary { .login-button--primary {
background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
color: white; color: white;
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); background: #fff;
color: #000;
z-index: 1;
}
/* The gradient hover effect sits behind */
.login-button--primary::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
z-index: -1;
opacity: 0;
transition: opacity 0.3s ease;
} }
.login-button--primary:hover:not(:disabled) { .login-button--primary:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
}
.login-button--github {
background: #1f2937;
color: white; color: white;
margin-top: 0;
}
.login-button--github:hover:not(:disabled) {
background: #111827;
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); box-shadow: 0 10px 30px -4px rgba(139, 92, 246, 0.5);
} }
.login-button--primary:hover:not(:disabled)::before {
opacity: 1;
}
/* Minimal GitHub Button */
.login-button--github {
background: transparent;
color: #94a3b8;
border: 1px dashed rgba(255, 255, 255, 0.2);
margin-top: 0.5rem;
padding: 0.9rem;
}
.login-button--github:hover {
background: rgba(255, 255, 255, 0.03);
border-color: rgba(255, 255, 255, 0.5);
border-style: solid;
color: #fff;
}
/* 6. Refined Footer */
.login-divider { .login-divider {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 1rem; gap: 1.5rem;
color: var(--text-muted); color: #4b5563;
font-size: 0.875rem; font-size: 0.75rem;
margin: 0.5rem 0; margin: 1rem 0;
font-weight: 500;
text-transform: uppercase;
} }
.login-divider::before, .login-divider::before,
@@ -236,60 +330,41 @@
content: ''; content: '';
flex: 1; flex: 1;
height: 1px; height: 1px;
background: var(--border-color); background: #1f2937;
} }
.login-footer { .login-footer {
text-align: center; text-align: center;
margin-top: 2rem; margin-top: 2rem;
padding-top: 1.5rem; font-size: 0.9rem;
border-top: 1px solid var(--border-color);
} }
.login-footer p { .login-footer p {
color: var(--text-secondary); color: #6b7280;
font-size: 0.95rem;
} }
.login-footer a { .login-footer a {
color: var(--accent-primary); color: white;
font-weight: 500;
text-decoration: none; text-decoration: none;
font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, 0.3);
margin-left: 0.25rem; padding-bottom: 2px;
transition: border-color 0.2s;
margin-left: 4px;
} }
.login-footer a:hover { .login-footer a:hover {
text-decoration: underline; border-color: white;
} }
/* Dark Mode Adjustments */ /* Errors */
@media (prefers-color-scheme: dark) { .login-error {
.login-container { background: rgba(255, 59, 48, 0.1);
background: rgba(30, 41, 59, 0.7); color: #ff3b30;
border-color: rgba(255, 255, 255, 0.1); padding: 0.8rem;
box-shadow: border-radius: 12px;
0 20px 40px -10px rgba(0, 0, 0, 0.3), font-size: 0.85rem;
0 0 0 1px rgba(255, 255, 255, 0.05) inset; text-align: center;
} margin-bottom: 0.5rem;
border: 1px solid rgba(255, 59, 48, 0.2);
.login-input {
background: rgba(0, 0, 0, 0.2);
border-color: rgba(255, 255, 255, 0.1);
}
.login-input:focus {
background: rgba(0, 0, 0, 0.4);
}
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
} }

View File

@@ -74,7 +74,7 @@ export default function Login({ mode = 'login' }: LoginProps) {
<div className="login-container"> <div className="login-container">
<div className="login-header"> <div className="login-header">
<div className="login-logo"> <div className="login-logo">
<div className="login-logo-inner"></div> <Icon icon="solar:wallet-2-bold-duotone" width="36" height="36" />
</div> </div>
<h1 className="login-title"> <h1 className="login-title">
{isLogin ? '欢迎回来' : '创建账户'} {isLogin ? '欢迎回来' : '创建账户'}