login.css 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: border-box;
  5. }
  6. body {
  7. height: 100vh;
  8. display: flex;
  9. justify-content: center;
  10. align-items: center;
  11. /* 深色底 + 左上/右下两团主题色光晕, 提升质感 (老浏览器回退纯色) */
  12. background:
  13. radial-gradient(ellipse 60% 50% at 15% 10%, rgba(37, 99, 235, 0.18), transparent 60%),
  14. radial-gradient(ellipse 55% 45% at 88% 90%, rgba(14, 165, 233, 0.12), transparent 60%),
  15. #0b1220;
  16. font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  17. color: #e2e8f0;
  18. -webkit-tap-highlight-color: transparent;
  19. -webkit-font-smoothing: antialiased;
  20. }
  21. .login-box {
  22. width: 420px;
  23. background: #0f172a;
  24. border: 1px solid #24314a;
  25. border-radius: 10px;
  26. padding: 40px;
  27. box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  28. position: relative;
  29. overflow: hidden;
  30. }
  31. /* 顶部一条主题色光线, 点缀卡片 */
  32. .login-box::before {
  33. content: "";
  34. position: absolute;
  35. top: 0;
  36. left: 0;
  37. right: 0;
  38. height: 3px;
  39. background: linear-gradient(90deg, transparent, #2563eb, #38bdf8, transparent);
  40. }
  41. .logo {
  42. text-align: center;
  43. margin-bottom: 20px;
  44. }
  45. /* 登录页内联 SVG logo: login.html 未加载 app.css, 需在此独立定义尺寸与样式 */
  46. .logo .icon {
  47. width: 64px;
  48. height: 64px;
  49. padding: 14px;
  50. box-sizing: border-box;
  51. border-radius: 16px;
  52. background: linear-gradient(135deg, #2563eb, #1e40af);
  53. fill: none;
  54. stroke: #ffffff;
  55. stroke-width: 2;
  56. stroke-linecap: round;
  57. stroke-linejoin: round;
  58. box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  59. }
  60. h1 {
  61. color: #e2e8f0;
  62. text-align: center;
  63. font-size: 24px;
  64. line-height: 1.35;
  65. max-width: 300px;
  66. margin: 0 auto 10px;
  67. }
  68. .subtitle {
  69. text-align: center;
  70. color: #94a3b8;
  71. margin-bottom: 30px;
  72. }
  73. input {
  74. width: 100%;
  75. height: 45px;
  76. margin-bottom: 15px;
  77. border: 1px solid #475569;
  78. border-radius: 4px;
  79. padding-left: 15px;
  80. background: #1e293b;
  81. color: #e2e8f0;
  82. font-size: 15px;
  83. outline: none;
  84. transition: border-color 0.18s;
  85. }
  86. input::placeholder {
  87. color: #64748b;
  88. }
  89. input:focus {
  90. border-color: #3b82f6;
  91. box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  92. }
  93. #msg {
  94. margin-top: 15px;
  95. text-align: center;
  96. color: #ef4444;
  97. font-size: 14px;
  98. /* 预留高度: 出现/消失提示文字时按钮不跳动 */
  99. min-height: 20px;
  100. }
  101. /* ================= 移动端适配 (≤480px) ================= */
  102. @media (max-width: 480px) {
  103. .login-box {
  104. width: calc(100% - 24px);
  105. padding: 24px 20px;
  106. }
  107. h1 {
  108. font-size: 19px;
  109. }
  110. }