/* 🎨 淡紫色主题色彩体系 */ :root { --primary-light: #f0e6ff; --primary-medium: #d8c8f0; --primary-dark: #b28fce; --accent-pink: #ffd1dc; --accent-mint: #d4f0f0; --text-soft: #5d5d81; --text-dark: #3a3a5d; --shadow-soft: rgba(178, 143, 206, 0.15); } html, body { height: 100%; } * { box-sizing: border-box; transition: all 0.3s ease; } body { font-family: 'Comic Neue', 'Nunito', 'Arial', sans-serif; background: linear-gradient(135deg, #f9f5ff 0%, #f0e6ff 100%); min-height: 100vh; margin: 0; padding: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-dark); line-height: 1.6; } /* 登录容器美化 */ .login-container { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-radius: 25px; padding: 40px 35px; box-shadow: 0 15px 35px var(--shadow-soft); border: 2px solid var(--primary-light); max-width: 420px; width: 100%; position: relative; overflow: hidden; animation: float 6s ease-in-out infinite; } .login-container::before { content: ""; position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: var(--accent-pink); border-radius: 50%; opacity: 0.3; z-index: 0; } .login-container::after { content: ""; position: absolute; bottom: -30px; left: -30px; width: 100px; height: 100px; background: var(--accent-mint); border-radius: 50%; opacity: 0.2; z-index: 0; } h2 { text-align: center; color: var(--text-dark); margin-bottom: 30px; font-weight: 600; position: relative; z-index: 1; } h2::before { content: "💬"; margin-right: 10px; font-size: 28px; } /* 针对平板电脑等中等屏幕的样式 (小于等于768px) */ @media (max-width: 768px) { .login-container { padding: 35px 30px; } h2 { font-size: 1.5em; } } /* 针对手机等小屏幕的样式 (小于等于480px) - 锁定一屏显示,禁止页面整体滚动 */ @media (max-width: 480px) { body { padding: 10px; display: flex; align-items: center; justify-content: center; height: 100vh; overflow: hidden; /* 禁止页面整体滚动 */ } .login-container { padding: 25px 20px; margin: 10px auto; /* 添加自动外边距使其保持居中 */ animation: none; /* 在小屏幕上可以取消浮动动画以提升性能 */ max-height: 95vh; overflow-y: auto; /* 允许容器内部滚动 */ } h2 { font-size: 1.3em; } /* 让输入框和按钮更适合触摸 */ input[type="text"], input[type="password"], button { padding: 14px 16px; font-size: 16px; /* 防止iOS浏览器缩放 */ min-height: 44px; /* 增加触摸目标大小 */ } .test-accounts { padding: 15px; margin-top: 20px; } .test-accounts p { font-size: 13px; /* 在小屏幕上缩小测试信息字体 */ word-break: break-all; /* 防止长链接换行溢出 */ } } /* 表单组美化 */ .form-group { margin-bottom: 25px; position: relative; z-index: 1; } label { display: block; margin-bottom: 8px; color: var(--text-soft); font-weight: 500; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; } input[type="text"], input[type="password"] { width: 100%; padding: 15px 20px; border: 2px solid var(--primary-light); border-radius: 15px; font-size: 16px; background: rgba(255, 255, 255, 0.9); transition: all 0.3s ease; font-family: inherit; } input[type="text"]:focus, input[type="password"]:focus { outline: none; border-color: var(--primary-medium); box-shadow: 0 0 0 4px rgba(201, 170, 246, 0.3); background: white; transform: translateY(-2px); } /* 按钮美化 */ button { background: linear-gradient(45deg, var(--primary-medium), var(--primary-dark)); color: white; border: none; padding: 15px 30px; border-radius: 15px; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; position: relative; overflow: hidden; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); z-index: 1; min-height: 44px; /* 增加触摸目标大小 */ -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */ touch-action: manipulation; /* 优化触摸响应 */ } button::after { content: "✨"; margin-left: 8px; } button:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(178, 143, 206, 0.6); } button:active { transform: scale(0.98); } /* 错误提示美化 */ .error { color: #ff6b6b; margin-top: 15px; padding: 12px 15px; background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); border-radius: 10px; text-align: center; font-size: 14px; position: relative; z-index: 1; } /* 测试账户信息美化 */ .test-accounts { margin-top: 30px; padding: 20px; background: rgba(240, 230, 255, 0.5); border-radius: 15px; border: 1px dashed var(--primary-light); position: relative; z-index: 1; } .test-accounts p:first-child { margin-top: 0; font-weight: 600; color: var(--text-dark); text-align: center; margin-bottom: 15px; } .test-accounts p { margin: 8px 0; color: var(--text-soft); font-size: 14px; padding: 5px 10px; background: rgba(255, 255, 255, 0.7); border-radius: 8px; } /* 装饰元素 */ .decoration { position: absolute; z-index: 0; } .decoration.heart { top: 20px; left: 20px; width: 20px; height: 20px; background: var(--accent-pink); opacity: 0.5; border-radius: 50%; } .decoration.star { bottom: 40px; right: 30px; width: 15px; height: 15px; background: var(--primary-medium); opacity: 0.4; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); } /* 动画效果 */ @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }