:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --text: #1e2633;
    --muted: #7c8796;
    --line: #ecf0f5;
    --red: #e93440;
    --red-dark: #c91f2d;
    --orange: #ff8a1f;
    --shadow: 0 18px 46px rgba(28, 38, 56, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(233, 52, 64, .08), rgba(246, 247, 251, 0) 310px),
        var(--bg);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-page {
    width: min(430px, 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 88% 6%, rgba(255, 138, 31, .18), transparent 120px),
        radial-gradient(circle at 10% 18%, rgba(233, 52, 64, .12), transparent 140px),
        #ffffff;
}

.login-panel {
    flex: 1;
    position: relative;
    padding-top: 30px;
}

.back-link {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #475467;
    background: #f4f6f9;
    font-size: 30px;
    line-height: 1;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 54px;
    margin-bottom: 34px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 12px 24px rgba(233, 52, 64, .24);
    font-size: 24px;
    font-weight: 800;
}

.brand-logo-image {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(31, 41, 55, .12);
}

.brand p {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .12em;
}

.brand h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 0;
}

.login-title {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--red);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(28, 38, 56, .08);
    text-align: center;
    font-weight: 800;
}

.login-form {
    display: grid;
    gap: 16px;
}

.field {
    min-height: 58px;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(28, 38, 56, .04);
}

.field:focus-within {
    border-color: rgba(233, 52, 64, .45);
    box-shadow: 0 0 0 4px rgba(233, 52, 64, .08);
}

.field span {
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.field input::placeholder {
    color: #b0b8c4;
}

.ghost-action {
    min-width: 48px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--red);
    background: #fff1f2;
    font-size: 13px;
    white-space: nowrap;
}

.agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.agreement input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: var(--red);
}

.agreement a {
    color: var(--red);
}

.submit-btn {
    width: 100%;
    min-height: 50px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    box-shadow: 0 14px 26px rgba(233, 52, 64, .26);
    font-size: 16px;
    font-weight: 800;
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.form-links {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 14px;
}

.login-footer {
    padding-top: 34px;
    color: #b0b8c4;
    text-align: center;
    font-size: 12px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 60px;
    z-index: 20;
    max-width: min(320px, calc(100% - 40px));
    padding: 10px 14px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(17, 24, 39, .92);
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.agreement-page {
    align-items: flex-start;
    padding-top: 28px;
}

.agreement-panel {
    max-width: 720px;
}

.agreement-content {
    margin-top: 22px;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.9;
    word-break: break-word;
    white-space: normal;
}

@media (max-width: 360px) {
    .login-page {
        padding-left: 16px;
        padding-right: 16px;
    }

    .field {
        grid-template-columns: 70px minmax(0, 1fr) auto;
        padding: 0 12px;
    }

    .brand h1 {
        font-size: 28px;
    }
}

/* Member login screen */
.member-login-body {
    background: #ffffff;
}

.login-screen {
    width: min(430px, 100%);
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 28px calc(24px + env(safe-area-inset-bottom));
    background: #ffffff;
}

.login-screen-panel {
    display: flex;
    flex-direction: column;
    padding-top: max(58px, 9vh);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 52px;
    text-align: center;
}

.login-brand .brand-logo-image {
    width: min(176px, 52vw);
    height: 82px;
    flex: 0 0 auto;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    box-shadow: none;
}

.login-brand .brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: #e9342b;
    box-shadow: none;
    font-size: 30px;
}

.login-brand h1 {
    max-width: 100%;
    margin: 20px 0 0;
    color: #252525;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.login-brand p {
    margin: 7px 0 0;
    color: #a0a0a0;
    font-size: 13px;
}

.login-screen .login-form {
    display: block;
}

.login-screen .login-line-field {
    min-height: 58px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 0 2px;
    border: 0;
    border-bottom: 1px solid #eeeeee;
    border-radius: 0;
    box-shadow: none;
}

.login-screen .login-line-field:focus-within {
    border-color: #ef3428;
    box-shadow: none;
}

.login-field-icon {
    position: relative;
    width: 18px;
    height: 20px;
    display: block;
    color: #b6bbc2;
}

.phone-icon::before {
    content: "";
    position: absolute;
    inset: 1px 3px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.phone-icon::after {
    content: "";
    position: absolute;
    left: 7px;
    bottom: 3px;
    width: 4px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
}

.lock-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 8px;
    width: 12px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
}

.lock-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
}

.login-screen .field input {
    height: 58px;
    font-size: 15px;
}

.login-screen .ghost-action {
    min-width: 44px;
    min-height: 38px;
    padding: 0;
    border-radius: 0;
    color: #ef3428;
    background: transparent;
}

.login-screen .submit-btn {
    min-height: 48px;
    margin-top: 42px;
    border-radius: 24px;
    background: #ef3428;
    box-shadow: none;
    font-weight: 500;
}

.login-screen .form-links {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    color: #9a9a9a;
    font-size: 13px;
}

.login-screen .form-links a:last-child {
    text-align: right;
}

.login-screen .form-links span {
    white-space: nowrap;
}

.login-screen .login-agreement {
    justify-content: center;
    margin-top: 26px;
    color: #999999;
    font-size: 12px;
    line-height: 1.7;
}

.login-screen .login-agreement input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.login-screen .login-agreement a {
    color: #ef3428;
}

.login-screen .login-footer {
    padding-top: 28px;
    color: #c0c0c0;
}

@media (max-width: 360px) {
    .login-screen {
        padding-left: 20px;
        padding-right: 20px;
    }

    .login-screen-panel {
        padding-top: 44px;
    }

    .login-brand {
        margin-bottom: 36px;
    }

    .login-screen .form-links {
        gap: 8px;
        font-size: 12px;
    }
}
