/**
 * 登录页面样式
 */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0; /* fallback color */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 背景视频 */
.login-background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* 背景叠加层，增强文字可读性 */
.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* 黑色半透明叠加层，根据视频亮度调整透明度 */
    z-index: 1;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

/* 顶部信息栏 */
.login-top-bar {
    position: relative;
    z-index: 10;
    padding: 25px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.company-name {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.system-name {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-container {
    flex: 1;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    min-height: calc(100vh - 100px);
}

.login-box {
    background: transparent;
    border-radius: 16px;
    padding: 40px 35px;
    box-shadow: none;
    width: 100%;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 50px;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 24px; /* 增加椭圆度，四个角更圆润 */
    box-shadow: 0 12px 24px rgba(79, 172, 254, 0.3);
    animation: pulse 2s ease-in-out infinite;
    overflow: hidden; /* 自动修边，确保内容不超出圆角边界 */
    padding: 3px; /* 减少内边距，减薄蓝色边框 */
    box-sizing: border-box;
    position: relative;
}

.login-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.login-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 21px; /* 图片圆角接近外层，减少蓝色边框可见度 */
    position: relative;
    z-index: 0;
    display: block;
    background: transparent;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 12px 24px rgba(79, 172, 254, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 16px 32px rgba(79, 172, 254, 0.4);
    }
}

.login-icon svg {
    width: 42px;
    height: 42px;
    color: white;
    position: relative;
    z-index: 0;
    display: block;
}

.login-header h1 {
    font-size: 32px;
    color: #1a237e;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #64b5f6;
    font-size: 16px;
    font-weight: 500;
}

.login-form {
    margin-bottom: 40px;
}

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

.form-group label {
    display: block;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #fafbfc;
    color: #2c3e50;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #4facfe;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #90caf9;
    font-weight: 400;
}

.form-group input:hover {
    border-color: #90caf9;
    background-color: white;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(79, 172, 254, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 2px solid #ef9a9a;
}

.login-footer {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid #e3f2fd;
    color: #64b5f6;
    font-size: 14px;
    font-weight: 500;
}

.login-footer p {
    margin: 0;
    line-height: 1.8;
}

/* 响应式设计 - 平板和中等屏幕 */
@media (max-width: 768px) {
    .login-top-bar {
        padding: 20px 30px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .company-name {
        font-size: 24px;
        letter-spacing: 1px;
    }
    
    .system-name {
        font-size: 18px;
    }
    
    .login-container {
        padding: 20px;
        min-height: calc(100vh - 80px);
    }
    
    .login-box {
        padding: 35px 30px;
    }
    
    .login-header {
        margin-bottom: 40px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .login-header p {
        font-size: 15px;
    }
    
    .login-icon {
        width: 70px;
        height: 70px;
        border-radius: 20px;
        padding: 2px;
    }
    
    .login-icon img {
        border-radius: 18px;
    }
    
    .login-icon svg {
        width: 38px;
        height: 38px;
    }
    
    .login-icon::before {
        border-radius: 20px;
    }
    
    .form-group {
        margin-bottom: 24px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .form-group input {
        padding: 14px 18px;
        font-size: 16px;
    }
    
    .btn {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .login-footer {
        padding-top: 25px;
        font-size: 13px;
    }
}

/* 响应式设计 - 手机小屏幕 */
@media (max-width: 480px) {
    .login-top-bar {
        padding: 15px 20px;
        gap: 10px;
    }
    
    .company-name {
        font-size: 20px;
        letter-spacing: 0.5px;
    }
    
    .system-name {
        font-size: 14px;
    }
    
    .login-container {
        padding: 15px;
        min-height: calc(100vh - 70px);
        align-items: flex-start;
        padding-top: 30px;
    }
    
    .login-box {
        padding: 30px 25px;
        border-radius: 16px;
    }
    
    .login-header {
        margin-bottom: 35px;
    }
    
    .login-header h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .login-header p {
        font-size: 14px;
    }
    
    .login-icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        padding: 2px;
        margin-bottom: 20px;
    }
    
    .login-icon img {
        border-radius: 16px;
    }
    
    .login-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .login-icon::before {
        border-radius: 18px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* 保持16px防止iOS自动缩放 */
        border-radius: 10px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 16px;
        border-radius: 10px;
        min-height: 48px; /* 触摸友好的最小高度 */
    }
    
    .login-footer {
        padding-top: 20px;
        font-size: 12px;
        border-top-width: 1px;
    }
    
    .login-footer p {
        line-height: 1.6;
    }
    
    /* 优化移动端背景视频性能 */
    .login-background-video {
        display: block;
    }
    
    /* 在移动端增加背景叠加层透明度以提高可读性 */
    .login-page::before {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* 响应式设计 - 超小屏幕手机 */
@media (max-width: 360px) {
    .login-top-bar {
        padding: 12px 15px;
    }
    
    .company-name {
        font-size: 18px;
    }
    
    .system-name {
        font-size: 13px;
    }
    
    .login-container {
        padding: 12px;
        padding-top: 25px;
    }
    
    .login-box {
        padding: 25px 20px;
    }
    
    .login-header {
        margin-bottom: 30px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .login-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 18px;
    }
    
    .login-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .form-group input {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .login-footer {
        font-size: 11px;
    }
}

/* 横屏适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .login-container {
        min-height: auto;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .login-box {
        padding: 25px 30px;
    }
    
    .login-header {
        margin-bottom: 25px;
    }
    
    .login-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 15px;
    }
    
    .login-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover {
        transform: none;
    }
    
    .form-group input:hover {
        border-color: #e3f2fd;
        background-color: #fafbfc;
    }
    
    .form-group input:focus {
        transform: none;
    }
}
