feat: 重构用户端手机号验证码登录页

This commit is contained in:
2026-07-10 17:08:31 +08:00
parent 808ba74fc5
commit 2e274dea51
9 changed files with 991 additions and 209 deletions

View File

@@ -1,18 +1,36 @@
:root {
font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
color: #17211d;
background: #e9efed;
font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
color: #14221d;
background: #f6faf8;
font-synthesis: none;
text-rendering: optimizeLegibility;
--login-bg: #f6faf8;
--login-surface: #ffffff;
--login-text: #14221d;
--login-muted: #66756f;
--login-weak: #98a39f;
--login-brand: #42a982;
--login-brand-dark: #2f8f6d;
--login-border: #dce6e2;
--login-error: #d85b5b;
--login-disabled: #e8f0ed;
--login-radius-card: 22px;
--login-radius-control: 15px;
--login-shadow: 0 18px 54px rgba(35, 79, 63, 0.09);
}
* {
box-sizing: border-box;
}
html {
background: var(--login-bg);
}
body {
margin: 0;
min-width: 320px;
overflow-x: hidden;
}
button,
@@ -25,16 +43,23 @@ button {
cursor: pointer;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
outline: 3px solid rgba(66, 169, 130, 0.2);
outline-offset: 2px;
}
.app-shell {
min-height: 100vh;
min-height: 100dvh;
display: grid;
place-items: center;
padding: 24px;
}
.phone-frame {
position: relative;
width: min(100%, 430px);
width: min(calc(100% - 48px), 430px);
height: min(860px, calc(100vh - 48px));
min-height: 640px;
overflow: hidden;
@@ -44,6 +69,19 @@ button {
box-shadow: 0 28px 80px rgba(15, 31, 26, 0.18);
}
.phone-frame.login-mode {
width: 100%;
max-width: none;
height: auto;
min-height: 100vh;
min-height: 100dvh;
overflow: visible;
border: 0;
border-radius: 0;
background: var(--login-bg);
box-shadow: none;
}
.booting {
height: 100%;
display: grid;
@@ -51,167 +89,562 @@ button {
color: #557066;
}
.login-panel {
height: 100%;
padding: 72px 24px 24px;
display: flex;
flex-direction: column;
gap: 18px;
background: linear-gradient(180deg, #ffffff 0%, #f3faf7 100%);
.login-page {
min-height: 100vh;
min-height: 100dvh;
padding:
max(30px, env(safe-area-inset-top))
22px
max(24px, env(safe-area-inset-bottom));
background: var(--login-bg);
}
.brand-mark {
width: 56px;
height: 56px;
.login-content {
width: min(100%, 460px);
min-height: calc(100vh - 54px);
min-height: calc(100dvh - 54px);
margin: 0 auto;
display: flex;
flex-direction: column;
}
.login-brand-area {
position: relative;
overflow: hidden;
padding: 28px 16px 26px;
}
.brand-heading {
position: relative;
z-index: 1;
display: flex;
align-items: center;
gap: 14px;
}
.brand-icon {
flex: 0 0 auto;
width: 54px;
height: 54px;
display: grid;
place-items: center;
border-radius: 16px;
background: #0f8b6f;
background: var(--login-brand);
color: #ffffff;
font-weight: 800;
box-shadow: 0 10px 24px rgba(47, 143, 109, 0.2);
}
.brand-heading h1 {
margin: 0;
color: var(--login-text);
font-size: 29px;
line-height: 1.25;
font-weight: 750;
letter-spacing: 0;
}
.login-panel h1 {
margin: 10px 0 0;
font-size: 28px;
line-height: 1.2;
.login-brand-area > p {
position: relative;
z-index: 1;
margin: 20px 0 0;
color: var(--login-muted);
font-size: 15px;
line-height: 1.7;
}
.login-panel p {
margin: 0 0 18px;
color: #5f746c;
.brand-watermark {
position: absolute;
top: -28px;
right: -18px;
color: var(--login-brand);
opacity: 0.07;
pointer-events: none;
}
.login-panel label {
.login-card {
display: grid;
gap: 22px;
padding: 26px 24px 24px;
border: 1px solid rgba(220, 230, 226, 0.9);
border-radius: var(--login-radius-card);
background: rgba(255, 255, 255, 0.97);
box-shadow: var(--login-shadow);
}
.form-field {
display: grid;
gap: 10px;
}
.form-field > label {
color: var(--login-text);
font-size: 16px;
line-height: 1.4;
font-weight: 650;
}
.input-shell {
min-height: 54px;
display: flex;
align-items: center;
gap: 11px;
padding: 0 15px;
border: 1px solid var(--login-border);
border-radius: var(--login-radius-control);
background: var(--login-surface);
color: #a5b0ac;
transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input-shell:focus-within {
border-color: var(--login-brand);
box-shadow: 0 0 0 3px rgba(66, 169, 130, 0.11);
color: var(--login-brand-dark);
}
.input-shell.invalid {
border-color: var(--login-error);
}
.input-shell input {
min-width: 0;
flex: 1;
height: 52px;
padding: 0;
border: 0;
outline: 0;
background: transparent;
color: var(--login-text);
font-size: 16px;
letter-spacing: 0;
}
.input-shell input::placeholder {
color: var(--login-weak);
}
.input-clear {
width: 44px;
height: 44px;
display: grid;
place-items: center;
margin-right: -12px;
border: 0;
background: transparent;
color: var(--login-weak);
}
.code-input-shell {
gap: 10px;
padding-right: 7px;
}
.input-divider {
width: 1px;
height: 26px;
background: var(--login-border);
}
.send-code-button {
min-width: 108px;
min-height: 44px;
padding: 0 8px;
border: 0;
background: transparent;
color: var(--login-brand-dark);
font-size: 15px;
font-weight: 650;
white-space: nowrap;
}
.send-code-button:disabled {
cursor: not-allowed;
color: var(--login-weak);
}
.security-hint {
min-height: 22px;
display: flex;
align-items: center;
gap: 7px;
margin: 0;
color: var(--login-weak);
font-size: 13px;
line-height: 1.6;
}
.field-error {
margin: -3px 0 0;
color: var(--login-error);
font-size: 13px;
line-height: 1.5;
}
.agreement-row {
min-height: 44px;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 2px;
margin-top: 1px;
padding: 5px 4px;
border-radius: 10px;
color: var(--login-muted);
font-size: 13px;
line-height: 1.7;
transition: background 0.18s ease, color 0.18s ease;
}
.agreement-row.attention {
background: rgba(216, 91, 91, 0.08);
color: var(--login-error);
}
.agreement-toggle {
min-height: 34px;
display: inline-flex;
align-items: center;
gap: 8px;
color: #40524b;
cursor: pointer;
}
.agreement-toggle input {
width: 20px;
height: 20px;
margin: 0;
accent-color: var(--login-brand-dark);
cursor: pointer;
}
.policy-link {
min-height: 34px;
padding: 0 2px;
border: 0;
background: transparent;
color: var(--login-brand-dark);
font-weight: 600;
}
.login-submit {
width: 100%;
height: 54px;
border: 0;
border-radius: 15px;
background: var(--login-brand-dark);
color: #ffffff;
font-size: 17px;
font-weight: 700;
letter-spacing: 0;
box-shadow: 0 11px 24px rgba(47, 143, 109, 0.2);
transition: transform 0.15s ease, background 0.15s ease;
}
.login-submit:not(:disabled):active {
transform: translateY(1px);
background: #287d60;
}
.login-submit:disabled,
.dialog-confirm:disabled {
cursor: not-allowed;
background: var(--login-disabled);
color: var(--login-weak);
box-shadow: none;
}
.login-help-links {
min-height: 44px;
display: grid;
grid-template-columns: 1fr 1px 1fr;
align-items: center;
gap: 12px;
}
.login-help-links span {
width: 1px;
height: 18px;
background: var(--login-border);
}
.login-help-links button {
min-height: 44px;
padding: 0;
border: 0;
background: transparent;
color: var(--login-muted);
font-size: 14px;
}
.login-panel input,
.composer textarea {
width: 100%;
border: 1px solid #cad8d2;
border-radius: 14px;
background: #ffffff;
color: #17211d;
outline: none;
.login-security-footer {
margin-top: auto;
padding: 34px 10px 6px;
color: #a3afaa;
text-align: center;
}
.login-panel input {
height: 48px;
padding: 0 14px;
.login-security-footer > span {
display: inline-block;
width: calc(50% - 28px);
height: 1px;
margin: 0 8px 5px;
background: var(--login-border);
}
.login-panel input:focus,
.composer textarea:focus {
border-color: #0f8b6f;
box-shadow: 0 0 0 3px rgba(15, 139, 111, 0.12);
.login-security-footer p {
margin: 10px 0 0;
font-size: 12px;
line-height: 1.6;
}
.code-row {
.login-toast {
position: fixed;
z-index: 80;
left: 50%;
bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
max-width: calc(100vw - 40px);
padding: 11px 16px;
border-radius: 10px;
background: rgba(20, 34, 29, 0.92);
color: #ffffff;
font-size: 14px;
line-height: 1.5;
text-align: center;
transform: translateX(-50%);
box-shadow: 0 10px 30px rgba(20, 34, 29, 0.18);
}
.modal-backdrop {
position: fixed;
inset: 0;
z-index: 70;
display: grid;
grid-template-columns: minmax(0, 1fr) 92px;
gap: 10px;
place-items: center;
padding: 22px;
background: rgba(20, 34, 29, 0.38);
}
.captcha-row {
display: grid;
grid-template-columns: minmax(0, 1fr) 128px;
gap: 10px;
}
.captcha-image {
height: 48px;
padding: 0;
.app-dialog {
width: min(100%, 390px);
max-height: min(78vh, 650px);
display: flex;
flex-direction: column;
overflow: hidden;
border: 1px solid #cad8d2;
border-radius: 14px;
border: 1px solid rgba(220, 230, 226, 0.95);
border-radius: 20px;
background: #ffffff;
box-shadow: 0 24px 70px rgba(20, 34, 29, 0.2);
}
.captcha-image img {
.dialog-header {
min-height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px 18px 12px 22px;
border-bottom: 1px solid #edf2f0;
}
.dialog-header h2 {
margin: 0;
color: var(--login-text);
font-size: 19px;
line-height: 1.4;
}
.dialog-close {
width: 44px;
height: 44px;
display: grid;
place-items: center;
border: 0;
border-radius: 50%;
background: transparent;
color: var(--login-muted);
}
.dialog-content {
overflow-y: auto;
padding: 20px 22px;
overscroll-behavior: contain;
}
.dialog-footer {
padding: 12px 22px max(18px, env(safe-area-inset-bottom));
border-top: 1px solid #edf2f0;
}
.dialog-confirm {
width: 100%;
min-height: 48px;
border: 0;
border-radius: 13px;
background: var(--login-brand-dark);
color: #ffffff;
font-size: 16px;
font-weight: 650;
}
.policy-copy p {
margin: 0 0 16px;
color: var(--login-muted);
font-size: 14px;
line-height: 1.8;
}
.policy-copy h3 {
margin: 20px 0 8px;
color: var(--login-text);
font-size: 15px;
}
.help-list {
display: grid;
gap: 15px;
margin: 0;
padding: 0;
list-style: none;
}
.help-list li {
display: grid;
grid-template-columns: 20px minmax(0, 1fr);
gap: 9px;
color: var(--login-muted);
font-size: 14px;
line-height: 1.7;
}
.help-list svg {
margin-top: 3px;
color: var(--login-brand-dark);
}
.support-contact {
margin: 20px 0 0;
padding: 12px 14px;
border-radius: 10px;
background: #f3f8f6;
color: #50645c;
font-size: 13px;
line-height: 1.7;
}
.captcha-dialog-copy > p:first-child {
margin: 0 0 15px;
color: var(--login-muted);
font-size: 14px;
line-height: 1.7;
}
.captcha-entry {
display: grid;
grid-template-columns: minmax(0, 1fr) 132px;
gap: 10px;
}
.captcha-entry input {
min-width: 0;
height: 50px;
padding: 0 13px;
border: 1px solid var(--login-border);
border-radius: 13px;
outline: 0;
color: var(--login-text);
font-size: 16px;
}
.captcha-entry input:focus {
border-color: var(--login-brand);
box-shadow: 0 0 0 3px rgba(66, 169, 130, 0.11);
}
.captcha-entry button {
height: 50px;
display: grid;
place-items: center;
overflow: hidden;
padding: 0;
border: 1px solid var(--login-border);
border-radius: 13px;
background: #f8fbfa;
color: var(--login-brand-dark);
}
.captcha-entry img {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
}
.captcha-image span {
color: #5f746c;
font-size: 13px;
.captcha-refresh-tip {
display: flex;
align-items: center;
gap: 6px;
margin: 9px 0 0;
color: var(--login-weak);
font-size: 12px;
}
.primary,
.secondary,
.send-btn,
.stop-btn,
.new-session-btn {
border: 0;
border-radius: 14px;
font-weight: 700;
.spinning {
animation: spin 0.8s linear infinite;
}
.primary {
height: 50px;
margin-top: 8px;
background: #0f8b6f;
color: #ffffff;
@keyframes spin {
to { transform: rotate(360deg); }
}
.secondary {
background: #e5f3ef;
color: #0f735d;
@media (max-width: 380px) {
.login-page {
padding-right: 18px;
padding-left: 18px;
}
.login-brand-area {
padding-right: 8px;
padding-left: 8px;
}
.brand-heading h1 {
font-size: 26px;
}
.login-card {
padding-right: 18px;
padding-left: 18px;
}
.send-code-button {
min-width: 96px;
font-size: 14px;
}
}
button:disabled {
cursor: not-allowed;
opacity: 0.52;
@media (max-height: 700px) {
.login-page {
padding-top: max(16px, env(safe-area-inset-top));
}
.login-brand-area {
padding-top: 12px;
padding-bottom: 18px;
}
.login-card {
gap: 17px;
}
.login-security-footer {
padding-top: 22px;
}
}
.form-tip {
min-height: 20px;
color: #657970;
font-size: 13px;
}
.dialog-mask {
position: absolute;
inset: 0;
z-index: 20;
display: grid;
place-items: center;
padding: 24px;
background: rgba(12, 24, 20, 0.42);
}
.dialog-box {
width: min(100%, 320px);
padding: 22px;
border-radius: 18px;
background: #ffffff;
box-shadow: 0 18px 48px rgba(15, 31, 26, 0.22);
}
.dialog-box strong {
display: block;
color: #17211d;
font-size: 18px;
line-height: 1.35;
}
.dialog-box p {
margin: 10px 0 18px;
color: #51655d;
font-size: 14px;
line-height: 1.7;
}
.dialog-box .primary {
width: 100%;
margin-top: 0;
@media (min-width: 700px) {
.login-page {
padding-top: 58px;
padding-bottom: 40px;
}
}
.topbar {