:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --text-color: #333;
    --light-color: #f8f9fa;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.login-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.login-logo:hover {
    transform: scale(1.05);
}

.login-header h1 {
    color: #21317C;
    font-size: 1.6rem;
    margin: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

.login-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me input {
    margin-right: 0.5rem;
}

.error-message {
    color: var(--danger-color);
    margin-bottom: 1rem;
    text-align: center;
    display: none;
    padding: 12px;
    border-radius: 4px;
    background-color: rgba(231, 76, 60, 0.15);
    border-left: 4px solid var(--danger-color);
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.success-message {
    color: var(--success-color);
    margin-bottom: 1rem;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    background-color: rgba(46, 204, 113, 0.1);
    border-left: 4px solid var(--success-color);
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
    animation-fill-mode: both; /* 确保动画结束后保持最终状态 */
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 添加闪烁效果，使错误信息更加醒目 */
.error-message.fade-in {
    animation: fadeInAndBlink 1s ease-in-out;
}

@keyframes fadeInAndBlink {
    0% { opacity: 0; transform: translateY(-10px); }
    50% { opacity: 1; transform: translateY(0); }
    60% { opacity: 0.8; }
    70% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { opacity: 1; }
}

.permissions-container {
    margin-top: 2rem;
    display: none;
}

/* 密码可见性切换控件 */
.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 32px; /* 预留按钮空间（更精致的小尺寸） */
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    width: 24px;
    height: 24px;
    padding: 0;
    cursor: pointer;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--primary-color);
    outline: none;
}

/* 图标尺寸与颜色 */
.password-toggle i {
    font-size: 14px; /* 更小更精致 */
    line-height: 1;
}

/* 默认显示“眼睛打开”（当前密码隐藏，点击可查看），隐藏带斜杠 */
.password-toggle .eye-open { display: inline; }
.password-toggle .eye-closed { display: none; }

/* 当按钮处于打开状态（已显示密码）时，显示“带斜杠眼睛”，提示可隐藏 */
.password-toggle.open .eye-open { display: none; }
.password-toggle.open .eye-closed { display: inline; }

.permissions-header {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.permission-item {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--light-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .login-container {
        margin: 50px 1rem;
        padding: 1.5rem;
    }
    
    .header-content {
        gap: 10px;
    }
    
    .login-logo {
        width: 32px;
        height: 32px;
    }
    
    .login-header h1 {
        font-size: 1.4rem;
    }
}