/* 登录界面样式 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(1200px 600px at 80% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
                linear-gradient(135deg, #2b0f17 0%, #3b0c12 35%, #4a0a12 60%, #1b090d 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

/* 背景图片层 */
.login-overlay .site-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('./admin_backgrounds/default_bg2.jpg');
    filter: none;
    transform: scale(1);
    transition: transform 20s ease-in-out, filter 0.3s ease, opacity 0.4s ease;
}

/* 暗化遮罩层 */
.login-overlay .site-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    pointer-events: none;
}

/* 背景图案 */
.login-overlay .background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 40%, rgba(229, 57, 53, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 25%, rgba(255, 213, 79, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 45% 85%, rgba(255, 255, 255, 0.08) 0%, transparent 45%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

.login-container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 182, 193, 0.15);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    animation: loginFadeIn 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(1px);
    z-index: -1;
    border-radius: 20px;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 阴阳玉容器 */
.login-overlay .yin-yang-container {
    position: relative;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px auto;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.login-overlay .yin-yang-container:hover {
    transform: scale(1.2);
}

/* SVG阴阳太极样式 */
.login-overlay .yin-yang-container .yin-yang {
    filter: drop-shadow(0 6px 22px rgba(229, 57, 53, 0.9));
    transform-origin: center;
    opacity: 1;
    width: 120px;
    height: 120px;
    transition: filter 0.4s ease;
}

.login-overlay .yin-yang-container:hover .yin-yang {
    filter: drop-shadow(0 12px 40px rgba(229, 57, 53, 1)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
}

.login-overlay .yin-yang circle,
.login-overlay .yin-yang path {
    opacity: 1;
}

/* 旋转动画 */
.login-overlay .rotating {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

/* 旋转动画类 */
.rotating {
    animation: rotate 10s linear infinite;
}

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

.login-title {
    font-size: 28px;
    font-weight: 600;
    color: #DC143C;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-subtitle {
    font-size: 14px;
    color: #add8e6;
    opacity: 0.8;
    font-style: italic;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.9;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 50px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #ffb6c1;
    background: rgba(255, 182, 193, 0.1);
}

.password-toggle:focus {
    outline: none;
    color: #ffb6c1;
}

.eye-icon {
    width: 20px;
    height: 20px;
}

.form-group input:focus {
    outline: none;
    border-color: #ffb6c1;
    box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-actions {
    margin-top: 10px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.login-error {
    background: rgba(255, 99, 99, 0.2);
    border: 1px solid rgba(255, 99, 99, 0.4);
    border-radius: 8px;
    padding: 12px;
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

/* 登录界面版权信息 */
.login-copyright {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 182, 193, 0.2);
    transition: all 0.3s ease;
    user-select: none;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

.login-copyright:hover {
    color: rgba(255, 182, 193, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 182, 193, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.2);
    text-decoration: none;
}

.login-copyright:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 182, 193, 0.15);
}

/* 用户信息和登出按钮样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.username {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 99, 99, 0.2) !important;
    border: 1px solid rgba(255, 99, 99, 0.4) !important;
    color: #ff6b6b !important;
    transition: all 0.3s ease !important;
}

.logout-btn:hover {
    background: rgba(255, 99, 99, 0.3) !important;
    border-color: #ff6b6b !important;
    transform: translateY(-1px);
}

/* 主应用容器隐藏状态 */
.main-app-container {
    width: 100%;
    height: 100vh;
}

/* 权限控制样式 */
.admin-only {
    display: none;
}

.admin-mode .admin-only {
    display: block !important;
}

.guest-mode .admin-only {
    display: none !important;
}

/* 游客模式下的受限元素样式 */
.guest-mode button:disabled {
    cursor: not-allowed;
    opacity: 0.5 !important;
}

.guest-mode .tool-btn:disabled {
    background-color: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

.guest-mode .btn:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

/* 管理员模式标识 */
.admin-mode .username::after {
    content: " 👑";
    color: #ffd700;
}

.guest-mode .username::after {
    content: " 👁️";
    color: #6c757d;
}

/* 权限提示样式 */
.permission-tooltip {
    position: relative;
}

.permission-tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .login-copyright {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 20px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .username {
        font-size: 12px;
    }
}

.auth-switch { margin-top: 10px; text-align: right; }
.auth-switch .link-btn { background: none; border: none; color: #e53935; cursor: pointer; text-decoration: underline; font-size: 14px; }
.register-form { margin-top: 12px; }
.login-success { margin-top: 8px; color: #2e7d32; background: rgba(46,125,50,0.08); border: 1px solid rgba(46,125,50,0.3); padding: 8px; border-radius: 6px; }