* { margin: 0; padding: 0; box-sizing: border-box; } body { /* min-height 而非固定 height: 内容高于视口时(如手机横屏)可正常滚动, 顶部不会被裁切 */ min-height: 100vh; padding: 16px 0; display: flex; justify-content: center; align-items: center; /* 深色底 + 左上/右下两团主题色光晕, 提升质感 (老浏览器回退纯色) */ background: radial-gradient(ellipse 60% 50% at 15% 10%, rgba(37, 99, 235, 0.18), transparent 60%), radial-gradient(ellipse 55% 45% at 88% 90%, rgba(14, 165, 233, 0.12), transparent 60%), #0b1220; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: #e2e8f0; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; } .login-box { width: 420px; background: #0f172a; border: 1px solid #24314a; border-radius: 10px; padding: 40px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); position: relative; overflow: hidden; } /* 顶部一条主题色光线, 点缀卡片 */ .login-box::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #2563eb, #38bdf8, transparent); } .logo { text-align: center; margin-bottom: 20px; } /* 登录页内联 SVG logo: login.html 未加载 app.css, 需在此独立定义尺寸与样式 */ .logo .icon { width: 64px; height: 64px; padding: 14px; box-sizing: border-box; border-radius: 16px; background: linear-gradient(135deg, #2563eb, #1e40af); fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4); } h1 { color: #e2e8f0; text-align: center; font-size: 24px; line-height: 1.35; max-width: 300px; margin: 0 auto 10px; } .subtitle { text-align: center; color: #94a3b8; margin-bottom: 30px; } input { width: 100%; height: 45px; margin-bottom: 15px; border: 1px solid #475569; border-radius: 4px; padding-left: 15px; background: #1e293b; color: #e2e8f0; font-size: 15px; outline: none; transition: border-color 0.18s; } input::placeholder { color: #64748b; } input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18); } #msg { margin-top: 15px; text-align: center; color: #ef4444; font-size: 14px; /* 预留高度: 出现/消失提示文字时按钮不跳动 */ min-height: 20px; } /* ================= 移动端适配 (≤480px) ================= */ @media (max-width: 480px) { .login-box { width: calc(100% - 24px); padding: 24px 20px; } h1 { font-size: 19px; } } /* 手机/平板上 iOS 聚焦输入框时若字号 <16px 会自动放大页面, 提到 16px 规避 */ @media (max-width: 768px) { input { font-size: 16px; } } /* ================= 矮屏适配 (手机横屏 / 小窗口, 高度 ≤520px) ================= */ @media (max-height: 520px) { body { padding: 10px 0; } .login-box { padding: 20px 24px; } .logo { margin-bottom: 12px; } .logo .icon { width: 48px; height: 48px; padding: 10px; border-radius: 12px; } h1 { font-size: 18px; margin-bottom: 6px; } .subtitle { margin-bottom: 14px; font-size: 13px; } input { height: 40px; margin-bottom: 10px; } .login-box .btn { height: 40px; } #msg { margin-top: 8px; min-height: 18px; } }