* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f3f3f3;
    color: #111;
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #f3f3f3;
}

.login-screen {
    position: relative;
    width: min(100vw, 414px);
    min-height: min(100vh, 778px);
    height: min(100vh, 778px);
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 184, 187, 0.96) 0%, rgba(255, 225, 226, 0.95) 31%, #fff 64%, #fff 100%);
    border: 1px solid rgba(155, 155, 155, 0.55);
    border-radius: 12px;
}

.mini-header {
    position: relative;
    z-index: 2;
    height: 72px;
}

.back-button {
    position: absolute;
    left: 20px;
    top: 34px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.back-button::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-left: 3px solid #1a1a1a;
    border-bottom: 3px solid #1a1a1a;
    transform: rotate(45deg);
    border-radius: 2px;
}

.capsule {
    position: absolute;
    top: 26px;
    right: 6px;
    width: 119px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.68);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}

.capsule-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #191919;
}

.capsule-divider {
    width: 1px;
    height: 16px;
    margin: 0 5px;
    background: rgba(0, 0, 0, 0.17);
}

.capsule-minus {
    width: 14px;
    height: 3px;
    border-radius: 999px;
    background: #191919;
}

.capsule-ring {
    width: 18px;
    height: 18px;
    border: 4px solid #191919;
    border-radius: 50%;
    position: relative;
}

.capsule-ring::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #191919;
}

.brand-area {
    position: absolute;
    top: 177px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-circle {
    width: 91px;
    height: 91px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 2px 18px rgba(255, 255, 255, 0.25);
}

.logo-circle img {
    width: 62px;
    height: auto;
    display: block;
}

.brand-area h1 {
    margin: 32px 0 0;
    font-family: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "PingFang SC", serif;
    font-size: 33px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
    color: #030303;
}

.action-area {
    position: absolute;
    top: 378px;
    left: 35px;
    right: 35px;
}

.parent-panel,
.teacher-panel {
    width: 100%;
}

.teacher-panel[hidden] {
    display: none;
}

.primary-login {
    width: 100%;
    height: 59px;
    border: 0;
    border-radius: 999px;
    background: #ff3138;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    cursor: pointer;
    box-shadow: none;
}

.teacher-login {
    margin-top: 18px;
}

.primary-login:active {
    transform: scale(0.985);
    background: #f4252d;
}

.teacher-field {
    height: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 18px;
    border: 1px solid rgba(255, 49, 56, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 8px 24px rgba(255, 49, 56, 0.06);
}

.teacher-field span {
    flex: 0 0 34px;
    color: #ff3138;
    font-size: 15px;
    font-weight: 600;
}

.teacher-field input {
    min-width: 0;
    flex: 1;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1e1e1e;
    font-size: 15px;
}

.teacher-field input::placeholder {
    color: #c8b4b4;
}

.teacher-field:focus-within {
    border-color: rgba(255, 49, 56, 0.46);
    background: #fff;
}

.teacher-switch {
    display: block;
    margin: 24px 0 0 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ff3138;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
}

.agreement-section {
    position: absolute;
    left: 50px;
    right: 34px;
    bottom: 89px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #a7a0a0;
    cursor: pointer;
    user-select: none;
}

.agreement-section input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.agreement-check {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 1px solid #aaa2a2;
    border-radius: 50%;
    background: #fff;
}

.agreement-section input:checked + .agreement-check {
    border-color: #ff3138;
    background: #ff3138;
    box-shadow: inset 0 0 0 3px #fff;
}

.agreement-text {
    min-width: 0;
    color: #a7a0a0;
    font-size: 15px;
    line-height: 1.4;
    white-space: nowrap;
}

.agreement-text a {
    color: #ff3138;
    text-decoration: none;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(8px);
}

.loading-spinner {
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loading-text {
    color: #fff;
    font-size: 15px;
}

.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 1001;
    max-width: 78vw;
    padding: 11px 20px;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 14px;
    text-align: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-height: 778px) {
    .login-screen {
        height: 100vh;
        min-height: 100vh;
    }
}

@media (max-width: 413px) {
    .login-screen {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}
