: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;
    }
}
