/**
 * 独立登录页 login.html
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif);
    background: #F5F5F5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--vh-text);
}

/* 隐藏页面顶部的导航栏、面包屑和标题 */
nav:not(.login-wrapper nav),
.navbar:not(.login-wrapper .navbar),
.breadcrumb:not(.login-wrapper .breadcrumb),
nav.breadcrumb:not(.login-wrapper nav.breadcrumb),
nav[aria-label="breadcrumb"]:not(.login-wrapper nav[aria-label="breadcrumb"]),
ol.breadcrumb:not(.login-wrapper ol.breadcrumb),
ul.breadcrumb:not(.login-wrapper ul.breadcrumb),
body > nav,
body > .navbar,
body > .breadcrumb,
body > nav.breadcrumb,
body > .container-fluid:not(.login-wrapper .container-fluid),
body > .container:not(.login-wrapper .container),
body > h1:not(.login-wrapper h1),
body > h2:not(.login-wrapper h2),
body > h3:not(.login-wrapper h3),
body > .page-header:not(.login-wrapper .page-header),
body > .page-title:not(.login-wrapper .page-title),
body > header:not(.login-wrapper header),
body > .header:not(.login-wrapper .header) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    position: relative;
}

.login-container {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 48px 40px;
    width: 100%;
    border: 1px solid #E5E5E5;
}

/* Logo区域 */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #E5E5E5;
}

.logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #1F2937;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #FFFFFF;
}

.logo-title {
    font-size: 24px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 14px;
    color: #6B7280;
    font-weight: 400;
}

/* 消息提示 */
.messages {
    margin-bottom: 24px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid;
}

.alert-error {
    background: #FEF2F2;
    color: #DC2626;
    border-left-color: #DC2626;
}

.alert-success {
    background: #F0FDF4;
    color: #16A34A;
    border-left-color: #16A34A;
}

.alert-info {
    background: #EFF6FF;
    color: #2563EB;
    border-left-color: #2563EB;
}

/* 表单样式 */
.login-form {
    margin-top: 8px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #FFFFFF;
    color: #1F2937;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #1F2937;
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.1);
}

.form-input:focus ~ .input-icon {
    color: #1F2937;
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* 记住密码和忘记密码 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    margin-top: -4px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1F2937;
}

.remember-me label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #1F2937;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    padding: 14px;
    background: #1F2937;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-login:hover:not(:disabled) {
    background: #111827;
}

.btn-login:active:not(:disabled) {
    background: #0F172A;
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 链接区域 */
.links-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E5E5E5;
}

.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
}

.links a {
    color: #6B7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.links a:hover {
    color: #1F2937;
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 32px;
    color: #9CA3AF;
    font-size: 12px;
    line-height: 1.6;
}

/* 加载动画 */
.btn-login.loading {
    position: relative;
    color: transparent;
}

.btn-login.loading span {
    opacity: 0;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 密码显示/隐藏切换 */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 1;
}

.password-toggle:hover {
    color: #1F2937;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-container {
        padding: 36px 28px;
    }

    .logo-title {
        font-size: 22px;
    }

    .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .links {
        flex-direction: column;
        gap: 12px;
    }
}
