/* 確保登入頁面沒有滾動條 - 只影響登入頁面 */
body:has(.login-page-container) {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

body:has(.login-page-container) html {
    height: 100%;
    overflow: hidden;
}

/* 登入頁面主容器 - 左右分欄布局 */
.login-page-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: #2e2e2e;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* 左側預覽圖片區域 - 占2/3版面 */
.preview-section {
    width: 66.67%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    clip-path: polygon(0 0, 100% 0, 70% 100%, 0 100%);
    overflow: hidden;
    box-sizing: border-box;
}

/* 斜線分隔線 - 從右上到左下 */
.preview-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.3) 10%,
        rgba(0, 0, 0, 0.8) 50%,
        rgba(0, 0, 0, 0.3) 90%,
        rgba(0, 0, 0, 0) 100%);
    transform: skewY(-12deg);
    transform-origin: top right;
    z-index: 10;
    pointer-events: none;
}

.preview-images {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image {
    position: absolute;
    width: 85%;
    max-width: 900px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    object-fit: contain;
}

/* 針對2K及以上解析度（2560px以上） */
@media (min-width: 2560px) {
    .preview-image {
        width: 100%;
        max-width: 1200px;
    }
}

/* 針對1080p解析度（1920px） */
@media (min-width: 1920px) and (max-width: 2559px) {
    .preview-image {
        width: 85%;
        max-width: 900px;
    }
}

/* 針對較小的1080p或更小的螢幕 */
@media (min-width: 1600px) and (max-width: 1919px) {
    .preview-image {
        width: 80%;
        max-width: 750px;
    }
}

/* 第一張圖片 - 預設在下層 */
.preview-image-1 {
    z-index: 1;
    transform: translate(-8%, -3%) scale(1);
}

/* 第二張圖片 - 預設在上層 */
.preview-image-2 {
    z-index: 2;
    transform: translate(8%, 3%) scale(1);
}

/* 圖片懸停效果 - 由 JavaScript 控制 z-index，CSS 處理視覺效果 */
.preview-image-1:hover {
    transform: translate(-8%, -3%) scale(1.08);
}

.preview-image-2:hover {
    transform: translate(8%, 3%) scale(1.08);
}

/* 右側登入面板 - 占1/3版面 */
.login-panel {
    width: 33.33%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    background-color: #2e2e2e;
    position: relative;
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.login-title {
    font-size: 32px;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 16px 0;
    text-align: center;
}

.login-subtitle {
    font-size: 16px;
    color: #a0a0a0;
    margin: 0 0 40px 0;
    text-align: center;
    line-height: 1.6;
}

.login-form {
    width: 100%;
    max-width: 400px;
    min-width: 280px;
    padding: 40px;
    background: #444;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

/* 輸入框容器 */
.input-container {
    position: relative;
    margin-bottom: 24px;
}

.input-container input {
    width: 100%;
    padding: 12px 0px;
    font-size: 16px;
    color: #fff;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid #ccc;
    outline: none;
    transition: border-color 0.3s ease;
    margin-top: 10px;
    box-sizing: border-box;
}

.input-container input:focus {
    border-color: #66ccff;
}

.input-container label {
    position: absolute;
    top: 50%;
    left: 5px;
    font-size: 16px;
    color: #ccc;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-container input:focus + label,
.input-container input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    color: #66ccff;
    transform: translateY(-100%);
    margin-top: 10px;
    left: 2px;
}

.login_button {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 16px;
    margin-top: 8px;
}

/* 響應式設計 */
@media (min-width: 1400px) and (max-width: 1599px) {
    .preview-image {
        width: 75%;
        max-width: 650px;
    }
}

@media (max-width: 1200px) {
    .login-panel {
        padding: 30px 20px;
    }
    
    .login-form {
        padding: 30px 25px;
    }
    
    .preview-image {
        width: 70%;
        max-width: 600px;
    }
}

@media (max-width: 1024px) {
    .login-page-container {
        flex-direction: column;
    }
    
    .preview-section {
        width: 100%;
        height: 50vh;
        min-height: 300px;
        clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
        padding: 30px;
    }
    
    .preview-section::after {
        display: none;
    }
    
    .preview-image {
        width: 70%;
        max-width: 600px;
    }
    
    .login-panel {
        width: 100%;
        height: auto;
        min-height: 50vh;
        clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 100%);
        padding: 30px 20px;
        overflow-y: visible;
    }
    
    .login-form {
        max-width: 100%;
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .preview-section {
        height: 40vh;
        min-height: 250px;
        padding: 20px;
    }
    
    .preview-image {
        width: 60%;
        max-width: 400px;
    }
    
    .login-panel {
        min-height: 60vh;
        padding: 20px 15px;
    }
    
    .login-title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .login-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .login-form {
        padding: 25px 15px;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .preview-section {
        height: 35vh;
        min-height: 200px;
        padding: 15px;
    }
    
    .preview-image {
        width: 55%;
        max-width: 300px;
    }
    
    .login-panel {
        padding: 15px 10px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .login-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .login-form {
        padding: 20px 12px;
        min-width: 220px;
    }
}
