refactor: 统一CSS设计系统 — 移除各页面重复内联样式,改用theme-modern.css自定义属性

This commit is contained in:
Yuzhiran Dev
2026-05-17 10:09:56 +08:00
parent 9c37c9a574
commit d32fc05f4f
7 changed files with 413 additions and 548 deletions
+1 -212
View File
@@ -5,218 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>宇之然内容创作平台 - 登录</title>
<link rel="stylesheet" href="element-plus.css">
<style>
/* 重置与基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
/* 紫蓝渐变背景 */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
}
/* 背景动态装饰圆 */
.bg-circle {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
animation: float 20s infinite ease-in-out;
}
.bg-circle:nth-child(1) { width: 300px; height: 300px; top: -150px; left: -150px; animation-delay: 0s; }
.bg-circle:nth-child(2) { width: 200px; height: 200px; bottom: -100px; right: -100px; animation-delay: -5s; }
.bg-circle:nth-child(3) { width: 150px; height: 150px; top: 50%; right: 10%; animation-delay: -10s; }
.bg-circle:nth-child(4) { width: 100px; height: 100px; bottom: 20%; left: 5%; animation-delay: -15s; }
@keyframes float {
0%, 100% { transform: translate(0, 0) scale(1); }
25% { transform: translate(30px, -30px) scale(1.1); }
50% { transform: translate(-20px, 20px) scale(0.9); }
75% { transform: translate(20px, 30px) scale(1.05); }
}
/* 登录卡片 */
.login-card {
position: relative;
z-index: 10;
width: 100%;
max-width: 420px;
padding: 48px 40px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-radius: 24px;
box-shadow:
0 20px 60px rgba(0, 0, 0, 0.3),
0 0 0 1px rgba(255, 255, 255, 0.2) inset;
animation: slide-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slide-up {
from {
opacity: 0;
transform: translateY(40px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.login-title {
text-align: center;
font-size: 28px;
font-weight: 700;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 40px;
letter-spacing: -0.5px;
}
.login-subtitle {
text-align: center;
color: #9ca3af;
font-size: 14px;
margin-top: -24px;
margin-bottom: 32px;
}
/* 表单样式 */
.form-group {
margin-bottom: 24px;
position: relative;
}
.form-input {
width: 100%;
padding: 14px 16px;
border: 2px solid #e5e7eb;
border-radius: 12px;
font-size: 16px;
color: #1f2937;
background: #f9fafb;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
outline: none;
}
.form-input:focus {
border-color: #667eea;
background: #ffffff;
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
transform: translateY(-2px);
}
.form-input:not(:placeholder-shown) {
border-color: #764ba2;
}
.form-label {
position: absolute;
left: 14px;
top: 50%;
transform: translateY(-50%);
color: #9ca3af;
pointer-events: none;
transition: all 0.2s ease;
font-size: 16px;
background: transparent;
padding: 0 4px;
}
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
top: 0;
font-size: 12px;
color: #667eea;
background: #ffffff;
}
/* 登录按钮 */
.login-btn {
width: 100%;
padding: 14px;
margin-top: 8px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 12px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}
.login-btn:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}
.login-btn:active:not(:disabled) {
transform: translateY(0);
}
.login-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}
/* 按钮加载动画 */
.btn-loader {
display: inline-block;
width: 16px;
height: 16px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin-right: 8px;
vertical-align: middle;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* 底部信息 */
.login-footer {
text-align: center;
margin-top: 24px;
color: #6b7280;
font-size: 13px;
}
.login-footer a {
color: #667eea;
text-decoration: none;
transition: color 0.2s;
}
.login-footer a:hover {
color: #764ba2;
}
/* 响应式 */
@media (max-width: 480px) {
.login-card {
max-width: 90%;
padding: 32px 24px;
margin: 16px;
border-radius: 20px;
}
.login-title {
font-size: 24px;
margin-bottom: 24px;
}
}
</style>
<link rel="stylesheet" href="theme-modern.css">
</head>
<body>
<!-- 背景装饰 -->