html {
    height: 100%;
}

body.signin {
    height: 100%;
    min-height: 600px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
}

body.signin::before {
    content: "";
    position: fixed;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

body.signin::after {
    content: "";
    position: fixed;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(25,118,210,0.08) 0%, rgba(25,118,210,0) 70%);
    pointer-events: none;
}

.signinpanel {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 5vh 20px 20px;
    position: relative;
    z-index: 1;
}

.brand-section {
    text-align: center;
    margin-bottom: 35px;
}

.brand-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    margin-bottom: 18px;
    box-shadow: 0 10px 25px rgba(25, 118, 210, 0.3);
}

.brand-title {
    color: #1565c0;
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: 1px;
}

.brand-subtitle {
    color: #607d8b;
    font-size: 14px;
    margin: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(25, 118, 210, 0.15);
    padding: 40px 45px;
    max-width: 420px;
    margin: 0 auto;
}

.login-card h4 {
    color: #263238;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 28px;
    text-align: center;
}

.form-group-custom {
    position: relative;
    margin-bottom: 20px;
}

.form-group-custom .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #90a4ae;
    font-size: 16px;
    z-index: 2;
}

.signinpanel .form-control {
    height: 46px;
    padding: 10px 14px 10px 42px;
    border: 1px solid #e0e6ed;
    border-radius: 10px !important;
    background: #fff;
    color: #263238;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
}

.signinpanel .form-control:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
    outline: none;
}

.signinpanel .form-control.has-error {
    border-color: #ef5350;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.12);
}

/* 滑块验证 */
.slide-verify-wrapper {
    margin-bottom: 20px;
}

.slide-verify-label {
    font-size: 13px;
    color: #607d8b;
    margin-bottom: 8px;
}

#dragContainer {
    position: relative;
    width: 100%;
    height: 42px;
    background: #eceff1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e6ed;
    user-select: none;
}

#dragBg {
    position: absolute;
    background: linear-gradient(90deg, #81c784 0%, #66bb6a 100%);
    width: 0;
    height: 100%;
    border-radius: 10px 0 0 10px;
}

#dragText {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    line-height: 42px;
    font-size: 13px;
    color: #78909c;
    z-index: 1;
}

#dragHandler {
    position: absolute;
    width: 44px;
    height: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    cursor: move;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #90a4ae;
    font-size: 16px;
    left: 0;
}

#dragHandler.dragHandlerOkBg {
    background: #fff;
    color: #66bb6a;
}

/* 记住我开关 */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: normal;
    color: #546e7a;
    font-size: 13px;
}

.switch-label input {
    display: none;
}

.switch-slider {
    width: 38px;
    height: 20px;
    background: #cfd8dc;
    border-radius: 20px;
    position: relative;
    margin-right: 8px;
    transition: background 0.25s ease;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-label input:checked + .switch-slider {
    background: #1976d2;
}

.switch-label input:checked + .switch-slider::before {
    transform: translateX(18px);
}

.forgot-link {
    font-size: 13px;
    color: #1976d2;
    text-decoration: none;
}

.forgot-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.signinpanel .btn-login {
    height: 46px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.3);
    transition: all 0.25s ease;
}

.signinpanel .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.4);
}

.signinpanel .btn-login:disabled {
    background: #90caf9;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-login .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.6);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.copyright {
    text-align: center;
    color: #78909c;
    font-size: 12px;
    margin-top: 30px;
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: #607d8b;
    font-size: 13px;
}

.auth-footer a {
    color: #1976d2;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.auth-footer .copyright {
    margin-top: 12px;
}

/* 密码强度条 */
.password-strength {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    font-size: 12px;
}

.strength-bar {
    flex: 1;
    height: 6px;
    background: #eceff1;
    border-radius: 3px;
    overflow: hidden;
    margin-right: 10px;
    position: relative;
}

.strength-bar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.strength-bar.weak::before {
    width: 33%;
    background: #ef5350;
}

.strength-bar.medium::before {
    width: 66%;
    background: #ffa726;
}

.strength-bar.strong::before {
    width: 100%;
    background: #66bb6a;
}

.strength-text {
    color: #90a4ae;
    min-width: 56px;
    text-align: right;
}

/* 注册页自定义复选框 */
.terms-row {
    margin-bottom: 20px;
}

.checkbox-custom {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    color: #546e7a;
    font-size: 13px;
    position: relative;
}

.checkbox-custom input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom .checkmark {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-custom .checkmark::after {
    content: "\f00c";
    font-family: "FontAwesome";
    font-size: 11px;
    color: #fff;
    display: none;
}

.checkbox-custom input:checked ~ .checkmark {
    background: #1976d2;
    border-color: #1976d2;
}

.checkbox-custom input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-custom a {
    color: #1976d2;
    margin-left: 4px;
}

.checkbox-custom a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    body.signin {
        min-height: auto;
        height: auto;
        padding: 20px 0;
    }

    .signinpanel {
        padding: 20px 15px;
    }

    .brand-logo {
        width: 58px;
        height: 58px;
        font-size: 26px;
    }

    .brand-title {
        font-size: 20px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 16px;
    }
}

@media screen and (max-width: 320px) {
    .login-card {
        padding: 22px 18px;
    }
}

/* 兼容 IE 的 fallback */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .login-card {
        background: #fff;
    }
}

label.error {
    position: inherit;
    color: #ef5350;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}
